1
//! Specialized body class.
4
* Predefined body class. Ready to use in a RobotActor.
5
* This body represents the wheels of a robot.
14
#include <srCore/robot/objectBase.h>
19
class ColorVisitor : public osg::NodeVisitor
23
ColorVisitor (const osg::Vec4& pColor): osg::NodeVisitor(TRAVERSE_ALL_CHILDREN), mColor(pColor)
28
virtual void apply(osg::Geode& geode)
31
// osg::StateSet* ss = geode.getOrCreateStateSet();
33
unsigned pNumDrawables = geode.getNumDrawables();
34
for(unsigned i = 0; i < pNumDrawables; ++i)
36
osg::Drawable* draw = geode.getDrawable(i);
37
osg::Material* mat = dynamic_cast<osg::Material*>(draw->getOrCreateStateSet()->getAttribute(osg::StateAttribute::MATERIAL));
40
mat->setDiffuse(osg::Material::FRONT_AND_BACK, mColor);
41
mat->setEmission(osg::Material::FRONT_AND_BACK, mColor);
53
class Led : public ObjectBase
57
/*! @param id a 16bit id, used to set the colliding bit parameter.
58
* @param x, y, z the position of the hinge in the world coordinate system.
59
* @param heading, pitch, roll the orientation of the axis of the hinge in the world coordinate system.
60
* @param Scene the scene in which the body should be placed.
61
* @param osgGroup using this group, another scene will be created that will be used by sensors
64
Led( dtCore::RefPtr<BodyBase> attachedBody,
65
osg::Vec3f translation, osg::Vec3f orientation,
66
std::string name = "noName", std::string type = "noType",
69
//! sets the position of the Body. Only use that while physics is deactivated.
70
void setTranslation(osg::Vec3f pos) {};
72
//! sets the rotation of the Body. Only use that while physics is deactivated.
73
void setRotation(osg::Vec3f hrp) {};
75
void setColor(osg::Vec4 color);