Class TransformExtensions
Extension methods for Transform components
Namespace: Unity.XRTools.Utils
Syntax
public static class TransformExtensions
Methods
GetLocalPose(Transform)
Gets the local position and rotation as a Pose
Declaration
public static Pose GetLocalPose(this Transform transform)
Parameters
Type | Name | Description |
---|---|---|
Transform | transform | The transform from which to get the pose |
Returns
Type | Description |
---|---|
Pose | The local pose |
GetWorldPose(Transform)
Gets the world position and rotation as a Pose
Declaration
public static Pose GetWorldPose(this Transform transform)
Parameters
Type | Name | Description |
---|---|---|
Transform | transform | The transform from which to get the pose |
Returns
Type | Description |
---|---|
Pose | The world pose |
SetLocalPose(Transform, Pose)
Sets the local position and rotation from a Pose
Declaration
public static void SetLocalPose(this Transform transform, Pose pose)
Parameters
Type | Name | Description |
---|---|---|
Transform | transform | The transform on which to set the pose |
Pose | pose | Pose specifying the new position and rotation |
SetWorldPose(Transform, Pose)
Sets the world position and rotation from a Pose
Declaration
public static void SetWorldPose(this Transform transform, Pose pose)
Parameters
Type | Name | Description |
---|---|---|
Transform | transform | The transform on which to set the pose |
Pose | pose | Pose specifying the new position and rotation |