PhysicsTransform
Represents a 2D transformation combining a translation and a PhysicsRotate.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Struct
- Namespace: Unity.U2D.Physics
- Assembly: UnityEngine.PhysicsCore2DModule
public struct PhysicsTransform
Fields
Value | Description |
|---|---|
| position | The translation for the transformation. |
| rotation | The rotation for the transformation. |
Constructors
Constructor | Description |
|---|---|
| PhysicsTransform() | Create an identity transform. |
| PhysicsTransform(UnityEngine.Vector2) | Create a transformation with the specified translation and no rotation. |
| PhysicsTransform(UnityEngine.Vector2,Unity.U2D.Physics.PhysicsRotate) | Create a transformation with the specified translation and rotation. |
Properties
Property | Description |
|---|---|
| isValid | Check if the PhysicsTransform is valid (position is not NaN and _isValid). |
Static Properties
Property | Description |
|---|---|
| identity | The identity transformation i.e. a transformation with no translation or rotation. |
Methods
Method | Description |
|---|---|
| GetPositionAndRotation | Get both the position and rotation. |
| InverseMultiplyTransform | Inverse Multiply the specified transform with the current transform. |
| InverseTransformPoint | Inverse Transform a point using the current transform translation and rotation. |
| MultiplyTransform | Multiply the specified transform with the current transform. |
| TransformPoint | Transform a point using the current transform translation and rotation. |
Operators
Operator | Description |
|---|---|
| PhysicsTransform | Implicit conversion of a PhysicsRotate that represents a rotation transformation with no translation. |