Class TransformExtensions
Several method extensions to Transform for transforming and inverse-transforming additional Unity types.
Inheritance
Inherited Members
Namespace: UnityEngine.XR.ARFoundation
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 |
| 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 |
| Pose | pose | The |
Returns
| Type | Description |
|---|---|
| Pose | A new |
InverseTransformRay(Transform, Ray)
Inverse transforms a Ray
Declaration
public static Ray InverseTransformRay(this Transform transform, Ray ray)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | transform | The |
| Ray | ray | The |
Returns
| Type | Description |
|---|---|
| Ray | A new |
InverseTransformXRRaycastHits(Transform, List<XRRaycastHit>)
Inverse transforms a List of XRRaycastHits.
Declaration
public static void InverseTransformXRRaycastHits(this Transform transform, List<XRRaycastHit> raycastHits)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | transform | The |
| List<XRRaycastHit> | raycastHits | The |
SetLayerRecursively(Transform, Int32)
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 |
| System.Int32 | 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 |
| 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 |
| Pose | pose | The |
Returns
| Type | Description |
|---|---|
| Pose | A new |
TransformRay(Transform, Ray)
Transforms a Ray
Declaration
public static Ray TransformRay(this Transform transform, Ray ray)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | transform | The |
| Ray | ray | The |
Returns
| Type | Description |
|---|---|
| Ray | A new |
TransformXRRaycastHits(Transform, List<XRRaycastHit>)
Transforms a List of XRRaycastHits.
Declaration
public static void TransformXRRaycastHits(this Transform transform, List<XRRaycastHit> raycastHits)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | transform | The |
| List<XRRaycastHit> | raycastHits | The |