2 #include <OgreSceneNode.h>
3 #include <OgreSceneManager.h>
17 : scene_manager_(scene_manager), parent_node_(parent_node)
33 value = std::min(value, 1.0
f);
34 value = std::max(value, 0.0
f);
36 float h = value * 5.0f + 1.0f;
44 color[0] = n, color[1] = 0, color[2] = 1;
46 color[0] = 0, color[1] = n, color[2] = 1;
48 color[0] = 0, color[1] = 1, color[2] = n;
50 color[0] = n, color[1] = 1, color[2] = 0;
52 color[0] = 1, color[1] = n, color[2] = 0;
57 bool enabled =
effort_enabled_.insert(std::make_pair(joint_name,
true)).first->second;
78 if (max_effort != 0.0)
80 effort_value = std::min(fabs(effort) / max_effort, 1.0) + 0.05;
84 effort_value = fabs(effort) + 0.05;
97 Ogre::Vector3(0, 0.05 + effort_value *
scale_ * 0.5, 0) +
101 for (
int i = 0; i < 30; i++)
103 Ogre::Vector3 point =
104 Ogre::Vector3((0.05 + effort_value *
scale_ * 0.5) * sin(i * 2 * M_PI / 32),
105 (0.05 + effort_value *
scale_ * 0.5) * cos(i * 2 * M_PI / 32), 0);
110 Ogre::ColourValue color;
112 effort_arrow_[joint_name]->setColor(color.r, color.g, color.b, color.a);
113 effort_circle_[joint_name]->setColor(color.r, color.g, color.b, color.a);