docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class TransformExtensions

    Several method extensions to Transform for transforming and inverse-transforming additional Unity types.

    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: UnityEngine.XR.ARFoundation
    Assembly: Unity.XR.ARFoundation.dll
    Syntax
    public static class TransformExtensions

    Methods

    InverseTransformPointList(Transform, List<Vector3>)

    Inverse transforms a List of Vector3s.

    Declaration
    public static void InverseTransformPointList(this Transform transform, List<Vector3> points)
    Parameters
    Type Name Description
    Transform transform

    The Transform component

    List<Vector3> points

    The points to inverse transform. This is done in-place.

    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

    SetLayerRecursively(Transform, int)

    Sets the layer for the GameObject associated with transform and all its children.

    Declaration
    public static void SetLayerRecursively(this Transform transform, int layer)
    Parameters
    Type Name Description
    Transform transform

    The Transform component

    int layer

    The layer in which the game object should be.

    TransformPointList(Transform, List<Vector3>)

    Transforms a List of positions.

    Declaration
    public static void TransformPointList(this Transform transform, List<Vector3> points)
    Parameters
    Type Name Description
    Transform transform

    The Transform component

    List<Vector3> points

    The points to transform. The points are transformed in-place.

    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

    TransformRay(Transform, Ray)

    Transforms a Ray

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

    The Transform component

    Ray ray

    The Ray to transform

    Returns
    Type Description
    Ray

    A new Ray representing the transformed ray

    In This Article
    Back to top
    Copyright © 2024 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)