Table of Contents

Class PhysicsSetupBase

Namespace
Stride.CommunityToolkit.Engine
Assembly
Stride.CommunityToolkit.dll

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

PhysicsSetupBase

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

entity Entity

The entity with the shape's model.

shape Primitive2D

The shape the model was built from.

options Primitive2DEntityOptions

The 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

entity Entity

The entity with the shape's model.

shape Primitive3D

The shape the model was built from.

options Primitive3DEntityOptions

The 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

entity Entity

The entity with the shape's model.

shape Primitive2D

The shape the model was built from.

options Primitive2DEntityOptions

The 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

entity Entity

The entity with the shape's model.

shape Primitive3D

The shape the model was built from.

options Primitive3DEntityOptions

The options the entity was created with; a package reads its own derived options back from them.

Of(IGame)

public static PhysicsSetupBase Of(IGame game)

Parameters

game IGame

Returns

PhysicsSetupBase