col::MatrixCell Class Reference

A single cell of the collision interest matrix. More...

Collaboration diagram for col::MatrixCell:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MatrixCell (const ColObj *colobj1, const ColObj *colobj2)
void addCallback (Callback *callback)
 Add a collision callback.
void callCallbacks (void) const
 Process all callbacks.
bool check (bool use_hulls)
 Check a pair for collision (internal).

Protected Attributes

vector< Callback * > m_callback
 positive collision callbacks
ColObj const *const m_colobj1
 the two collision objects of this cell
ColObj const *const m_colobj2
LevelOfDetectionE m_level
 the maximum level of detection of all callbacks of this cell
SepPlane m_sep_plane
 the seprating plane of the convex hulls ColObj::hull
Data m_data
 Collision data for collision callback and internal usage.
bool m_allpolygons

Detailed Description

A single cell of the collision interest matrix.

Each cell contains a list of Callback's, and other pairwise data (like separating plane).

Each cell also contains a "level of collision". The minimum level is LEVEL_BOX. When a cell checks the pair of objects for collision, the maximum level of all callbacks is used for that check.

Exceptions:
XCollision If one of the nodes does not have a geometry.
Todo:
Flag all_poygons auswerten.
Author:
Gabriel Zachmann
Implementation:
When different algorithms will be available, a cell will be the place to store the kind of algo appropriate for a certain pair of objects.


Member Function Documentation

void col::MatrixCell::addCallback ( Callback cb  ) 

Add a collision callback.

Exceptions:
XColBug If m_callback->m_node1/2 doesn't match cell.m_colobj1/2->m_node.
XCollision If one of the objects pointers in the callback is a NullNode.

void col::MatrixCell::callCallbacks ( void   )  const

Process all callbacks.

Precondition:
m_data is valid.

bool col::MatrixCell::check ( bool  use_hulls  ) 

Check a pair for collision (internal).

Parameters:
use_hulls do a convex hull pre-check
Depending on the levels of detection of each callback, the max level needed is done. For instance, if all callbacks have level LEVEL_HULL or less, then only the convex hull check is done.

Implementation:
The check is based on the positions of the objects stored in ColObj::m_curr_matr .
Warning:
Only one of the instance variables m_doptree and m_boxtree should be set! It will call the check() function of the one which is set. And both ColObj's in a cell should have the same instance variables set, and the other unset!
See also:
ColObj::hasMoved()
Todo:
  • Check whether or not only a bbox check is wanted. This would be a flag stored with each Callback, and a counter stored with the MatrixCell.
  • Matrix-Inversion in ColObj::hasMoved() machen.
  • Nochmal ueberpruefen, warum die berechnete Matrix m12 so stimmt; eigtl. haette ich jetzt doch eine umgekehrte Multiplikation erwartet.
  • use_hulls in jeder MatrixCell speichern. Dann braucht man nicht das Flag global fuer alle MatrixCell's in Collision.cpp sich zu merken.


The documentation for this class was generated from the following files:
Generated on Tue Oct 16 18:13:06 2007 for CollDet by  doxygen 1.5.2