Panda3D
 All Classes Functions Variables Enumerations
odeTriMeshGeom.h
1 // Filename: odeTriMeshGeom.h
2 // Created by: joswilso (27Dec06)
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 ODETRIMESHGEOM_H
16 #define ODETRIMESHGEOM_H
17 
18 #include "pandabase.h"
19 #include "luse.h"
20 
21 #include "ode_includes.h"
22 #include "odeGeom.h"
23 #include "odeTriMeshData.h"
24 
25 ////////////////////////////////////////////////////////////////////
26 // Class : OdeTriMeshGeom
27 // Description :
28 ////////////////////////////////////////////////////////////////////
29 class EXPCL_PANDAODE OdeTriMeshGeom : public OdeGeom {
30  friend class OdeGeom;
31 
32 public:
33  OdeTriMeshGeom(dGeomID id);
34 
35 PUBLISHED:
36  /* ODE_API dGeomID dCreateTriMesh(dSpaceID space, dTriMeshDataID Data, dTriCallback* Callback, dTriArrayCallback* ArrayCallback, dTriRayCallback* RayCallback); */
38  OdeTriMeshGeom(OdeSpace &space, OdeTriMeshData &data);
39  OdeTriMeshGeom(const OdeTriMeshGeom &copy);
40  virtual ~OdeTriMeshGeom();
41 
42  void destroy();
43  INLINE void set_tri_mesh_data(OdeTriMeshData &data);
44  INLINE PT(OdeTriMeshData) get_tri_mesh_data() const;
45  INLINE void set_data(OdeTriMeshData &data);
46  INLINE PT(OdeTriMeshData) get_data() const;
47  INLINE void enable_TC(int geom_class, int enable);
48  INLINE int is_TC_enabled(int geom_class) const;
49  INLINE void clear_TC_cache(const OdeGeom &geom);
50  INLINE void get_triangle(int face_index, LPoint3f &v0, LPoint3f &v1, LPoint3f &v2) const;
51  INLINE LPoint3f get_point(int face_index, dReal u, dReal v) const;
52  INLINE int get_num_triangles() const;
53 
54 public:
55  INLINE static int get_geom_class() { return dTriMeshClass; };
56  INLINE dTriMeshDataID get_tri_mesh_data_id() const;
57  INLINE dTriMeshDataID get_data_id() const;
58 
59 public:
60  static TypeHandle get_class_type() {
61  return _type_handle;
62  }
63  static void init_type() {
64  OdeGeom::init_type();
65  register_type(_type_handle, "OdeTriMeshGeom",
66  OdeGeom::get_class_type());
67  }
68  virtual TypeHandle get_type() const {
69  return get_class_type();
70  }
71  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
72 
73 private:
74  static TypeHandle _type_handle;
75 };
76 
77 #include "odeTriMeshGeom.I"
78 
79 #endif
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
Definition: lpoint3.h:99
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85