Disable shadows for geoms of category mjCAT_DECOR. Fixes #1114.
Added `frustum` to `rgba` and `scale` in the `visual` section. PiperOrigin-RevId: 576547599 Change-Id: I69bf528680e3d4a59d6e04f6db99a6d345001d1d
This commit is contained in:
committed by
Copybara-Service
parent
5231a335bf
commit
1a47a97040
@@ -920,6 +920,11 @@ documented below.
|
|||||||
The radius of the capsules used to render slider-crank mechanisms. The second part of the mechanism is automatically
|
The radius of the capsules used to render slider-crank mechanisms. The second part of the mechanism is automatically
|
||||||
scaled relative to this setting.
|
scaled relative to this setting.
|
||||||
|
|
||||||
|
.. _visual-scale-frustum:
|
||||||
|
|
||||||
|
:at:`frustum`: :at-val:`real, "10"`
|
||||||
|
The distance of the zfar plane from the camera pinhole for rendering the frustum.
|
||||||
|
|
||||||
|
|
||||||
.. _visual-rgba:
|
.. _visual-rgba:
|
||||||
|
|
||||||
@@ -1046,6 +1051,11 @@ disables the rendering of the corresponding object.
|
|||||||
Color used to render the crank of slide-crank mechanisms, in model configurations where the specified rod length
|
Color used to render the crank of slide-crank mechanisms, in model configurations where the specified rod length
|
||||||
cannot be maintained, i.e., it is "broken".
|
cannot be maintained, i.e., it is "broken".
|
||||||
|
|
||||||
|
.. _visual-rgba-frustum:
|
||||||
|
|
||||||
|
:at:`frustum`: :at-val:`real(4), "1 1 0 0.2"`
|
||||||
|
Color used to render the camera frustum.
|
||||||
|
|
||||||
|
|
||||||
.. _asset:
|
.. _asset:
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -109,6 +109,8 @@
|
|||||||
| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ |
|
| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ |
|
||||||
| | | | :ref:`framelength<visual-scale-framelength>` | :ref:`framewidth<visual-scale-framewidth>` | :ref:`constraint<visual-scale-constraint>` | :ref:`slidercrank<visual-scale-slidercrank>` | |
|
| | | | :ref:`framelength<visual-scale-framelength>` | :ref:`framewidth<visual-scale-framewidth>` | :ref:`constraint<visual-scale-constraint>` | :ref:`slidercrank<visual-scale-slidercrank>` | |
|
||||||
| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ |
|
| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ |
|
||||||
|
| | | | :ref:`frustum<visual-scale-frustum>` | | | | |
|
||||||
|
| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ |
|
||||||
+------------------------------------+----+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
+------------------------------------+----+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||||
| |_| visual |br| |_| |L| | | .. table:: |
|
| |_| visual |br| |_| |L| | | .. table:: |
|
||||||
| :ref:`rgba | ? | :class: mjcf-attributes |
|
| :ref:`rgba | ? | :class: mjcf-attributes |
|
||||||
@@ -124,7 +126,7 @@
|
|||||||
| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ |
|
| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ |
|
||||||
| | | | :ref:`contacttorque<visual-rgba-contacttorque>` | :ref:`contactgap<visual-rgba-contactgap>` | :ref:`rangefinder<visual-rgba-rangefinder>` | :ref:`constraint<visual-rgba-constraint>` | |
|
| | | | :ref:`contacttorque<visual-rgba-contacttorque>` | :ref:`contactgap<visual-rgba-contactgap>` | :ref:`rangefinder<visual-rgba-rangefinder>` | :ref:`constraint<visual-rgba-constraint>` | |
|
||||||
| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ |
|
| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ |
|
||||||
| | | | :ref:`slidercrank<visual-rgba-slidercrank>` | :ref:`crankbroken<visual-rgba-crankbroken>` | | | |
|
| | | | :ref:`slidercrank<visual-rgba-slidercrank>` | :ref:`crankbroken<visual-rgba-crankbroken>` | :ref:`frustum<visual-rgba-frustum>` | | |
|
||||||
| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ |
|
| | | +-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------------------+ |
|
||||||
+------------------------------------+----+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
+------------------------------------+----+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||||||
| mujoco |br| |L| | | *no attributes* |
|
| mujoco |br| |L| | | *no attributes* |
|
||||||
|
|||||||
@@ -800,6 +800,7 @@ struct mjVisual_ { // visualization options
|
|||||||
float framewidth; // bodyframe axis width
|
float framewidth; // bodyframe axis width
|
||||||
float constraint; // constraint width
|
float constraint; // constraint width
|
||||||
float slidercrank; // slidercrank width
|
float slidercrank; // slidercrank width
|
||||||
|
float frustum; // frustum zfar plane
|
||||||
} scale;
|
} scale;
|
||||||
|
|
||||||
struct { // color of decor elements
|
struct { // color of decor elements
|
||||||
@@ -825,6 +826,7 @@ struct mjVisual_ { // visualization options
|
|||||||
float constraint[4]; // constraint
|
float constraint[4]; // constraint
|
||||||
float slidercrank[4]; // slidercrank
|
float slidercrank[4]; // slidercrank
|
||||||
float crankbroken[4]; // used when crank must be stretched/broken
|
float crankbroken[4]; // used when crank must be stretched/broken
|
||||||
|
float frustum[4]; // camera frustum
|
||||||
} rgba;
|
} rgba;
|
||||||
};
|
};
|
||||||
typedef struct mjVisual_ mjVisual;
|
typedef struct mjVisual_ mjVisual;
|
||||||
|
|||||||
@@ -505,6 +505,7 @@ struct mjVisual_ { // visualization options
|
|||||||
float framewidth; // bodyframe axis width
|
float framewidth; // bodyframe axis width
|
||||||
float constraint; // constraint width
|
float constraint; // constraint width
|
||||||
float slidercrank; // slidercrank width
|
float slidercrank; // slidercrank width
|
||||||
|
float frustum; // frustum zfar plane
|
||||||
} scale;
|
} scale;
|
||||||
|
|
||||||
struct { // color of decor elements
|
struct { // color of decor elements
|
||||||
@@ -530,6 +531,7 @@ struct mjVisual_ { // visualization options
|
|||||||
float constraint[4]; // constraint
|
float constraint[4]; // constraint
|
||||||
float slidercrank[4]; // slidercrank
|
float slidercrank[4]; // slidercrank
|
||||||
float crankbroken[4]; // used when crank must be stretched/broken
|
float crankbroken[4]; // used when crank must be stretched/broken
|
||||||
|
float frustum[4]; // camera frustum
|
||||||
} rgba;
|
} rgba;
|
||||||
};
|
};
|
||||||
typedef struct mjVisual_ mjVisual;
|
typedef struct mjVisual_ mjVisual;
|
||||||
|
|||||||
@@ -578,6 +578,11 @@ STRUCTS: Mapping[str, StructDecl] = dict([
|
|||||||
type=ValueType(name='float'),
|
type=ValueType(name='float'),
|
||||||
doc='slidercrank width',
|
doc='slidercrank width',
|
||||||
),
|
),
|
||||||
|
StructFieldDecl(
|
||||||
|
name='frustum',
|
||||||
|
type=ValueType(name='float'),
|
||||||
|
doc='frustum zfar plane',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
doc='',
|
doc='',
|
||||||
@@ -762,6 +767,14 @@ STRUCTS: Mapping[str, StructDecl] = dict([
|
|||||||
),
|
),
|
||||||
doc='used when crank must be stretched/broken',
|
doc='used when crank must be stretched/broken',
|
||||||
),
|
),
|
||||||
|
StructFieldDecl(
|
||||||
|
name='frustum',
|
||||||
|
type=ArrayType(
|
||||||
|
inner_type=ValueType(name='float'),
|
||||||
|
extents=(4,),
|
||||||
|
),
|
||||||
|
doc='camera frustum',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
doc='',
|
doc='',
|
||||||
|
|||||||
@@ -147,7 +147,8 @@ MjVisualRgbaWrapper::MjWrapper()
|
|||||||
X(rangefinder),
|
X(rangefinder),
|
||||||
X(constraint),
|
X(constraint),
|
||||||
X(slidercrank),
|
X(slidercrank),
|
||||||
X(crankbroken) {}
|
X(crankbroken),
|
||||||
|
X(frustum) {}
|
||||||
|
|
||||||
MjVisualRgbaWrapper::MjWrapper(raw::MjVisualRgba* ptr, py::handle owner)
|
MjVisualRgbaWrapper::MjWrapper(raw::MjVisualRgba* ptr, py::handle owner)
|
||||||
: WrapperBase(ptr, owner),
|
: WrapperBase(ptr, owner),
|
||||||
@@ -172,7 +173,8 @@ MjVisualRgbaWrapper::MjWrapper(raw::MjVisualRgba* ptr, py::handle owner)
|
|||||||
X(rangefinder),
|
X(rangefinder),
|
||||||
X(constraint),
|
X(constraint),
|
||||||
X(slidercrank),
|
X(slidercrank),
|
||||||
X(crankbroken) {}
|
X(crankbroken),
|
||||||
|
X(frustum) {}
|
||||||
#undef X
|
#undef X
|
||||||
|
|
||||||
MjVisualRgbaWrapper::MjWrapper(const MjVisualRgbaWrapper& other)
|
MjVisualRgbaWrapper::MjWrapper(const MjVisualRgbaWrapper& other)
|
||||||
@@ -1488,6 +1490,7 @@ PYBIND11_MODULE(_structs, m) {
|
|||||||
X(framewidth);
|
X(framewidth);
|
||||||
X(constraint);
|
X(constraint);
|
||||||
X(slidercrank);
|
X(slidercrank);
|
||||||
|
X(frustum);
|
||||||
#undef X
|
#undef X
|
||||||
|
|
||||||
py::class_<MjVisualRgbaWrapper> mjVisualRgba(mjVisual, "Rgba");
|
py::class_<MjVisualRgbaWrapper> mjVisualRgba(mjVisual, "Rgba");
|
||||||
@@ -1522,6 +1525,7 @@ PYBIND11_MODULE(_structs, m) {
|
|||||||
X(constraint);
|
X(constraint);
|
||||||
X(slidercrank);
|
X(slidercrank);
|
||||||
X(crankbroken);
|
X(crankbroken);
|
||||||
|
X(frustum);
|
||||||
#undef X
|
#undef X
|
||||||
|
|
||||||
#define X(var) \
|
#define X(var) \
|
||||||
|
|||||||
@@ -232,6 +232,7 @@ class MjWrapper<raw::MjVisualRgba> : public WrapperBase<raw::MjVisualRgba> {
|
|||||||
X(constraint);
|
X(constraint);
|
||||||
X(slidercrank);
|
X(slidercrank);
|
||||||
X(crankbroken);
|
X(crankbroken);
|
||||||
|
X(frustum);
|
||||||
#undef X
|
#undef X
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -245,6 +245,7 @@ void mj_defaultVisual(mjVisual* vis) {
|
|||||||
vis->scale.framewidth = 0.1;
|
vis->scale.framewidth = 0.1;
|
||||||
vis->scale.constraint = 0.1;
|
vis->scale.constraint = 0.1;
|
||||||
vis->scale.slidercrank = 0.2;
|
vis->scale.slidercrank = 0.2;
|
||||||
|
vis->scale.frustum = 10.0;
|
||||||
|
|
||||||
// colors
|
// colors
|
||||||
setf4(vis->rgba.fog, 0., 0., 0., 1.);
|
setf4(vis->rgba.fog, 0., 0., 0., 1.);
|
||||||
@@ -269,6 +270,7 @@ void mj_defaultVisual(mjVisual* vis) {
|
|||||||
setf4(vis->rgba.constraint, .9, .0, .0, 1.);
|
setf4(vis->rgba.constraint, .9, .0, .0, 1.);
|
||||||
setf4(vis->rgba.slidercrank, .5, .3, .8, 1.);
|
setf4(vis->rgba.slidercrank, .5, .3, .8, 1.);
|
||||||
setf4(vis->rgba.crankbroken, .9, .0, .0, 1.);
|
setf4(vis->rgba.crankbroken, .9, .0, .0, 1.);
|
||||||
|
setf4(vis->rgba.frustum, 1., 1., .0, .2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1407,7 +1407,7 @@ void mjv_addGeoms(const mjModel* m, mjData* d, const mjvOption* vopt,
|
|||||||
FINISH
|
FINISH
|
||||||
|
|
||||||
// set type and category: frame
|
// set type and category: frame
|
||||||
objtype = mjOBJ_UNKNOWN;
|
objtype = mjOBJ_UNKNOWN;
|
||||||
category = mjCAT_DECOR;
|
category = mjCAT_DECOR;
|
||||||
if (!(category & catmask) || vopt->frame != mjFRAME_GEOM) {
|
if (!(category & catmask) || vopt->frame != mjFRAME_GEOM) {
|
||||||
continue;
|
continue;
|
||||||
@@ -1483,7 +1483,7 @@ void mjv_addGeoms(const mjModel* m, mjData* d, const mjvOption* vopt,
|
|||||||
FINISH
|
FINISH
|
||||||
|
|
||||||
// set category for site frame
|
// set category for site frame
|
||||||
category = mjCAT_DECOR;
|
category = mjCAT_DECOR;
|
||||||
if (!(category & catmask) || vopt->frame != mjFRAME_SITE) {
|
if (!(category & catmask) || vopt->frame != mjFRAME_SITE) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1563,7 +1563,7 @@ void mjv_addGeoms(const mjModel* m, mjData* d, const mjvOption* vopt,
|
|||||||
FINISH
|
FINISH
|
||||||
|
|
||||||
// set category for camera frame
|
// set category for camera frame
|
||||||
category = mjCAT_DECOR;
|
category = mjCAT_DECOR;
|
||||||
if (!(category & catmask) || vopt->frame != mjFRAME_CAMERA) {
|
if (!(category & catmask) || vopt->frame != mjFRAME_CAMERA) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1600,11 +1600,13 @@ void mjv_addGeoms(const mjModel* m, mjData* d, const mjvOption* vopt,
|
|||||||
|
|
||||||
// camera frustum
|
// camera frustum
|
||||||
if (vopt->flags[mjVIS_CAMERA]) {
|
if (vopt->flags[mjVIS_CAMERA]) {
|
||||||
float rgba[] = {1, 1, 0, .2};
|
objtype = mjOBJ_CAMERA;
|
||||||
|
category = mjCAT_DECOR;
|
||||||
|
const float* rgba = m->vis.rgba.frustum;
|
||||||
mjtNum vnear[4][3], vfar[4][3];
|
mjtNum vnear[4][3], vfar[4][3];
|
||||||
mjtNum center[3];
|
mjtNum center[3];
|
||||||
mjtNum znear = m->vis.map.znear * m->stat.extent;
|
mjtNum znear = m->vis.map.znear * m->stat.extent;
|
||||||
mjtNum zfar = m->vis.map.zfar * m->stat.extent;
|
mjtNum zfar = m->vis.scale.frustum * scl;
|
||||||
float zver[2], zhor[2];
|
float zver[2], zhor[2];
|
||||||
for (int i=0; i < m->ncam; i++) {
|
for (int i=0; i < m->ncam; i++) {
|
||||||
if (m->cam_sensorsize[2*i+1] == 0) {
|
if (m->cam_sensorsize[2*i+1] == 0) {
|
||||||
@@ -1710,7 +1712,7 @@ void mjv_addGeoms(const mjModel* m, mjData* d, const mjvOption* vopt,
|
|||||||
FINISH
|
FINISH
|
||||||
|
|
||||||
// set category for light frame
|
// set category for light frame
|
||||||
category = mjCAT_DECOR;
|
category = mjCAT_DECOR;
|
||||||
if (!(category & catmask) || vopt->frame != mjFRAME_LIGHT) {
|
if (!(category & catmask) || vopt->frame != mjFRAME_LIGHT) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -215,8 +215,8 @@ static void renderGeom(const mjvGeom* geom, int mode, const float* headpos,
|
|||||||
float rgba[4] = {geom->rgba[0], geom->rgba[1], geom->rgba[2], geom->rgba[3]};
|
float rgba[4] = {geom->rgba[0], geom->rgba[1], geom->rgba[2], geom->rgba[3]};
|
||||||
int behind, whichface, lighting;
|
int behind, whichface, lighting;
|
||||||
|
|
||||||
// lines to do not cast shadows
|
// lines and triangles do not cast shadows
|
||||||
if (mode == mjrRND_SHADOWCAST && geom->type == mjGEOM_LINE) {
|
if (mode == mjrRND_SHADOWCAST && (geom->type == mjGEOM_LINE || geom->category == mjCAT_DECOR)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -121,14 +121,14 @@ static const char* MJCF[nMJCF][mjXATTRNUM] = {
|
|||||||
{"map", "?", "13", "stiffness", "stiffnessrot", "force", "torque", "alpha",
|
{"map", "?", "13", "stiffness", "stiffnessrot", "force", "torque", "alpha",
|
||||||
"fogstart", "fogend", "znear", "zfar", "haze", "shadowclip", "shadowscale",
|
"fogstart", "fogend", "znear", "zfar", "haze", "shadowclip", "shadowscale",
|
||||||
"actuatortendon"},
|
"actuatortendon"},
|
||||||
{"scale", "?", "16", "forcewidth", "contactwidth", "contactheight", "connect", "com",
|
{"scale", "?", "17", "forcewidth", "contactwidth", "contactheight", "connect", "com",
|
||||||
"camera", "light", "selectpoint", "jointlength", "jointwidth", "actuatorlength",
|
"camera", "light", "selectpoint", "jointlength", "jointwidth", "actuatorlength",
|
||||||
"actuatorwidth", "framelength", "framewidth", "constraint", "slidercrank"},
|
"actuatorwidth", "framelength", "framewidth", "constraint", "slidercrank", "frustum"},
|
||||||
{"rgba", "?", "22", "fog", "haze", "force", "inertia", "joint",
|
{"rgba", "?", "23", "fog", "haze", "force", "inertia", "joint",
|
||||||
"actuator", "actuatornegative", "actuatorpositive", "com",
|
"actuator", "actuatornegative", "actuatorpositive", "com",
|
||||||
"camera", "light", "selectpoint", "connect", "contactpoint", "contactforce",
|
"camera", "light", "selectpoint", "connect", "contactpoint", "contactforce",
|
||||||
"contactfriction", "contacttorque", "contactgap", "rangefinder",
|
"contactfriction", "contacttorque", "contactgap", "rangefinder",
|
||||||
"constraint", "slidercrank", "crankbroken"},
|
"constraint", "slidercrank", "crankbroken", "frustum"},
|
||||||
{">"},
|
{">"},
|
||||||
|
|
||||||
{"statistic", "*", "5", "meaninertia", "meanmass", "meansize", "extent", "center"},
|
{"statistic", "*", "5", "meaninertia", "meanmass", "meansize", "extent", "center"},
|
||||||
@@ -2765,6 +2765,7 @@ void mjXReader::Visual(XMLElement* section) {
|
|||||||
ReadAttr(elem, "framewidth", 1, &vis->scale.framewidth, text);
|
ReadAttr(elem, "framewidth", 1, &vis->scale.framewidth, text);
|
||||||
ReadAttr(elem, "constraint", 1, &vis->scale.constraint, text);
|
ReadAttr(elem, "constraint", 1, &vis->scale.constraint, text);
|
||||||
ReadAttr(elem, "slidercrank", 1, &vis->scale.slidercrank, text);
|
ReadAttr(elem, "slidercrank", 1, &vis->scale.slidercrank, text);
|
||||||
|
ReadAttr(elem, "frustum", 1, &vis->scale.frustum, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
// rgba sub-element
|
// rgba sub-element
|
||||||
@@ -2791,6 +2792,7 @@ void mjXReader::Visual(XMLElement* section) {
|
|||||||
ReadAttr(elem, "constraint", 4, vis->rgba.constraint, text);
|
ReadAttr(elem, "constraint", 4, vis->rgba.constraint, text);
|
||||||
ReadAttr(elem, "slidercrank", 4, vis->rgba.slidercrank, text);
|
ReadAttr(elem, "slidercrank", 4, vis->rgba.slidercrank, text);
|
||||||
ReadAttr(elem, "crankbroken", 4, vis->rgba.crankbroken, text);
|
ReadAttr(elem, "crankbroken", 4, vis->rgba.crankbroken, text);
|
||||||
|
ReadAttr(elem, "frustum", 4, vis->rgba.frustum, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
// advance to next element
|
// advance to next element
|
||||||
|
|||||||
@@ -1082,6 +1082,7 @@ void mjXWriter::Visual(XMLElement* root) {
|
|||||||
WriteAttr(elem, "framewidth", 1, &vis->scale.framewidth, &visdef.scale.framewidth);
|
WriteAttr(elem, "framewidth", 1, &vis->scale.framewidth, &visdef.scale.framewidth);
|
||||||
WriteAttr(elem, "constraint", 1, &vis->scale.constraint, &visdef.scale.constraint);
|
WriteAttr(elem, "constraint", 1, &vis->scale.constraint, &visdef.scale.constraint);
|
||||||
WriteAttr(elem, "slidercrank", 1, &vis->scale.slidercrank, &visdef.scale.slidercrank);
|
WriteAttr(elem, "slidercrank", 1, &vis->scale.slidercrank, &visdef.scale.slidercrank);
|
||||||
|
WriteAttr(elem, "frustum", 1, &vis->scale.frustum, &visdef.scale.frustum);
|
||||||
if (!elem->FirstAttribute()) {
|
if (!elem->FirstAttribute()) {
|
||||||
section->DeleteChild(elem);
|
section->DeleteChild(elem);
|
||||||
}
|
}
|
||||||
@@ -1110,6 +1111,7 @@ void mjXWriter::Visual(XMLElement* root) {
|
|||||||
WriteAttr(elem, "constraint", 4, vis->rgba.constraint, visdef.rgba.constraint);
|
WriteAttr(elem, "constraint", 4, vis->rgba.constraint, visdef.rgba.constraint);
|
||||||
WriteAttr(elem, "slidercrank", 4, vis->rgba.slidercrank, visdef.rgba.slidercrank);
|
WriteAttr(elem, "slidercrank", 4, vis->rgba.slidercrank, visdef.rgba.slidercrank);
|
||||||
WriteAttr(elem, "crankbroken", 4, vis->rgba.crankbroken, visdef.rgba.crankbroken);
|
WriteAttr(elem, "crankbroken", 4, vis->rgba.crankbroken, visdef.rgba.crankbroken);
|
||||||
|
WriteAttr(elem, "frustum", 4, vis->rgba.frustum, visdef.rgba.frustum);
|
||||||
if (!elem->FirstAttribute()) {
|
if (!elem->FirstAttribute()) {
|
||||||
section->DeleteChild(elem);
|
section->DeleteChild(elem);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
<mujoco>
|
<mujoco>
|
||||||
<visual>
|
<visual>
|
||||||
<map znear="0.01"/>
|
<map znear="0.01"/>
|
||||||
|
<rgba frustum="1. 1. 0 0.2"/>
|
||||||
|
<scale frustum="3"/>
|
||||||
</visual>
|
</visual>
|
||||||
|
|
||||||
<asset>
|
<asset>
|
||||||
|
|||||||
@@ -5038,6 +5038,7 @@ public unsafe struct scale {
|
|||||||
public float framewidth;
|
public float framewidth;
|
||||||
public float constraint;
|
public float constraint;
|
||||||
public float slidercrank;
|
public float slidercrank;
|
||||||
|
public float frustum;
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
@@ -5064,6 +5065,7 @@ public unsafe struct rgba {
|
|||||||
public fixed float constraint[4];
|
public fixed float constraint[4];
|
||||||
public fixed float slidercrank[4];
|
public fixed float slidercrank[4];
|
||||||
public fixed float crankbroken[4];
|
public fixed float crankbroken[4];
|
||||||
|
public fixed float frustum[4];
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
|||||||
Reference in New Issue
Block a user