Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LSSCollider Class Reference

#include <OPC_LSSCollider.h>

Inheritance diagram for LSSCollider:
VolumeCollider Collider HybridLSSCollider

Public Member Functions

 LSSCollider ()
 
virtual ~LSSCollider ()
 
bool Collide (LSSCache &cache, const LSS &lss, const Model &model, const Matrix4x4 *worldl=null, const Matrix4x4 *worldm=null)
 
bool Collide (LSSCache &cache, const LSS &lss, const AABBTree *tree)
 
- Public Member Functions inherited from VolumeCollider
 VolumeCollider ()
 
virtual ~VolumeCollider ()=0
 
inline_ udword GetNbTouchedPrimitives () const
 
inline_ const udwordGetTouchedPrimitives () const
 
inline_ udword GetNbVolumeBVTests () const
 
inline_ udword GetNbVolumePrimTests () const
 
 override (Collider) const char *ValidateSettings()
 
- Public Member Functions inherited from Collider
 Collider ()
 
virtual ~Collider ()
 
inline_ BOOL GetContactStatus () const
 
inline_ BOOL FirstContactEnabled () const
 
inline_ BOOL TemporalCoherenceEnabled () const
 
inline_ BOOL ContactFound () const
 
inline_ BOOL TemporalHit () const
 
inline_ BOOL SkipPrimitiveTests () const
 
inline_ void SetFirstContact (bool flag)
 
inline_ void SetTemporalCoherence (bool flag)
 
inline_ void SetPrimitiveTests (bool flag)
 
virtual const char * ValidateSettings ()=0
 

Protected Member Functions

void _Collide (const AABBCollisionNode *node)
 
void _Collide (const AABBNoLeafNode *node)
 
void _Collide (const AABBQuantizedNode *node)
 
void _Collide (const AABBQuantizedNoLeafNode *node)
 
void _Collide (const AABBTreeNode *node)
 
void _CollideNoPrimitiveTest (const AABBCollisionNode *node)
 
void _CollideNoPrimitiveTest (const AABBNoLeafNode *node)
 
void _CollideNoPrimitiveTest (const AABBQuantizedNode *node)
 
void _CollideNoPrimitiveTest (const AABBQuantizedNoLeafNode *node)
 
inline_ bool LSSContainsBox (const Point &bc, const Point &be)
 
inline_ bool LSSAABBOverlap (const Point &center, const Point &extents)
 
inline_ bool LSSTriOverlap (const Point &vert0, const Point &vert1, const Point &vert2)
 
bool InitQuery (LSSCache &cache, const LSS &lss, const Matrix4x4 *worldl=null, const Matrix4x4 *worldm=null)
 
- Protected Member Functions inherited from VolumeCollider
void _Dump (const AABBCollisionNode *node)
 
void _Dump (const AABBNoLeafNode *node)
 
void _Dump (const AABBQuantizedNode *node)
 
void _Dump (const AABBQuantizedNoLeafNode *node)
 
 override (Collider) inline_ void InitQuery()
 
inline_ BOOL IsCacheValid (VolumeCache &cache)
 
- Protected Member Functions inherited from Collider
inline_ BOOL Setup (const BaseModel *model)
 
virtual inline_ void InitQuery ()
 

Protected Attributes

Segment mSeg
 Segment. More...
 
float mRadius2
 LSS radius squared. More...
 
- Protected Attributes inherited from VolumeCollider
ContainermTouchedPrimitives
 List of touched primitives. More...
 
Point mCenterCoeff
 
Point mExtentsCoeff
 
udword mNbVolumeBVTests
 Number of Volume-BV tests. More...
 
udword mNbVolumePrimTests
 Number of Volume-Primitive tests. More...
 
- Protected Attributes inherited from Collider
udword mFlags
 Bit flags. More...
 
const BaseModelmCurrentModel
 Current model for collision query (owner of touched faces) More...
 
const MeshInterfacemIMesh
 User-defined mesh interface. More...
 

Detailed Description

Contains a lss-vs-tree collider.

Author
Pierre Terdiman
Version
1.3
Date
December, 28, 2002

Definition at line 39 of file OPC_LSSCollider.h.

Constructor & Destructor Documentation

LSSCollider::LSSCollider ( )
virtual LSSCollider::~LSSCollider ( )
virtual

Member Function Documentation

void LSSCollider::_Collide ( const AABBCollisionNode node)
protected
void LSSCollider::_Collide ( const AABBNoLeafNode node)
protected
void LSSCollider::_Collide ( const AABBQuantizedNode node)
protected
void LSSCollider::_Collide ( const AABBQuantizedNoLeafNode node)
protected
void LSSCollider::_Collide ( const AABBTreeNode node)
protected
void LSSCollider::_CollideNoPrimitiveTest ( const AABBCollisionNode node)
protected
void LSSCollider::_CollideNoPrimitiveTest ( const AABBNoLeafNode node)
protected
void LSSCollider::_CollideNoPrimitiveTest ( const AABBQuantizedNode node)
protected
void LSSCollider::_CollideNoPrimitiveTest ( const AABBQuantizedNoLeafNode node)
protected
bool LSSCollider::Collide ( LSSCache cache,
const LSS lss,
const Model model,
const Matrix4x4 worldl = null,
const Matrix4x4 worldm = null 
)

Generic collision query for generic OPCODE models. After the call, access the results:

Parameters
cache[in/out] an lss cache
lss[in] collision lss in local space
model[in] Opcode model to collide with
worldl[in] lss world matrix, or null
worldm[in] model's world matrix, or null
Returns
true if success
Warning
SCALE NOT SUPPORTED. The matrices must contain rotation & translation parts only.
bool LSSCollider::Collide ( LSSCache cache,
const LSS lss,
const AABBTree tree 
)
bool LSSCollider::InitQuery ( LSSCache cache,
const LSS lss,
const Matrix4x4 worldl = null,
const Matrix4x4 worldm = null 
)
protected
inline_ bool LSSCollider::LSSAABBOverlap ( const Point center,
const Point extents 
)
protected

Definition at line 514 of file OPC_LSSAABBOverlap.h.

References FALSE, VolumeCollider::mNbVolumeBVTests, mRadius2, mSeg, OPC_SegmentOBBSqrDist(), and TRUE.

515 {
516  // Stats
518 
519  float s2 = OPC_SegmentOBBSqrDist(mSeg, center, extents);
520  if(s2<mRadius2) return TRUE;
521 
522  return FALSE;
523 }
inline_ bool LSSCollider::LSSContainsBox ( const Point bc,
const Point be 
)
protected
inline_ bool LSSCollider::LSSTriOverlap ( const Point vert0,
const Point vert1,
const Point vert2 
)
protected

Definition at line 671 of file OPC_LSSTriOverlap.h.

References FALSE, VolumeCollider::mNbVolumePrimTests, mRadius2, mSeg, OPC_SegmentTriangleSqrDist(), and TRUE.

672 {
673  // Stats
675 
676  float s2 = OPC_SegmentTriangleSqrDist(mSeg, vert0, vert1, vert2);
677  if(s2<mRadius2) return TRUE;
678  return FALSE;
679 }

Member Data Documentation

float LSSCollider::mRadius2
protected

LSS radius squared.

Definition at line 68 of file OPC_LSSCollider.h.

Referenced by LSSAABBOverlap(), and LSSTriOverlap().

Segment LSSCollider::mSeg
protected

Segment.

Definition at line 67 of file OPC_LSSCollider.h.

Referenced by LSSAABBOverlap(), and LSSTriOverlap().


The documentation for this class was generated from the following files: