public class CollisionHandlerTable
extends java.lang.Object
getCollidableIndex()
method. Each handler is associated with a pair of bodies, and since these
pairings are symmetric, we only need store the upper triangular part of the
matrix.
Each body is associated with an Anchor
structure that
contains linked lists to the other handlers in both the k-th row and column.
Note that entries within these lists a not sorted in index order.
Each body's anchor is obtained using a HashMap.
Modifier and Type | Field and Description |
---|---|
static boolean |
useCollidableIndices |
Constructor and Description |
---|
CollisionHandlerTable(CollisionManager manager) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
void |
collectHandlers(java.util.ArrayList<CollisionHandler> handlers,
CollidablePair pair) |
CollisionHandler |
get(CollidableBody col0,
CollidableBody col1) |
void |
getState(DataBuffer data) |
void |
initialize(java.util.List<CollidableBody> collidables) |
void |
printTable()
For debugging
|
CollisionHandler |
put(CollidableBody col0,
CollidableBody col1,
CollisionBehavior behav,
artisynth.core.mechmodels.CollisionManager.BehaviorSource src) |
void |
reinitialize(java.util.List<CollidableBody> collidables)
Reinitializes the table with a new set of collidables.
|
void |
setState(DataBuffer data) |
int |
size()
Number of handlers currently in the table
|
public CollisionHandlerTable(CollisionManager manager)
public void collectHandlers(java.util.ArrayList<CollisionHandler> handlers, CollidablePair pair)
public void clear()
public void initialize(java.util.List<CollidableBody> collidables)
public void reinitialize(java.util.List<CollidableBody> collidables)
collidables
- new collidablespublic CollisionHandler get(CollidableBody col0, CollidableBody col1)
public CollisionHandler put(CollidableBody col0, CollidableBody col1, CollisionBehavior behav, artisynth.core.mechmodels.CollisionManager.BehaviorSource src)
public int size()
public void getState(DataBuffer data)
public void setState(DataBuffer data)
public void printTable()