#include <primitive.h>
Inherited by Box, Capsule, Cylinder, DummyPrimitive, HeightField, InvisibleBox, InvisibleCapsule, InvisibleSphere, Mesh, Plane, Sphere, and Transform.
Inheritance diagram for Primitive:

Public Types | |
| Body = 1 | |
| Geom = 2 | |
| Draw = 4 | |
| enum | Modes { Body = 1, Geom = 2, Draw = 4 } |
| Body means that it is a dynamic object with a body. More... | |
Public Member Functions | |
| Primitive () | |
| virtual | ~Primitive () |
| virtual void | init (const OdeHandle &odeHandle, double mass, const OsgHandle &osgHandle, char mode=Body|Geom|Draw)=0 |
| registers primitive in ODE and OSG. | |
| virtual void | update ()=0 |
| Updates the OSG nodes with ODE coordinates. | |
| virtual OSGPrimitive * | getOSGPrimitive ()=0 |
| returns the assoziated osg primitive if there or 0 | |
| virtual void | setTexture (const std::string &filename) |
| assigns a texture to the primitive | |
| virtual void | setTexture (const std::string &filename, bool repeatOnX, bool repeatOnY) |
| assigns a texture to the primitive, you can choose if the texture should be repeated | |
| void | setPosition (const osg::Vec3 &pos) |
| set the position of the primitive (orientation is preserved) | |
| void | setPose (const osg::Matrix &pose) |
| set the pose of the primitive | |
| osg::Vec3 | getPosition () const |
| returns the position | |
| osg::Matrix | getPose () const |
| returns the pose | |
| dGeomID | getGeom () const |
| returns ODE geomID if there | |
| dBodyID | getBody () const |
| returns ODE bodyID if there | |
Protected Attributes | |
| dGeomID | geom |
| dBodyID | body |
| char | mode |
This is intended to bring OSG and ODE together and hide most implementation details.
| enum Modes |
| Primitive | ( | ) |
| ~Primitive | ( | ) | [virtual] |
| dBodyID getBody | ( | ) | const |
returns ODE bodyID if there
| dGeomID getGeom | ( | ) | const |
returns ODE geomID if there
| virtual OSGPrimitive* getOSGPrimitive | ( | ) | [pure virtual] |
returns the assoziated osg primitive if there or 0
Implemented in HeightField, InvisibleBox, InvisibleSphere, InvisibleCapsule, Plane, Box, Sphere, Capsule, Cylinder, Mesh, Transform, and DummyPrimitive.
| osg::Matrix getPose | ( | ) | const |
returns the pose
| osg::Vec3 getPosition | ( | ) | const |
returns the position
| virtual void init | ( | const OdeHandle & | odeHandle, | |
| double | mass, | |||
| const OsgHandle & | osgHandle, | |||
| char | mode = Body|Geom|Draw | |||
| ) | [pure 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. |
Implemented in HeightField, InvisibleBox, InvisibleSphere, InvisibleCapsule, Plane, Box, Sphere, Capsule, Cylinder, Mesh, Transform, and DummyPrimitive.
| void setPose | ( | const osg::Matrix & | pose | ) |
| void setPosition | ( | const osg::Vec3 & | pos | ) |
set the position of the primitive (orientation is preserved)
| void setTexture | ( | const std::string & | filename, | |
| bool | repeatOnX, | |||
| bool | repeatOnY | |||
| ) | [virtual] |
assigns a texture to the primitive, you can choose if the texture should be repeated
| void setTexture | ( | const std::string & | filename | ) | [virtual] |
assigns a texture to the primitive
| virtual void update | ( | ) | [pure virtual] |
Updates the OSG nodes with ODE coordinates.
This function must be overloaded (usually calls setMatrix of OsgPrimitives)
Implemented in HeightField, InvisibleBox, InvisibleSphere, InvisibleCapsule, Plane, Box, Sphere, Capsule, Cylinder, Mesh, Transform, and DummyPrimitive.
dBodyID body [protected] |
dGeomID geom [protected] |
char mode [protected] |
1.4.7