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 HasSingleNode() const
const MeshInterface * mIMesh
User-defined mesh interface.
inline_ const udword * GetIndices() const
virtual inline_ void InitQuery()
inline_ BOOL SkipPrimitiveTests() const
bool Collide(SphereCache &cache, const Sphere &sphere, const HybridModel &model, const Matrix4x4 *worlds=null, const Matrix4x4 *worldm=null)
inline_ const udword * GetPrimitives() const
virtual ~SphereCollider()
Container TouchedPrimitives
Indices of touched primitives.
#define SET_CONTACT(prim_index, flag)
const BaseModel * mCurrentModel
Current model for collision query (owner of touched faces)
inline_ BOOL SphereContainsBox(const Point &bc, const Point &be)
#define TEST_BOX_IN_SPHERE(center, extents)
uword mExtents[3]
Quantized extents.
inline_ Point & Zero()
Clears the vector.
inline_ BOOL ContactFound() const
inline_ BOOL TemporalCoherenceEnabled() const
bool Collide(SphereCache &cache, const Sphere &sphere, const Model &model, const Matrix4x4 *worlds=null, const Matrix4x4 *worldm=null)
inline_ udword GetNbEntries() const
Returns the current number of entries.
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.
inline_ const AABBOptimizedTree * GetTree() const
float mRadius2
Sphere radius squared.
inline_ BOOL GetContactStatus() const
Point mCenter
Sphere center.
int BOOL
Another boolean type.
unsigned int udword
sizeof(udword) must be 4
inline_ BOOL IsCacheValid(VolumeCache &cache)
inline_ udword GetNbTriangles() const
inline_ BOOL IsQuantized() const
inline_ BOOL SphereAABBOverlap(const Point ¢er, const Point &extents)
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)
ICEMATHS_API void InvertPRMatrix(Matrix4x4 &dest, const Matrix4x4 &src)
Point mCenter
Sphere center.
inline_ udword GetNbTriangles() const
inline_ udword GetTriangleIndex() const
inline_ udword GetEntry(udword i) const
Returns ith entry.
inline_ udword GetNbPrimitives() const
Point Center
Sphere used when performing the query resulting in cached faces.
float FatCoeff
mRadius2 multiplier used to create a fat sphere
inline_ BOOL HasLeafNodes() const
Container * mTouchedPrimitives
List of touched primitives.
inline_ float SquareDistance(const Point &b) const
Computes square distance to another point.
Keep or discard primitive-bv tests in leaf nodes (volume-mesh queries)
inline_ BOOL FirstContactEnabled() const
inline_ const LeafTriangles * GetLeafTriangles() const