Panda3D
physxDebugGeomNode.I
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file physxDebugGeomNode.I
10  * @author enn0x
11  * @date 2009-09-15
12  */
13 
14 /**
15  *
16  */
17 INLINE PhysxDebugGeomNode::
18 PhysxDebugGeomNode() : GeomNode("debug") {
19 
20  _scale = 1.0f;
21 
22  _vdata = new GeomVertexData("", GeomVertexFormat::get_v3c4(), Geom::UH_stream);
23 
24  // Lines
25  _prim_lines = new GeomLines(Geom::UH_stream);
26  _prim_lines->set_shade_model(Geom::SM_uniform);
27 
28  _geom_lines = new Geom(_vdata);
29  _geom_lines->add_primitive(_prim_lines);
30 
31  this->add_geom(_geom_lines);
32 
33  // Triangles
34  _prim_triangles = new GeomTriangles(Geom::UH_stream);
35  _prim_triangles->set_shade_model(Geom::SM_uniform);
36 
37  _geom_triangles = new Geom(_vdata);
38  _geom_triangles->add_primitive(_prim_triangles);
39 
40  this->add_geom(_geom_triangles);
41 }
42 
43 /**
44  *
45  */
46 INLINE PhysxDebugGeomNode::
47 ~PhysxDebugGeomNode() {
48 
49 }
50 
51 /**
52  *
53  */
54 INLINE void PhysxDebugGeomNode::
55 visualize_world_axes(bool value) {
56 
57  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_WORLD_AXES, value);
58 }
59 
60 /**
61  *
62  */
63 INLINE void PhysxDebugGeomNode::
64 visualize_body_axes(bool value) {
65 
66  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_BODY_AXES, value);
67 }
68 
69 /**
70  *
71  */
72 INLINE void PhysxDebugGeomNode::
73 visualize_body_mass_axes(bool value) {
74 
75  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_BODY_MASS_AXES, value);
76 }
77 
78 /**
79  *
80  */
81 INLINE void PhysxDebugGeomNode::
82 visualize_body_lin_velocity(bool value) {
83 
84  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_BODY_LIN_VELOCITY, value);
85 }
86 
87 /**
88  *
89  */
90 INLINE void PhysxDebugGeomNode::
91 visualize_body_ang_velocity(bool value) {
92 
93  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_BODY_ANG_VELOCITY, value);
94 }
95 
96 /**
97  *
98  */
99 INLINE void PhysxDebugGeomNode::
100 visualize_body_joint_groups(bool value) {
101 
102  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_BODY_JOINT_GROUPS, value);
103 }
104 
105 /**
106  *
107  */
108 INLINE void PhysxDebugGeomNode::
109 visualize_joint_local_axes(bool value) {
110 
111  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_JOINT_LOCAL_AXES, value);
112 }
113 
114 /**
115  *
116  */
117 INLINE void PhysxDebugGeomNode::
118 visualize_joint_world_axes(bool value) {
119 
120  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_JOINT_WORLD_AXES, value);
121 }
122 
123 /**
124  *
125  */
126 INLINE void PhysxDebugGeomNode::
127 visualize_joint_limits(bool value) {
128 
129  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_JOINT_LIMITS, value);
130 }
131 
132 /**
133  *
134  */
135 INLINE void PhysxDebugGeomNode::
136 visualize_contact_point(bool value) {
137 
138  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_CONTACT_POINT, value);
139 }
140 
141 /**
142  *
143  */
144 INLINE void PhysxDebugGeomNode::
145 visualize_contact_normal(bool value) {
146 
147  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_CONTACT_NORMAL, value);
148 }
149 
150 /**
151  *
152  */
153 INLINE void PhysxDebugGeomNode::
154 visualize_contact_error(bool value) {
155 
156  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_CONTACT_ERROR, value);
157 }
158 
159 /**
160  *
161  */
162 INLINE void PhysxDebugGeomNode::
163 visualize_contact_force(bool value) {
164 
165  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_CONTACT_FORCE, value);
166 }
167 
168 /**
169  *
170  */
171 INLINE void PhysxDebugGeomNode::
172 visualize_actor_axes(bool value) {
173 
174  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_ACTOR_AXES, value);
175 }
176 
177 /**
178  *
179  */
180 INLINE void PhysxDebugGeomNode::
181 visualize_collision_aabbs(bool value) {
182 
183  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_COLLISION_AABBS, value);
184 }
185 
186 /**
187  *
188  */
189 INLINE void PhysxDebugGeomNode::
190 visualize_collision_shapes(bool value) {
191 
192  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_COLLISION_SHAPES, value);
193 }
194 
195 /**
196  *
197  */
198 INLINE void PhysxDebugGeomNode::
199 visualize_collision_axes(bool value) {
200 
201  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_COLLISION_AXES, value);
202 }
203 
204 /**
205  *
206  */
207 INLINE void PhysxDebugGeomNode::
208 visualize_collision_compounds(bool value) {
209 
210  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_COLLISION_COMPOUNDS, value);
211 }
212 
213 /**
214  *
215  */
216 INLINE void PhysxDebugGeomNode::
217 visualize_collision_vnormals(bool value) {
218 
219  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_COLLISION_VNORMALS, value);
220 }
221 
222 /**
223  *
224  */
225 INLINE void PhysxDebugGeomNode::
226 visualize_collision_fnormals(bool value) {
227 
228  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_COLLISION_FNORMALS, value);
229 }
230 
231 /**
232  *
233  */
234 INLINE void PhysxDebugGeomNode::
235 visualize_collision_edges(bool value) {
236 
237  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_COLLISION_EDGES, value);
238 }
239 
240 /**
241  *
242  */
243 INLINE void PhysxDebugGeomNode::
244 visualize_collision_spheres(bool value) {
245 
246  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_COLLISION_SPHERES, value);
247 }
248 
249 /**
250  *
251  */
252 INLINE void PhysxDebugGeomNode::
253 visualize_collision_static(bool value) {
254 
255  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_COLLISION_STATIC, value);
256 }
257 
258 /**
259  *
260  */
261 INLINE void PhysxDebugGeomNode::
262 visualize_collision_dynamic(bool value) {
263 
264  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_COLLISION_DYNAMIC, value);
265 }
266 
267 /**
268  *
269  */
270 INLINE void PhysxDebugGeomNode::
271 visualize_collision_free(bool value) {
272 
273  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_COLLISION_FREE, value);
274 }
275 
276 /**
277  *
278  */
279 INLINE void PhysxDebugGeomNode::
280 visualize_collision_ccd(bool value) {
281 
282  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_COLLISION_CCD, value);
283 }
284 
285 /**
286  *
287  */
288 INLINE void PhysxDebugGeomNode::
289 visualize_collision_skeletons(bool value) {
290 
291  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_COLLISION_SKELETONS, value);
292 }
293 
294 /**
295  *
296  */
297 INLINE void PhysxDebugGeomNode::
298 visualize_cloth_mesh(bool value) {
299 
300  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_CLOTH_MESH, value);
301 }
302 
303 /**
304  *
305  */
306 INLINE void PhysxDebugGeomNode::
307 visualize_cloth_validbounds(bool value) {
308 
309  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_CLOTH_VALIDBOUNDS, value);
310 }
311 
312 /**
313  *
314  */
315 INLINE void PhysxDebugGeomNode::
316 visualize_softbody_mesh(bool value) {
317 
318  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_SOFTBODY_MESH, value);
319 }
320 
321 /**
322  *
323  */
324 INLINE void PhysxDebugGeomNode::
325 visualize_softbody_validbounds(bool value) {
326 
327  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_SOFTBODY_VALIDBOUNDS, value);
328 }
329 
330 /**
331  *
332  */
333 INLINE void PhysxDebugGeomNode::
334 visualize_force_fields(bool value) {
335 
336  NxGetPhysicsSDK()->setParameter(NX_VISUALIZE_FORCE_FIELDS, value);
337 }
static const GeomVertexFormat * get_v3c4()
Returns a standard vertex format with a 4-component color and a 3-component vertex position.
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:54
Defines a series of disconnected line segments.
Definition: geomLines.h:23
Defines a series of disconnected triangles.
Definition: geomTriangles.h:23
A node that holds Geom objects, renderable pieces of geometry.
Definition: geomNode.h:34
void add_geom(Geom *geom, const RenderState *state=RenderState::make_empty())
Adds a new Geom to the node.
Definition: geomNode.cxx:584