39 #include <OgreSceneNode.h> 40 #include <OgreMatrix3.h> 47 Ogre::SceneNode* parent_node )
61 if (!
shape_ || old_message->type != new_message->type)
67 switch( new_message->type )
69 case visualization_msgs::Marker::CUBE: shape_type =
Shape::Cube;
break;
70 case visualization_msgs::Marker::CYLINDER: shape_type =
Shape::Cylinder;
break;
71 case visualization_msgs::Marker::SPHERE: shape_type =
Shape::Sphere;
break;
82 Ogre::Vector3 pos, scale, scale_correct;
83 Ogre::Quaternion orient;
84 transform(new_message, pos, orient, scale);
87 setOrientation( orient * Ogre::Quaternion( Ogre::Degree(90), Ogre::Vector3(1,0,0) ) );
89 scale_correct = Ogre::Quaternion( Ogre::Degree(90), Ogre::Vector3(1,0,0) ) * scale;
94 new_message->color.b, new_message->color.a);
Ogre::SceneNode * scene_node_
bool transform(const MarkerConstPtr &message, Ogre::Vector3 &pos, Ogre::Quaternion &orient, Ogre::Vector3 &scale)
virtual S_MaterialPtr getMaterials()
virtual void setPosition(const Ogre::Vector3 &position)
ShapeMarker(MarkerDisplay *owner, DisplayContext *context, Ogre::SceneNode *parent_node)
void extractMaterials(Ogre::Entity *entity, S_MaterialPtr &materials)
virtual void setColor(float r, float g, float b, float a)
Set the color of the object. Values are in the range [0, 1].
std::pair< std::string, int32_t > MarkerID
Pure-virtual base class for objects which give Display subclasses context in which to work...
boost::shared_ptr< MarkerSelectionHandler > handler_
DisplayContext * context_
visualization_msgs::Marker::ConstPtr MarkerConstPtr
virtual Ogre::SceneManager * getSceneManager() const =0
Returns the Ogre::SceneManager used for the main RenderPanel.
std::set< Ogre::MaterialPtr > S_MaterialPtr
virtual void setOrientation(const Ogre::Quaternion &orientation)
virtual void onNewMessage(const MarkerConstPtr &old_message, const MarkerConstPtr &new_message)
Ogre::SceneNode * getRootNode()
Get the root scene node (pivot node) for this object.
Displays "markers" sent in by other ROS nodes on the "visualization_marker" topic.
virtual void setScale(const Ogre::Vector3 &scale)
Set the scale of the object. Always relative to the identity orientation of the object.
Ogre::Entity * getEntity()