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;
|
||||
struct mjvLight_ { // OpenGL light
|
||||
int id; // light id, -1 for headlight
|
||||
float pos[3]; // position rel. to body frame
|
||||
float dir[3]; // direction rel. to body frame
|
||||
int type; // type (mjtLightType)
|
||||
|
||||
@@ -259,6 +259,7 @@ typedef struct mjvGeom_ mjvGeom;
|
||||
//---------------------------------- mjvLight ------------------------------------------------------
|
||||
|
||||
struct mjvLight_ { // OpenGL light
|
||||
int id; // light id, -1 for headlight
|
||||
float pos[3]; // position rel. to body frame
|
||||
float dir[3]; // direction rel. to body frame
|
||||
int type; // type (mjtLightType)
|
||||
|
||||
@@ -6697,6 +6697,11 @@ STRUCTS: Mapping[str, StructDecl] = dict([
|
||||
name='mjvLight',
|
||||
declname='struct mjvLight_',
|
||||
fields=(
|
||||
StructFieldDecl(
|
||||
name='id',
|
||||
type=ValueType(name='int'),
|
||||
doc='light id, -1 for headlight',
|
||||
),
|
||||
StructFieldDecl(
|
||||
name='pos',
|
||||
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) { \
|
||||
c.get()->var = rhs; \
|
||||
})
|
||||
X(id);
|
||||
X(cutoff);
|
||||
X(exponent);
|
||||
X(headlight);
|
||||
|
||||
@@ -2310,6 +2310,7 @@ void mjv_makeLights(const mjModel* m, const mjData* d, mjvScene* scn) {
|
||||
|
||||
// set default properties
|
||||
memset(thislight, 0, sizeof(mjvLight));
|
||||
thislight->id = -1;
|
||||
thislight->headlight = 1;
|
||||
thislight->texid = -1;
|
||||
thislight->type = mjLIGHT_DIRECTIONAL;
|
||||
@@ -2341,6 +2342,7 @@ void mjv_makeLights(const mjModel* m, const mjData* d, mjvScene* scn) {
|
||||
|
||||
// copy properties
|
||||
memset(thislight, 0, sizeof(mjvLight));
|
||||
thislight->id = i;
|
||||
thislight->type = m->light_type[i];
|
||||
thislight->texid = m->light_texid[i];
|
||||
thislight->castshadow = m->light_castshadow[i];
|
||||
|
||||
@@ -6110,6 +6110,7 @@ public unsafe struct mjvGeom_ {
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public unsafe struct mjvLight_ {
|
||||
public int id;
|
||||
public fixed float pos[3];
|
||||
public fixed float dir[3];
|
||||
public int type;
|
||||
|
||||
Reference in New Issue
Block a user