42 #define SET_CONTACT(prim_index, flag) \ 45 mTouchedPrimitives->Add(prim_index); 48 #define SPHERE_PRIM(prim_index, flag) \ 50 VertexPointers VP; mIMesh->GetTriangle(VP, prim_index); \ 53 if(SphereTriOverlap(*VP.Vertex[0], *VP.Vertex[1], *VP.Vertex[2])) \ 55 SET_CONTACT(prim_index, flag) \ 97 if(!
Setup(&model))
return false;
100 if(
InitQuery(cache, sphere, worlds, worldm))
return true;
292 if(!tree)
return false;
295 if(
InitQuery(cache, sphere))
return true;
328 #define TEST_BOX_IN_SPHERE(center, extents) \ 329 if(SphereContainsBox(center, extents)) \ 332 mFlags |= OPC_CONTACT; \ 562 Point Center, Extents;
563 node->GetAABB()->GetCenter(Center);
564 node->GetAABB()->GetExtents(Extents);
609 if(!
Setup(&model))
return false;
612 if(
InitQuery(cache, sphere, worlds, worldm))
return true;
629 mTouchedBoxes.Reset();
688 const udword* Touched = mTouchedBoxes.GetEntries();
707 udword TriangleIndex = *T++;
718 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.
bool Collide(SphereCache &cache, const Sphere &sphere, const HybridModel &model, const Matrix4x4 *worlds=null, const Matrix4x4 *worldm=null)
virtual ~SphereCollider()
Container TouchedPrimitives
Indices of touched primitives.
#define SET_CONTACT(prim_index, flag)
inline_ udword GetNbPrimitives() const
const BaseModel * mCurrentModel
Current model for collision query (owner of touched faces)
inline_ udword GetNbTriangles() const
inline_ BOOL SphereContainsBox(const Point &bc, const Point &be)
#define TEST_BOX_IN_SPHERE(center, extents)
inline_ const udword * GetIndices() const
uword mExtents[3]
Quantized extents.
inline_ Point & Zero()
Clears the vector.
bool Collide(SphereCache &cache, const Sphere &sphere, const Model &model, const Matrix4x4 *worlds=null, const Matrix4x4 *worldm=null)
sword mCenter[3]
Quantized center.
float FatRadius2
Sphere used when performing the query resulting in cached faces.
float mRadius
Sphere radius.
#define SPHERE_PRIM(prim_index, flag)
Sphere-triangle overlap test.
float mRadius2
Sphere radius squared.
inline_ const udword * GetPrimitives() const
Point mCenter
Sphere center.
int BOOL
Another boolean type.
inline_ const LeafTriangles * GetLeafTriangles() const
unsigned int udword
sizeof(udword) must be 4
inline_ BOOL IsCacheValid(VolumeCache &cache)
inline_ BOOL GetContactStatus() const
inline_ BOOL SphereAABBOverlap(const Point ¢er, const Point &extents)
inline_ BOOL ContactFound() const
inline_ BOOL Setup(const BaseModel *model)
void _Collide(const AABBCollisionNode *node)
inline_ Container & Add(udword entry)
virtual ~HybridSphereCollider()
Final contact status after a collision query.
void _CollideNoPrimitiveTest(const AABBCollisionNode *node)
inline_ BOOL SkipPrimitiveTests() const
ICEMATHS_API void InvertPRMatrix(Matrix4x4 &dest, const Matrix4x4 &src)
Point mCenter
Sphere center.
Point Center
Sphere used when performing the query resulting in cached faces.
float FatCoeff
mRadius2 multiplier used to create a fat sphere
inline_ BOOL IsQuantized() const
inline_ float SquareDistance(const Point &b) const
Computes square distance to another point.
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