Anteworld - Outerra Game > JavaScript development

Functions

(1/1)

SteelRat:
Hi cameni!

RU:
Я сделал функцию "relative_pos()" которая определяет позицию по заданным параметрам.
У меня сильное чувство, что я сделал что то не так.
Что бы снизить частые краши движка во время создания объекта на вычисленной позиции, мне пришлось ввести пятый параметр "addZ", при создании определённых моделей без этого корректирующего параметра вообще не обойтись.

Этот негативный эффект проявляется при вызове метода
$world.create_instance()
Для объектов с физикой.

Со статичными объектами нет проблем!

Помогите прояснить ситуацию.

Translate:
I made a function "relative_pos()"  that determines the position of the specified parameters.
I have a strong feeling that I did something wrong.
To reduce the frequent crash of the engine during the creation of the object on the calculated position, I had to enter the fifth option "addZ", when creating certain models without this adjustment parameter does not do.

This negative effect is shown when calling
$World.create_instance()
For objects with physics.

With static objects do not have problems!

Help to clarify the situation.

Call function:

--- Code: ---var pos = this.geom.get_pos();
var rot = this.geom.get_rot();
var distance = 15; // meter
var angle = 0; // degree
var addZ = 10;

pos = relative_pos(pos, rot, distance, angle, addZ);

this.obj_0 = $world.create_instance("SteelRat/Model/Model", pos, rot, false);

--- End code ---

SteelRat:
`

Navigation

[0] Message Index

Go to full version