SIQuaternion.Mul

Description

Multiplies the quaternion q1 by the quaternion q2 and stores the result in this quaternion: this = q1 . q2

When used in the context of rotation this operation has the effect of adding two rotations.

C# Syntax

SIQuaternion.Mul( SIQuaternion in_pQuat1, SIQuaternion in_pQuat2 );

Scripting Syntax

SIQuaternion.Mul( q1, q2 );

Parameters

Parameter Type Description
q1 SIQuaternion quaternion operand
q2 SIQuaternion quaternion operand

Examples

VBScript Example

dim q1, q2, q3
' Create Quaternions.
set q1 = XSIMath.CreateQuaternion(1.0, 1.0, 2.0, 3.0)
set q2 = XSIMath.CreateQuaternion(1.0, 4.0, 5.0, 6.0)
set q3 = XSIMath.CreateQuaternion
'q3 = q1 . q2
q3.Mul q1, q2
Application.LogMessage "q3 : " & q3.W & "," & q3.X & "," & q3.Y & "," & q3.Z 
'Mul operation is non-commutative
q3.Mul q2, q1
Application.LogMessage "q3 : " & q3.W & "," & q3.X & "," & q3.Y & "," & q3.Z 
'Output
'INFO : q3 : -31,2,13,6
'INFO : q3 : -31,8,1,12

See Also

SIQuaternion.MulInPlace SIVector3 SIMatrix3 SIMatrix4 SIRotation SITransformation SIQuaternion