diff --git a/include/mc_rtc/visual_utils.h b/include/mc_rtc/visual_utils.h index ef71f63e8d..e6932855d6 100644 --- a/include/mc_rtc/visual_utils.h +++ b/include/mc_rtc/visual_utils.h @@ -103,14 +103,20 @@ inline rbd::parsers::Visual makeVisualBox(const Eigen::Vector3d & dim, const mc_ inline constexpr auto getVisualBox = details::getVisualGeometry; /** 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; diff --git a/src/mc_rbdyn/configuration_io.cpp b/src/mc_rbdyn/configuration_io.cpp index 53291c6e4d..23282b415d 100644 --- a/src/mc_rbdyn/configuration_io.cpp +++ b/src/mc_rbdyn/configuration_io.cpp @@ -685,7 +685,7 @@ rbd::parsers::Geometry::Mesh ConfigurationLoader:: { rbd::parsers::Geometry::Mesh m; m.filename = static_cast(config("filename")); - m.scale = config("scale"); + m.scaleV = config("scaleV"); return m; } @@ -693,7 +693,7 @@ mc_rtc::Configuration ConfigurationLoader::save(co { mc_rtc::Configuration config; config.add("filename", m.filename); - config.add("scale", m.scale); + config.add("scaleV", m.scaleV); return config; } diff --git a/tests/testJsonIO.cpp b/tests/testJsonIO.cpp index 6f351063df..77bfd33dd3 100644 --- a/tests/testJsonIO.cpp +++ b/tests/testJsonIO.cpp @@ -274,7 +274,7 @@ bool operator==(const Geometry::Sphere & lhs, const Geometry::Sphere & rhs) bool operator==(const Geometry::Mesh & lhs, const Geometry::Mesh & rhs) { - return lhs.filename == rhs.filename && lhs.scale == rhs.scale; + return lhs.filename == rhs.filename && lhs.scaleV == rhs.scaleV; } bool operator==(const Geometry::Superellipsoid & lhs, const Geometry::Superellipsoid & rhs)