для этой страницы,
отображается код на другом
A world transform path is a succession of transformations based on an arbitrary path. The objects that are made children of the WorldTransformPath can move along with these transformations.
- The WorldTransformPath class to manage transform paths via API
Adding Transform Path#
To add a transform path to the scene via UnigineEditor, do the following:
- Run the project with UnigineEditor.
- On the Menu bar, click Create -> Transform Path.
- Choose the path to the .path file.
The path can be changed afterwards in the Parameters window -> Node tab -> World Transform Path section -> Path field.
- Place the object somewhere in the world.
Adding Objects Moving along the Path#
To make objects move along the path, do the following:
- Make the object the child of the path.
- Set the same initial positions of the object and of the path.
If the object has coordinates different from the path, it will have the corresponding offset relatively to the path.
- To put the object in motion, click Play on the Node tab.
- Adjust the playback parameters.
In the Node tab of the Parameters window, you can adjust the following parameters of the transformation path:
|Path||Sets a path to the new .path file.|
|Orientation||Indicates whether the object should be oriented along the path or keep its initial position.|
The WorldTransformPath has the following playback parameters:
|Loop||Loops the transformation defined by the path.|
|Update Distance Limit||Sets the range of distance from the camera within which the object should be updated.|
|Time||Sets the time, from which the playback of the transformation defined by the path starts.
If the object is oriented along the path, its transformation corresponds to the path transformation at the specified time. Otherwise, only position of the object is changed.
|Speed||Sets the speed of playback of the transformation defined by the path.
Negative values provide the reverse playback.
|Play||Continues playback of the transformation defined by the path if it has been paused, or starts the playback, if it has been stopped.|
|Stop||Stops the playback of the transformation defined by the path. This function saves the playback position so that playing of the transformation defined by the path can be resumed from the same point.|