Table of Contents

Class ShapeBatch

Namespace
BepuPhysics.Collidables
Assembly
BepuPhysics.dll
public abstract class ShapeBatch
Inheritance
ShapeBatch
Derived
Inherited Members

Fields

idPool

protected IdPool idPool

Field Value

IdPool

pool

protected BufferPool pool

Field Value

BufferPool

shapeDataSize

protected int shapeDataSize

Field Value

int

shapesData

protected Buffer<byte> shapesData

Field Value

Buffer<byte>

Properties

Capacity

Gets the number of shapes that the batch can currently hold without resizing.

public int Capacity { get; }

Property Value

int

Compound

Gets whether this shape batch's contained type potentially contains children that require other shape batches.

public bool Compound { get; protected set; }

Property Value

bool

ShapeDataSize

Gets the size of the shape type stored in this batch in bytes.

public int ShapeDataSize { get; }

Property Value

int

TypeId

Gets the type id of the shape type in this batch.

public int TypeId { get; protected set; }

Property Value

int

Methods

Clear()

Frees all shape slots without returning any resources to the pool.

public abstract void Clear()

ComputeBounds(ref BoundingBoxBatcher)

public abstract void ComputeBounds(ref BoundingBoxBatcher batcher)

Parameters

batcher BoundingBoxBatcher

ComputeBounds(int, RigidPose, out Vector3, out Vector3)

public void ComputeBounds(int shapeIndex, RigidPose pose, out Vector3 min, out Vector3 max)

Parameters

shapeIndex int
pose RigidPose
min Vector3
max Vector3

ComputeBounds(int, Quaternion, out Vector3, out Vector3)

public abstract void ComputeBounds(int shapeIndex, Quaternion orientation, out Vector3 min, out Vector3 max)

Parameters

shapeIndex int
orientation Quaternion
min Vector3
max Vector3

ComputeBounds(int, Vector3, Quaternion, out Vector3, out Vector3)

public void ComputeBounds(int shapeIndex, Vector3 position, Quaternion orientation, out Vector3 min, out Vector3 max)

Parameters

shapeIndex int
position Vector3
orientation Quaternion
min Vector3
max Vector3

Dispose()

Returns all backing resources to the pool, leaving the batch in an unusable state.

public abstract void Dispose()

Dispose(int, BufferPool)

protected abstract void Dispose(int index, BufferPool pool)

Parameters

index int
pool BufferPool

EnsureCapacity(int)

Increases the size of the type batch if necessary to hold the target capacity.

public abstract void EnsureCapacity(int shapeCapacity)

Parameters

shapeCapacity int

Target capacity.

GetShapeData(int, out void*, out int)

Gets a raw untyped pointer to a shape's data.

public void GetShapeData(int shapeIndex, out void* shapePointer, out int shapeSize)

Parameters

shapeIndex int

Index of the shape to look up.

shapePointer void*

Pointer to the indexed shape data.

shapeSize int

Size of the shape data in bytes.

RayTest<TRayHitHandler>(int, in RigidPose, in RayData, ref float, ref TRayHitHandler)

public abstract void RayTest<TRayHitHandler>(int shapeIndex, in RigidPose pose, in RayData ray, ref float maximumT, ref TRayHitHandler hitHandler) where TRayHitHandler : struct, IShapeRayHitHandler

Parameters

shapeIndex int
pose RigidPose
ray RayData
maximumT float
hitHandler TRayHitHandler

Type Parameters

TRayHitHandler

RayTest<TRayHitHandler>(int, in RigidPose, ref RaySource, ref TRayHitHandler)

public abstract void RayTest<TRayHitHandler>(int shapeIndex, in RigidPose pose, ref RaySource rays, ref TRayHitHandler hitHandler) where TRayHitHandler : struct, IShapeRayHitHandler

Parameters

shapeIndex int
pose RigidPose
rays RaySource
hitHandler TRayHitHandler

Type Parameters

TRayHitHandler

RecursivelyRemoveAndDispose(int, Shapes, BufferPool)

public void RecursivelyRemoveAndDispose(int index, Shapes shapes, BufferPool pool)

Parameters

index int
shapes Shapes
pool BufferPool

Remove(int)

public void Remove(int index)

Parameters

index int

RemoveAndDispose(int, BufferPool)

public void RemoveAndDispose(int index, BufferPool pool)

Parameters

index int
pool BufferPool

RemoveAndDisposeChildren(int, Shapes, BufferPool)

protected abstract void RemoveAndDisposeChildren(int index, Shapes shapes, BufferPool pool)

Parameters

index int
shapes Shapes
pool BufferPool

Resize(int)

Changes the size of the type batch if the target capacity is different than the current capacity. Note that shrinking allocations is conservative; resizing will never allow an existing shape to point to unallocated memory.

public abstract void Resize(int shapeCapacity)

Parameters

shapeCapacity int

Target capacity.

ResizeIdPool(int)

Shrinks or expands the allocation of the batch's id pool. Note that shrinking allocations is conservative; resizing will never allow any pending ids to be lost.

public void ResizeIdPool(int targetIdCapacity)

Parameters

targetIdCapacity int

Number of slots to allocate space for in the id pool.