Table of Contents

Class EntityExtensions

Namespace
Stride.CommunityToolkit.Bullet
Assembly
Stride.CommunityToolkit.Bullet.dll

Provides extension methods for the Entity class to simplify adding Bullet 2D and 3D physics components.

public static class EntityExtensions
Inheritance
EntityExtensions

Methods

AddBullet2DPhysics(Entity, Primitive2DModelType, Bullet2DPhysicsOptions?)

Adds Bullet 2D physics components to the entity with an appropriate collider shape based on the primitive type.

public static Entity AddBullet2DPhysics(this Entity entity, Primitive2DModelType type, Bullet2DPhysicsOptions? options = null)

Parameters

entity Entity

The entity to add physics components to.

type Primitive2DModelType

The type of 2D primitive shape for the collider.

options Bullet2DPhysicsOptions

Optional physics configuration including the physics component, size, depth, and whether to include a collider. If null, default options are used.

Returns

Entity

The entity with the Bullet 2D physics components added.

Exceptions

ArgumentNullException

Thrown when entity is null.

InvalidOperationException

Thrown when an unsupported Primitive2DModelType is specified.

AddBullet3DPhysics(Entity, PrimitiveModelType, Bullet3DPhysicsOptions?)

Adds Bullet 3D physics components to the entity with an appropriate collider shape based on the primitive type.

public static Entity AddBullet3DPhysics(this Entity entity, PrimitiveModelType type, Bullet3DPhysicsOptions? options = null)

Parameters

entity Entity

The entity to add physics components to.

type PrimitiveModelType

The type of 3D primitive shape for the collider.

options Bullet3DPhysicsOptions

Optional physics configuration including the physics component, size, and whether to include a collider. If null, default options are used.

Returns

Entity

The entity with the Bullet 3D physics components added.

Remarks

Some primitive types (Torus, Teapot) do not have a collider shape and will be added without a collider even if IncludeCollider is true.

Exceptions

ArgumentNullException

Thrown when entity is null.