38 #define SET_CONTACT(prim_index, flag) \ 41 mTouchedPrimitives->Add(prim_index); 44 #define PLANES_PRIM(prim_index, flag) \ 46 mIMesh->GetTriangle(mVP, prim_index); \ 48 if(PlanesTriOverlap(clip_mask)) \ 50 SET_CONTACT(prim_index, flag) \ 59 collisionPairInserter(NULL),
107 if(!
Setup(&model))
return false;
110 if(
InitQuery(cache, planes, nb_planes, worldm))
return true;
112 udword PlaneMask = (1<<nb_planes)-1;
126 else _Collide(Tree->GetNodes(), PlaneMask);
134 else _Collide(Tree->GetNodes(), PlaneMask);
149 else _Collide(Tree->GetNodes(), PlaneMask);
157 else _Collide(Tree->GetNodes(), PlaneMask);
260 #define TEST_CLIP_MASK \ 266 mFlags |= OPC_CONTACT; \ 281 if(!
PlanesAABBOverlap(node->mAABB.mCenter, node->mAABB.mExtents, OutClipMask, clip_mask))
return;
292 _Collide(node->GetPos(), OutClipMask);
296 _Collide(node->GetNeg(), OutClipMask);
310 if(!
PlanesAABBOverlap(node->mAABB.mCenter, node->mAABB.mExtents, OutClipMask, clip_mask))
return;
355 _Collide(node->GetPos(), OutClipMask);
359 _Collide(node->GetNeg(), OutClipMask);
407 if(!
PlanesAABBOverlap(node->mAABB.mCenter, node->mAABB.mExtents, OutClipMask, clip_mask))
return;
413 else _Collide(node->GetPos(), OutClipMask);
418 else _Collide(node->GetNeg(), OutClipMask);
431 if(!
PlanesAABBOverlap(node->mAABB.mCenter, node->mAABB.mExtents, OutClipMask, clip_mask))
return;
466 else _Collide(node->GetPos(), OutClipMask);
471 else _Collide(node->GetNeg(), OutClipMask);
533 if(!
Setup(&model))
return false;
536 if(
InitQuery(cache, planes, nb_planes, worldm))
return true;
554 mTouchedBoxes.Reset();
557 udword PlaneMask = (1<<nb_planes)-1;
615 const udword* Touched = mTouchedBoxes.GetEntries();
635 udword TriangleIndex = *T++;
646 udword TriangleIndex = BaseIndex++;
inline_ BOOL FirstContactEnabled() const
const MeshInterface * mIMesh
User-defined mesh interface.
virtual inline_ void InitQuery()
inline_ udword GetEntry(udword i) const
Returns ith entry.
#define null
our own NULL pointer
Container TouchedPrimitives
Indices of touched primitives.
const BaseModel * mCurrentModel
Current model for collision query (owner of touched faces)
inline_ udword GetNbTriangles() const
#define DELETEARRAY(x)
Deletes an array.
inline_ const udword * GetIndices() const
uword mExtents[3]
Quantized extents.
#define PLANES_PRIM(prim_index, flag)
Planes-triangle test.
sword mCenter[3]
Quantized center.
virtual const char * ValidateSettings()=0
int BOOL
Another boolean type.
#define SET_CONTACT(prim_index, flag)
inline_ const LeafTriangles * GetLeafTriangles() const
unsigned int udword
sizeof(udword) must be 4
void _CollideNoPrimitiveTest(const AABBCollisionNode *node, udword clip_mask)
inline_ BOOL GetContactStatus() const
void _Collide(const AABBCollisionNode *node, udword clip_mask)
inline_ BOOL ContactFound() const
inline_ BOOL Setup(const BaseModel *model)
Final contact status after a collision query.
inline_ BOOL SkipPrimitiveTests() const
bool Collide(PlanesCache &cache, const Plane *planes, udword nb_planes, const HybridModel &model, const Matrix4x4 *worldm=null)
virtual ~PlanesCollider()
ICEMATHS_API void InvertPRMatrix(Matrix4x4 &dest, const Matrix4x4 &src)
inline_ void CopyMemory(void *dest, const void *src, udword size)
virtual ~HybridPlanesCollider()
inline_ BOOL PlanesAABBOverlap(const Point ¢er, const Point &extents, udword &out_clip_mask, udword in_clip_mask)
inline_ BOOL IsQuantized() const
bool Collide(PlanesCache &cache, const Plane *planes, udword nb_planes, const Model &model, const Matrix4x4 *worldm=null)
inline_ void TransformPlane(Plane &transformed, const Plane &plane, const Matrix4x4 &transform)
inline_ udword GetTriangleIndex() const
inline_ BOOL TemporalCoherenceEnabled() const
Container * mTouchedPrimitives
List of touched primitives.
inline_ BOOL HasSingleNode() const
inline_ udword GetNbEntries() const
Returns the current number of entries.
Keep or discard primitive-bv tests in leaf nodes (volume-mesh queries)
inline_ BOOL HasLeafNodes() const
inline_ udword GetNbTriangles() const
inline_ const AABBOptimizedTree * GetTree() const