Add content_type attribute that takes a MIME type to specify the file contents for meshes, hfields, and textures.
PiperOrigin-RevId: 549302344 Change-Id: I30a8adfef5b5d87bb20479329f3396892f5137ff
This commit is contained in:
committed by
Copybara-Service
parent
5f327b0c31
commit
5fcdae771b
@@ -173,6 +173,10 @@ class mjCBase {
|
||||
// load resource if found (fallback to OS filesystem)
|
||||
mjResource* LoadResource(std::string filename, int provider);
|
||||
|
||||
// Get and sanitize content type from raw_text if not empty, otherwise parse
|
||||
// content type from resource_name; throw on failure
|
||||
std::string GetAssetContentType(std::string_view resource_name, std::string_view raw_text);
|
||||
|
||||
std::string name; // object name
|
||||
std::string classname; // defaults class name
|
||||
int id; // object id
|
||||
@@ -529,6 +533,7 @@ class mjCMesh: public mjCBase {
|
||||
// returns a bounding volume given a face
|
||||
mjCBoundingVolume GetBoundingVolume(int faceid);
|
||||
|
||||
std::string content_type; // content type of file
|
||||
std::string file; // mesh file
|
||||
double refpos[3]; // reference position (translate)
|
||||
double refquat[4]; // reference orientation (rotate)
|
||||
@@ -652,6 +657,7 @@ class mjCHField : public mjCBase {
|
||||
friend class mjXWriter;
|
||||
|
||||
public:
|
||||
std::string content_type; // content type of file
|
||||
std::string file; // file: (nrow, ncol, [elevation data])
|
||||
double size[4]; // hfield size (ignore referencing geom size)
|
||||
int nrow; // number of rows
|
||||
@@ -691,6 +697,7 @@ class mjCTexture : public mjCBase {
|
||||
int width; // width in pixels
|
||||
|
||||
// method 2: single file
|
||||
std::string content_type; // content type of file
|
||||
std::string file; // png file to load; use for all sides of cube
|
||||
int gridsize[2]; // size of grid for composite file; (1,1)-repeat
|
||||
char gridlayout[13]; // row-major: L,R,F,B,U,D for faces; . for unused
|
||||
|
||||
Reference in New Issue
Block a user