Skip to content

Commit

Permalink
Merge pull request robotology#845 from S-Dafarra/fix_minor_visualizat…
Browse files Browse the repository at this point in the history
…ion_bugs

Fixed some minor bugs in the visualization.
  • Loading branch information
traversaro authored Apr 8, 2021
2 parents a75f105 + 3d80d56 commit 5d9d7a2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/visualization/src/Environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ bool Environment::removeLight(const std::string& lightName)
m_lights[i]->removeLight();
delete m_lights[i];
m_lights[i] = nullptr;
std::vector<Light*>::iterator it;
std::vector<Light*>::iterator it = m_lights.begin();
std::advance(it,i);
m_lights.erase(it);
return true;
Expand Down
6 changes: 5 additions & 1 deletion src/visualization/src/IrrlichtUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,18 @@ inline irr::scene::ISceneNode * addGeometryToSceneManager(const iDynTree::SolidS
// mesh has a specific formal (for now collada) that we now specifies internally materials
bool use_iDynTree_material = true;

irr::scene::ISceneNode * geomNode = 0;
irr::scene::IMeshSceneNode * geomNode = 0;

if (geom->isBox())
{
const iDynTree::Box* box = geom->asBox();

irr::scene::IMesh* boxMesh = smgr->getGeometryCreator()->createCubeMesh(irr::core::vector3df(box->getX(),box->getY(),box->getZ()));

irr::core::matrix4 irr2idyntree;
irr2idyntree.buildRotateFromTo(irr::core::vector3df(0.0,1.0,0.0),irr::core::vector3df(0.0,0.0,1.0));
smgr->getMeshManipulator()->transform(boxMesh,irr2idyntree);

geomNode = smgr->addMeshSceneNode(boxMesh,linkNode);

boxMesh->drop();
Expand Down

0 comments on commit 5d9d7a2

Please sign in to comment.