15 #ifndef COLLISIONTRAVERSER_H 16 #define COLLISIONTRAVERSER_H 18 #include "pandabase.h" 20 #include "collisionHandler.h" 21 #include "collisionLevelState.h" 23 #include "pointerTo.h" 24 #include "pStatCollector.h" 27 #include "register_type.h" 30 class CollisionRecorder;
31 class CollisionVisualizer;
54 INLINE
void set_respect_prev_transform(
bool flag);
55 INLINE
bool get_respect_prev_transform()
const;
58 bool remove_collider(
const NodePath &collider);
59 bool has_collider(
const NodePath &collider)
const;
60 int get_num_colliders()
const;
62 MAKE_SEQ(get_colliders, get_num_colliders, get_collider);
64 void clear_colliders();
68 #ifdef DO_COLLISION_RECORDING 69 void set_recorder(CollisionRecorder *recorder);
70 INLINE
bool has_recorder()
const;
71 INLINE CollisionRecorder *get_recorder()
const;
72 INLINE
void clear_recorder();
74 CollisionVisualizer *show_collisions(
const NodePath &root);
75 void hide_collisions();
76 #endif // DO_COLLISION_RECORDING 78 void output(ostream &out)
const;
79 void write(ostream &out,
int indent_level)
const;
83 void prepare_colliders_single(LevelStatesSingle &level_states,
const NodePath &root);
87 void prepare_colliders_double(LevelStatesDouble &level_states,
const NodePath &root);
91 void prepare_colliders_quad(LevelStatesQuad &level_states,
const NodePath &root);
115 class OrderedColliderDef {
122 Colliders _colliders;
124 OrderedColliders _ordered_colliders;
129 Handlers::iterator remove_handler(Handlers::iterator hi);
131 bool _respect_prev_transform;
132 #ifdef DO_COLLISION_RECORDING 133 CollisionRecorder *_recorder;
135 #endif // DO_COLLISION_RECORDING 146 PassCollectors _pass_collectors;
149 SolidCollideCollectors _solid_collide_collectors;
155 static void init_type() {
156 register_type(_type_handle,
"CollisionTraverser");
170 #include "collisionTraverser.I" The abstract interface to a number of classes that decide what to do when a collision is detected...
void output(ostream &out) const
Outputs the Namable.
This is the state information the CollisionTraverser retains for each level during traversal...
This is our own Panda specialization on the default STL vector.
A lightweight class that represents a single element that may be timed and/or counted via stats...
This is another abstract class, for a general class of bounding volumes that actually enclose points ...
A base class for all things which can have a name.
Defines a single collision event.
A container for geometry primitives.
A node in the scene graph that can hold any number of CollisionSolids.
This class manages the traversal through the scene graph to detect collisions.
TypeHandle is the identifier used to differentiate C++ class types.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...