#include <primitive.h>
Inheritance diagram for Primitive:
This is intended to bring OSG and ODE together and hide most implementation details.
Definition at line 87 of file primitive.h.
Public Types | |
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 | |
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 |
|
Body means that it is a dynamic object with a body. Geom means it has a geometrical represenation used for collision detection. Draw means the primitive is drawn Definition at line 93 of file primitive.h. |
|
Definition at line 108 of file primitive.cpp. |
|
Definition at line 112 of file primitive.cpp. |
|
returns ODE bodyID if there
Definition at line 165 of file primitive.cpp. |
|
returns ODE geomID if there
Definition at line 160 of file primitive.cpp. |
|
returns the assoziated osg primitive if there or 0
Implemented in InvisibleBox, InvisibleSphere, InvisibleCapsule, Plane, Box, Sphere, Capsule, Transform, and DummyPrimitive. |
|
returns the pose
Definition at line 155 of file primitive.cpp. |
|
returns the position
Definition at line 150 of file primitive.cpp. |
|
registers primitive in ODE and OSG.
Implemented in InvisibleBox, InvisibleSphere, InvisibleCapsule, Plane, Box, Sphere, Capsule, Transform, and DummyPrimitive. |
|
set the pose of the primitive
Definition at line 127 of file primitive.cpp. |
|
set the position of the primitive (orientation is preserved)
Definition at line 118 of file primitive.cpp. |
|
Updates the OSG nodes with ODE coordinates. This function must be overloaded (usually calls setMatrix of OsgPrimitives) Implemented in InvisibleBox, InvisibleSphere, InvisibleCapsule, Plane, Box, Sphere, Capsule, Transform, and DummyPrimitive. |
|
Definition at line 131 of file primitive.h. |
|
Definition at line 130 of file primitive.h. |
|
Definition at line 132 of file primitive.h. |