Add intensity and range parameters to lights.

PiperOrigin-RevId: 758603199
Change-Id: I74e88bdfeedd9224e84d953f237d68eca79e6cb7
This commit is contained in:
Google DeepMind
2025-05-14 03:27:06 -07:00
committed by Copybara-Service
parent a6c3a287d6
commit fa95fe0c59
15 changed files with 160 additions and 52 deletions
+2 -1
View File
@@ -203,6 +203,8 @@ void mjs_defaultLight(mjsLight* light) {
// intrinsics
light->castshadow = 1;
light->bulbradius = 0.02;
light->intensity = 1000.0;
light->range = 10.0;
light->active = 1;
light->attenuation[0] = 1;
light->cutoff = 45;
@@ -404,4 +406,3 @@ void mjs_defaultKey(mjsKey* key) {
void mjs_defaultPlugin(mjsPlugin* plugin) {
memset(plugin, 0, sizeof(mjsPlugin));
}
+2
View File
@@ -2675,6 +2675,8 @@ void mjCModel::CopyTree(mjModel* m) {
mjuu_copyvec(m->light_pos+3*lid, pl->pos, 3);
mjuu_copyvec(m->light_dir+3*lid, pl->dir, 3);
m->light_bulbradius[lid] = pl->bulbradius;
m->light_intensity[lid] = pl->intensity;
m->light_range[lid] = pl->range;
mjuu_copyvec(m->light_attenuation+3*lid, pl->attenuation, 3);
m->light_cutoff[lid] = pl->cutoff;
m->light_exponent[lid] = pl->exponent;