Namespace Unity.Physics.GraphicsIntegration
Classes
BufferInterpolatedRigidBodiesMotion
A system that writes to a rigid body's PhysicsGraphicalInterpolationBuffer
component by copying its LocalTransform and PhysicsVelocity
before physics steps. These values are used for bodies whose graphics representations will be
interpolated by the SmoothRigidBodiesGraphicalMotion system. Add a WriteGroupAttribute
to your own component if you need to use different values (as with a
character controller).
NOTE: Consider the case when an interpolated rigid body needs to be teleported (i.e. have its LocalTransform or PhysicsVelocity components changed directly), specifically after this system is updated and before SmoothRigidBodiesGraphicalMotion is updated. In that case, you should set associated ApplySmoothing to 0. or assign the appropriate new PhysicsGraphicalInterpolationBuffer component values as well.
CopyPhysicsVelocityToSmoothing
A system that writes to a body's PhysicsGraphicalSmoothing component by copying its PhysicsVelocity after physics has stepped.
These values are used for bodies whose graphics representations will be smoothed by the SmoothRigidBodiesGraphicalMotion system.
Add a WriteGroupAttribute
to your own component if you need to use a different value (as with a character controller).
GraphicalSmoothingUtility
Utility functions for smoothing the motion of rigid bodies' graphical representations when physics steps at a lower frequency than rendering.
RecordMostRecentFixedTime
A system to keep track of the time values in the most recent tick of the PhysicsSystemGroup
.
SmoothRigidBodiesGraphicalMotion
A system that can smooth out the motion of rigid bodies if the fixed physics tick rate is slower than the variable graphics framerate. Each affected body's LocalToWorld matrix is adjusted before rendering, but its underlying LocalTransform component is left alone.
Structs
BufferInterpolatedRigidBodiesMotion.UpdateInterpolationBuffersJob
An IJobChunk which updates PhysicsGraphicalInterpolationBuffer of the entities in chunk specified by PhysicsVelocity, LocalTransform and PhysicsGraphicalInterpolationBuffer.
CopyPhysicsVelocityToSmoothing.CopyPhysicsVelocityJob
An IJobChunk which writes to a body's PhysicsGraphicalSmoothing by copying it's PhysicsVelocity.
MostRecentFixedTime
Singleton dynamic buffer that record the last Time.ElapsedTime
and Time.DeltaTime
of the most recent tick for each stepped Physics World. The PhysicsWorldIndex
value is used as index to store and retrieve the timing data. Because of that, the dynamic
buffer size is always equals to the largest PhysicsWorldIndex value set by the application.
PhysicsGraphicalInterpolationBuffer
Stores the state of a rigid body from the previous physics tick in order to interpolate the motion of the body's graphical representation. When used in conjunction with PhysicsGraphicalSmoothing, it indicates that smoothing should interpolate between the two most recent physics simulation ticks. The result is thus a more accurate representation of the physics simulation, but is one tick behind.
PhysicsGraphicalSmoothing
A component to indicate that the graphical representation of a dynamic rigid body's motion should be smoothed when the rendering framerate is greater than the fixed step rate used by physics. When used on its own, it indicates that smoothing should extrapolate into the future based on the body's current velocity. The result is thus up-to-date, but can mis-predict the body's transformations since any future collision response has not yet been resolved. See also PhysicsGraphicalInterpolationBuffer.
PhysicsRenderEntity
Stores a direct association to another Entity holding a graphical representation of a physics shape referenced by this Entity.