Add light radius attribute.

Also fix bug: light defaults were not being saved.

PiperOrigin-RevId: 625142278
Change-Id: I8ec3a5a06e9f314e98b7c34346db3c24b34d7e0b
This commit is contained in:
Yuval Tassa
2024-04-15 17:54:05 -07:00
committed by Copybara-Service
parent 683929ab34
commit 0cd28d2423
14 changed files with 135 additions and 48 deletions
+1
View File
@@ -347,6 +347,7 @@ typedef struct _mjsLight { // light specification
// frame
double pos[3]; // position
double dir[3]; // direction
double radius; // radius
mjtCamLight mode; // tracking mode
mjString targetbody; // target body for targeting
+1
View File
@@ -1985,6 +1985,7 @@ void mjCModel::CopyTree(mjModel* m) {
m->light_active[lid] = (mjtByte)pl->active;
copyvec(m->light_pos+3*lid, pl->pos, 3);
copyvec(m->light_dir+3*lid, pl->dir, 3);
m->light_radius[lid] = pl->radius;
copyvec(m->light_attenuation+3*lid, pl->attenuation, 3);
m->light_cutoff[lid] = pl->cutoff;
m->light_exponent[lid] = pl->exponent;