Static or shared objects are not light volumes (but can include some)

This commit is contained in:
Frederic Bouvier 2012-06-11 09:12:47 +02:00
parent a634d7c361
commit 7e8fb16507

View File

@ -38,6 +38,7 @@
#include <simgear/debug/logstream.hxx> #include <simgear/debug/logstream.hxx>
#include <simgear/misc/sgstream.hxx> #include <simgear/misc/sgstream.hxx>
#include <simgear/scene/util/SGReaderWriterOptions.hxx> #include <simgear/scene/util/SGReaderWriterOptions.hxx>
#include <simgear/scene/util/RenderConstants.hxx>
#include <simgear/scene/material/mat.hxx> #include <simgear/scene/material/mat.hxx>
#include <simgear/scene/material/matlib.hxx> #include <simgear/scene/material/matlib.hxx>
#include <simgear/scene/tgdb/apt_signs.hxx> #include <simgear/scene/tgdb/apt_signs.hxx>
@ -239,7 +240,10 @@ ReaderWriterSTG::readStgFile(const std::string& absoluteFileName,
std::string absName = osgDB::findDataFile(name, opt.get()); std::string absName = osgDB::findDataFile(name, opt.get());
proxyNode->setFileName(0, absName); proxyNode->setFileName(0, absName);
if (SGPath(absName).lower_extension() == "ac") if (SGPath(absName).lower_extension() == "ac")
{
proxyNode->setNodeMask( ~simgear::MODELLIGHT_BIT );
opt->setInstantiateEffects(true); opt->setInstantiateEffects(true);
}
else else
opt->setInstantiateEffects(false); opt->setInstantiateEffects(false);
proxyNode->setDatabaseOptions(opt.get()); proxyNode->setDatabaseOptions(opt.get());
@ -261,6 +265,8 @@ ReaderWriterSTG::readStgFile(const std::string& absoluteFileName,
else else
opt->setInstantiateEffects(false); opt->setInstantiateEffects(false);
node = osgDB::readRefNodeFile(absName, opt.get()); node = osgDB::readRefNodeFile(absName, opt.get());
if (SGPath(absName).lower_extension() == "ac")
node->setNodeMask( ~simgear::MODELLIGHT_BIT );
if (!node.valid()) { if (!node.valid()) {
SG_LOG( SG_TERRAIN, SG_ALERT, absoluteFileName SG_LOG( SG_TERRAIN, SG_ALERT, absoluteFileName