Table of Contents

Struct MeshReduction

Namespace
BepuPhysics.CollisionDetection
Assembly
BepuPhysics.dll
public struct MeshReduction : ICollisionTestContinuation
Implements
Inherited Members

Fields

FaceCollisionFlag

Flag used to mark a contact as being generated by the face of a triangle in its feature id.

public const int FaceCollisionFlag = 32768

Field Value

int

Inner

public NonconvexReduction Inner

Field Value

NonconvexReduction

Mesh

public void* Mesh

Field Value

void*

MeshOrientation

public Quaternion MeshOrientation

Field Value

Quaternion

MinimumDotForFaceCollision

Minimum dot product between a triangle face and the contact normal for a collision to be considered a triangle face contact.

public const float MinimumDotForFaceCollision = 0.999999

Field Value

float

QueryBounds

public BoundingBox QueryBounds

Field Value

BoundingBox

RequiresFlip

public bool RequiresFlip

Field Value

bool

Triangles

public Buffer<Triangle> Triangles

Field Value

Buffer<Triangle>

Methods

Create(int, BufferPool)

Creates a collision test continuation with the given number of slots for subpairs.

public void Create(int childManifoldCount, BufferPool pool)

Parameters

childManifoldCount int
pool BufferPool

Pool to take resources from.

OnChildCompleted<TCallbacks>(ref PairContinuation, ref ConvexContactManifold, ref CollisionBatcher<TCallbacks>)

Handles what to do next when the child pair has finished execution and the resulting manifold is available.

public void OnChildCompleted<TCallbacks>(ref PairContinuation report, ref ConvexContactManifold manifold, ref CollisionBatcher<TCallbacks> batcher) where TCallbacks : struct, ICollisionCallbacks

Parameters

report PairContinuation

Continuation instance being considered.

manifold ConvexContactManifold

Contact manifold for the child pair.

batcher CollisionBatcher<TCallbacks>

Collision batcher processing the pair.

Type Parameters

TCallbacks

Type of the callbacks used in the batcher.

OnUntestedChildCompleted<TCallbacks>(ref PairContinuation, ref CollisionBatcher<TCallbacks>)

Handles what to do next when the child pair was rejected for testing, and no manifold exists.

public void OnUntestedChildCompleted<TCallbacks>(ref PairContinuation report, ref CollisionBatcher<TCallbacks> batcher) where TCallbacks : struct, ICollisionCallbacks

Parameters

report PairContinuation

Continuation instance being considered.

batcher CollisionBatcher<TCallbacks>

Collision batcher processing the pair.

Type Parameters

TCallbacks

Type of the callbacks used in the batcher.

ReduceManifolds(ref Buffer<Triangle>, ref Buffer<NonconvexReductionChild>, int, int, bool, in BoundingBox, in Matrix3x3, in Matrix3x3, Mesh*, BufferPool)

public static void ReduceManifolds(ref Buffer<Triangle> continuationTriangles, ref Buffer<NonconvexReductionChild> continuationChildren, int start, int count, bool requiresFlip, in BoundingBox queryBounds, in Matrix3x3 meshOrientation, in Matrix3x3 meshInverseOrientation, Mesh* mesh, BufferPool pool)

Parameters

continuationTriangles Buffer<Triangle>
continuationChildren Buffer<NonconvexReductionChild>
start int
count int
requiresFlip bool
queryBounds BoundingBox
meshOrientation Matrix3x3
meshInverseOrientation Matrix3x3
mesh Mesh*
pool BufferPool

TryFlush<TCallbacks>(int, ref CollisionBatcher<TCallbacks>)

Checks if the parent pair is complete and should be flushed.

public bool TryFlush<TCallbacks>(int pairId, ref CollisionBatcher<TCallbacks> batcher) where TCallbacks : struct, ICollisionCallbacks

Parameters

pairId int

Id of the pair to attempt to flush.

batcher CollisionBatcher<TCallbacks>

Collision batcher processing the pair.

Returns

bool

True if the pair was done and got flushed, false otherwise.

Type Parameters

TCallbacks

Type of the callbacks used in the batcher.