Public Member Functions | Protected Member Functions | Protected Attributes
AABBTreeCollider Class Reference

#include <OPC_TreeCollider.h>

Inheritance diagram for AABBTreeCollider:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 AABBTreeCollider ()
bool Collide (BVTCache &cache, const Matrix4x4 *world0=null, const Matrix4x4 *world1=null)
bool Collide (const AABBCollisionTree *tree0, const AABBCollisionTree *tree1, const Matrix4x4 *world0=null, const Matrix4x4 *world1=null, Pair *cache=null)
bool Collide (const AABBNoLeafTree *tree0, const AABBNoLeafTree *tree1, const Matrix4x4 *world0=null, const Matrix4x4 *world1=null, Pair *cache=null)
bool Collide (const AABBQuantizedTree *tree0, const AABBQuantizedTree *tree1, const Matrix4x4 *world0=null, const Matrix4x4 *world1=null, Pair *cache=null)
bool Collide (const AABBQuantizedNoLeafTree *tree0, const AABBQuantizedNoLeafTree *tree1, const Matrix4x4 *world0=null, const Matrix4x4 *world1=null, Pair *cache=null)
inline_ udword GetNbBVBVTests () const
inline_ udword GetNbBVPrimTests () const
inline_ udword GetNbPairs () const
inline_ udword GetNbPrimPrimTests () const
inline_ const PairGetPairs () const
 override (Collider) HRP_COLLISION_EXPORT const char *ValidateSettings()
void setCollisionPairInserter (hrp::CollisionPairInserterBase *collisionPairInserter)
inline_ void SetFullBoxBoxTest (bool flag)
inline_ void SetFullPrimBoxTest (bool flag)
virtual ~AABBTreeCollider ()

Protected Member Functions

void _Collide (const AABBCollisionNode *b0, const AABBCollisionNode *b1)
void _Collide (const AABBQuantizedNode *b0, const AABBQuantizedNode *b1, const Point &a, const Point &Pa, const Point &b, const Point &Pb)
void _Collide (const AABBNoLeafNode *a, const AABBNoLeafNode *b)
void _Collide (const AABBQuantizedNoLeafNode *a, const AABBQuantizedNoLeafNode *b)
void _CollideBoxTri (const AABBNoLeafNode *b)
void _CollideBoxTri (const AABBQuantizedNoLeafNode *b)
void _CollideTriBox (const AABBNoLeafNode *b)
void _CollideTriBox (const AABBQuantizedNoLeafNode *b)
inline_ BOOL BoxBoxOverlap (const Point &ea, const Point &ca, const Point &eb, const Point &cb)
bool CheckTemporalCoherence (Pair *cache)
HRP_COLLISION_EXPORT void InitQuery (const Matrix4x4 *world0=null, const Matrix4x4 *world1=null)
void PrimTest (udword id0, udword id1)
inline_ void PrimTestIndexTri (udword id0)
inline_ void PrimTestTriIndex (udword id1)
inline_ BOOL Setup (const MeshInterface *mi0, const MeshInterface *mi1)
inline_ BOOL TriBoxOverlap (const Point &center, const Point &extents)
BOOL TriTriOverlap (const Point &V0, const Point &V1, const Point &V2, const Point &U0, const Point &U1, const Point &U2)

Protected Attributes

hrp::CollisionPairInserterBasecollisionPairInserter
Matrix3x3 mAR
 Absolute rotation matrix.
Point mCenterCoeff0
Point mCenterCoeff1
Point mExtentsCoeff0
Point mExtentsCoeff1
bool mFullBoxBoxTest
 Perform full BV-BV tests (true) or SAT-lite tests (false)
bool mFullPrimBoxTest
 Perform full Primitive-BV tests (true) or SAT-lite tests (false)
udword mId0
udword mId1
const MeshInterfacemIMesh0
 User-defined mesh interface for object0.
const MeshInterfacemIMesh1
 User-defined mesh interface for object1.
udword mLeafIndex
 Triangle index.
Point mLeafVerts [3]
 Triangle vertices.
udword mNbBVBVTests
 Number of BV-BV tests.
udword mNbBVPrimTests
 Number of BV-Primitive tests.
udword mNbPrimPrimTests
 Number of Primitive-Primitive tests.
const AABBCollisionNodemNowNode0
const AABBCollisionNodemNowNode1
Container mPairs
 Pairs of colliding primitives.
Matrix3x3 mR0to1
 Rotation from object0 to object1.
Matrix3x3 mR1to0
 Rotation from object1 to object0.
Point mT0to1
 Translation from object0 to object1.
Point mT1to0
 Translation from object1 to object0.

Detailed Description

Contains an AABB tree collider. This class performs a collision test between two AABB trees.

Author:
Pierre Terdiman
Version:
1.3
Date:
March, 20, 2001

Definition at line 70 of file OPC_TreeCollider.h.


Constructor & Destructor Documentation

virtual AABBTreeCollider::~AABBTreeCollider ( ) [virtual]

Member Function Documentation

void AABBTreeCollider::_Collide ( const AABBQuantizedNode b0,
const AABBQuantizedNode b1,
const Point a,
const Point Pa,
const Point b,
const Point Pb 
) [protected]
inline_ BOOL AABBTreeCollider::BoxBoxOverlap ( const Point ea,
const Point ca,
const Point eb,
const Point cb 
) [protected]

OBB-OBB overlap test using the separating axis theorem.

  • original code by Gomez / Gamasutra (similar to Gottschalk's one in RAPID)
  • optimized for AABB trees by computing the rotation matrix once (SOLID-fashion)
  • the fabs matrix is precomputed as well and epsilon-tweaked (RAPID-style, we found this almost mandatory)
  • Class III axes can be disabled... (SOLID & Intel fashion)
  • ...or enabled to perform some profiling
  • CPU comparisons used when appropriate
  • lazy evaluation sometimes saves some work in case of early exits (unlike SOLID)
Parameters:
ea[in] extents from box A
ca[in] center from box A
eb[in] extents from box B
cb[in] center from box B
Returns:
true if boxes overlap

Definition at line 19 of file OPC_BoxBoxOverlap.h.

bool AABBTreeCollider::CheckTemporalCoherence ( Pair cache) [protected]
bool AABBTreeCollider::Collide ( BVTCache cache,
const Matrix4x4 world0 = null,
const Matrix4x4 world1 = null 
)

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

Parameters:
cache[in] collision cache for model pointers and a colliding pair of primitives
world0[in] world matrix for first object, or null
world1[in] world matrix for second object, or null
Returns:
true if success
Warning:
SCALE NOT SUPPORTED. The matrices must contain rotation & translation parts only.
bool AABBTreeCollider::Collide ( const AABBCollisionTree tree0,
const AABBCollisionTree tree1,
const Matrix4x4 world0 = null,
const Matrix4x4 world1 = null,
Pair cache = null 
)
bool AABBTreeCollider::Collide ( const AABBNoLeafTree tree0,
const AABBNoLeafTree tree1,
const Matrix4x4 world0 = null,
const Matrix4x4 world1 = null,
Pair cache = null 
)
bool AABBTreeCollider::Collide ( const AABBQuantizedTree tree0,
const AABBQuantizedTree tree1,
const Matrix4x4 world0 = null,
const Matrix4x4 world1 = null,
Pair cache = null 
)
bool AABBTreeCollider::Collide ( const AABBQuantizedNoLeafTree tree0,
const AABBQuantizedNoLeafTree tree1,
const Matrix4x4 world0 = null,
const Matrix4x4 world1 = null,
Pair cache = null 
)

Stats: gets the number of BV-BV overlap tests after a collision query.

See also:
GetNbPrimPrimTests()
GetNbBVPrimTests()
Returns:
the number of BV-BV tests performed during last query

Definition at line 135 of file OPC_TreeCollider.h.

Stats: gets the number of BV-Triangle overlap tests after a collision query.

See also:
GetNbBVBVTests()
GetNbPrimPrimTests()
Returns:
the number of BV-Triangle tests performed during last query

Definition at line 155 of file OPC_TreeCollider.h.

Gets the number of contacts after a collision query.

See also:
GetContactStatus()
GetPairs()
Returns:
the number of contacts / colliding pairs.

Definition at line 167 of file OPC_TreeCollider.h.

Stats: gets the number of Triangle-Triangle overlap tests after a collision query.

See also:
GetNbBVBVTests()
GetNbBVPrimTests()
Returns:
the number of Triangle-Triangle tests performed during last query

Definition at line 145 of file OPC_TreeCollider.h.

Gets the pairs of colliding triangles after a collision query.

See also:
GetContactStatus()
GetNbPairs()
Returns:
the list of colliding pairs (triangle indices)

Definition at line 177 of file OPC_TreeCollider.h.

Validates current settings. You should call this method after all the settings and callbacks have been defined for a collider.

Returns:
null if everything is ok, else a string describing the problem
void AABBTreeCollider::PrimTest ( udword  id0,
udword  id1 
) [protected]

Definition at line 77 of file OPC_TreeCollider.h.

Settings: selects between full box-box tests or "SAT-lite" tests (where Class III axes are discarded)

Parameters:
flag[in] true for full tests, false for coarse tests
See also:
SetFullPrimBoxTest(bool flag)

Definition at line 114 of file OPC_TreeCollider.h.

Settings: selects between full triangle-box tests or "SAT-lite" tests (where Class III axes are discarded)

Parameters:
flag[in] true for full tests, false for coarse tests
See also:
SetFullBoxBoxTest(bool flag)

Definition at line 123 of file OPC_TreeCollider.h.

inline_ BOOL AABBTreeCollider::Setup ( const MeshInterface mi0,
const MeshInterface mi1 
) [inline, protected]

Definition at line 247 of file OPC_TreeCollider.h.

inline_ BOOL AABBTreeCollider::TriBoxOverlap ( const Point center,
const Point extents 
) [protected]

Triangle-Box overlap test using the separating axis theorem. This is the code from Tomas Möller, a bit optimized:

  • with some more lazy evaluation (faster path on PC)
  • with a tiny bit of assembly
  • with "SAT-lite" applied if needed
  • and perhaps with some more minor modifs...
Parameters:
center[in] box center
extents[in] box extents
Returns:
true if triangle & box overlap

Definition at line 118 of file OPC_TriBoxOverlap.h.

BOOL AABBTreeCollider::TriTriOverlap ( const Point V0,
const Point V1,
const Point V2,
const Point U0,
const Point U1,
const Point U2 
) [protected]

Triangle/triangle intersection test routine, by Tomas Moller, 1997. See article "A Fast Triangle-Triangle Intersection Test", Journal of Graphics Tools, 2(2), 1997

Updated June 1999: removed the divisions -- a little faster now! Updated October 1999: added {} to CROSS and SUB macros

int NoDivTriTriIsect(float V0[3],float V1[3],float V2[3], float U0[3],float U1[3],float U2[3])

Parameters:
V0[in] triangle 0, vertex 0
V1[in] triangle 0, vertex 1
V2[in] triangle 0, vertex 2
U0[in] triangle 1, vertex 0
U1[in] triangle 1, vertex 1
U2[in] triangle 1, vertex 2
Returns:
true if triangles overlap

Definition at line 179 of file OPC_TriTriOverlap.h.


Member Data Documentation

Definition at line 220 of file OPC_TreeCollider.h.

Absolute rotation matrix.

Definition at line 198 of file OPC_TreeCollider.h.

Definition at line 204 of file OPC_TreeCollider.h.

Definition at line 206 of file OPC_TreeCollider.h.

Definition at line 205 of file OPC_TreeCollider.h.

Definition at line 207 of file OPC_TreeCollider.h.

Perform full BV-BV tests (true) or SAT-lite tests (false)

Definition at line 218 of file OPC_TreeCollider.h.

Perform full Primitive-BV tests (true) or SAT-lite tests (false)

Definition at line 219 of file OPC_TreeCollider.h.

Definition at line 210 of file OPC_TreeCollider.h.

Definition at line 211 of file OPC_TreeCollider.h.

User-defined mesh interface for object0.

Definition at line 191 of file OPC_TreeCollider.h.

User-defined mesh interface for object1.

Definition at line 192 of file OPC_TreeCollider.h.

Triangle index.

Definition at line 216 of file OPC_TreeCollider.h.

Triangle vertices.

Definition at line 215 of file OPC_TreeCollider.h.

Number of BV-BV tests.

Definition at line 194 of file OPC_TreeCollider.h.

Number of BV-Primitive tests.

Definition at line 196 of file OPC_TreeCollider.h.

Number of Primitive-Primitive tests.

Definition at line 195 of file OPC_TreeCollider.h.

Definition at line 212 of file OPC_TreeCollider.h.

Definition at line 213 of file OPC_TreeCollider.h.

Pairs of colliding primitives.

Definition at line 189 of file OPC_TreeCollider.h.

Rotation from object0 to object1.

Definition at line 199 of file OPC_TreeCollider.h.

Rotation from object1 to object0.

Definition at line 200 of file OPC_TreeCollider.h.

Translation from object0 to object1.

Definition at line 201 of file OPC_TreeCollider.h.

Translation from object1 to object0.

Definition at line 202 of file OPC_TreeCollider.h.


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


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sun Apr 2 2017 03:43:59