Refactor numerical parsing in XML.

PiperOrigin-RevId: 653979240
Change-Id: I4d39f4041b88396193eb35f0cc393141d64f6fc0
This commit is contained in:
Kyle Bayes
2024-07-19 05:40:54 -07:00
committed by Copybara-Service
parent e92af73cbf
commit 8a8a44a4db
13 changed files with 378 additions and 314 deletions
+6 -3
View File
@@ -62,13 +62,16 @@
#include "user/user_objects.h"
#include "user/user_resource.h"
#include "user/user_util.h"
#include "xml/xml_util.h"
#include <tiny_obj_loader.h>
extern "C" {
#include "qhull_ra.h"
}
namespace {
using mujoco::user::VectorToString;
} // namespace
// compute triangle area, surface normal, center
static double _triangle(double* normal, double* center,
const float* v1, const float* v2, const float* v3) {
@@ -2627,8 +2630,8 @@ void mjCFlex::Compile(const mjVFS* vfs) {
// add plugins
std::string userface, useredge;
mjXUtil::Vector2String(userface, elem_);
mjXUtil::Vector2String(useredge, edgeidx);
userface = VectorToString(elem_);
useredge = VectorToString(edgeidx);
for (const auto& vbodyid : vertbodyid) {
if (model->Bodies()[vbodyid]->plugin.instance) {