Class PhysicsSetupBase
The physics engine of a SceneSetup: what CreatePrimitive(IGame, Primitive3D, Primitive3DEntityOptions?)
and the grounds attach a body or a static collider with. A physics package derives from it and registers its
setup through an extension method on the setup (UseBepu(), UseBullet()); None attaches
nothing, which is the core on its own.
public abstract class PhysicsSetupBase
- Inheritance
-
PhysicsSetupBase
- Derived
Remarks
The setup is chosen once and decides what the implicit calls mean. The explicit route, the entity extensions of
each physics package (AddBepuPhysics, AddBulletPhysics), stays open whatever is chosen, so two
engines can share a game.
Properties
None
No physics engine: the primitives get a mesh and nothing else.
public static PhysicsSetupBase None { get; }
Property Value
Methods
AddBody(Entity, Primitive2D, Primitive2DEntityOptions?)
Attaches a dynamic body with the collider that matches shape.
public abstract void AddBody(Entity entity, Primitive2D shape, Primitive2DEntityOptions? options)
Parameters
entityEntityThe entity with the shape's model.
shapePrimitive2DThe shape the model was built from.
optionsPrimitive2DEntityOptionsThe options the entity was created with; a package reads its own derived options back from them.
AddBody(Entity, Primitive3D, Primitive3DEntityOptions?)
Attaches a dynamic body with the collider that matches shape.
public abstract void AddBody(Entity entity, Primitive3D shape, Primitive3DEntityOptions? options)
Parameters
entityEntityThe entity with the shape's model.
shapePrimitive3DThe shape the model was built from.
optionsPrimitive3DEntityOptionsThe options the entity was created with; a package reads its own derived options back from them.
AddStatic(Entity, Primitive2D, Primitive2DEntityOptions?)
Attaches a static collider that matches shape: a ground, a wall.
public abstract void AddStatic(Entity entity, Primitive2D shape, Primitive2DEntityOptions? options)
Parameters
entityEntityThe entity with the shape's model.
shapePrimitive2DThe shape the model was built from.
optionsPrimitive2DEntityOptionsThe options the entity was created with; a package reads its own derived options back from them.
AddStatic(Entity, Primitive3D, Primitive3DEntityOptions?)
Attaches a static collider that matches shape: a ground, a wall.
public abstract void AddStatic(Entity entity, Primitive3D shape, Primitive3DEntityOptions? options)
Parameters
entityEntityThe entity with the shape's model.
shapePrimitive3DThe shape the model was built from.
optionsPrimitive3DEntityOptionsThe options the entity was created with; a package reads its own derived options back from them.
Of(IGame)
The physics setup registered on game by Run(Game, SceneSetup, Action<Scene>?, Action<Scene, GameTime>?, GameContext?), or None.
public static PhysicsSetupBase Of(IGame game)
Parameters
gameIGame