Class DepthRefiner<TShapeA, TShapeWideA, TSupportFinderA, TShapeB, TShapeWideB, TSupportFinderB>
- Namespace
- BepuPhysics.CollisionDetection
- Assembly
- BepuPhysics.dll
Incrementally refines a sample direction to approach a local minimum depth between two convex bodies.
public static class DepthRefiner<TShapeA, TShapeWideA, TSupportFinderA, TShapeB, TShapeWideB, TSupportFinderB> where TShapeA : IConvexShape where TShapeWideA : IShapeWide<TShapeA> where TSupportFinderA : ISupportFinder<TShapeA, TShapeWideA> where TShapeB : IConvexShape where TShapeWideB : IShapeWide<TShapeB> where TSupportFinderB : ISupportFinder<TShapeB, TShapeWideB>
Type Parameters
TShapeA
Type of the first shape.
TShapeWideA
SIMD type of the first shape.
TSupportFinderA
Type providing support sampling for the first shape.
TShapeB
Type of the second shape.
TShapeWideB
SIMD type of the second shape.
TSupportFinderB
Type providing support sampling for the second shape.
- Inheritance
-
DepthRefiner<TShapeA, TShapeWideA, TSupportFinderA, TShapeB, TShapeWideB, TSupportFinderB>
- Inherited Members
Remarks
The DepthRefiner implements a Tootbird search: an incremental algorithm that takes steps towards the Tootbird. The Tootbird is the origin projected on the support plane of the best(lowest depth) support direction observed so far. This uses a simplex that updates with rules similar to a simplified version of GJK.The Tootbird is definitionally not inside the minkowski sum.
Methods
Create(in Vector3Wide, in Vector3Wide, out Simplex)
public static void Create(in Vector3Wide normal, in Vector3Wide support, out DepthRefiner<TShapeA, TShapeWideA, TSupportFinderA, TShapeB, TShapeWideB, TSupportFinderB>.Simplex simplex)
Parameters
normal
Vector3Widesupport
Vector3Widesimplex
DepthRefiner<TShapeA, TShapeWideA, TSupportFinderA, TShapeB, TShapeWideB, TSupportFinderB>.Simplex
Create(in Vector3Wide, in Vector3Wide, in Vector3Wide, out SimplexWithWitness)
public static void Create(in Vector3Wide normal, in Vector3Wide support, in Vector3Wide supportOnA, out DepthRefiner<TShapeA, TShapeWideA, TSupportFinderA, TShapeB, TShapeWideB, TSupportFinderB>.SimplexWithWitness simplex)
Parameters
normal
Vector3Widesupport
Vector3WidesupportOnA
Vector3Widesimplex
DepthRefiner<TShapeA, TShapeWideA, TSupportFinderA, TShapeB, TShapeWideB, TSupportFinderB>.SimplexWithWitness
FindMinimumDepth(in TShapeWideA, in TShapeWideB, in Vector3Wide, in Matrix3x3Wide, ref TSupportFinderA, ref TSupportFinderB, ref Simplex, in Vector3Wide, in Vector<float>, in Vector<int>, in Vector<float>, in Vector<float>, out Vector<float>, out Vector3Wide, int)
public static void FindMinimumDepth(in TShapeWideA a, in TShapeWideB b, in Vector3Wide localOffsetB, in Matrix3x3Wide localOrientationB, ref TSupportFinderA supportFinderA, ref TSupportFinderB supportFinderB, ref DepthRefiner<TShapeA, TShapeWideA, TSupportFinderA, TShapeB, TShapeWideB, TSupportFinderB>.Simplex simplex, in Vector3Wide initialNormal, in Vector<float> initialDepth, in Vector<int> inactiveLanes, in Vector<float> convergenceThreshold, in Vector<float> minimumDepthThreshold, out Vector<float> refinedDepth, out Vector3Wide refinedNormal, int maximumIterations = 50)
Parameters
a
TShapeWideAb
TShapeWideBlocalOffsetB
Vector3WidelocalOrientationB
Matrix3x3WidesupportFinderA
TSupportFinderAsupportFinderB
TSupportFinderBsimplex
DepthRefiner<TShapeA, TShapeWideA, TSupportFinderA, TShapeB, TShapeWideB, TSupportFinderB>.SimplexinitialNormal
Vector3WideinitialDepth
Vector<float>inactiveLanes
Vector<int>convergenceThreshold
Vector<float>minimumDepthThreshold
Vector<float>refinedDepth
Vector<float>refinedNormal
Vector3WidemaximumIterations
int
FindMinimumDepth(in TShapeWideA, in TShapeWideB, in Vector3Wide, in Matrix3x3Wide, ref TSupportFinderA, ref TSupportFinderB, ref SimplexWithWitness, in Vector3Wide, in Vector<float>, in Vector<int>, in Vector<float>, in Vector<float>, out Vector<float>, out Vector3Wide, out Vector3Wide, int)
public static void FindMinimumDepth(in TShapeWideA a, in TShapeWideB b, in Vector3Wide localOffsetB, in Matrix3x3Wide localOrientationB, ref TSupportFinderA supportFinderA, ref TSupportFinderB supportFinderB, ref DepthRefiner<TShapeA, TShapeWideA, TSupportFinderA, TShapeB, TShapeWideB, TSupportFinderB>.SimplexWithWitness simplex, in Vector3Wide initialNormal, in Vector<float> initialDepth, in Vector<int> inactiveLanes, in Vector<float> convergenceThreshold, in Vector<float> minimumDepthThreshold, out Vector<float> refinedDepth, out Vector3Wide refinedNormal, out Vector3Wide witnessOnA, int maximumIterations = 50)
Parameters
a
TShapeWideAb
TShapeWideBlocalOffsetB
Vector3WidelocalOrientationB
Matrix3x3WidesupportFinderA
TSupportFinderAsupportFinderB
TSupportFinderBsimplex
DepthRefiner<TShapeA, TShapeWideA, TSupportFinderA, TShapeB, TShapeWideB, TSupportFinderB>.SimplexWithWitnessinitialNormal
Vector3WideinitialDepth
Vector<float>inactiveLanes
Vector<int>convergenceThreshold
Vector<float>minimumDepthThreshold
Vector<float>refinedDepth
Vector<float>refinedNormal
Vector3WidewitnessOnA
Vector3WidemaximumIterations
int
FindMinimumDepth(in TShapeWideA, in TShapeWideB, in Vector3Wide, in Matrix3x3Wide, ref TSupportFinderA, ref TSupportFinderB, in Vector3Wide, in Vector<int>, in Vector<float>, in Vector<float>, out Vector<float>, out Vector3Wide, out Vector3Wide, int)
public static void FindMinimumDepth(in TShapeWideA a, in TShapeWideB b, in Vector3Wide localOffsetB, in Matrix3x3Wide localOrientationB, ref TSupportFinderA supportFinderA, ref TSupportFinderB supportFinderB, in Vector3Wide initialNormal, in Vector<int> inactiveLanes, in Vector<float> searchEpsilon, in Vector<float> minimumDepthThreshold, out Vector<float> depth, out Vector3Wide refinedNormal, out Vector3Wide witnessOnA, int maximumIterations = 25)
Parameters
a
TShapeWideAb
TShapeWideBlocalOffsetB
Vector3WidelocalOrientationB
Matrix3x3WidesupportFinderA
TSupportFinderAsupportFinderB
TSupportFinderBinitialNormal
Vector3WideinactiveLanes
Vector<int>searchEpsilon
Vector<float>minimumDepthThreshold
Vector<float>depth
Vector<float>refinedNormal
Vector3WidewitnessOnA
Vector3WidemaximumIterations
int
FindMinimumDepth(in TShapeWideA, in TShapeWideB, in Vector3Wide, in Matrix3x3Wide, ref TSupportFinderA, ref TSupportFinderB, in Vector3Wide, in Vector<int>, in Vector<float>, in Vector<float>, out Vector<float>, out Vector3Wide, int)
public static void FindMinimumDepth(in TShapeWideA a, in TShapeWideB b, in Vector3Wide localOffsetB, in Matrix3x3Wide localOrientationB, ref TSupportFinderA supportFinderA, ref TSupportFinderB supportFinderB, in Vector3Wide initialNormal, in Vector<int> inactiveLanes, in Vector<float> searchEpsilon, in Vector<float> minimumDepthThreshold, out Vector<float> depth, out Vector3Wide refinedNormal, int maximumIterations = 25)
Parameters
a
TShapeWideAb
TShapeWideBlocalOffsetB
Vector3WidelocalOrientationB
Matrix3x3WidesupportFinderA
TSupportFinderAsupportFinderB
TSupportFinderBinitialNormal
Vector3WideinactiveLanes
Vector<int>searchEpsilon
Vector<float>minimumDepthThreshold
Vector<float>depth
Vector<float>refinedNormal
Vector3WidemaximumIterations
int
FindSupport(in TShapeWideA, in TShapeWideB, in Vector3Wide, in Matrix3x3Wide, ref TSupportFinderA, ref TSupportFinderB, in Vector3Wide, in Vector<int>, out Vector3Wide)
public static void FindSupport(in TShapeWideA a, in TShapeWideB b, in Vector3Wide localOffsetB, in Matrix3x3Wide localOrientationB, ref TSupportFinderA supportFinderA, ref TSupportFinderB supportFinderB, in Vector3Wide direction, in Vector<int> terminatedLanes, out Vector3Wide support)
Parameters
a
TShapeWideAb
TShapeWideBlocalOffsetB
Vector3WidelocalOrientationB
Matrix3x3WidesupportFinderA
TSupportFinderAsupportFinderB
TSupportFinderBdirection
Vector3WideterminatedLanes
Vector<int>support
Vector3Wide
FindSupport(in TShapeWideA, in TShapeWideB, in Vector3Wide, in Matrix3x3Wide, ref TSupportFinderA, ref TSupportFinderB, in Vector3Wide, in Vector<int>, out Vector3Wide, out Vector3Wide)
public static void FindSupport(in TShapeWideA a, in TShapeWideB b, in Vector3Wide localOffsetB, in Matrix3x3Wide localOrientationB, ref TSupportFinderA supportFinderA, ref TSupportFinderB supportFinderB, in Vector3Wide direction, in Vector<int> terminatedLanes, out Vector3Wide support, out Vector3Wide supportOnA)