Klamp't  0.8.1
ODEGeometry.h
1 #ifndef ODE_INTERFACE_TRI_MESH_H
2 #define ODE_INTERFACE_TRI_MESH_H
3 
4 #include "ODESurface.h"
5 #include <KrisLibrary/geometry/AnyGeometry.h>
6 #include <ode/common.h>
7 #include <ode/collision_trimesh.h>
8 using namespace Math3D;
9 using namespace Geometry;
10 
18 {
19  public:
20  ODEGeometry();
21  ~ODEGeometry();
22 
23  void Create(AnyCollisionGeometry3D* geom,dSpaceID space,Vector3 offset=Vector3(0.0),bool useCustomMesh = true);
25  void Clear();
27  void DrawGL();
29  void SetPadding(Real outerMargin);
31  Real GetPadding();
47  AnyCollisionGeometry3D* SetPaddingWithPreshrink(Real outerMargin,bool inplace=false);
48 
49  dGeomID geom() const { return geomID; }
50  dTriMeshDataID triMeshData() const { return triMeshDataID; }
51  ODESurfaceProperties& surf() { return surface; }
52 
53  private:
54  dTriMeshDataID triMeshDataID;
55  dGeomID geomID;
56 
57  dReal* verts;
58  int* indices;
59  dReal* normals;
60  int numVerts;
61  int numTris;
62  int numVertComponents;
63 
64  AnyCollisionGeometry3D* collisionGeometry;
65  ODESurfaceProperties surface;
66  bool geometrySelfAllocated;
67 };
68 
69 #endif
An ODE collision geometry.
Definition: ODEGeometry.h:17
surface properties for any ODE rigid object, robot link, or fixed object.
Definition: ODESurface.h:8