Add texture attribute to lights.

PiperOrigin-RevId: 763739805
Change-Id: I333ed2ac68f30f79f688ca01d7b5fd6bf2d836c9
This commit is contained in:
Google DeepMind
2025-05-27 05:03:04 -07:00
committed by Copybara-Service
parent 441ca838a1
commit 568620dd2f
18 changed files with 106 additions and 4 deletions
+5
View File
@@ -2143,8 +2143,12 @@ void mjv_makeLights(const mjModel* m, const mjData* d, mjvScene* scn) {
// set default properties
memset(thislight, 0, sizeof(mjvLight));
thislight->headlight = 1;
thislight->texid = -1;
thislight->type = mjLIGHT_DIRECTIONAL;
thislight->castshadow = 0;
thislight->bulbradius = 0.02;
thislight->intensity = 1000;
thislight->range = 10;
// compute head position and gaze direction in model space
mjtNum hpos[3], hfwd[3];
@@ -2170,6 +2174,7 @@ void mjv_makeLights(const mjModel* m, const mjData* d, mjvScene* scn) {
// copy properties
memset(thislight, 0, sizeof(mjvLight));
thislight->type = m->light_type[i];
thislight->texid = m->light_texid[i];
thislight->castshadow = m->light_castshadow[i];
thislight->bulbradius = m->light_bulbradius[i];
thislight->intensity = m->light_intensity[i];