Method InterpolateUsingVelocity
InterpolateUsingVelocity(in RigidTransform, in PhysicsVelocity, in PhysicsVelocity, in PhysicsMass, float, float)
Compute an interpolated transform for the graphical representation of a rigid body between its previous transform and current transform, integrating forward using an interpolated velocity value.
This method tries to achieve a compromise between the visual artifacts of Interpolate(in RigidpreviousVelocity
alone would exhibit behavior similar to Extrapolate(in RigidpreviousTransform
results in smoother motion for small velocity changes.
Collisions can still appear premature when physics has a low tick rate, however, as when using Interpolate(in Rigid
Declaration
public static RigidTransform InterpolateUsingVelocity(in RigidTransform previousTransform, in PhysicsVelocity previousVelocity, in PhysicsVelocity currentVelocity, in PhysicsMass mass, float timeAhead, float normalizedTimeAhead)
Parameters
Type | Name | Description |
---|---|---|
Rigid |
previousTransform | The transform of the rigid body before physics stepped. |
Physics |
previousVelocity | The velocity of the rigid body before physics stepped. |
Physics |
currentVelocity | The velocity of the rigid body after physics has stepped (i.e., the value of its Physics |
Physics |
mass | The body's Physics |
float | timeAhead | A value indicating how many seconds the current elapsed time for graphics is ahead of the elapsed time when physics last stepped. |
float | normalizedTimeAhead | A value in the range [0, 1] indicating how many seconds the current elapsed time for graphics is ahead of the elapsed time when physics last stepped, as a proportion of the fixed timestep used by physics. |
Returns
Type | Description |
---|---|
Rigid |
An interpolated transform for a rigid body's graphical representation, suitable for constructing its |