SIRotation.XYZAngles

SIRotation.XYZAngles

導入

v5.1

詳細

この回転の x,y,zSIVector3 を設定したり、戻したりします(ベクトルは自動的に作成されます)。

C#構文

// get accessor

SIVector3 rtn = ISIRotation.XYZAngles;

// set accessor

ISIRotation.XYZAngles = SIVector3;

JScript の例

/*

	This example demonstrates how to use rotation property XYZAngles

	This example demonstrates how to use XYZAngles property to return the x,y,z vector of the rotation 

	as an SIVector3 (without having to explicitly create it first) as well as how to set new values.

*/

var oRot = XSIMath.CreateRotation();

// The XYZAngles property takes care of creating oVec as an SIVector3

var oVec = oRot.XYZAngles;

var l_dx = XSIMath.DegreesToRadians(20);

var l_dy = XSIMath.DegreesToRadians(45);

var l_dz = XSIMath.DegreesToRadians(90);

oVec.Set(l_dx, l_dy, l_dz) ;

oRot.XYZAngles = oVec;

Application.LogMessage(" The x,y,z angles of the rotation are: " + oRot.RotX + " " + oRot.RotY + " " + oRot.RotZ );

// Expected results:

//INFO :  The x,y,z angles of the rotation are: 20 45 90

関連項目

SIRotation.GetXYZAngles SIRotation.GetXYZAnglesValues SIRotation.GetXYZAnglesValues2 SIRotation.SetFromXYZAnglesValues SIRotation.SetFromXYZAngles