Panda3D
 All Classes Functions Variables Enumerations
odeTriMeshGeom.h
00001 // Filename: odeTriMeshGeom.h
00002 // Created by:  joswilso (27Dec06)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef ODETRIMESHGEOM_H
00016 #define ODETRIMESHGEOM_H
00017 
00018 #include "pandabase.h"
00019 #include "luse.h"
00020 
00021 #include "ode_includes.h"
00022 #include "odeGeom.h"
00023 #include "odeTriMeshData.h"
00024 
00025 ////////////////////////////////////////////////////////////////////
00026 //       Class : OdeTriMeshGeom
00027 // Description : 
00028 ////////////////////////////////////////////////////////////////////
00029 class EXPCL_PANDAODE OdeTriMeshGeom : public OdeGeom {
00030   friend class OdeGeom;
00031 
00032 private:
00033   OdeTriMeshGeom(dGeomID id);
00034 
00035 PUBLISHED:
00036   /* ODE_API dGeomID dCreateTriMesh(dSpaceID space, dTriMeshDataID Data, dTriCallback* Callback, dTriArrayCallback* ArrayCallback, dTriRayCallback* RayCallback); */
00037   OdeTriMeshGeom(OdeTriMeshData &data);
00038   OdeTriMeshGeom(OdeSpace &space, OdeTriMeshData &data);
00039   OdeTriMeshGeom(const OdeTriMeshGeom &copy);
00040   virtual ~OdeTriMeshGeom();
00041   
00042   void destroy();
00043   INLINE void set_tri_mesh_data(OdeTriMeshData &data);
00044   INLINE PT(OdeTriMeshData) get_tri_mesh_data() const;
00045   INLINE void set_data(OdeTriMeshData &data);
00046   INLINE PT(OdeTriMeshData) get_data() const;
00047   INLINE void enable_TC(int geom_class, int enable);
00048   INLINE int is_TC_enabled(int geom_class) const;
00049   INLINE void clear_TC_cache(const OdeGeom &geom);
00050   INLINE void get_triangle(int face_index, LPoint3f &v0, LPoint3f &v1, LPoint3f &v2) const;
00051   INLINE LPoint3f get_point(int face_index, dReal u, dReal v) const;
00052   INLINE int get_num_triangles() const;
00053 
00054 public:
00055   INLINE static int get_geom_class() { return dTriMeshClass; };
00056   INLINE dTriMeshDataID get_tri_mesh_data_id() const;
00057   INLINE dTriMeshDataID get_data_id() const;
00058 
00059 private:
00060   void operator = (const OdeTriMeshGeom &copy);
00061 
00062 public:
00063   static TypeHandle get_class_type() {
00064     return _type_handle;
00065   }
00066   static void init_type() {
00067     OdeGeom::init_type();
00068     register_type(_type_handle, "OdeTriMeshGeom",
00069                   OdeGeom::get_class_type());
00070   }
00071   virtual TypeHandle get_type() const {
00072     return get_class_type();
00073   }
00074   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00075 
00076 private:
00077   static TypeHandle _type_handle;
00078 };
00079 
00080 #include "odeTriMeshGeom.I"
00081 
00082 #endif
 All Classes Functions Variables Enumerations