Panda3D
odeTriMeshGeom.h
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 odeTriMeshGeom.h
10  * @author joswilso
11  * @date 2006-12-27
12  */
13 
14 #ifndef ODETRIMESHGEOM_H
15 #define ODETRIMESHGEOM_H
16 
17 #include "pandabase.h"
18 #include "luse.h"
19 
20 #include "ode_includes.h"
21 #include "odeGeom.h"
22 #include "odeTriMeshData.h"
23 
24 /**
25  *
26  */
27 class EXPCL_PANDAODE OdeTriMeshGeom : public OdeGeom {
28  friend class OdeGeom;
29 
30 public:
31  OdeTriMeshGeom(dGeomID id);
32 
33 PUBLISHED:
34  /* ODE_API dGeomID dCreateTriMesh(dSpaceID space, dTriMeshDataID Data, dTriCallback* Callback, dTriArrayCallback* ArrayCallback, dTriRayCallback* RayCallback); */
36  OdeTriMeshGeom(OdeSpace &space, OdeTriMeshData &data);
37  OdeTriMeshGeom(const OdeTriMeshGeom &copy);
38  virtual ~OdeTriMeshGeom();
39 
40  void destroy();
41  INLINE void set_tri_mesh_data(OdeTriMeshData &data);
42  INLINE PT(OdeTriMeshData) get_tri_mesh_data() const;
43  INLINE void set_data(OdeTriMeshData &data);
44  INLINE PT(OdeTriMeshData) get_data() const;
45  INLINE void enable_TC(int geom_class, int enable);
46  INLINE int is_TC_enabled(int geom_class) const;
47  INLINE void clear_TC_cache(const OdeGeom &geom);
48  INLINE void get_triangle(int face_index, LPoint3f &v0, LPoint3f &v1, LPoint3f &v2) const;
49  INLINE LPoint3f get_point(int face_index, dReal u, dReal v) const;
50  INLINE int get_num_triangles() const;
51 
52 public:
53  INLINE static int get_geom_class() { return dTriMeshClass; };
54  INLINE dTriMeshDataID get_tri_mesh_data_id() const;
55  INLINE dTriMeshDataID get_data_id() const;
56 
57 public:
58  static TypeHandle get_class_type() {
59  return _type_handle;
60  }
61  static void init_type() {
62  OdeGeom::init_type();
63  register_type(_type_handle, "OdeTriMeshGeom",
64  OdeGeom::get_class_type());
65  }
66  virtual TypeHandle get_type() const {
67  return get_class_type();
68  }
69  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
70 
71 private:
72  static TypeHandle _type_handle;
73 };
74 
75 #include "odeTriMeshGeom.I"
76 
77 #endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81