Copy texture coordinates from OBJ into flex. Fixes #2464.

PiperOrigin-RevId: 732109960
Change-Id: I506b3540ab5d489ce8f10d0c473919611ccb654a
This commit is contained in:
Alessio Quaglino
2025-02-28 06:03:11 -08:00
committed by Copybara-Service
parent 06e217df7e
commit 7651cb1b33
19 changed files with 117 additions and 15 deletions
+8 -3
View File
@@ -3916,9 +3916,14 @@ cases, the user will specify a :el:`flexcomp` which will then automatically cons
.. _deformable-flex-texcoord:
:at:`texcoord`: :at-val:`real(2*nvert), optional`
Texture coordinates for each vertex. If omitted, texture mapping for this flex is disabled, even if a texture is
specified in the material.
:at:`texcoord`: :at-val:`real(2*vert or ntexcoord), optional`
Texture coordinates. If omitted, texture mapping for this flex is disabled, even if a texture is specified in the
material.
.. _deformable-flex-facetexcoord:
:at:`facetexcoord`: :at-val:`int((dim+1)*nelem), optional`
Texture indices for each face. If omitted, texture are assumed to be vertex-based.
.. _deformable-flex-element:
+3 -1
View File
@@ -485,7 +485,9 @@
| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ |
| | | | :ref:`material<deformable-flex-material>` | :ref:`rgba<deformable-flex-rgba>` | :ref:`flatskin<deformable-flex-flatskin>` | :ref:`body<deformable-flex-body>` | |
| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ |
| | | | :ref:`vertex<deformable-flex-vertex>` | :ref:`element<deformable-flex-element>` | :ref:`texcoord<deformable-flex-texcoord>` | :ref:`node<deformable-flex-node>` | |
| | | | :ref:`vertex<deformable-flex-vertex>` | :ref:`element<deformable-flex-element>` | :ref:`texcoord<deformable-flex-texcoord>` | :ref:`facetexcoord<deformable-flex-facetexcoord>` | |
| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ |
| | | | :ref:`node<deformable-flex-node>` | | | | |
| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ |
+------------------------------------+----+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |_2| flex |br| |_2| |L| | | .. table:: |
+3
View File
@@ -1177,6 +1177,7 @@ struct mjModel_ {
int* flex_vertbodyid; // vertex body ids (nflexvert x 1)
int* flex_edge; // edge vertex ids (2 per edge) (nflexedge x 2)
int* flex_elem; // element vertex ids (dim+1 per elem) (nflexelemdata x 1)
int* flex_elemtexcoord; // element texture coordinates (dim+1) (nflexelemdata x 1)
int* flex_elemedge; // element edge ids (nflexelemedge x 1)
int* flex_elemlayer; // element distance from surface, 3D only (nflexelem x 1)
int* flex_shell; // shell fragment vertex ids (dim per frag) (nflexshelldata x 1)
@@ -2009,6 +2010,7 @@ typedef struct mjsFlex_ { // flex specification
mjDoubleVec* vert; // vertex positions
mjIntVec* elem; // element vertex ids
mjFloatVec* texcoord; // vertex texture coordinates
mjIntVec* facetexcoord; // face texture coordinates
// other
mjString* info; // message appended to compiler errors
@@ -2997,6 +2999,7 @@ struct mjvSceneState_ {
int* flex_vertadr;
int* flex_vertnum;
int* flex_elem;
int* flex_elemtexcoord;
int* flex_elemlayer;
int* flex_elemadr;
int* flex_elemnum;