Update GroundLightManager
Also use GroundLightManager to manage light node masks.
This commit is contained in:
parent
3b26a3219c
commit
149419386d
1 changed files with 12 additions and 11 deletions
|
@ -70,6 +70,8 @@
|
||||||
#include <simgear/scene/model/modellib.hxx>
|
#include <simgear/scene/model/modellib.hxx>
|
||||||
#include <simgear/scene/model/placement.hxx>
|
#include <simgear/scene/model/placement.hxx>
|
||||||
#include <simgear/scene/util/SGUpdateVisitor.hxx>
|
#include <simgear/scene/util/SGUpdateVisitor.hxx>
|
||||||
|
#include <simgear/scene/util/RenderConstants.hxx>
|
||||||
|
#include <simgear/scene/tgdb/GroundLightManager.hxx>
|
||||||
#include <simgear/scene/tgdb/pt_lights.hxx>
|
#include <simgear/scene/tgdb/pt_lights.hxx>
|
||||||
#include <simgear/props/props.hxx>
|
#include <simgear/props/props.hxx>
|
||||||
#include <simgear/timing/sg_time.hxx>
|
#include <simgear/timing/sg_time.hxx>
|
||||||
|
@ -826,20 +828,19 @@ FGRenderer::update( bool refresh_camera_settings ) {
|
||||||
l->adj_fog_color(),
|
l->adj_fog_color(),
|
||||||
l->get_sun_angle()*SGD_RADIANS_TO_DEGREES);
|
l->get_sun_angle()*SGD_RADIANS_TO_DEGREES);
|
||||||
mUpdateVisitor->setVisibility(actual_visibility);
|
mUpdateVisitor->setVisibility(actual_visibility);
|
||||||
|
simgear::GroundLightManager::instance()->update(mUpdateVisitor.get());
|
||||||
bool hotspots = fgGetBool("/sim/panel-hotspots");
|
bool hotspots = fgGetBool("/sim/panel-hotspots");
|
||||||
|
osg::Node::NodeMask cullMask = ~simgear::LIGHTS_BITS & ~simgear::PICK_BIT;
|
||||||
|
cullMask |= simgear::GroundLightManager::instance()
|
||||||
|
->getLightNodeMask(mUpdateVisitor.get());
|
||||||
|
if (hotspots)
|
||||||
|
cullMask |= simgear::PICK_BIT;
|
||||||
if (viewer) {
|
if (viewer) {
|
||||||
if (hotspots)
|
camera->setCullMask(cullMask);
|
||||||
camera->setCullMask(camera->getCullMask()|SG_NODEMASK_PICK_BIT);
|
for (int i = 0; i < viewer->getNumSlaves(); ++i)
|
||||||
else
|
viewer->getSlave(i)._camera->setCullMask(cullMask);
|
||||||
camera->setCullMask(camera->getCullMask()
|
|
||||||
& ~SG_NODEMASK_PICK_BIT);
|
|
||||||
} else {
|
} else {
|
||||||
if (hotspots)
|
sceneView->setCullMask(cullMask);
|
||||||
sceneView->setCullMask(sceneView->getCullMask()
|
|
||||||
|SG_NODEMASK_PICK_BIT);
|
|
||||||
else
|
|
||||||
sceneView->setCullMask(sceneView->getCullMask()
|
|
||||||
&(~SG_NODEMASK_PICK_BIT));
|
|
||||||
sceneView->update();
|
sceneView->update();
|
||||||
sceneView->cull();
|
sceneView->cull();
|
||||||
sceneView->draw();
|
sceneView->draw();
|
||||||
|
|
Loading…
Add table
Reference in a new issue