Convert light directional boolean into a type enum.
PiperOrigin-RevId: 761983728 Change-Id: Id5bf93c103e5358d9c5cd9f1176532a978e0b3a8
This commit is contained in:
committed by
Copybara-Service
parent
373b4c0437
commit
74cc904edc
@@ -2143,7 +2143,7 @@ void mjv_makeLights(const mjModel* m, const mjData* d, mjvScene* scn) {
|
||||
// set default properties
|
||||
memset(thislight, 0, sizeof(mjvLight));
|
||||
thislight->headlight = 1;
|
||||
thislight->directional = 1;
|
||||
thislight->type = mjLIGHT_DIRECTIONAL;
|
||||
thislight->castshadow = 0;
|
||||
|
||||
// compute head position and gaze direction in model space
|
||||
@@ -2169,12 +2169,12 @@ void mjv_makeLights(const mjModel* m, const mjData* d, mjvScene* scn) {
|
||||
|
||||
// copy properties
|
||||
memset(thislight, 0, sizeof(mjvLight));
|
||||
thislight->directional = m->light_directional[i];
|
||||
thislight->type = m->light_type[i];
|
||||
thislight->castshadow = m->light_castshadow[i];
|
||||
thislight->bulbradius = m->light_bulbradius[i];
|
||||
thislight->intensity = m->light_intensity[i];
|
||||
thislight->range = m->light_range[i];
|
||||
if (!thislight->directional) {
|
||||
if (thislight->type == mjLIGHT_SPOT) {
|
||||
f2f(thislight->attenuation, m->light_attenuation+3*i, 3);
|
||||
thislight->exponent = m->light_exponent[i];
|
||||
thislight->cutoff = m->light_cutoff[i];
|
||||
|
||||
Reference in New Issue
Block a user