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

#include <Opcode.h>

Inheritance diagram for Opcode::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

Definition at line 70 of file Opcode.h.


Constructor & Destructor Documentation

Constructor.

Definition at line 49 of file OPC_TreeCollider.cpp.

Destructor.

Definition at line 67 of file OPC_TreeCollider.cpp.


Member Function Documentation

Recursive collision query for normal AABB trees.

Parameters:
b0[in] collision node from first tree
b1[in] collision node from second tree

Definition at line 518 of file OPC_TreeCollider.cpp.

void AABBTreeCollider::_Collide ( const AABBQuantizedNode b0,
const AABBQuantizedNode b1,
const Point a,
const Point Pa,
const Point b,
const Point Pb 
) [protected]

Recursive collision query for quantized AABB trees.

Parameters:
b0[in] collision node from first tree
b1[in] collision node from second tree
a[in] extent from box A
Pa[in] center from box A
b[in] extent from box B
Pb[in] center from box B

Definition at line 804 of file OPC_TreeCollider.cpp.

Recursive collision query for no-leaf AABB trees.

Parameters:
a[in] collision node from first tree
b[in] collision node from second tree

Definition at line 709 of file OPC_TreeCollider.cpp.

Recursive collision query for quantized no-leaf AABB trees.

Parameters:
a[in] collision node from first tree
b[in] collision node from second tree

Definition at line 914 of file OPC_TreeCollider.cpp.

Recursive collision of a leaf node from B and a branch from A.

Parameters:
b[in] collision node from first tree

Definition at line 674 of file OPC_TreeCollider.cpp.

Recursive collision of a leaf node from B and a quantized branch from A.

Parameters:
b[in] collision node from first tree
leaf[in] leaf triangle from second tree

Definition at line 885 of file OPC_TreeCollider.cpp.

Recursive collision of a leaf node from A and a branch from B.

Parameters:
b[in] collision node from second tree

Definition at line 650 of file OPC_TreeCollider.cpp.

Recursive collision of a leaf node from A and a quantized branch from B.

Parameters:
leaf[in] leaf triangle from first tree
b[in] collision node from second tree

Definition at line 856 of file OPC_TreeCollider.cpp.

inline_ BOOL Opcode::AABBTreeCollider::BoxBoxOverlap ( const Point ea,
const Point ca,
const Point eb,
const Point cb 
) [protected]
bool AABBTreeCollider::CheckTemporalCoherence ( Pair cache) [protected]

Takes advantage of temporal coherence.

Parameters:
cache[in] cache for a pair of previously colliding primitives
Returns:
true if we can return immediately
Warning:
only works for "First Contact" mode

Definition at line 316 of file OPC_TreeCollider.cpp.

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.

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
world1[in] world matrix for second object
Returns:
true if success
Warning:
SCALE NOT SUPPORTED. The matrices must contain rotation & translation parts only.

Definition at line 97 of file OPC_TreeCollider.cpp.

bool AABBTreeCollider::Collide ( const AABBCollisionTree tree0,
const AABBCollisionTree tree1,
const Matrix4x4 world0 = null,
const Matrix4x4 world1 = null,
Pair cache = null 
)

Collision query for normal AABB trees.

Parameters:
tree0[in] AABB tree from first object
tree1[in] AABB tree from second object
world0[in] world matrix for first object
world1[in] world matrix for second object
cache[in/out] cache for a pair of previously colliding primitives
Returns:
true if success
Warning:
SCALE NOT SUPPORTED. The matrices must contain rotation & translation parts only.

Definition at line 349 of file OPC_TreeCollider.cpp.

bool AABBTreeCollider::Collide ( const AABBNoLeafTree tree0,
const AABBNoLeafTree tree1,
const Matrix4x4 world0 = null,
const Matrix4x4 world1 = null,
Pair cache = null 
)

Collision query for no-leaf AABB trees.

Parameters:
tree0[in] AABB tree from first object
tree1[in] AABB tree from second object
world0[in] world matrix for first object
world1[in] world matrix for second object
cache[in/out] cache for a pair of previously colliding primitives
Returns:
true if success
Warning:
SCALE NOT SUPPORTED. The matrices must contain rotation & translation parts only.

Definition at line 377 of file OPC_TreeCollider.cpp.

bool AABBTreeCollider::Collide ( const AABBQuantizedTree tree0,
const AABBQuantizedTree tree1,
const Matrix4x4 world0 = null,
const Matrix4x4 world1 = null,
Pair cache = null 
)

Collision query for quantized AABB trees.

Parameters:
tree0[in] AABB tree from first object
tree1[in] AABB tree from second object
world0[in] world matrix for first object
world1[in] world matrix for second object
cache[in/out] cache for a pair of previously colliding primitives
Returns:
true if success
Warning:
SCALE NOT SUPPORTED. The matrices must contain rotation & translation parts only.

Definition at line 405 of file OPC_TreeCollider.cpp.

bool AABBTreeCollider::Collide ( const AABBQuantizedNoLeafTree tree0,
const AABBQuantizedNoLeafTree tree1,
const Matrix4x4 world0 = null,
const Matrix4x4 world1 = null,
Pair cache = null 
)

Collision query for quantized no-leaf AABB trees.

Parameters:
tree0[in] AABB tree from first object
tree1[in] AABB tree from second object
world0[in] world matrix for first object
world1[in] world matrix for second object
cache[in/out] cache for a pair of previously colliding primitives
Returns:
true if success
Warning:
SCALE NOT SUPPORTED. The matrices must contain rotation & translation parts only.

Definition at line 448 of file OPC_TreeCollider.cpp.

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 Opcode.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 Opcode.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 Opcode.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 Opcode.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 Opcode.h.

void AABBTreeCollider::InitQuery ( const Matrix4x4 world0 = null,
const Matrix4x4 world1 = null 
) [protected]

Initializes a collision query :

  • reset stats & contact status
  • setup matrices
Parameters:
world0[in] world matrix for first object
world1[in] world matrix for second object
Warning:
SCALE NOT SUPPORTED. The matrices must contain rotation & translation parts only.

Definition at line 241 of file OPC_TreeCollider.cpp.

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]

Leaf-leaf test for two primitive indices.

Parameters:
id0[in] index from first leaf-triangle
id1[in] index from second leaf-triangle

Definition at line 571 of file OPC_TreeCollider.cpp.

Leaf-leaf test for a previously fetched triangle from tree B (in A's space) and a new leaf from A.

Parameters:
id0[in] leaf-triangle index from tree A

Definition at line 628 of file OPC_TreeCollider.cpp.

Leaf-leaf test for a previously fetched triangle from tree A (in B's space) and a new leaf from B.

Parameters:
id1[in] leaf-triangle index from tree B

Definition at line 606 of file OPC_TreeCollider.cpp.

Definition at line 77 of file Opcode.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 Opcode.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 Opcode.h.

Definition at line 247 of file Opcode.h.

inline_ BOOL Opcode::AABBTreeCollider::TriBoxOverlap ( const Point center,
const Point extents 
) [protected]
BOOL Opcode::AABBTreeCollider::TriTriOverlap ( const Point V0,
const Point V1,
const Point V2,
const Point U0,
const Point U1,
const Point U2 
) [protected]

Member Data Documentation

Definition at line 220 of file Opcode.h.

Absolute rotation matrix.

Definition at line 198 of file Opcode.h.

Definition at line 204 of file Opcode.h.

Definition at line 206 of file Opcode.h.

Definition at line 205 of file Opcode.h.

Definition at line 207 of file Opcode.h.

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

Definition at line 218 of file Opcode.h.

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

Definition at line 219 of file Opcode.h.

Definition at line 210 of file Opcode.h.

Definition at line 211 of file Opcode.h.

User-defined mesh interface for object0.

Definition at line 191 of file Opcode.h.

User-defined mesh interface for object1.

Definition at line 192 of file Opcode.h.

Triangle index.

Definition at line 216 of file Opcode.h.

Triangle vertices.

Definition at line 215 of file Opcode.h.

Number of BV-BV tests.

Definition at line 194 of file Opcode.h.

Number of BV-Primitive tests.

Definition at line 196 of file Opcode.h.

Number of Primitive-Primitive tests.

Definition at line 195 of file Opcode.h.

Definition at line 212 of file Opcode.h.

Definition at line 213 of file Opcode.h.

Pairs of colliding primitives.

Definition at line 189 of file Opcode.h.

Rotation from object0 to object1.

Definition at line 199 of file Opcode.h.

Rotation from object1 to object0.

Definition at line 200 of file Opcode.h.

Translation from object0 to object1.

Definition at line 201 of file Opcode.h.

Translation from object1 to object0.

Definition at line 202 of file Opcode.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:44:02