#include <simgear/scene/material/Pass.hxx>
#include <simgear/scene/util/CopyOp.hxx>
#include <simgear/scene/util/OsgMath.hxx>
+#include <simgear/scene/util/SGReaderWriterOptions.hxx>
#include <boost/scoped_array.hpp>
#include <boost/foreach.hpp>
SGLightAnimation::SGLightAnimation(const SGPropertyNode* configNode,
SGPropertyNode* modelRoot,
+ const osgDB::Options* options,
const string &path, int i) :
- SGAnimation(configNode, modelRoot)
+ SGAnimation(configNode, modelRoot),
+ _options(options)
{
_light_type = getConfig()->getStringValue("light-type");
_position = SGVec3d( getConfig()->getDoubleValue("position/x"), getConfig()->getDoubleValue("position/y"), getConfig()->getDoubleValue("position/z") );
return;
}
- effect = simgear::makeEffect(effectProp, true);
+ effect = simgear::makeEffect(effectProp, true, dynamic_cast<const simgear::SGReaderWriterOptions*>(_options.get()));
if (iter == lightEffectMap.end() && cacheEffect)
lightEffectMap.insert(EffectMap::value_type(_key, effect));
else if (cacheEffect)
SGTranslateAnimation animInst(configNode, modelRoot);
animInst.apply(node);
} else if (type == "light") {
- SGLightAnimation animInst(configNode, modelRoot, path, i);
+ SGLightAnimation animInst(configNode, modelRoot, options, path, i);
animInst.apply(node);
} else if (type == "null" || type == "none" || type.empty()) {
SGGroupAnimation animInst(configNode, modelRoot);
public:
SGLightAnimation(const SGPropertyNode* configNode,
SGPropertyNode* modelRoot,
+ const osgDB::Options* options,
const string &path, int i);
virtual osg::Group* createAnimationGroup(osg::Group& parent);
virtual void install(osg::Node& node);
class UpdateCallback;
friend class UpdateCallback;
SGSharedPtr<SGExpressiond> _animationValue;
+ osg::ref_ptr<const osgDB::Options> _options;
};
#endif // _SG_ANIMATION_HXX
#include <osg/ShadeModel>
#include <osg/PrimitiveSet>
#include <osg/CullFace>
+#include <osgDB/Registry>
#include <simgear/debug/logstream.hxx>
#include <simgear/scene/util/OsgMath.hxx>
+#include <simgear/scene/util/SGReaderWriterOptions.hxx>
#include <simgear/scene/util/VectorArrayAdapter.hxx>
#include <simgear/scene/material/Effect.hxx>
#include <simgear/scene/material/EffectGeode.hxx>
// initialize the sky object and connect it into our scene graph
osg::Node*
-SGSkyDome::build( double hscale, double vscale ) {
+SGSkyDome::build( double hscale, double vscale, simgear::SGReaderWriterOptions *options ) {
EffectGeode* geode = new EffectGeode;
// Geode* geode = new Geode;
geode->setName("Skydome");
geode->setCullingActive(false); // Prevent skydome from being culled away
- Effect *effect = makeEffect("Effects/skydome", true);
+ Effect *effect = makeEffect("Effects/skydome", true, options);
if(effect)
geode->setEffect(effect);
class DrawElementsUShort;
}
+namespace simgear {
+class SGReaderWriterOptions;
+}
+
class SGSkyDome : public SGReferenced {
osg::ref_ptr<osg::MatrixTransform> dome_transform;
double asl;
// initialize the sky object and connect it into our scene graph
// root
- osg::Node *build( double hscale = 80000.0, double vscale = 80000.0 );
+ osg::Node *build( double hscale = 80000.0, double vscale = 80000.0, simgear::SGReaderWriterOptions *options = 0 );
// repaint the sky colors based on current value of sun_angle,
// sky, and fog colors. This updates the color arrays for
// the provided branch
void SGSky::build( double h_radius_m, double v_radius_m,
double sun_size, double moon_size,
- const SGEphemeris& eph, SGPropertyNode *property_tree_node )
+ const SGEphemeris& eph, SGPropertyNode *property_tree_node,
+ simgear::SGReaderWriterOptions* options )
{
dome = new SGSkyDome;
- pre_transform->addChild( dome->build( h_radius_m, v_radius_m ) );
+ pre_transform->addChild( dome->build( h_radius_m, v_radius_m, options ) );
pre_transform->addChild(_ephTransform.get());
planets = new SGStars;
#include <simgear/scene/sky/oursun.hxx>
#include <simgear/scene/sky/stars.hxx>
+namespace simgear {
+class SGReaderWriterOptions;
+}
+
typedef struct {
SGVec3d pos;
SGGeod pos_geod;
*/
void build( double h_radius_m, double v_radius_m,
double sun_size, double moon_size,
- const SGEphemeris& eph, SGPropertyNode *property_tree_node );
+ const SGEphemeris& eph, SGPropertyNode *property_tree_node,
+ simgear::SGReaderWriterOptions* options = 0);
/**
* Repaint the sky components based on current value of sun_angle,