Table of Contents

Struct CollisionBatcher<TCallbacks>

Namespace
BepuPhysics.CollisionDetection
Assembly
BepuPhysics.dll
public struct CollisionBatcher<TCallbacks> where TCallbacks : struct, ICollisionCallbacks

Type Parameters

TCallbacks
Inherited Members

Constructors

CollisionBatcher(BufferPool, Shapes, CollisionTaskRegistry, float, TCallbacks)

public CollisionBatcher(BufferPool pool, Shapes shapes, CollisionTaskRegistry collisionTypeMatrix, float dt, TCallbacks callbacks)

Parameters

pool BufferPool
shapes Shapes
collisionTypeMatrix CollisionTaskRegistry
dt float
callbacks TCallbacks

Fields

Callbacks

public TCallbacks Callbacks

Field Value

TCallbacks

CompoundMeshReductions

public BatcherContinuations<CompoundMeshReduction> CompoundMeshReductions

Field Value

BatcherContinuations<CompoundMeshReduction>

Dt

Timestep duration used by pairs which rely on velocity to compute local bounding boxes for pruning.

public float Dt

Field Value

float

MeshReductions

public BatcherContinuations<MeshReduction> MeshReductions

Field Value

BatcherContinuations<MeshReduction>

NonconvexReductions

public BatcherContinuations<NonconvexReduction> NonconvexReductions

Field Value

BatcherContinuations<NonconvexReduction>

Pool

public BufferPool Pool

Field Value

BufferPool

Shapes

public Shapes Shapes

Field Value

Shapes

Methods

Add(TypedIndex, TypedIndex, Vector3, Quaternion, Quaternion, in BodyVelocity, in BodyVelocity, float, float, in PairContinuation)

public void Add(TypedIndex shapeIndexA, TypedIndex shapeIndexB, Vector3 offsetB, Quaternion orientationA, Quaternion orientationB, in BodyVelocity velocityA, in BodyVelocity velocityB, float speculativeMargin, float maximumExpansion, in PairContinuation continuation)

Parameters

shapeIndexA TypedIndex
shapeIndexB TypedIndex
offsetB Vector3
orientationA Quaternion
orientationB Quaternion
velocityA BodyVelocity
velocityB BodyVelocity
speculativeMargin float
maximumExpansion float
continuation PairContinuation

Add(TypedIndex, TypedIndex, Vector3, Quaternion, Quaternion, float, in PairContinuation)

public void Add(TypedIndex shapeIndexA, TypedIndex shapeIndexB, Vector3 offsetB, Quaternion orientationA, Quaternion orientationB, float speculativeMargin, in PairContinuation continuation)

Parameters

shapeIndexA TypedIndex
shapeIndexB TypedIndex
offsetB Vector3
orientationA Quaternion
orientationB Quaternion
speculativeMargin float
continuation PairContinuation

Add(int, int, int, int, void*, void*, Vector3, Quaternion, Quaternion, float, int)

public void Add(int shapeTypeA, int shapeTypeB, int shapeSizeA, int shapeSizeB, void* shapeA, void* shapeB, Vector3 offsetB, Quaternion orientationA, Quaternion orientationB, float speculativeMargin, int pairId)

Parameters

shapeTypeA int
shapeTypeB int
shapeSizeA int
shapeSizeB int
shapeA void*
shapeB void*
offsetB Vector3
orientationA Quaternion
orientationB Quaternion
speculativeMargin float
pairId int

AddDirectly(int, int, void*, void*, Vector3, Quaternion, Quaternion, in BodyVelocity, in BodyVelocity, float, float, in PairContinuation)

public void AddDirectly(int shapeTypeA, int shapeTypeB, void* shapeA, void* shapeB, Vector3 offsetB, Quaternion orientationA, Quaternion orientationB, in BodyVelocity velocityA, in BodyVelocity velocityB, float speculativeMargin, float maximumExpansion, in PairContinuation pairContinuation)

Parameters

shapeTypeA int
shapeTypeB int
shapeA void*
shapeB void*
offsetB Vector3
orientationA Quaternion
orientationB Quaternion
velocityA BodyVelocity
velocityB BodyVelocity
speculativeMargin float
maximumExpansion float
pairContinuation PairContinuation

AddDirectly(int, int, void*, void*, Vector3, Quaternion, Quaternion, float, in PairContinuation)

public void AddDirectly(int shapeTypeA, int shapeTypeB, void* shapeA, void* shapeB, Vector3 offsetB, Quaternion orientationA, Quaternion orientationB, float speculativeMargin, in PairContinuation pairContinuation)

Parameters

shapeTypeA int
shapeTypeB int
shapeA void*
shapeB void*
offsetB Vector3
orientationA Quaternion
orientationB Quaternion
speculativeMargin float
pairContinuation PairContinuation

Add<TShapeA, TShapeB>(TShapeA, TShapeB, Vector3, Quaternion, Quaternion, float, int)

public void Add<TShapeA, TShapeB>(TShapeA shapeA, TShapeB shapeB, Vector3 offsetB, Quaternion orientationA, Quaternion orientationB, float speculativeMargin, int pairId) where TShapeA : struct, IShape where TShapeB : struct, IShape

Parameters

shapeA TShapeA
shapeB TShapeB
offsetB Vector3
orientationA Quaternion
orientationB Quaternion
speculativeMargin float
pairId int

Type Parameters

TShapeA
TShapeB

CacheShapeB(int, int, void*, int, out void*)

public void CacheShapeB(int shapeTypeA, int shapeTypeB, void* shapeDataB, int shapeSizeB, out void* cachedShapeDataB)

Parameters

shapeTypeA int
shapeTypeB int
shapeDataB void*
shapeSizeB int
cachedShapeDataB void*

Flush()

Forces any remaining partial batches to execute and disposes the batcher.

public void Flush()

ProcessConvexResult(ref ConvexContactManifold, ref PairContinuation)

Reports the result of a convex collision test to the callbacks and, if necessary, to any continuations for postprocessing.

public void ProcessConvexResult(ref ConvexContactManifold manifold, ref PairContinuation continuation)

Parameters

manifold ConvexContactManifold

Contacts detected for the pair.

continuation PairContinuation

Continuation describing the pair and what to do with it.

Remarks

Unless you're building custom compound collision pairs or adding new contact processing continuations, you can safely ignore this.

ProcessEmptyResult(ref PairContinuation)

Reports the zero result of a convex collision test to the callbacks and, if necessary, to any continuations for postprocessing.

public void ProcessEmptyResult(ref PairContinuation continuation)

Parameters

continuation PairContinuation

Continuation describing the pair and what to do with it.

Remarks

Unless you're building custom compound collision pairs or adding new contact processing continuations, you can safely ignore this.

ProcessUntestedSubpairConvexResult(ref PairContinuation)

Submits a subpair whose testing was blocked by user callback as complete to any relevant continuations.

public void ProcessUntestedSubpairConvexResult(ref PairContinuation continuation)

Parameters

continuation PairContinuation

Continuation describing the pair and what to do with it.

Remarks

Unless you're building custom compound collision pairs or adding new contact processing continuations, you can safely ignore this.