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
poolBufferPoolinitialCapacityPerTypeBatchint
Properties
InitialCapacityPerTypeBatch
public int InitialCapacityPerTypeBatch { get; set; }
Property Value
this[int]
public ShapeBatch this[int typeIndex] { get; }
Parameters
typeIndexint
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
shapeTShape
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
shapeCapacityintCapacity to ensure for all existing shape batches.
GetShape<TShape>(int)
public ref TShape GetShape<TShape>(int shapeIndex) where TShape : unmanaged, IShape
Parameters
shapeIndexint
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
shapeIndexTypedIndexIndex of the shape to remove.
poolBufferPoolPool 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
shapeIndexTypedIndexIndex 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
shapeIndexTypedIndexIndex of the shape to remove.
poolBufferPoolPool 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
shapeCapacityintCapacity 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
poseRigidPosePose to calculate the bounding box of.
shapeIndexTypedIndexIndex of the shape.
boundsBoundingBoxBounding 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
positionVector3Position of the shape.
orientationQuaternionOrientation of the shape.
shapeIndexTypedIndexIndex of the shape.
boundsBoundingBoxBounding box of the specified shape with the specified pose.