24 void PhysxDebugGeomNode::
25 update(NxScene *scenePtr) {
31 const NxDebugRenderable *renderable = scenePtr->getDebugRenderable();
34 physx_cat.warning() <<
"Could no get debug renderable." << std::endl;
43 _prim_lines->clear_vertices();
44 _prim_triangles->clear_vertices();
48 NxU32 n = renderable->getNbLines();
49 const NxDebugLine *lines = renderable->getLines();
51 for (NxU32 i=0; i<n; i++)
53 NxF32 b = NxF32((lines[i].color)&0xff) / 255.0f;
54 NxF32 g = NxF32((lines[i].color>>8)&0xff) / 255.0f;
55 NxF32 r = NxF32((lines[i].color>>16)&0xff) / 255.0f;
57 NxVec3 p0 = lines[i].p0;
58 NxVec3 p1 = lines[i].p1;
62 _prim_lines->add_vertex(v++);
66 _prim_lines->add_vertex(v++);
73 NxU32 n = renderable->getNbTriangles();
74 const NxDebugTriangle *triangles = renderable->getTriangles();
76 for (NxU32 i=0; i<n; i++)
78 NxF32 b = NxF32((triangles[i].color)&0xff) / 255.0f;
79 NxF32 g = NxF32((triangles[i].color>>8)&0xff) / 255.0f;
80 NxF32 r = NxF32((triangles[i].color>>16)&0xff) / 255.0f;
82 NxVec3 p0 = triangles[i].p0;
83 NxVec3 p1 = triangles[i].p1;
84 NxVec3 p2 = triangles[i].p2;
88 _prim_triangles->add_vertex(v++);
92 _prim_triangles->add_vertex(v++);
96 _prim_triangles->add_vertex(v++);
100 _prim_lines->close_primitive();
101 _prim_triangles->close_primitive();
103 physx_cat.spam() <<
"Updated PhysxDebugGeomNode geometry\n";
109 void PhysxDebugGeomNode::
112 NxGetPhysicsSDK()->setParameter(NX_VISUALIZATION_SCALE, _scale);
118 void PhysxDebugGeomNode::
121 NxGetPhysicsSDK()->setParameter(NX_VISUALIZATION_SCALE, 0.0f);
127 void PhysxDebugGeomNode::
130 if (NxGetPhysicsSDK()->getParameter(NX_VISUALIZATION_SCALE) == 0.0f) {
void add_data4f(float x, float y, float z, float w)
Sets the write row to a particular 4-component value, and advances the write row.
This object provides a high-level interface for quickly writing a sequence of numeric values from a v...
get_num_parents
Returns the number of parent nodes this node has.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void add_data3f(float x, float y, float z)
Sets the write row to a particular 3-component value, and advances the write row.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
void remove_all_geoms()
Removes all the geoms from the node at once.