XSIMath.MapWorldOrientationToObjectSpace

XSIMath.MapWorldOrientationToObjectSpace

説明

WorldSpace で記述された方向を、異なるObjectSpace に変換します。

C#構文

SIVector3 XSIMath.MapWorldOrientationToObjectSpace( SITransformation in_pObjectSapce, SIVector3 in_pOrientation );

スクリプト構文

oReturn = XSIMath.MapWorldOrientationToObjectSpace( ObjectSpace, Orientation );

戻り値

SIVector3(向き)

パラメータ

パラメータ タイプ 説明
ObjectSpace SITransformation 方向を変換する先の ObjectSpace
Orientation SIVector3 変換する方向

VBScript の例

set oRoot = Application.ActiveProject.ActiveScene.Root  

	set oCube = oRoot.AddGeometry("Cube","MeshSurface")  

	oCube.Kinematics.Global.Parameters("posy").value = 4.0  

	oCube.Kinematics.Global.Parameters("posx").value = 2.0  

	set oCube2 = oCube.AddGeometry("Cube","MeshSurface")  

	oCube2.Kinematics.Global.Parameters("posz").value = 3.0  

	oCube2.Kinematics.Global.Parameters("rotx").value = 45.0  

	set oCone = oRoot.AddGeometry("Cone", "MeshSurface")  

	oCone.Kinematics.Global.Parameters("posy").value = -2.0  

	oCone.Kinematics.Global.Parameters("posz").value = 90.0  

	set oTrans = oCube.Kinematics.Local.Transform  

	set oTransParent = oCube2.Kinematics.Global.Transform  

	set oVec3 = XSIMath.CreateVector3  

	oTrans.GetTranslation oVec3  

	set oDestinationTrans = oCone.Kinematics.Global.Transform  

	Application.LogMessage "The translation of the cube relative to its parent: x " & _  

	 oVec3.x & " y " & oVec3.y & " z " & oVec3.z  

	set oObjectTrans = XSIMath.MapObjectPoseToObjectSpace(oTransParent, oDestinationTrans,oTrans)  

	oObjectTrans.GetTranslation oVec3  

	Application.LogMessage "The translation of the cube relative to the cone: x " & _  

	 oVec3.x & " y " & oVec3.y & " z " & oVec3.z