IPhysicsWorldControlΒΆ

interface IPhysicsWorldControl

This interface provides control over the physics properties of the current world.

Vector3 Gravity

The gravity in the current world.

Jitter.Dynamics.MaterialCoefficientMixingType MaterialCoefficientMixing

The coefficient mixing to use for physics collisions in the world. When two bodies collide, this determines the strategy to use for calculating static friction, dynamic friction and restitution between the two bodies.

System.Func<RigidBody, RigidBody, Boolean> ConsiderAngularVelocityCallback

Optionally set a callback which determines whether or not angular velocity should be considered between two bodies that are colliding.

For most scenarios, you want to leave this unset, which means angular velocity will always be considered during collisions.

System.Func<RigidBody, RigidBody, Single> CalculateStaticFrictionCallback

Optionally set a callback that returns the static friction between two bodies when they collide. This is used if P:Protogame.IPhysicsWorldControl.MaterialCoefficientMixing is set to F:Jitter.Dynamics.ContactSettings.MaterialCoefficientMixingType.UseCallback.

System.Func<RigidBody, RigidBody, Single> CalculateDynamicFrictionCallback

Optionally set a callback that returns the dynamic friction between two bodies when they collide. This is used if P:Protogame.IPhysicsWorldControl.MaterialCoefficientMixing is set to F:Jitter.Dynamics.ContactSettings.MaterialCoefficientMixingType.UseCallback.

System.Func<RigidBody, RigidBody, Single> CalculateRestitutionCallback

Optionally set a callback that returns the restitution between two bodies when they collide. This is used if P:Protogame.IPhysicsWorldControl.MaterialCoefficientMixing is set to F:Jitter.Dynamics.ContactSettings.MaterialCoefficientMixingType.UseCallback.

bool EnableSpeculativeContacts

Speculative contacts increases collision accuracy and reduces the number of situations where rigid bodies get stuck inside each other. However, it can also impact material coefficient calculations by preventing objects from ever being considered to have collided. Speculative contacts is turned on by default in Protogame.

void SyncPendingChanges()

This is an internal method used to synchronise pending changes to the physics world. The internal physics world state is not always available when users of this interface set properties, so this method is called by the engine hook to ensure those changes are propagated to the physics world when it becomes available.