PhysicsBody.TransformWriteTween
Used to define a Transform write "tween" for a body.
Read time 2 minutesLast updated 8 days ago
Definition
- Type: Struct
- Namespace: Unity.U2D.Physics
- Assembly: UnityEngine.PhysicsCore2DModule
public struct PhysicsBody.TransformWriteTween
Properties
Property | Description |
|---|---|
| angularVelocity | The angular velocity of the body to be used during the lifetime of the tween, in degrees per second. This is typically used when the _transformWriteMode is PhysicsBody.TransformWriteMode.Extrapolate. |
| body | The body to be used during the lifetime of the tween. |
| linearVelocity | The linear velocity of the body to be used during the lifetime of the tween. This is typically used when the _transformWriteMode is PhysicsBody.TransformWriteMode.Extrapolate. |
| physicsTransform | The physics transform to be used during the lifetime of the tween. When the _transformWriteMode is PhysicsBody.TransformWriteMode.Interpolate, this defines the target pose to move to. When the _transformWriteMode is PhysicsBody.TransformWriteMode.Extrapolate, this defines the source pose to move from. |
| positionFrom | The start position of the tween. When the _transformWriteMode is PhysicsBody.TransformWriteMode.Current, this is set to the last _position. but is not used. When the _transformWriteMode is PhysicsBody.TransformWriteMode.Interpolate, this is set to the last _position. When the _transformWriteMode is PhysicsBody.TransformWriteMode.Extrapolate, this will be calculated from _physicsTransform. See _position. |
| rotationFrom | The start rotation of the tween. When the _transformWriteMode is PhysicsBody.TransformWriteMode.Current, this is set to the last _rotation but is not used. When the _transformWriteMode is PhysicsBody.TransformWriteMode.Interpolate, this is set to the last _rotation. When the _transformWriteMode is PhysicsBody.TransformWriteMode.Extrapolate, this will be calculated from _physicsTransform. See _rotation. |
| transform | The Transform to be used during the lifetime of the tween. |
| transformDepth | The depth of the Transform in the hierarchy where zero is the root. When the _transformTweenMode is anything other than PhysicsWorld.TransformTweenMode.Parallel, all PhysicsBody.TransformWriteTween are sorted into ascending depth order so that writing the transforms in tween order will result in the deeper children correctly overwriting any parent transform writes. This is NOT set when the _transformTweenMode is set to PhysicsWorld.TransformTweenMode.Parallel and will be zero. |
| transformWriteMode | The transform write mode to be used during the lifetime of the tween. Anything other than PhysicsBody.TransformWriteMode.Interpolate or PhysicsBody.TransformWriteMode.Extrapolate will be removed. |
Methods
Method | Description |
|---|---|
| GetExtrapolatedPose | Get the extrapolated pose for the current write tween. |
| GetInterpolatedPose | Get the interpolated pose for the current write tween. |
| GetPose | Get the write pose for the current write tween. |