Add light ids.
PiperOrigin-RevId: 805755907 Change-Id: I92a1b1ea4ce1495c2746fd518f33ab2d1ad81399
This commit is contained in:
committed by
Copybara-Service
parent
da2fad4530
commit
017e7d5a73
@@ -2861,6 +2861,7 @@ struct mjvGeom_ { // abstract geom
|
|||||||
};
|
};
|
||||||
typedef struct mjvGeom_ mjvGeom;
|
typedef struct mjvGeom_ mjvGeom;
|
||||||
struct mjvLight_ { // OpenGL light
|
struct mjvLight_ { // OpenGL light
|
||||||
|
int id; // light id, -1 for headlight
|
||||||
float pos[3]; // position rel. to body frame
|
float pos[3]; // position rel. to body frame
|
||||||
float dir[3]; // direction rel. to body frame
|
float dir[3]; // direction rel. to body frame
|
||||||
int type; // type (mjtLightType)
|
int type; // type (mjtLightType)
|
||||||
|
|||||||
@@ -259,6 +259,7 @@ typedef struct mjvGeom_ mjvGeom;
|
|||||||
//---------------------------------- mjvLight ------------------------------------------------------
|
//---------------------------------- mjvLight ------------------------------------------------------
|
||||||
|
|
||||||
struct mjvLight_ { // OpenGL light
|
struct mjvLight_ { // OpenGL light
|
||||||
|
int id; // light id, -1 for headlight
|
||||||
float pos[3]; // position rel. to body frame
|
float pos[3]; // position rel. to body frame
|
||||||
float dir[3]; // direction rel. to body frame
|
float dir[3]; // direction rel. to body frame
|
||||||
int type; // type (mjtLightType)
|
int type; // type (mjtLightType)
|
||||||
|
|||||||
@@ -6697,6 +6697,11 @@ STRUCTS: Mapping[str, StructDecl] = dict([
|
|||||||
name='mjvLight',
|
name='mjvLight',
|
||||||
declname='struct mjvLight_',
|
declname='struct mjvLight_',
|
||||||
fields=(
|
fields=(
|
||||||
|
StructFieldDecl(
|
||||||
|
name='id',
|
||||||
|
type=ValueType(name='int'),
|
||||||
|
doc='light id, -1 for headlight',
|
||||||
|
),
|
||||||
StructFieldDecl(
|
StructFieldDecl(
|
||||||
name='pos',
|
name='pos',
|
||||||
type=ArrayType(
|
type=ArrayType(
|
||||||
|
|||||||
@@ -1076,6 +1076,7 @@ This is useful for example when the MJB is not available as a file on disk.)"));
|
|||||||
[](MjvLightWrapper& c, decltype(raw::MjvLight::var) rhs) { \
|
[](MjvLightWrapper& c, decltype(raw::MjvLight::var) rhs) { \
|
||||||
c.get()->var = rhs; \
|
c.get()->var = rhs; \
|
||||||
})
|
})
|
||||||
|
X(id);
|
||||||
X(cutoff);
|
X(cutoff);
|
||||||
X(exponent);
|
X(exponent);
|
||||||
X(headlight);
|
X(headlight);
|
||||||
|
|||||||
@@ -2310,6 +2310,7 @@ void mjv_makeLights(const mjModel* m, const mjData* d, mjvScene* scn) {
|
|||||||
|
|
||||||
// set default properties
|
// set default properties
|
||||||
memset(thislight, 0, sizeof(mjvLight));
|
memset(thislight, 0, sizeof(mjvLight));
|
||||||
|
thislight->id = -1;
|
||||||
thislight->headlight = 1;
|
thislight->headlight = 1;
|
||||||
thislight->texid = -1;
|
thislight->texid = -1;
|
||||||
thislight->type = mjLIGHT_DIRECTIONAL;
|
thislight->type = mjLIGHT_DIRECTIONAL;
|
||||||
@@ -2341,6 +2342,7 @@ void mjv_makeLights(const mjModel* m, const mjData* d, mjvScene* scn) {
|
|||||||
|
|
||||||
// copy properties
|
// copy properties
|
||||||
memset(thislight, 0, sizeof(mjvLight));
|
memset(thislight, 0, sizeof(mjvLight));
|
||||||
|
thislight->id = i;
|
||||||
thislight->type = m->light_type[i];
|
thislight->type = m->light_type[i];
|
||||||
thislight->texid = m->light_texid[i];
|
thislight->texid = m->light_texid[i];
|
||||||
thislight->castshadow = m->light_castshadow[i];
|
thislight->castshadow = m->light_castshadow[i];
|
||||||
|
|||||||
@@ -6110,6 +6110,7 @@ public unsafe struct mjvGeom_ {
|
|||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
public unsafe struct mjvLight_ {
|
public unsafe struct mjvLight_ {
|
||||||
|
public int id;
|
||||||
public fixed float pos[3];
|
public fixed float pos[3];
|
||||||
public fixed float dir[3];
|
public fixed float dir[3];
|
||||||
public int type;
|
public int type;
|
||||||
|
|||||||
Reference in New Issue
Block a user