TransformRef
A reference to the transform of an entity, which can be part of a transform hierarchy.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Struct
- Namespace: Unity.Entities
- Assembly: UnityEngine.EntitiesModule
- Implements: IQueryTypeParameter
public readonly struct TransformRef : IQueryTypeParameter
Properties
Property | Description |
|---|---|
| HasHierarchy | Returns whether this transform is currently part of a hierarchy. |
| IsValid | Whether this reference points to a transform. |
| LocalPosition | The position relative to the parent, or to the world if the transform has no parent. |
| LocalRotation | The rotation relative to the parent, or to the world if the transform has no parent. |
| LocalScale | The scale relative to the parent, or to the world if the transform has no parent. |
Methods
Method | Description |
|---|---|
| ComputeLocalToWorld | Computes the matrix that transforms from this transform's local space to world space. |
| GetChild | Gets the child entity at the specified index. |
| GetChildCount | Gets the number of direct children of this transform. |
| GetChildEntities | Gets all child entities. |
| GetLocalPositionAndRotation | Gets the local (parent-relative) position and rotation. |
| GetParent | Gets the parent entity of this transform. |
| GetWorldPositionAndRotation | Gets the world-space position and rotation. |
| SetLocalPositionAndRotation | Sets the local (parent-relative) position and rotation to the provided values. |
| SetLocalTransform | Sets the local (parent-relative) position, rotation, and scale to the provided values. |
| SetWorldPositionAndRotation | Sets the world-space position and rotation to the provided values. |