Class ShapeBatch<TShape>
- Namespace
- BepuPhysics.Collidables
- Assembly
- BepuPhysics.dll
public abstract class ShapeBatch<TShape> : ShapeBatch where TShape : unmanaged, IShape
Type Parameters
TShape
- Inheritance
-
ShapeBatch<TShape>
- Derived
- Inherited Members
Constructors
ShapeBatch(BufferPool, int)
protected ShapeBatch(BufferPool pool, int initialShapeCount)
Parameters
pool
BufferPoolinitialShapeCount
int
Properties
this[int]
Gets a reference to the shape associated with an index.
public ref TShape this[int shapeIndex] { get; }
Parameters
shapeIndex
intIndex of the shape reference to retrieve.
Property Value
- TShape
Reference to the shape at the given index.
Methods
Add(in TShape)
public int Add(in TShape shape)
Parameters
shape
TShape
Returns
Clear()
Frees all shape slots without returning any resources to the pool.
public override void Clear()
Dispose()
Returns all backing resources to the pool, leaving the batch in an unusable state.
public override void Dispose()
EnsureCapacity(int)
Increases the size of the type batch if necessary to hold the target capacity.
public override void EnsureCapacity(int shapeCapacity)
Parameters
shapeCapacity
intTarget capacity.
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 override void Resize(int shapeCapacity)
Parameters
shapeCapacity
intTarget capacity.