Panda3D
physxDebugGeomNode.h
1 // Filename: physxDebugGeomNode.h
2 // Created by: enn0x (15Sep09)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef PHYSXDEBUGGEOMNODE_H
16 #define PHYSXDEBUGGEOMNODE_H
17 
18 #include "pandabase.h"
19 #include "pointerTo.h"
20 #include "geomNode.h"
21 #include "transformState.h"
22 #include "geom.h"
23 #include "geomVertexData.h"
24 #include "geomLines.h"
25 #include "geomTriangles.h"
26 
27 #include "physx_includes.h"
28 
29 class PhysxScene;
30 
31 ////////////////////////////////////////////////////////////////////
32 // Class : PhysxDebugGeomNode
33 // Description : Renderable geometry which represents visualizations
34 // of physics objects. Intended to help with
35 // debugging code.
36 ////////////////////////////////////////////////////////////////////
37 class EXPCL_PANDAPHYSX PhysxDebugGeomNode : public GeomNode {
38 
39 PUBLISHED:
40  INLINE PhysxDebugGeomNode();
41  INLINE ~PhysxDebugGeomNode();
42 
43  void on();
44  void off();
45  void toggle();
46 
47  INLINE void visualize_world_axes(bool value);
48  INLINE void visualize_body_axes(bool value);
49  INLINE void visualize_body_mass_axes(bool value);
50  INLINE void visualize_body_lin_velocity(bool value);
51  INLINE void visualize_body_ang_velocity(bool value);
52  INLINE void visualize_body_joint_groups(bool value);
53  INLINE void visualize_joint_local_axes(bool value);
54  INLINE void visualize_joint_world_axes(bool value);
55  INLINE void visualize_joint_limits(bool value);
56  INLINE void visualize_contact_point(bool value);
57  INLINE void visualize_contact_normal(bool value);
58  INLINE void visualize_contact_error(bool value);
59  INLINE void visualize_contact_force(bool value);
60  INLINE void visualize_actor_axes(bool value);
61  INLINE void visualize_collision_aabbs(bool value);
62  INLINE void visualize_collision_shapes(bool value);
63  INLINE void visualize_collision_axes(bool value);
64  INLINE void visualize_collision_compounds(bool value);
65  INLINE void visualize_collision_vnormals(bool value);
66  INLINE void visualize_collision_fnormals(bool value);
67  INLINE void visualize_collision_edges(bool value);
68  INLINE void visualize_collision_spheres(bool value);
69  INLINE void visualize_collision_static(bool value);
70  INLINE void visualize_collision_dynamic(bool value);
71  INLINE void visualize_collision_free(bool value);
72  INLINE void visualize_collision_ccd(bool value);
73  INLINE void visualize_collision_skeletons(bool value);
74  INLINE void visualize_cloth_mesh(bool value);
75  INLINE void visualize_cloth_validbounds(bool value);
76  INLINE void visualize_softbody_mesh(bool value);
77  INLINE void visualize_softbody_validbounds(bool value);
78  INLINE void visualize_force_fields(bool value);
79 
80 public:
81  void update(NxScene *scenePtr);
82 
83 private:
84  float _scale;
85 
86  PT(GeomVertexData) _vdata;
87  PT(Geom) _geom_lines;
88  PT(GeomLines) _prim_lines;
89  PT(Geom) _geom_triangles;
90  PT(GeomTriangles) _prim_triangles;
91 
92 ////////////////////////////////////////////////////////////////////
93 public:
94  static TypeHandle get_class_type() {
95  return _type_handle;
96  }
97  static void init_type() {
98  GeomNode::init_type();
99  register_type(_type_handle, "PhysxDebugGeomNode",
100  GeomNode::get_class_type());
101  }
102  virtual TypeHandle get_type() const {
103  return get_class_type();
104  }
105  virtual TypeHandle force_init_type() {
106  init_type();
107  return get_class_type();
108  }
109 
110 private:
111  static TypeHandle _type_handle;
112 };
113 
114 #include "physxDebugGeomNode.I"
115 
116 #endif // PHYSXDEBUGGEOMNODE_H
A scene is a collection of bodies, constraints, and effectors which can interact. ...
Definition: physxScene.h:73
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
A container for geometry primitives.
Definition: geom.h:58
Defines a series of disconnected line segments.
Definition: geomLines.h:25
Defines a series of disconnected triangles.
Definition: geomTriangles.h:25
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
A node that holds Geom objects, renderable pieces of geometry.
Definition: geomNode.h:37
Renderable geometry which represents visualizations of physics objects.