Rollback of Move OBJ handling to a mjpDecoder.

PiperOrigin-RevId: 875705083
Change-Id: I21403d84abd56ef72de915bddc724fe3efa506e6
This commit is contained in:
Sam Haves
2026-02-26 07:03:57 -08:00
committed by Copybara-Service
parent 55d7226b06
commit 0ec836b281
12 changed files with 109 additions and 258 deletions
+7 -4
View File
@@ -22,7 +22,6 @@
#include <array>
#include <deque>
#include <functional>
#include <map>
#include <string>
#include <string_view>
#include <unordered_map>
@@ -35,6 +34,10 @@
#include <mujoco/mjtnum.h>
#include "user/user_cache.h"
#include "user/user_util.h"
#include <tiny_obj_loader.h>
using face_vertices_type =
decltype(tinyobj::mesh_t::num_face_vertices)::value_type;
// forward declarations of all mjC/X classes
class mjCError;
@@ -1238,11 +1241,11 @@ class mjCMesh: public mjCMesh_, private mjsMesh {
// load from OBJ, STL, or MSH file; throws mjCError on failure
void LoadFromResource(mjResource* resource, bool remove_repeated = false);
static bool IsObj(std::string_view filename, std::string_view ct = "");
static bool IsSTL(std::string_view filename, std::string_view ct = "");
static bool IsMSH(std::string_view filename, std::string_view ct = "");
bool IsObj() const;
bool IsSTL() const;
bool IsMSH() const;
@@ -1259,7 +1262,7 @@ class mjCMesh: public mjCMesh_, private mjsMesh {
void ProcessVertices(const std::vector<float>& vert, bool remove_repeated = false);
void LoadFromDecoder(mjResource* resource, bool remove_repeated); // load mesh using decoder plugin
void LoadOBJ(mjResource* resource, bool remove_repeated); // load mesh in wavefront OBJ format
void LoadSTL(mjResource* resource); // load mesh in STL BIN format
void LoadMSH(mjResource* resource, bool remove_repeated); // load mesh in MSH BIN format