Table of Contents

Class Shapes

Namespace
BepuPhysics.Collidables
Assembly
BepuPhysics.dll
public class Shapes
Inheritance
Shapes
Inherited Members

Constructors

Shapes(BufferPool, int)

public Shapes(BufferPool pool, int initialCapacityPerTypeBatch)

Parameters

pool BufferPool
initialCapacityPerTypeBatch int

Properties

InitialCapacityPerTypeBatch

public int InitialCapacityPerTypeBatch { get; set; }

Property Value

int

this[int]

public ShapeBatch this[int typeIndex] { get; }

Parameters

typeIndex int

Property Value

ShapeBatch

RegisteredTypeSpan

public int RegisteredTypeSpan { get; }

Property Value

int

Methods

Add<TShape>(in TShape)

public TypedIndex Add<TShape>(in TShape shape) where TShape : unmanaged, IShape

Parameters

shape TShape

Returns

TypedIndex

Type Parameters

TShape

Clear()

Clears all shapes from existing batches. Does not release any memory.

public void Clear()

Dispose()

Releases all memory from existing batches. Leaves shapes set in an unusable state.

public void Dispose()

EnsureBatchCapacities(int)

Ensures a minimum capacity for all existing shape batches.

public void EnsureBatchCapacities(int shapeCapacity)

Parameters

shapeCapacity int

Capacity to ensure for all existing shape batches.

GetShape<TShape>(int)

public ref TShape GetShape<TShape>(int shapeIndex) where TShape : unmanaged, IShape

Parameters

shapeIndex int

Returns

TShape

Type Parameters

TShape

RecursivelyRemoveAndDispose(TypedIndex, BufferPool)

Removes a shape and any existing children from the shapes collection and returns their resources to the given pool.

public void RecursivelyRemoveAndDispose(TypedIndex shapeIndex, BufferPool pool)

Parameters

shapeIndex TypedIndex

Index of the shape to remove.

pool BufferPool

Pool to return all shape resources to.

Remove(TypedIndex)

Removes a shape without removing its children or disposing any resources.

public void Remove(TypedIndex shapeIndex)

Parameters

shapeIndex TypedIndex

Index of the shape to remove.

RemoveAndDispose(TypedIndex, BufferPool)

Removes a shape from the shapes collection and returns its resources to the given pool. Does not remove or dispose any children.

public void RemoveAndDispose(TypedIndex shapeIndex, BufferPool pool)

Parameters

shapeIndex TypedIndex

Index of the shape to remove.

pool BufferPool

Pool to return all shape resources to.

ResizeBatches(int)

Resizes all existing batches for a target capacity. Note that this is conservative; it will never orphan an existing shape.

public void ResizeBatches(int shapeCapacity)

Parameters

shapeCapacity int

Capacity to target for all existing shape batches.

UpdateBounds(RigidPose, TypedIndex, out BoundingBox)

Computes a bounding box for a single shape.

public void UpdateBounds(RigidPose pose, TypedIndex shapeIndex, out BoundingBox bounds)

Parameters

pose RigidPose

Pose to calculate the bounding box of.

shapeIndex TypedIndex

Index of the shape.

bounds BoundingBox

Bounding box of the specified shape with the specified pose.

UpdateBounds(Vector3, Quaternion, TypedIndex, out BoundingBox)

Computes a bounding box for a single shape.

public void UpdateBounds(Vector3 position, Quaternion orientation, TypedIndex shapeIndex, out BoundingBox bounds)

Parameters

position Vector3

Position of the shape.

orientation Quaternion

Orientation of the shape.

shapeIndex TypedIndex

Index of the shape.

bounds BoundingBox

Bounding box of the specified shape with the specified pose.