SIRotation.Quaternion

導入

v 5.1

詳細

この回転のSIQuaternionを設定したり、戻したりします(クォータニオンは自動的に作成されます)。

JScript の例

/*
        This example demonstrates how to use Quaternion property to return the quaternion of the rotation 
        as an SIQuaternion (without having to explicitly create it first) as well as how to set a new quaternion.
*/
var oRot = XSIMath.CreateRotation();
// The Quaternion property takes care of creating oQuat as an SIQuaternion
var oQuat = oRot.Quaternion;
// Now set w, x, y and z normalize properties of the quaternion and then save it back onto the rotation
oQuat.Set(0.5, 0.5, 0.5, 0.5);
oRot.Quaternion = oQuat;
// Get a new quaternion
var oQuatDest = oRot.Quaternion;
Application.LogMessage( " The w,x,y,z quaternion values of this rotation are: " 
                + oQuatDest.W + " " + oQuatDest.X + " " + oQuatDest.Y + " " + oQuatDest.Z );
// Expected results:
//INFO :  The w,x,y,z quaternion values of this rotation are: 0.5 0.5 0.5 0.5

関連項目

SIRotation.GetQuaternion SIRotation.SetFromQuaternion