14#ifndef __BULLET_DEBUG_NODE_H__
15#define __BULLET_DEBUG_NODE_H__
29class EXPCL_PANDABULLET BulletDebugNode :
public PandaNode {
31 explicit BulletDebugNode(
const char *name=
"debug");
32 INLINE ~BulletDebugNode();
40 INLINE
bool get_show_wireframe()
const;
41 INLINE
bool get_show_constraints()
const;
42 INLINE
bool get_show_bounding_boxes()
const;
43 INLINE
bool get_show_normals()
const;
62 void do_sync_b2p(btDynamicsWorld *world);
67 UnalignedLVecBase4 _color;
74 UnalignedLVecBase4 _color;
77 class DebugDraw :
public btIDebugDraw {
82 virtual void setDebugMode(
int mode);
83 virtual int getDebugMode()
const;
84 virtual void reportErrorWarning(
const char *warning);
86 virtual void drawLine(
const btVector3 &from,
const btVector3 &to,
87 const btVector3 &color);
88 virtual void drawContactPoint(
const btVector3 &point,
89 const btVector3 &normal, btScalar distance,
int lifetime,
90 const btVector3 &color);
91 virtual void draw3dText(
const btVector3 &location,
const char *text);
92 virtual void drawTriangle(
const btVector3 &v0,
const btVector3 &v1,
93 const btVector3 &v2,
const btVector3 &color, btScalar);
94 virtual void drawTriangle(
const btVector3 &v0,
const btVector3 &v1,
95 const btVector3 &v2,
const btVector3 &n0,
const btVector3 &n1,
96 const btVector3 &n2,
const btVector3 &color, btScalar alpha);
97 virtual void drawSphere(btScalar radius,
const btTransform &transform,
98 const btVector3 &color);
101 pvector<Line> _lines;
102 pvector<Triangle> _triangles;
111 btDynamicsWorld *_debug_world;
112 PT(Geom) _debug_lines;
113 PT(Geom) _debug_triangles;
119 friend class BulletWorld;
121 static PStatCollector _pstat_debug;
128 static TypedWritable *make_from_bam(
const FactoryParams ¶ms);
129 void fillin(DatagramIterator &scan, BamReader *manager);
132 static TypeHandle get_class_type() {
135 static void init_type() {
136 PandaNode::init_type();
138 PandaNode::get_class_type());
140 virtual TypeHandle get_type()
const {
141 return get_class_type();
143 virtual TypeHandle force_init_type() {
145 return get_class_type();
149 static TypeHandle _type_handle;
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void draw_mask_changed()
Called after the node's DrawMask has been changed for any reason, this just provides a hook so derive...
show_bounding_boxes
If true, displays axis aligned bounding boxes for objects.
show_constraints
If true, display limits defined for constraints, e.g.
show_normals
If true, displays normal vectors for triangle mesh and heightfield faces.
show_wireframe
If true, displays collision shapes in wireframe mode.
This collects together the pieces of data that are accumulated for each node while walking the scene ...
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling,...
virtual bool safe_to_combine() const
Returns true if it is generally safe to combine this particular kind of PandaNode with other kinds of...
virtual bool safe_to_transform() const
Returns true if it is generally safe to transform this particular kind of PandaNode by calling the xf...
virtual bool is_renderable() const
Returns true if there is some value to visiting this particular node during the cull traversal for an...
virtual bool safe_to_combine_children() const
Returns true if it is generally safe to combine the children of this PandaNode with each other.
virtual bool safe_to_modify_transform() const
Returns true if it is safe to automatically adjust the transform on this kind of node.
static void register_with_read_factory()
Tells the BamReader how to create objects of type PandaNode.
virtual bool safe_to_flatten_below() const
Returns true if a flatten operation may safely continue past this node, or false if nodes below this ...
virtual void add_for_draw(CullTraverser *trav, CullTraverserData &data)
Adds the node's contents to the CullResult we are building up during the cull traversal,...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
virtual bool safe_to_flatten() const
Returns true if it is generally safe to flatten out this particular kind of PandaNode by duplicating ...
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(),...