Panda3D
physxTriangleMeshDesc.h
1 // Filename: physxTriangleMeshDesc.h
2 // Created by: enn0x (11Oct09)
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 PHYSXTRIANGLEMESHDESC_H
16 #define PHYSXTRIANGLEMESHDESC_H
17 
18 #include "pandabase.h"
19 #include "nodePath.h"
20 #include "luse.h"
21 
22 #include "physx_includes.h"
23 
24 ////////////////////////////////////////////////////////////////////
25 // Class : PhysxTriangleMeshDesc
26 // Description :
27 ////////////////////////////////////////////////////////////////////
28 class EXPCL_PANDAPHYSX PhysxTriangleMeshDesc {
29 
30 PUBLISHED:
31  INLINE PhysxTriangleMeshDesc();
32  INLINE ~PhysxTriangleMeshDesc();
33 
34  INLINE bool is_valid() const;
35 
36  void set_num_vertices(unsigned int n);
37  void set_vertex(unsigned int idx, const LPoint3f &vert);
38 
39  void set_num_triangles(unsigned int n, bool use_material_indices=false);
40  void set_triangle(unsigned int idx,
41  unsigned int i1, unsigned int i2, unsigned int i3,
42  unsigned int material_index=1);
43 
44  void set_from_node_path(const NodePath &np);
45 
46 public:
47  const NxTriangleMeshDesc &get_desc() const;
48 
49 private:
50  NxVec3 *_vertices;
51  NxU32 *_triangles;
52  NxMaterialIndex *_materials;
53  NxTriangleMeshDesc _desc;
54 };
55 
56 #include "physxTriangleMeshDesc.I"
57 
58 #endif // PHYSXTRIANGLEMESHDESC_H
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:99
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:165