From 07e161e5299b3e92be9973d757bf02aac8982553 Mon Sep 17 00:00:00 2001 From: Jenn Nguyen Date: Tue, 23 Mar 2021 17:58:46 -0700 Subject: [PATCH 1/2] Fixed collision visual bounding boxes Signed-off-by: Jenn Nguyen --- src/rendering/RenderUtil.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/rendering/RenderUtil.cc b/src/rendering/RenderUtil.cc index 45d0c4a116..017ae6c0a3 100644 --- a/src/rendering/RenderUtil.cc +++ b/src/rendering/RenderUtil.cc @@ -2161,5 +2161,21 @@ void RenderUtil::ViewCollisions(const Entity &_entity) this->dataPtr->viewingCollisions[colEntity] = showCol; colVisual->SetVisible(showCol); + + if (showCol) + { + // turn off wireboxes for collision entity except for most recent + // selected entity (it is still highlighted in entity tree) + if (this->dataPtr->wireBoxes.find(colEntity) + != this->dataPtr->wireBoxes.end() + && colEntity != this->dataPtr->selectedEntities.back()) + { + ignition::rendering::WireBoxPtr wireBox = + this->dataPtr->wireBoxes[colEntity]; + auto visParent = wireBox->Parent(); + if (visParent) + visParent->SetVisible(false); + } + } } } From 4dfe6d32614474aad1819a532d11b0978294e594 Mon Sep 17 00:00:00 2001 From: Jenn Nguyen Date: Tue, 23 Mar 2021 21:06:22 -0700 Subject: [PATCH 2/2] disabled wirebox for selected collision entity toggle Signed-off-by: Jenn Nguyen --- src/rendering/RenderUtil.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/rendering/RenderUtil.cc b/src/rendering/RenderUtil.cc index 017ae6c0a3..382a48ae86 100644 --- a/src/rendering/RenderUtil.cc +++ b/src/rendering/RenderUtil.cc @@ -2164,11 +2164,9 @@ void RenderUtil::ViewCollisions(const Entity &_entity) if (showCol) { - // turn off wireboxes for collision entity except for most recent - // selected entity (it is still highlighted in entity tree) + // turn off wireboxes for collision entity if (this->dataPtr->wireBoxes.find(colEntity) - != this->dataPtr->wireBoxes.end() - && colEntity != this->dataPtr->selectedEntities.back()) + != this->dataPtr->wireBoxes.end()) { ignition::rendering::WireBoxPtr wireBox = this->dataPtr->wireBoxes[colEntity];