SIQuaternion

Object Hierarchy | Related C++ Class: CQuaternion

Description

A 4-element unit quaternion represented by double precision floating point w,x,y,z coordinates. A quaternion is a compact and convenient way to represent orientations and rotations in 3D space.

Methods

Add AddInPlace Conjugate ConjugateInPlace
Copy EpsilonEquals Equals Get
Get2 GetXYZAngleValues GetXYZAngleValues2 Invert
InvertInPlace Length LengthSquared Mul
MulInPlace Negate NegateInPlace Normalize
Set SetFromXYZAngleValues SetIdentity Slerp
Sub SubInPlace    
       

Properties

Value W X Y
Z      
       

Examples

JScript Example

var oRotation = XSIMath.CreateRotation( XSIMath.DegreesToRadians( 90 ), 0, 0 ) ;
var oQuaternion = XSIMath.CreateQuaternion() ;
oRotation.GetQuaternion( oQuaternion ) ;
Application.LogMessage( "Quaternion for 90 degree x rotation is " 
				+ oQuaternion.W + "," 
				+ oQuaternion.X + "," 
				+ oQuaternion.Y + "," 
				+ oQuaternion.Z ) ;
//Output:
//INFO : Quaternion for 90 degree x rotation is 0.7071067811865476,0.7071067811865475,0,0

See Also

SIQuaternion.Set SIVector3 SIMatrix3.GetQuaternion SIMatrix3.SetFromQuaternion SIMatrix4 SIRotation.GetQuaternion SIRotation.SetFromQuaternion SITransformation.GetRotationQuaternion SITransformation.SetRotationFromQuaternion XSIMath.CreateQuaternion