Class SaPCollisionManager

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

Class Documentation

class SaPCollisionManager : public coal::BroadPhaseCollisionManager

Rigorous SAP collision manager.

Public Types

typedef BroadPhaseCollisionManager Base

Public Functions

SaPCollisionManager()
~SaPCollisionManager()
virtual void registerObjects(const std::vector<CollisionObject*> &other_objs)

add objects to the manager

virtual void registerObject(CollisionObject *obj)

remove one object from the manager

virtual void unregisterObject(CollisionObject *obj)

add one object to the manager

virtual void setup()

initialize the manager, related with the specific type of manager

virtual void update()

update the condition of manager

virtual void update(CollisionObject *updated_obj)

update the manager by explicitly given the object updated

virtual void update(const std::vector<CollisionObject*> &updated_objs)

update the manager by explicitly given the set of objects update

virtual void clear()

clear the manager

virtual void getObjects(std::vector<CollisionObject*> &objs) const

return the objects managed by the manager

virtual void collide(CollisionObject *obj, CollisionCallBackBase *callback) const

perform collision test between one object and all the objects belonging to the manager

virtual void distance(CollisionObject *obj, DistanceCallBackBase *callback) const

perform distance computation between one object and all the objects belonging to the manager

virtual void collide(CollisionCallBackBase *callback) const

perform collision test for the objects belonging to the manager (i.e., N^2 self collision)

virtual void distance(DistanceCallBackBase *callback) const

perform distance test for the objects belonging to the manager (i.e., N^2 self distance)

virtual void collide(BroadPhaseCollisionManager *other_manager, CollisionCallBackBase *callback) const

perform collision test with objects belonging to another manager

virtual void distance(BroadPhaseCollisionManager *other_manager, DistanceCallBackBase *callback) const

perform distance test with objects belonging to another manager

virtual bool empty() const

whether the manager is empty

virtual size_t size() const

the number of objects managed by the manager

virtual void getObjects(std::vector<CollisionObject*> &objs) const = 0

return the objects managed by the manager

inline virtual std::vector<CollisionObject*> getObjects() const

return the objects managed by the manager

Protected Functions

void update_(SaPAABB *updated_aabb)
void updateVelist()
bool distance_(CollisionObject *obj, DistanceCallBackBase *callback, CoalScalar &min_dist) const
bool collide_(CollisionObject *obj, CollisionCallBackBase *callback) const
void addToOverlapPairs(const SaPPair &p)
void removeFromOverlapPairs(const SaPPair &p)

Protected Attributes

EndPoint *elist[3]

End point list for x, y, z coordinates.

std::vector<EndPoint*> velist[3]

vector version of elist, for acceleration

std::list<SaPAABB*> AABB_arr

SAP interval list.

std::list<SaPPair> overlap_pairs

The pair of objects that should further check for collision.

int optimal_axis
std::map<CollisionObject*, SaPAABB*> obj_aabb_map
struct EndPoint

End point for an interval.

Public Functions

const Vec3s &getVal() const

get the value of the end point

Vec3s &getVal()

set the value of the end point

CoalScalar getVal(int i) const
CoalScalar &getVal(int i)

Public Members

char minmax

tag for whether it is a lower bound or higher bound of an interval, 0 for lo, and 1 for hi

SaPAABB *aabb

back pointer to SAP interval

EndPoint *prev[3]

the previous end point in the end point list

EndPoint *next[3]

the next end point in the end point list

class isNotValidPair

Functor to help remove collision pairs no longer valid (i.e., should be culled away)

Public Functions

isNotValidPair(CollisionObject *obj1_, CollisionObject *obj2_)
bool operator()(const SaPPair &pair)
class isUnregistered

Functor to help unregister one object.

Public Functions

isUnregistered(CollisionObject *obj_)
bool operator()(const SaPPair &pair) const
struct SaPAABB

SAP interval for one object.

Public Members

CollisionObject *obj

object

EndPoint *lo

lower bound end point of the interval

EndPoint *hi

higher bound end point of the interval

AABB cached

cached AABB value

struct SaPPair

A pair of objects that are not culling away and should further check collision.

Public Functions

SaPPair(CollisionObject *a, CollisionObject *b)
bool operator==(const SaPPair &other) const

Public Members

CollisionObject *obj1
CollisionObject *obj2