Struct PoseIntegratorCallbacks

Namespace
Game.Shared.Physics
Assembly
Game.dll
public struct PoseIntegratorCallbacks : IPoseIntegratorCallbacks
Implements
IPoseIntegratorCallbacks
Inherited Members

Constructors

PoseIntegratorCallbacks(Vector3)

public PoseIntegratorCallbacks(Vector3 gravity)

Parameters

gravity Vector3

Fields

Gravity

public Vector3 Gravity

Field Value

Vector3

Properties

AllowSubstepsForUnconstrainedBodies

Gets whether the integrator should use substepping for unconstrained bodies when using a substepping solver. If true, unconstrained bodies will be integrated with the same number of substeps as the constrained bodies in the solver. If false, unconstrained bodies use a single step of length equal to the dt provided to Simulation.Timestep.

public readonly bool AllowSubstepsForUnconstrainedBodies { get; }

Property Value

bool

AngularIntegrationMode

Gets how the pose integrator should handle angular velocity integration.

public readonly AngularIntegrationMode AngularIntegrationMode { get; }

Property Value

AngularIntegrationMode

IntegrateVelocityForKinematics

Gets whether the velocity integration callback should be called for kinematic bodies. If true, IntegrateVelocity will be called for bundles including kinematic bodies. If false, kinematic bodies will just continue using whatever velocity they have set. Most use cases should set this to false.

public readonly bool IntegrateVelocityForKinematics { get; }

Property Value

bool

Methods

Initialize(Simulation)

Performs any required initialization logic after the Simulation instance has been constructed.

public void Initialize(Simulation simulation)

Parameters

simulation Simulation

IntegrateVelocity(Vector<int>, Vector3Wide, QuaternionWide, BodyInertiaWide, Vector<int>, int, Vector<float>, ref BodyVelocityWide)

Callback for a bundle of bodies being integrated.

public void IntegrateVelocity(Vector<int> bodyIndices, Vector3Wide position, QuaternionWide orientation, BodyInertiaWide localInertia, Vector<int> integrationMask, int workerIndex, Vector<float> dt, ref BodyVelocityWide velocity)

Parameters

bodyIndices Vector<int>
position Vector3Wide
orientation QuaternionWide
localInertia BodyInertiaWide
integrationMask Vector<int>
workerIndex int
dt Vector<float>
velocity BodyVelocityWide

PrepareForIntegration(float)

Callback invoked ahead of dispatches that may call into IntegrateVelocity(Vector<int>, Vector3Wide, QuaternionWide, BodyInertiaWide, Vector<int>, int, Vector<float>, ref BodyVelocityWide). It may be called more than once with different values over a frame. For example, when performing bounding box prediction, velocity is integrated with a full frame time step duration. During substepped solves, integration is split into substepCount steps, each with fullFrameDuration / substepCount duration. The final integration pass for unconstrained bodies may be either fullFrameDuration or fullFrameDuration / substepCount, depending on the value of AllowSubstepsForUnconstrainedBodies.

public void PrepareForIntegration(float dt)

Parameters

dt float