docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class TransformExtensions

    Extension methods for Transform components.

    Inheritance
    object
    TransformExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.XR.CoreUtils
    Assembly: Unity.XR.CoreUtils.dll
    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.

    InverseTransformPose(Transform, Pose)

    Inverse transforms a Pose.

    Declaration
    public static Pose InverseTransformPose(this Transform transform, Pose pose)
    Parameters
    Type Name Description
    Transform transform

    The Transform component.

    Pose pose

    The Pose to inversely transform.

    Returns
    Type Description
    Pose

    A new Pose representing the inversely transformed pose.

    InverseTransformRay(Transform, Ray)

    Inverse transforms a Ray.

    Declaration
    public static Ray InverseTransformRay(this Transform transform, Ray ray)
    Parameters
    Type Name Description
    Transform transform

    The Transform component.

    Ray ray

    The Ray to inversely transform.

    Returns
    Type Description
    Ray

    A new Ray representing the inversely transformed ray.

    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.

    TransformPose(Transform, Pose)

    Transforms a Pose.

    Declaration
    public static Pose TransformPose(this Transform transform, Pose pose)
    Parameters
    Type Name Description
    Transform transform

    The Transform component.

    Pose pose

    The Pose to transform.

    Returns
    Type Description
    Pose

    A new Pose representing the transformed pose.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)