14#ifndef COLLISIONVISUALIZER_H
15#define COLLISIONVISUALIZER_H
25#ifdef DO_COLLISION_RECORDING
35class EXPCL_PANDA_COLLIDE CollisionVisualizer :
public PandaNode,
public CollisionRecorder {
37 explicit CollisionVisualizer(
const std::string &name);
38 CollisionVisualizer(
const CollisionVisualizer ©);
39 virtual ~CollisionVisualizer();
41 INLINE
void set_point_scale(PN_stdfloat point_scale);
42 INLINE PN_stdfloat get_point_scale()
const;
44 INLINE
void set_normal_scale(PN_stdfloat normal_scale);
45 INLINE PN_stdfloat get_normal_scale()
const;
50 MAKE_PROPERTY(point_scale, get_point_scale, set_point_scale);
51 MAKE_PROPERTY(normal_scale, get_normal_scale, set_normal_scale);
56 virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data);
58 virtual void output(std::ostream &out)
const;
61 virtual void begin_traversal();
62 virtual void collision_tested(
const CollisionEntry &entry,
bool detected);
69 CPT(RenderState) get_viz_state();
78 typedef pmap<CPT(CollisionSolid), SolidInfo> Solids;
80 class CollisionPoint {
82 LPoint3 _surface_point;
83 LVector3 _surface_normal;
84 LPoint3 _interior_point;
86 typedef pvector<CollisionPoint> Points;
98 PN_stdfloat _point_scale;
99 PN_stdfloat _normal_scale;
102 static TypeHandle get_class_type() {
106 static void init_type() {
107 PandaNode::init_type();
108 CollisionRecorder::init_type();
110 PandaNode::get_class_type(),
111 CollisionRecorder::get_class_type());
113 virtual TypeHandle get_type()
const {
114 return get_class_type();
116 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
119 static TypeHandle _type_handle;
A basic node of the scene graph or data graph.
virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data)
This function will be called during the cull traversal to perform any additional operations that shou...
virtual bool is_renderable() const
Returns true if there is some value to visiting this particular node during the cull traversal for an...
virtual PandaNode * make_copy() const
Returns a newly-allocated PandaNode that is a shallow copy of this one.
TypedObject * as_typed_object()
Returns the object, upcast (if necessary) to a TypedObject pointer.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...