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
BufferPoolinitialCapacityPerTypeBatch
int
Properties
InitialCapacityPerTypeBatch
public int InitialCapacityPerTypeBatch { get; set; }
Property Value
this[int]
public ShapeBatch this[int typeIndex] { get; }
Parameters
typeIndex
int
Property Value
RegisteredTypeSpan
public int RegisteredTypeSpan { get; }
Property Value
Methods
Add<TShape>(in TShape)
public TypedIndex Add<TShape>(in TShape shape) where TShape : unmanaged, IShape
Parameters
shape
TShape
Returns
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
intCapacity 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
TypedIndexIndex of the shape to remove.
pool
BufferPoolPool 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
TypedIndexIndex 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
TypedIndexIndex of the shape to remove.
pool
BufferPoolPool 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
intCapacity 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
RigidPosePose to calculate the bounding box of.
shapeIndex
TypedIndexIndex of the shape.
bounds
BoundingBoxBounding 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
Vector3Position of the shape.
orientation
QuaternionOrientation of the shape.
shapeIndex
TypedIndexIndex of the shape.
bounds
BoundingBoxBounding box of the specified shape with the specified pose.