Added various functions basic math classes. Also enabled math checks only for debug builds.

Added set_scale, set_rotation_euler, set_rotation_axis_angle. Addresses #2565 directly.
Added an euler angle constructor for Basis in GDScript and also exposed is_normalized for vectors and quaternions.
Various other changes mostly cosmetic in nature.
This commit is contained in:
Ferenc Arn
2017-04-05 17:47:13 -05:00
parent 454f53c776
commit 9a37ff1e34
13 changed files with 217 additions and 50 deletions

View File

@@ -6839,6 +6839,15 @@
Create a rotation matrix which rotates around the given axis by the specified angle. The axis must be a normalized vector.
</description>
</method>
<method name="Basis">
<return type="Basis">
</return>
<argument index="0" name="euler" type="Vector3">
</argument>
<description>
Create a rotation matrix (in the XYZ convention: first Z, then Y, and X last) from the specified Euler angles, given in the vector format as (third,second,first).
</description>
</method>
<method name="Basis">
<return type="Basis">
</return>
@@ -6863,8 +6872,7 @@
<return type="Vector3">
</return>
<description>
Return Euler angles (in the XYZ convention: first Z, then Y, and X last) from the matrix. Returned vector contains the rotation angles in the format (third,second,first).
This function only works if the matrix represents a proper rotation.
Assuming that the matrix is a proper rotation matrix (orthonormal matrix with determinant +1), return Euler angles (in the XYZ convention: first Z, then Y, and X last). Returned vector contains the rotation angles in the format (third,second,first).
</description>
</method>
<method name="get_orthogonal_index">
@@ -6906,6 +6914,26 @@
Introduce an additional rotation around the given axis by phi. Only relevant when the matrix is being used as a part of [Transform]. The axis must be a normalized vector.
</description>
</method>
<method name="set_rotation_euler">
<return type="Basis">
</return>
<argument index="0" name="euler" type="Vector3">
</argument>
<description>
Changes only the rotation part of the [Basis] to a rotation corresponding to given Euler angles, while preserving the scaling part (as determined by get_scale).
</description>
</method>
<method name="set_rotation_axis_angle">
<return type="Basis">
</return>
<argument index="0" name="axis" type="Vector3">
</argument>
<argument index="1" name="phi" type="float">
</argument>
<description>
Changes only the rotation part of the [Basis] to a rotation around given axis by phi, while preserving the scaling part (as determined by get_scale).
</description>
</method>
<method name="scaled">
<return type="Basis">
</return>
@@ -6915,6 +6943,15 @@
Introduce an additional scaling specified by the given 3D scaling factor. Only relevant when the matrix is being used as a part of [Transform].
</description>
</method>
<method name="set_scale">
<return type="Basis">
</return>
<argument index="0" name="scale" type="Vector3">
</argument>
<description>
Changes only the scaling part of the Basis to the specified scaling, while preserving the rotation part (as determined by get_rotation).
</description>
</method>
<method name="tdotx">
<return type="float">
</return>
@@ -34942,6 +34979,13 @@
Returns a copy of the quaternion, normalized to unit length.
</description>
</method>
<method name="is_normalized">
<return type="bool">
</return>
<description>
Returns whether the quaternion is normalized or not.
</description>
</method>
<method name="slerp">
<return type="Quat">
</return>
@@ -47093,6 +47137,13 @@ do_property].
Returns a normalized vector to unit length.
</description>
</method>
<method name="is_normalized">
<return type="bool">
</return>
<description>
Returns whether the vector is normalized or not.
</description>
</method>
<method name="reflect">
<return type="Vector2">
</return>
@@ -47317,6 +47368,13 @@ do_property].
Return a copy of the normalized vector to unit length. This is the same as v / v.length().
</description>
</method>
<method name="is_normalized">
<return type="bool">
</return>
<description>
Returns whether the vector is normalized or not.
</description>
</method>
<method name="outer">
<return type="Basis">
</return>