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
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
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
ShapeDataSize
Gets the size of the shape type stored in this batch in bytes.
public int ShapeDataSize { get; }
Property Value
TypeId
Gets the type id of the shape type in this batch.
public int TypeId { get; protected set; }
Property Value
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
ComputeBounds(int, Quaternion, out Vector3, out Vector3)
public abstract void ComputeBounds(int shapeIndex, Quaternion orientation, out Vector3 min, out Vector3 max)
Parameters
shapeIndex
intorientation
Quaternionmin
Vector3max
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
intposition
Vector3orientation
Quaternionmin
Vector3max
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
intpool
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
intTarget 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
intIndex of the shape to look up.
shapePointer
void*Pointer to the indexed shape data.
shapeSize
intSize 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
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
Type Parameters
TRayHitHandler
RecursivelyRemoveAndDispose(int, Shapes, BufferPool)
public void RecursivelyRemoveAndDispose(int index, Shapes shapes, BufferPool pool)
Parameters
Remove(int)
public void Remove(int index)
Parameters
index
int
RemoveAndDispose(int, BufferPool)
public void RemoveAndDispose(int index, BufferPool pool)
Parameters
index
intpool
BufferPool
RemoveAndDisposeChildren(int, Shapes, BufferPool)
protected abstract void RemoveAndDisposeChildren(int index, Shapes shapes, BufferPool pool)
Parameters
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
intTarget 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
intNumber of slots to allocate space for in the id pool.