Dummy Primitive which returns 0 for geom and body. More...
#include <primitive.h>
Inherits lpzrobots::Primitive.
Public Member Functions | |
DummyPrimitive () | |
virtual void | init (const OdeHandle &odeHandle, double mass, const OsgHandle &osgHandle, char mode=Body|Geom|Draw) |
registers primitive in ODE and OSG. | |
virtual void | update () |
Updates the OSG nodes with ODE coordinates. | |
virtual OSGPrimitive * | getOSGPrimitive () |
returns the assoziated osg primitive if there or 0 | |
virtual void | setMass (double mass) |
sets the mass of the body (uniform) | |
virtual void | setPosition (Pos pos) |
virtual Pos | getPosition () const |
returns the position | |
virtual void | setVel (Pos vel) |
virtual Pos | getVel () const |
returns the velocity |
Dummy Primitive which returns 0 for geom and body.
Only useful for representing the static world in terms of primitives or if virtual objects are created, but then the position and speed has to be set manually.
DummyPrimitive | ( | ) | [inline] |
virtual OSGPrimitive* getOSGPrimitive | ( | ) | [inline, virtual] |
returns the assoziated osg primitive if there or 0
Implements Primitive.
virtual Pos getPosition | ( | ) | const [inline, virtual] |
returns the position
Reimplemented from Primitive.
virtual void init | ( | const OdeHandle & | odeHandle, | |
double | mass, | |||
const OsgHandle & | osgHandle, | |||
char | mode = Body|Geom|Draw | |||
) | [inline, virtual] |
registers primitive in ODE and OSG.
osgHandle | scruct with ODE variables inside (to specify space, world...) | |
mass | Mass of the object in ODE (if withBody = true) | |
osgHandle | scruct with OSG variables inside (scene node, color ...) | |
mode | is a conjuction of Modes. |
Implements Primitive.
virtual void setMass | ( | double | mass | ) | [inline, virtual] |
sets the mass of the body (uniform)
Implements Primitive.
virtual void setPosition | ( | Pos | pos | ) | [inline, virtual] |
virtual void setVel | ( | Pos | vel | ) | [inline, virtual] |
virtual void update | ( | ) | [inline, virtual] |
Updates the OSG nodes with ODE coordinates.
This function must be overloaded (usually calls setMatrix of OsgPrimitives)
Implements Primitive.