Version: Unity 6.5 Alpha (6000.5)
LanguageEnglish
  • C#

TransformWriteTween

struct in Unity.U2D.Physics

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Used to define a Transform write "tween" for a body. See Unity.U2D.Physics.PhysicsWorld.SetTransformWriteTweens, PhysicsWorld.GetTransformWriteTweens and Transform.

Properties

Property Description
angularVelocity The angular velocity of the body to be used during the lifetime of the tween. This is typically used when the PhysicsBody.TransformWriteTween.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 PhysicsBody.TransformWriteTween.transformWriteMode is PhysicsBody.TransformWriteMode.Extrapolate.
physicsTransform The physics transform to be used during the lifetime of the tween. When the PhysicsBody.TransformWriteTween.transformWriteMode is PhysicsBody.TransformWriteMode.Interpolate, this defines the target pose to move to. When the PhysicsBody.TransformWriteTween.transformWriteMode is PhysicsBody.TransformWriteMode.Extrapolate, this defines the source pose to move from.
positionFrom The start position of the tween. When the PhysicsBody.TransformWriteTween.transformWriteMode is PhysicsBody.TransformWriteMode.Current, this is set to the last Transform._position. but is not used. When the PhysicsBody.TransformWriteTween.transformWriteMode is PhysicsBody.TransformWriteMode.Interpolate, this is set to the last Transform._position. When the PhysicsBody.TransformWriteTween.transformWriteMode is PhysicsBody.TransformWriteMode.Extrapolate, this will be calculated from PhysicsBody.TransformWriteTween.physicsTransform. See Transform._position.
rotationFrom The start rotation of the tween. When the PhysicsBody.TransformWriteTween.transformWriteMode is PhysicsBody.TransformWriteMode.Current, this is set to the last Transform._rotation but is not used. When the PhysicsBody.TransformWriteTween.transformWriteMode is PhysicsBody.TransformWriteMode.Interpolate, this is set to the last Transform._rotation. When the PhysicsBody.TransformWriteTween.transformWriteMode is PhysicsBody.TransformWriteMode.Extrapolate, this will be calculated from PhysicsBody.TransformWriteTween.physicsTransform. See Transform._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 PhysicsWorld.transformTweenMode is anything other than PhysicsWorld.TransformTweenMode.Parallel, all 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 PhysicsWorld.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.

Public 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.