Klamp't  0.9.0
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 
9 namespace Klampt {
10  using namespace Math3D;
11  using namespace Geometry;
12 
20 {
21  public:
22  ODEGeometry();
23  ~ODEGeometry();
24 
25  void Create(AnyCollisionGeometry3D* geom,dSpaceID space,Vector3 offset=Vector3(0.0),bool useCustomMesh = true);
27  void Clear();
29  void DrawGL();
31  void SetPadding(Real outerMargin);
33  Real GetPadding();
49  AnyCollisionGeometry3D* SetPaddingWithPreshrink(Real outerMargin,bool inplace=false);
50 
51  dGeomID geom() const { return geomID; }
52  dTriMeshDataID triMeshData() const { return triMeshDataID; }
53  ODESurfaceProperties& surf() { return surface; }
54 
55  private:
56  dTriMeshDataID triMeshDataID;
57  dGeomID geomID;
58 
59  dReal* verts;
60  int* indices;
61  dReal* normals;
62  int numVerts;
63  int numTris;
64  int numVertComponents;
65 
66  AnyCollisionGeometry3D* collisionGeometry;
67  ODESurfaceProperties surface;
68  bool geometrySelfAllocated;
69 };
70 
71 } //namespace Klampt
72 
73 #endif
surface properties for any ODE rigid object, robot link, or fixed object.
Definition: ODESurface.h:10
Definition: ContactDistance.h:6
An ODE collision geometry.
Definition: ODEGeometry.h:19