SQuatI
An Int backed Quaternion.
Quaternions are used to represent rotations. They are compact, don't suffer from gimbal lock and can easily be interpolated.
Constructors
Method New(x:Int, y:Int, z:Int, w:Int)
Creates a new SQuatI from the supplied arguments.
Operators
Method Operator*:SQuatI(b:SQuatI)
Multiplies the quaternion by b, returning a new quaternion.
Method Operator-:SQuatI()
Returns a new quaternion, negated.
Methods
Method AngleTo:Double(quat:SQuatI)
Returns the angle between ths quaternion and the quaternion quat.
Method Dot:Int(b:SQuatI)
The dot product between two rotations.
Method Invert:SQuatI()
Returns the Inverse of rotation.
Method Interpolate:SQuatI(b:SQuatI, t:Int)
Interpolates between the SQuatI and b by t and normalizes the result afterwards.
Method Length:Double()
Computes the length of this quaternion, considered as a 4 dimensional vector.
Method LengthSquared:Double()
Computes the length of this quaternion, considered as a 4 dimensional vector.
Calculating the squared length instead of the length is much faster. Often if you are comparing lengths of two quaternions you can just compare their squared lengths.
Method Normal:SQuatI()
Converts this quaternion to one with the same orientation but with a magnitude of 1.
Method RotateTowards:SQuatI(quat:SQuatI, s:Double)
Rotates this quaternion by a given angular step s to the specified quaternion quat.
Method SphericalInterpolate:SQuatI(b:SQuatI, t:Double)
Spherically interpolates between this SQuatI and b by t.
Method EulerRotate:SQuatI(rot:SVec3I, order:ERotationOrder = ERotationOrder.XYZ)
Returns a rotation that rotates around rot.
Method ToEuler:SVec3I(order:ERotationOrder = ERotationOrder.XYZ)
Returns the quaternion converted to Euler angles, using the specified rotation order.
Method ToString:String() Override
Returns a String representation of the quaternion.
Functions
Function CreateFromEuler:SQuatI(euler:SVec3I, order:ERotationOrder = ERotationOrder.XYZ)
Creates a new SQuatI from the rotation specified by the euler angle and order.
Function CreateFromRotation:SQuatI(mat:SMat4I)
Creates a new SQuatI from the rotation component of matrix mat.
see http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm
Function ToMat3:SMat3I(a:SQuatI)
Applies the quaternion a to the matrix, returning a new matrix.
Function ToMat4:SMat4I(a:SQuatI)
Applies the quaternian to the matrix, return the new matrix.
Function RotTrans:SMat4I(a:SQuatI, s:SVec3I)
Creates a translation and rotation matrix.
The returned matrix is such that it places objects at position s, oriented in rotation a.
Function RotTransOrigin:SMat4I(a:SQuatI, s:SVec3I, origin:SVec3I)
Creates a translation, rotation and scaling matrix.
The returned matrix is such that it places objects at position origin, oriented in rotation a and scaled by s.
Function Identity:SQuatI()
The identity rotation.