docs.unity3d.com
    Show / Hide Table of Contents

    Class TransformExtensions

    Extension methods for Transform components

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

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023