Robot Simulator of the Robotics Group for Self-Organization of Control  0.8.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
heightfieldprimitive.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005-2011 LpzRobots development team *
3  * Georg Martius <georg dot martius at web dot de> *
4  * Frank Guettler <guettler at informatik dot uni-leipzig dot de *
5  * Frank Hesse <frank at nld dot ds dot mpg dot de> *
6  * Ralf Der <ralfder at mis dot mpg dot de> *
7  * *
8  * This program is free software; you can redistribute it and/or modify *
9  * it under the terms of the GNU General Public License as published by *
10  * the Free Software Foundation; either version 2 of the License, or *
11  * (at your option) any later version. *
12  * *
13  * This program is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16  * GNU General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU General Public License *
19  * along with this program; if not, write to the *
20  * Free Software Foundation, Inc., *
21  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
22  * *
23  ***************************************************************************/
24 #ifndef __HEIGHTFIELDPRIMITIVES_H
25 #define __HEIGHTFIELDPRIMITIVES_H
26 
27 #include "primitive.h"
28 #include "osgheightfield.h"
29 #include <ode-dbl/ode.h>
30 
31 namespace lpzrobots {
32 
33 
34  /** Height field primitive */
35  class HeightField : public Primitive {
36  public:
37  HeightField(const std::string& filename, float x_size, float y_size, float height);
38  HeightField(osg::HeightField* heightfield, float x_size, float y_size);
39 
40  virtual ~HeightField();
41  virtual void init(const OdeHandle& odeHandle, double mass,
42  const OsgHandle& osgHandle,
43  char mode = Body | Geom | Draw) ;
44 
45 
46  virtual void setPose(const osg::Matrix& pose);
47 
48  virtual void update();
50 
51  virtual void setMass(double mass, bool density = false) {}
52 
53  protected:
55  dTriMeshDataID data;
56 
57  };
58 
59 
60 }
61 
62 #endif
virtual OSGPrimitive * getOSGPrimitive()
returns the assoziated osg primitive if there or 0
Definition: heightfieldprimitive.h:49
Data structure for accessing the ODE.
Definition: odehandle.h:44
Matrixd Matrix
Definition: osgforwarddecl.h:47
virtual void init(const OdeHandle &odeHandle, double mass, const OsgHandle &osgHandle, char mode=Body|Geom|Draw)
registers primitive in ODE and OSG.
Definition: heightfieldprimitive.cpp:72
Interface class for graphic primitives like spheres, boxes, and meshes, which can be drawn by OSG...
Definition: osgprimitive.h:62
virtual void update()
Updates the OSG nodes with ODE coordinates.
Definition: heightfieldprimitive.cpp:172
HeightField(const std::string &filename, float x_size, float y_size, float height)
Definition: heightfieldprimitive.cpp:57
virtual void setPose(const osg::Matrix &pose)
set the pose of the primitive
Definition: heightfieldprimitive.cpp:178
Data structure for accessing the OpenSceneGraph.
Definition: osghandle.h:79
char mode
Definition: primitive.h:236
Definition: primitive.h:89
virtual ~HeightField()
Definition: heightfieldprimitive.cpp:67
Height field primitive.
Definition: heightfieldprimitive.h:35
dTriMeshDataID data
Definition: heightfieldprimitive.h:55
Definition: primitive.h:89
Definition: primitive.h:89
Interface class for primitives represented in the physical and graphical world.
Definition: primitive.h:80
Graphical HeightField.
Definition: osgheightfield.h:36
virtual void setMass(double mass, bool density=false)
sets the mass of the body (uniform) if density==true then mass is interpreted as a density ...
Definition: heightfieldprimitive.h:51
OSGHeightField * osgheightfield
Definition: heightfieldprimitive.h:54