12#ifdef JPH_INTERNAL_EDGE_REMOVING_COLLECTOR_DEBUG
22 static constexpr uint cMaxDelayedResults = 16;
23 static constexpr uint cMaxVoidedFeatures = 128;
26 inline bool IsVoided(
Vec3 inV)
const
28 for (
const Float3 &
vf : mVoidedFeatures)
40 if (mVoidedFeatures.
size() == cMaxVoidedFeatures)
67 #ifdef JPH_INTERNAL_EDGE_REMOVING_COLLECTOR_DEBUG
85 mChainedCollector.
Reset();
87 mVoidedFeatures.
clear();
88 mDelayedResults.
clear();
102 if (
inResult.mShape2Face.size() < 3)
119 if (mDelayedResults.
size() == cMaxDelayedResults)
199 #ifdef JPH_INTERNAL_EDGE_REMOVING_COLLECTOR_DEBUG
218 static void sCollideShapeVsShape(
const Shape *
inShape1,
const Shape *
inShape2,
Vec3Arg inScale1,
Vec3Arg inScale2,
Mat44Arg inCenterOfMassTransform1,
Mat44Arg inCenterOfMassTransform2,
const SubShapeIDCreator &
inSubShapeIDCreator1,
const SubShapeIDCreator &
inSubShapeIDCreator2,
const CollideShapeSettings &
inCollideShapeSettings,
CollideShapeCollector &
ioCollector,
const ShapeFilter &
inShapeFilter = { })
223 CollisionDispatch::sCollideShapeVsShape(
inShape1,
inShape2,
inScale1,
inScale2,
inCenterOfMassTransform1,
inCenterOfMassTransform2,
inSubShapeIDCreator1,
inSubShapeIDCreator2,
inCollideShapeSettings,
wrapper,
inShapeFilter);
@ CollectFaces
mShape1/2Face is desired
unsigned int uint
Definition Core.h:439
#define JPH_NAMESPACE_END
Definition Core.h:367
#define JPH_NAMESPACE_BEGIN
Definition Core.h:361
#define JPH_ASSERT(...)
Definition IssueReporting.h:33
constexpr T Square(T inV)
Square a value.
Definition Math.h:52
AllocateFunction Allocate
Definition Memory.cpp:59
void QuickSort(Iterator inBegin, Iterator inEnd, Compare inCompare)
Implementation of the quick sort algorithm. The STL version implementation is not consistent across p...
Definition QuickSort.h:53
Vec3 RVec3
Definition Real.h:29
Class that contains all information of two colliding shapes.
Definition CollideShape.h:19
Vec3 mContactPointOn2
Contact point on the surface of shape 2 (in world space or relative to base offset)....
Definition CollideShape.h:60
Vec3 mPenetrationAxis
Direction to move shape 2 out of collision along the shortest path (magnitude is meaningless,...
Definition CollideShape.h:61
float mPenetrationDepth
Penetration depth (move shape 2 by this distance to resolve the collision)
Definition CollideShape.h:62
Face mShape2Face
Colliding face on shape 2 (optional result, in world space or relative to base offset)
Definition CollideShape.h:67
Settings to be passed with a collision query.
Definition CollideShape.h:94
Virtual interface that allows collecting multiple collision results.
Definition CollisionCollector.h:45
virtual void AddHit(const ResultType &inResult)=0
This function will be called for every hit found, it's up to the application to decide how to store t...
virtual void Reset()
If you want to reuse this collector, call Reset()
Definition CollisionCollector.h:62
float GetEarlyOutFraction() const
Get the current early out value.
Definition CollisionCollector.h:89
const TransformedShape * GetContext() const
Definition CollisionCollector.h:71
virtual void OnBody(const Body &inBody)
Definition CollisionCollector.h:67
void UpdateEarlyOutFraction(float inFraction)
Update the early out fraction (should be lower than before)
Definition CollisionCollector.h:77
void SetContext(const TransformedShape *inContext)
Set by the collision detection functions to the current TransformedShape that we're colliding against...
Definition CollisionCollector.h:70
static void sCollideShapeVsShape(const Shape *inShape1, const Shape *inShape2, Vec3Arg inScale1, Vec3Arg inScale2, Mat44Arg inCenterOfMassTransform1, Mat44Arg inCenterOfMassTransform2, const SubShapeIDCreator &inSubShapeIDCreator1, const SubShapeIDCreator &inSubShapeIDCreator2, const CollideShapeSettings &inCollideShapeSettings, CollideShapeCollector &ioCollector, const ShapeFilter &inShapeFilter={ })
Definition CollisionDispatch.h:33
Class that holds an RGBA color with 8-bits per component.
Definition Color.h:16
static const Color sGreen
Definition Color.h:54
static const Color sRed
Definition Color.h:52
static const Color sYellow
Definition Color.h:57
virtual void DrawText3D(RVec3Arg inPosition, const string_view &inString, ColorArg inColor=Color::sWhite, float inHeight=0.5f)=0
Draw text.
void DrawMarker(RVec3Arg inPosition, ColorArg inColor, float inSize)
Draw a marker on a position.
Definition DebugRenderer.cpp:172
static DebugRenderer * sInstance
Singleton instance.
Definition DebugRenderer.h:168
void DrawWirePolygon(RMat44Arg inTransform, const VERTEX_ARRAY &inVertices, ColorArg inColor, float inArrowSize=0.0f)
Draw a wireframe polygon.
Definition DebugRenderer.h:83
void DrawArrow(RVec3Arg inFrom, RVec3Arg inTo, ColorArg inColor, float inSize)
Draw an arrow.
Definition DebugRenderer.cpp:184
Class that holds 3 floats. Used as a storage class. Convert to Vec3 for calculations.
Definition Float3.h:13
Definition InternalEdgeRemovingCollector.h:21
virtual void OnBody(const Body &inBody) override
Definition InternalEdgeRemovingCollector.h:92
void Flush()
After all hits have been added, call this function to process the delayed results.
Definition InternalEdgeRemovingCollector.h:125
InternalEdgeRemovingCollector(CollideShapeCollector &inChainedCollector)
Constructor, configures a collector to be called with all the results that do not hit internal edges.
Definition InternalEdgeRemovingCollector.h:75
static void sCollideShapeVsShape(const Shape *inShape1, const Shape *inShape2, Vec3Arg inScale1, Vec3Arg inScale2, Mat44Arg inCenterOfMassTransform1, Mat44Arg inCenterOfMassTransform2, const SubShapeIDCreator &inSubShapeIDCreator1, const SubShapeIDCreator &inSubShapeIDCreator2, const CollideShapeSettings &inCollideShapeSettings, CollideShapeCollector &ioCollector, const ShapeFilter &inShapeFilter={ })
Version of CollisionDispatch::sCollideShapeVsShape that removes internal edges.
Definition InternalEdgeRemovingCollector.h:218
virtual void Reset() override
If you want to reuse this collector, call Reset()
Definition InternalEdgeRemovingCollector.h:81
virtual void AddHit(const CollideShapeResult &inResult) override
Definition InternalEdgeRemovingCollector.h:99
Holds a 4x4 matrix of floats, but supports also operations on the 3x3 upper left part of the matrix.
Definition Mat44.h:13
static JPH_INLINE Mat44 sIdentity()
Identity matrix.
Definition Mat44.inl:35
Filter class.
Definition ShapeFilter.h:17
Base class for all shapes (collision volume of a body). Defines a virtual interface for collision det...
Definition Shape.h:178
Simple variable length array backed by a fixed size buffer.
Definition StaticArray.h:12
void push_back(const T &inElement)
Add element to the back of the array.
Definition StaticArray.h:59
void clear()
Destruct all elements and set length to zero.
Definition StaticArray.h:50
size_type size() const
Returns amount of elements in the array.
Definition StaticArray.h:87
Definition SubShapeID.h:108
JPH_INLINE float Length() const
Length of vector.
Definition Vec3.inl:669
JPH_INLINE Vec3 NormalizedOr(Vec3Arg inZeroValue) const
Normalize vector or return inZeroValue if the length of the vector is zero.
Definition Vec3.inl:708
JPH_INLINE float LengthSq() const
Squared length of vector.
Definition Vec3.inl:653
static JPH_INLINE Vec3 sZero()
Vector with all zeros.
Definition Vec3.inl:107
static JPH_INLINE Vec3 sLoadFloat3Unsafe(const Float3 &inV)
Load 3 floats from memory (reads 32 bits extra which it doesn't use)
Definition Vec3.inl:134