diff options
Diffstat (limited to 'doc/classes')
-rw-r--r-- | doc/classes/Basis.xml | 2 | ||||
-rw-r--r-- | doc/classes/Spatial.xml | 60 |
2 files changed, 43 insertions, 19 deletions
diff --git a/doc/classes/Basis.xml b/doc/classes/Basis.xml index a873bd9a27..1573596487 100644 --- a/doc/classes/Basis.xml +++ b/doc/classes/Basis.xml @@ -38,7 +38,7 @@ <argument index="1" name="phi" type="float"> </argument> <description> - Create a rotation matrix which rotates around the given axis by the specified angle. The axis must be a normalized vector. + Create a rotation matrix which rotates around the given axis by the specified angle, in radians. The axis must be a normalized vector. </description> </method> <method name="Basis"> diff --git a/doc/classes/Spatial.xml b/doc/classes/Spatial.xml index ea04192a5e..7940e4065e 100644 --- a/doc/classes/Spatial.xml +++ b/doc/classes/Spatial.xml @@ -5,6 +5,8 @@ </brief_description> <description> 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> + <method name="rotate_object_local"> + <return type="void"> + </return> + <argument index="0" name="axis" type="Vector3"> + </argument> + <argument index="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> + <method name="scale_object_local"> + <return type="void"> + </return> + <argument index="0" name="scale" type="Vector3"> + </argument> + <description> + Scales the local transformation by given 3D scale factors in object-local coordinate system. + </description> + </method> <method name="global_rotate"> <return type="void"> </return> - <argument index="0" name="normal" type="Vector3"> + <argument index="0" name="axis" type="Vector3"> </argument> - <argument index="1" name="radians" type="float"> + <argument index="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> <method name="global_translate"> @@ -49,7 +71,7 @@ <argument index="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> <method name="hide"> @@ -115,45 +137,45 @@ <return type="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> <method name="rotate"> <return type="void"> </return> - <argument index="0" name="normal" type="Vector3"> + <argument index="0" name="axis" type="Vector3"> </argument> - <argument index="1" name="radians" type="float"> + <argument index="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> <method name="rotate_x"> <return type="void"> </return> - <argument index="0" name="radians" type="float"> + <argument index="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> <method name="rotate_y"> <return type="void"> </return> - <argument index="0" name="radians" type="float"> + <argument index="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> <method name="rotate_z"> <return type="void"> </return> - <argument index="0" name="radians" type="float"> + <argument index="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. </description> </method> <method name="set_as_toplevel"> @@ -255,16 +277,18 @@ World space (global) [Transform] of this node. </member> <member name="rotation" type="Vector3" setter="set_rotation" getter="get_rotation"> - Local euler rotation in radians of this node. + 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. </member> <member name="rotation_degrees" type="Vector3" setter="set_rotation_degrees" getter="get_rotation_degrees"> - Local euler rotation in degrees of this node. + Rotation part of the local transformation, specified in terms of YXZ-Euler angles in the format (X-angle, Y-angle, Z-angle), in degrees. </member> <member name="scale" type="Vector3" setter="set_scale" getter="get_scale"> - Local scale of this node. + Scale part of the local transformation. </member> <member name="transform" type="Transform" setter="set_transform" getter="get_transform"> - Local space [Transform] of this node. + Local space [Transform] of this node, with respect to the parent node. </member> <member name="translation" type="Vector3" setter="set_translation" getter="get_translation"> Local translation of this node. |