15 #include "physxConvexMeshDesc.h"
16 #include "physxManager.h"
18 #include "nodePathCollection.h"
20 #include "geomVertexReader.h"
38 nassertv_always(numVertices < 256);
44 _vertices =
new NxVec3[numVertices];
46 _desc.numVertices = numVertices;
47 _desc.points = _vertices;
59 nassertv(_desc.numVertices > idx);
68 const NxConvexMeshDesc &PhysxConvexMeshDesc::
99 CPT(
Geom) geom = gnode->get_geom(j);
112 NxU32 numVertices = dataVertices.size();
114 _vertices =
new NxVec3[numVertices];
118 for (it=dataVertices.begin(); it!=dataVertices.end(); it++) {
121 _vertices[i].x = v.get_x();
122 _vertices[i].y = v.get_y();
123 _vertices[i].z = v.get_z();
127 _desc.numVertices = numVertices;
128 _desc.points = _vertices;
void set_num_vertices(unsigned int n)
Sets the number of vertices to be stored within this convex mesh.
static NxVec3 point3_to_nxVec3(const LPoint3f &p)
Converts from LPoint3f to NxVec3.
NodePath get_path(int index) const
Returns the nth NodePath in the collection.
PandaNode * node() const
Returns the referenced node of the path.
void set_from_node_path(const NodePath &np)
A convenience method to set the mesh data from a NodePath in a single call.
const LVecBase3f & get_data3f()
Returns the data associated with the read row, expressed as a 3-component value, and advances the rea...
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
bool is_at_end() const
Returns true if the reader is currently at the end of the list of vertices, false otherwise...
int get_num_paths() const
Returns the number of NodePaths in the collection.
This is our own Panda specialization on the default STL vector.
void set_vertex(unsigned int idx, const LPoint3f &vert)
Sets a single vertex.
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
A container for geometry primitives.
This object provides a high-level interface for quickly reading a sequence of numeric values from a v...
NodePathCollection find_all_matches(const string &path) const
Returns the complete set of all NodePaths that begin with this NodePath and can be extended by path...
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
A node that holds Geom objects, renderable pieces of geometry.
int get_num_geoms() const
Returns the number of geoms in the node.
This is a set of zero or more NodePaths.