Tie the scene ambient,diffuse end specular red,green and blue components to a property under /rendering/scene
This commit is contained in:
parent
54ee68291b
commit
6c331a55a8
2 changed files with 33 additions and 0 deletions
|
@ -233,3 +233,18 @@ propeller:
|
|||
/engines/engine[%d]/rpm
|
||||
/engines/engine[%d]/pitch
|
||||
/engines/engine[%d]/torque
|
||||
|
||||
|
||||
================================================================================
|
||||
LIGHT
|
||||
================================================================================
|
||||
/sim/time/sun-angle-rad
|
||||
/rendering/scene/ambient-r
|
||||
/rendering/scene/ambient-g
|
||||
/rendering/scene/ambient-b
|
||||
/rendering/scene/diffuse-r
|
||||
/rendering/scene/diffuse-g
|
||||
/rendering/scene/diffuse-b
|
||||
/rendering/scene/specular-r
|
||||
/rendering/scene/specular-g
|
||||
/rendering/scene/specular-b
|
||||
|
|
|
@ -132,11 +132,29 @@ void FGLight::reinit () {
|
|||
void FGLight::bind () {
|
||||
SGPropertyNode *prop = globals->get_props();
|
||||
prop->tie("/sim/time/sun-angle-rad",SGRawValuePointer<double>(&_sun_angle));
|
||||
prop->tie("/rendering/scene/ambient-r",SGRawValuePointer<float>(&_scene_ambient[0]));
|
||||
prop->tie("/rendering/scene/ambient-g",SGRawValuePointer<float>(&_scene_ambient[1]));
|
||||
prop->tie("/rendering/scene/ambient-b",SGRawValuePointer<float>(&_scene_ambient[2]));
|
||||
prop->tie("/rendering/scene/diffuse-r",SGRawValuePointer<float>(&_scene_diffuse[0]));
|
||||
prop->tie("/rendering/scene/diffuse-g",SGRawValuePointer<float>(&_scene_diffuse[1]));
|
||||
prop->tie("/rendering/scene/diffuse-b",SGRawValuePointer<float>(&_scene_diffuse[2]));
|
||||
prop->tie("/rendering/scene/specular-r",SGRawValuePointer<float>(&_scene_specular[0]));
|
||||
prop->tie("/rendering/scene/specular-g",SGRawValuePointer<float>(&_scene_specular[1]));
|
||||
prop->tie("/rendering/scene/specular-b",SGRawValuePointer<float>(&_scene_specular[2]));
|
||||
}
|
||||
|
||||
void FGLight::unbind () {
|
||||
SGPropertyNode *prop = globals->get_props();
|
||||
prop->untie("/sim/time/sun-angle-rad");
|
||||
prop->untie("/rendering/scene/ambient-r");
|
||||
prop->untie("/rendering/scene/ambient-g");
|
||||
prop->untie("/rendering/scene/ambient-b");
|
||||
prop->untie("/rendering/scene/diffuse-r");
|
||||
prop->untie("/rendering/scene/diffuse-g");
|
||||
prop->untie("/rendering/scene/diffuse-b");
|
||||
prop->untie("/rendering/scene/specular-r");
|
||||
prop->untie("/rendering/scene/specular-g");
|
||||
prop->untie("/rendering/scene/specular-b");
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue