Most basic 3D game object, with a 3D [Transform] and visibility settings. All other 3D game objects inherit from Spatial. Use Spatial as a parent node to move, scale, rotate and show/hide children in a 3D project.
Affine operations (rotate, scale, translate) happen in parent's local coordinate system, unless the Spatial object is set as top level. Affine operations in this coordinate system correspond to direct affine operations on the Spatial's transform. The word local below refers to this coordinate system. The coordinate system that is attached to the Spatial object itself is referred to as object-local coordinate system.
</description>
<tutorials>
</tutorials>
@ -32,15 +34,35 @@
Returns the current [World] resource this Spatial node is registered to.
</description>
</method>
<methodname="rotate_object_local">
<returntype="void">
</return>
<argumentindex="0"name="axis"type="Vector3">
</argument>
<argumentindex="1"name="angle"type="float">
</argument>
<description>
Rotates the local transformation around axis, a unit [Vector3], by specified angle in radians. The rotation axis is in object-local coordinate system.
</description>
</method>
<methodname="scale_object_local">
<returntype="void">
</return>
<argumentindex="0"name="scale"type="Vector3">
</argument>
<description>
Scales the local transformation by given 3D scale factors in object-local coordinate system.
</description>
</method>
<methodname="global_rotate">
<returntype="void">
</return>
<argumentindex="0"name="normal"type="Vector3">
<argumentindex="0"name="axis" type="Vector3">
</argument>
<argumentindex="1"name="radians"type="float">
<argumentindex="1"name="angle" type="float">
</argument>
<description>
Rotates the current node along normal [Vector3] by angle in radians in Global space.
Rotates the global (world) transformation around axis, a unit [Vector3], by specified angle in radians. The rotation axis is in global coordinate system.
</description>
</method>
<methodname="global_translate">
@ -49,7 +71,7 @@
<argumentindex="0"name="offset"type="Vector3">
</argument>
<description>
Moves the node by [Vector3] offset in Global space.
Moves the global (world) transformation by [Vector3] offset. The offset is in global coordinate system.
</description>
</method>
<methodname="hide">
@ -115,45 +137,45 @@
<returntype="void">
</return>
<description>
Resets this node's transformations (like scale, skew and taper) preserving its rotation and translation. Performs orthonormalization on this node [Transform3D].
Resets this node's transformations (like scale, skew and taper) preserving its rotation and translation by performing Gram-Schmidt orthonormalization on this node's [Transform3D].
</description>
</method>
<methodname="rotate">
<returntype="void">
</return>
<argumentindex="0"name="normal" type="Vector3">
<argumentindex="0"name="axis" type="Vector3">
</argument>
<argumentindex="1"name="radians" type="float">
<argumentindex="1"name="angle" type="float">
</argument>
<description>
Rotates the node in local space on given normal [Vector3] by angle in radians.
Rotates the local transformation around axis, a unit [Vector3], by specified angle in radians.
</description>
</method>
<methodname="rotate_x">
<returntype="void">
</return>
<argumentindex="0"name="radians" type="float">
<argumentindex="0"name="angle" type="float">
</argument>
<description>
Rotates the node in local space on X axis by angle in radians.
Rotates the local transformation around the X axis by angle in radians
</description>
</method>
<methodname="rotate_y">
<returntype="void">
</return>
<argumentindex="0"name="radians" type="float">
<argumentindex="0"name="angle" type="float">
</argument>
<description>
Rotates the node in local space on Y axis by angle in radians.
Rotates the local transformation around the Y axis by angle in radians.
</description>
</method>
<methodname="rotate_z">
<returntype="void">
</return>
<argumentindex="0"name="radians" type="float">
<argumentindex="0"name="angle" type="float">
</argument>
<description>
Rotates the node in local space on Z axis by angle in radians.
Rotates the local transformation around the Z axis by angle in radians.
Rotation part of the local transformation, specified in terms of YXZ-Euler angles in the format (X-angle, Y-angle, Z-angle), in radians.
Note that in the mathematical sense, rotation is a matrix and not a vector. The three Euler angles, which are the three indepdent parameters of the Euler-angle parametrization of the rotation matrix, are stored in a [Vector3] data structure not because the rotation is a vector, but only because [Vector3] exists as a convenient data-structure to store 3 floating point numbers. Therefore, applying affine operations on the rotation "vector" is not meaningful.