#include <primitive.h>
Inherited by Box, Capsule, Cylinder, DummyPrimitive, HeightField, InvisibleBox, InvisibleCapsule, InvisibleSphere, Mesh, Plane, Sphere, and Transform.
Inheritance diagram for Primitive:
Public Types | |
enum | Modes { Body = 1, Geom = 2, Draw = 4, Child = 8 } |
Body means that it is a dynamic object with a body. More... | |
enum | Category { Dyn = 1, Stat = 2 } |
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 Member Functions | |
virtual void | attachGeomAndSetColliderFlags () |
attaches geom to body (if any) and sets the category bits and collision bitfields. | |
Protected Attributes | |
dGeomID | geom |
dBodyID | body |
char | mode |
This is intended to bring OSG and ODE together and hide most implementation details.
|
|
|
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 Child is only used internally and is used for transformed geoms. |
|
|
|
|
|
attaches geom to body (if any) and sets the category bits and collision bitfields. assumes: mode & Geom != 0 |
|
returns ODE bodyID if there
|
|
returns ODE geomID if there
|
|
returns the assoziated osg primitive if there or 0
Implemented in HeightField, InvisibleBox, InvisibleSphere, InvisibleCapsule, Plane, Box, Sphere, Capsule, Cylinder, Mesh, Transform, and DummyPrimitive.
|
|
returns the pose
|
|
returns the position
|
|
registers primitive in ODE and OSG.
Implemented in HeightField, InvisibleBox, InvisibleSphere, InvisibleCapsule, Plane, Box, Sphere, Capsule, Cylinder, Mesh, Transform, and DummyPrimitive.
|
|
set the pose of the primitive
Reimplemented in HeightField.
|
|
set the position of the primitive (orientation is preserved)
|
|
assigns a texture to the primitive, you can choose if the texture should be repeated
|
|
assigns a texture to the primitive
|
|
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.
|
|
|
|
|
|
|