-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from Tobias-Fischer/fix-invisible-meshes
Fix invisible meshes (fix #74)
- Loading branch information
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
diff --git a/gazebo/rendering/Visual.cc b/gazebo/rendering/Visual.cc | ||
index 14ee82bc5c..d8df743a8b 100644 | ||
--- a/gazebo/rendering/Visual.cc | ||
+++ b/gazebo/rendering/Visual.cc | ||
@@ -626,6 +626,7 @@ void Visual::DetachVisual(const std::string &_name) | ||
////////////////////////////////////////////////// | ||
void Visual::AttachObject(Ogre::MovableObject *_obj) | ||
{ | ||
+ static std::atomic_uint64_t id = 0; | ||
// This code makes plane render before grids. This allows grids to overlay | ||
// planes, and then other elements to overlay both planes and grids. | ||
// if (this->dataPtr->sdf->HasElement("geometry")) | ||
@@ -647,7 +648,7 @@ void Visual::AttachObject(Ogre::MovableObject *_obj) | ||
{ | ||
std::string newMaterialName; | ||
newMaterialName = this->dataPtr->sceneNode->getName() + | ||
- "_MATERIAL_" + material->getName(); | ||
+ "_MATERIAL_" + material->getName() + "_" + boost::lexical_cast<std::string>(id++); | ||
|
||
// keep a pointer to the original submesh material so it can be used | ||
// to restore material state when setting transparency |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters