33 #include <OgreMeshManager.h> 34 #include <OgreSceneManager.h> 35 #include <OgreSceneNode.h> 36 #include <OgreEntity.h> 37 #include <OgreMaterialManager.h> 38 #include <OgreManualObject.h> 41 #include <boost/lexical_cast.hpp> 47 :
Shape(
Shape::Mesh, scene_manager, parent_node )
50 static uint32_t count = 0;
51 manual_object_ = scene_manager->createManualObject(
"MeshShape_ManualObject" + boost::lexical_cast<std::string>(count++));
52 material_->setCullingMode(Ogre::CULL_NONE);
71 ROS_WARN(
"Cannot modify mesh once construction is complete");
95 void MeshShape::addVertex(
const Ogre::Vector3& position,
const Ogre::Vector3& normal,
const Ogre::ColourValue &color)
124 static uint32_t count = 0;
125 std::string name =
"ConvertedMeshShape@" + boost::lexical_cast<std::string>(count++);
134 ROS_ERROR(
"Unable to construct triangle mesh");
145 Ogre::MeshManager::getSingleton().remove(
entity_->getMesh()->getName());
void addColor(const Ogre::ColourValue &color)
Add color for a vertex.
void endTriangles()
Notify that the set of triangles to add is complete. No more triangles can be added, beginTriangles() can no longer be called unless clear() was called.
Ogre::SceneNode * offset_node_
std::string material_name_
Ogre::MaterialPtr material_
void addVertex(const Ogre::Vector3 &position)
Add a vertex to the mesh (no normal defined). If using this function only (not using addTriangle()) i...
void clear()
Clear the mesh.
void addTriangle(unsigned int p1, unsigned int p2, unsigned int p3)
Add a triangle by indexing in the defined vertices.
MeshShape(Ogre::SceneManager *scene_manager, Ogre::SceneNode *parent_node=NULL)
Constructor.
Ogre::ManualObject * manual_object_
void addNormal(const Ogre::Vector3 &normal)
Add normal for a vertex.
void estimateVertexCount(size_t vcount)
void beginTriangles()
Start adding triangles to the mesh.
Ogre::SceneManager * scene_manager_
Ogre scene manager this object is part of.