Skip to content

Commit

Permalink
[GUI/Visual] Adapt visual_utils to scale removal
Browse files Browse the repository at this point in the history
  • Loading branch information
arntanguy committed Feb 2, 2024
1 parent e5cabaa commit 81bffd6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions include/mc_rtc/visual_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,20 @@ inline rbd::parsers::Visual makeVisualBox(const Eigen::Vector3d & dim, const mc_
inline constexpr auto getVisualBox = details::getVisualGeometry<rbd::parsers::Geometry::Type::BOX>;

/** Returns a new Visual that holds a Mesh object */
inline rbd::parsers::Visual makeVisualMesh(const std::string & path, double scale)
inline rbd::parsers::Visual makeVisualMesh(const std::string & path, Eigen::Vector3d scaleV)
{
rbd::parsers::Geometry::Mesh m;
m.filename = path;
m.scale = scale;
m.scaleV = scaleV;
return details::makeVisual(m, {});
}

/** Returns a new Visual that holds a Mesh object */
inline rbd::parsers::Visual makeVisualMesh(const std::string & path, double scale)
{
return makeVisualMesh(path, Eigen::Vector3d(scale, scale, scale));
}

/** Get the mesh data if the visual is a mesh, throws otherwise */
inline constexpr auto getVisualMesh = details::getVisualGeometry<rbd::parsers::Geometry::Type::MESH>;

Expand Down

0 comments on commit 81bffd6

Please sign in to comment.