From ed7aadcd87a64cde70febc8ee313860e8c67dcaf Mon Sep 17 00:00:00 2001
From: tagcup
Date: Fri, 11 May 2018 20:14:39 -0400
Subject: Add SLERP to Vector{2,3}, optimize Quat's Vector3 rotation.
Also even out Basis and Quat APIs a little.
---
doc/classes/Basis.xml | 18 +++++++++++++++---
doc/classes/Quat.xml | 41 +++++++++++++++++++++++++++++++++++++----
doc/classes/Vector2.xml | 12 ++++++++++++
doc/classes/Vector3.xml | 12 ++++++++++++
4 files changed, 76 insertions(+), 7 deletions(-)
(limited to 'doc')
diff --git a/doc/classes/Basis.xml b/doc/classes/Basis.xml
index 554ed9996..b9dc76382 100644
--- a/doc/classes/Basis.xml
+++ b/doc/classes/Basis.xml
@@ -4,11 +4,12 @@
3x3 matrix datatype.
- 3x3 matrix used for 3D rotation and scale. Contains 3 vector fields x,y and z as its columns, which can be interpreted as the local basis vectors of a transformation. Can also be accessed as array of 3D vectors. These vectors are orthogonal to each other, but are not necessarily normalized. Almost always used as orthogonal basis for a [Transform].
+ 3x3 matrix used for 3D rotation and scale. Contains 3 vector fields x,y and z as its columns, which can be interpreted as the local basis vectors of a transformation. Can also be accessed as array of 3D vectors. These vectors are orthogonal to each other, but are not necessarily normalized (due to scaling). Almost always used as orthogonal basis for a [Transform].
For such use, it is composed of a scaling and a rotation matrix, in that order (M = R.S).
http://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html
+ http://docs.godotengine.org/en/latest/tutorials/math/rotations.html
@@ -105,7 +106,7 @@
- Introduce an additional rotation around the given axis by phi (radians). Only relevant when the matrix is being used as a part of [Transform]. The axis must be a normalized vector.
+ Introduce an additional rotation around the given axis by phi (radians). The axis must be a normalized vector.
@@ -114,7 +115,18 @@
- Introduce an additional scaling specified by the given 3D scaling factor. Only relevant when the matrix is being used as a part of [Transform].
+ Introduce an additional scaling specified by the given 3D scaling factor.
+
+
+
+
+
+
+
+
+
+
+ Assuming that the matrix is a proper rotation matrix, slerp performs a spherical-linear interpolation with another rotation matrix.
diff --git a/doc/classes/Quat.xml b/doc/classes/Quat.xml
index 33f2b9758..412179088 100644
--- a/doc/classes/Quat.xml
+++ b/doc/classes/Quat.xml
@@ -4,13 +4,14 @@
Quaternion.
- A 4-dimensional vector representing a rotation.
- The vector represents a 4 dimensional complex number where multiplication of the basis elements is not commutative (multiplying i with j gives a different result than multiplying j with i).
- Multiplying quaternions reproduces rotation sequences. However quaternions need to be often renormalized, or else they suffer from precision issues.
- It can be used to perform SLERP (spherical-linear interpolation) between two rotations.
+ A unit quaternion used for representing 3D rotations.
+ It is similar to [Basis], which implements matrix representation of rotations, and can be parametrized using both an axis-angle pair or Euler angles. But due to its compactness and the way it is stored in memory, certain operations (obtaining axis-angle and performing SLERP, in particular) are more efficient and robust against floating point errors.
+
+ Quaternions need to be (re)normalized.
http://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html#interpolating-with-quaternions
+ http://docs.godotengine.org/en/latest/tutorials/math/rotations.html
@@ -41,6 +42,15 @@
Returns a quaternion that will rotate around the given axis by the specified angle. The axis must be a normalized vector.
+
+
+
+
+
+
+ Returns a quaternion that will perform a rotation specified by Euler angles (in the YXZ convention: first Z, then X, and Y last), given in the vector format as (X-angle, Y-angle, Z-angle).
+
+
@@ -74,6 +84,13 @@
Returns the dot product of two quaternions.
+
+
+
+
+ Return Euler angles (in the YXZ convention: first Z, then X, and Y last) corresponding to the rotation represented by the unit quaternion. Returned vector contains the rotation angles in the format (X-angle, Y-angle, Z-angle).
+
+
@@ -109,6 +126,22 @@
Returns a copy of the quaternion, normalized to unit length.
+
+
+
+
+
+
+ Set the quaternion to a rotation which rotates around axis by the specified angle, in radians. The axis must be a normalized vector.
+
+
+
+
+
+
+ Set the quaternion to a rotation specified by Euler angles (in the YXZ convention: first Z, then X, and Y last), given in the vector format as (X-angle, Y-angle, Z-angle).
+
+
diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml
index 66563dc5a..cee80281e 100644
--- a/doc/classes/Vector2.xml
+++ b/doc/classes/Vector2.xml
@@ -208,6 +208,18 @@
+
+
+
+
+
+
+
+
+ Returns the result of SLERP between this vector and "b", by amount "t". "t" should be a float of 0.0-1.0, a percentage of how far along the interpolation is.
+ Both vectors need to be normalized.
+
+
diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml
index 0ffb5603c..827033e48 100644
--- a/doc/classes/Vector3.xml
+++ b/doc/classes/Vector3.xml
@@ -210,6 +210,18 @@
+
+
+
+
+
+
+
+
+ Returns the result of SLERP between this vector and "b", by amount "t". "t" should be a float of 0.0-1.0, a percentage of how far along the interpolation is.
+ Both vectors need to be normalized.
+
+
--
cgit v1.2.3-70-g09d2