Skip to content

Commit

Permalink
Support Capsule and Ellipsoid in Scene3D
Browse files Browse the repository at this point in the history
Signed-off-by: ahcorde <ahcorde@gmail.com>
  • Loading branch information
ahcorde committed Apr 28, 2021
1 parent 4df7622 commit 84f46d0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/plugins/scene3d/Scene3D.cc
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,20 @@ rendering::GeometryPtr SceneManager::LoadGeometry(const msgs::Geometry &_msg,
scale.Y() = scale.X();
scale.Z() = _msg.cylinder().length();
}
else if (_msg.has_capsule())
{
auto capsule = this->scene->CreateCapsule();
capsule->SetRadius(_msg.capsule().radius());
capsule->SetLength(_msg.capsule().length());
geom = capsule;
}
else if (_msg.has_ellipsoid())
{
geom = this->scene->CreateSphere();
scale.X() = _msg.ellipsoid().radii().x() * 2;
scale.Y() = _msg.ellipsoid().radii().y() * 2;
scale.Z() = _msg.ellipsoid().radii().z() * 2;
}
else if (_msg.has_plane())
{
geom = this->scene->CreatePlane();
Expand Down

0 comments on commit 84f46d0

Please sign in to comment.