XSIMath.MapWorldPoseToObjectSpace

Description

Converts a Pose described in WorldSpace to a different ObjectSpace.

C# Syntax

SITransformation XSIMath.MapWorldPoseToObjectSpace( SITransformation in_pObjectSpace, SITransformation in_pPose );

Scripting Syntax

oReturn = XSIMath.MapWorldPoseToObjectSpace( ObjectSpace, Pose );

Return Value

SITransformation (pose)

Parameters

Parameter Type Description
ObjectSpace SITransformation ObjectSpace in which we want to convert the pose.
Pose SITransformation Pose to convert.

Examples

VBScript Example

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 = oRoot.AddGeometry("Cube","MeshSurface")
	oCube2.Kinematics.Global.Parameters("roty").value = 45.0
	oCube2.Kinematics.Global.Parameters("posz").value = -2.0
	set oTransfo = GetObjectPoseRelativeToOther(oCube, oCube2)
	'Function that gets the local pose of an object if it would be parented under another object
	Function GetObjectPoseRelativeToOther(in_obj1, in_obj2)
		Dim l_srcPose, l_destPose
		set l_srcPose = in_obj1.Kinematics.Global.Transform
		set l_destPose = in_obj2.Kinematics.Global.Transform
		set GetObjectPoseRelativeToOther = XSIMath.MapWorldPoseToObjectSpace(l_srcPose, l_destPose)
	End Function