Skip to content

Commit

Permalink
Adding cone primitives.
Browse files Browse the repository at this point in the history
Squashing commits to make requested target of main with backports to
harmonic.

Signed-off-by: Benjamin Perseghetti <[email protected]>
  • Loading branch information
bperseghetti committed May 15, 2024
1 parent aad19ea commit 754ca30
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/plugins/marker_manager/MarkerManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,8 @@ MarkerManager::Implementation::MsgToType(const gz::msgs::Marker &_msg)
return gz::rendering::MarkerType::MT_BOX;
case gz::msgs::Marker::CAPSULE:
return gz::rendering::MarkerType::MT_CAPSULE;
case gz::msgs::Marker::CONE:
return gz::rendering::MarkerType::MT_CONE;
case gz::msgs::Marker::CYLINDER:
return gz::rendering::MarkerType::MT_CYLINDER;
case gz::msgs::Marker::LINE_STRIP:
Expand Down
7 changes: 7 additions & 0 deletions src/plugins/transport_scene_manager/TransportSceneManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,13 @@ rendering::GeometryPtr TransportSceneManager::Implementation::LoadGeometry(
if (_msg.box().has_size())
scale = msgs::Convert(_msg.box().size());
}
else if (_msg.has_cone())
{
geom = this->scene->CreateCone();
scale.X() = _msg.cone().radius() * 2;
scale.Y() = scale.X();
scale.Z() = _msg.cone().length();
}
else if (_msg.has_cylinder())
{
geom = this->scene->CreateCylinder();
Expand Down

0 comments on commit 754ca30

Please sign in to comment.