]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/model/animation.hxx
Improove bounding volume building in the scenery loading process.
[simgear.git] / simgear / scene / model / animation.hxx
index 7828dbc320210daa9d0f65365b1e7903c9c3d359..eec16bc4b89fb2036e3b030d591e45a58498f2d5 100644 (file)
 # error This library requires C++
 #endif
 
-#include <vector>
-#include <map>
-
-#include <osg/Vec3>
-#include <osg/Vec4>
-
 #include <osg/ref_ptr>
-#include <osg/AlphaFunc>
 #include <osg/Group>
-#include <osg/Material>
 #include <osg/Node>
-#include <osg/NodeCallback>
 #include <osg/NodeVisitor>
-#include <osg/StateSet>
 #include <osg/Texture2D>
-#include <osg/TexMat>
+#include <osgDB/ReaderWriter>
 
-#include <simgear/props/props.hxx>
-#include <simgear/misc/sg_path.hxx>
-
-#include <simgear/math/interpolater.hxx>
-#include <simgear/scene/model/persparam.hxx>
 #include <simgear/scene/util/SGNodeMasks.hxx>
-
-
-SG_USING_STD(vector);
-SG_USING_STD(map);
-
-// Don't pull in the headers, since we don't need them here.
-class SGInterpTable;
-class SGCondition;
+#include <simgear/props/props.hxx>
+#include <simgear/props/condition.hxx>
+#include <simgear/structure/SGExpression.hxx>
 
 // Has anyone done anything *really* stupid, like making min and max macros?
 #ifdef min
@@ -51,18 +31,9 @@ class SGCondition;
 #undef max
 #endif
 
-
-\f
-//////////////////////////////////////////////////////////////////////
-// Helper classes, FIXME: factor out
-//////////////////////////////////////////////////////////////////////
-
-class SGDoubleValue : public SGReferenced {
-public:
-  virtual ~SGDoubleValue() {}
-  virtual double getValue() const = 0;
-};
-
+SGExpressiond*
+read_value(const SGPropertyNode* configNode, SGPropertyNode* modelRoot,
+           const char* unit, double defMin, double defMax);
 \f
 //////////////////////////////////////////////////////////////////////
 // Base class for animation installers
@@ -74,7 +45,8 @@ public:
   virtual ~SGAnimation();
 
   static bool animate(osg::Node* node, const SGPropertyNode* configNode,
-                      SGPropertyNode* modelRoot);
+                      SGPropertyNode* modelRoot,
+                      const osgDB::ReaderWriter::Options* options);
 
 protected:
   void apply(osg::Node* node);
@@ -147,9 +119,8 @@ public:
   virtual osg::Group* createAnimationGroup(osg::Group& parent);
 private:
   class UpdateCallback;
-  class Transform;
   SGSharedPtr<const SGCondition> _condition;
-  SGSharedPtr<const SGDoubleValue> _animationValue;
+  SGSharedPtr<const SGExpressiond> _animationValue;
   SGVec3d _axis;
   double _initialValue;
 };
@@ -167,9 +138,8 @@ public:
 private:
   class UpdateCallback;
   class SpinUpdateCallback;
-  class Transform;
   SGSharedPtr<const SGCondition> _condition;
-  SGSharedPtr<const SGDoubleValue> _animationValue;
+  SGSharedPtr<const SGExpressiond> _animationValue;
   SGVec3d _axis;
   SGVec3d _center;
   double _initialValue;
@@ -188,9 +158,8 @@ public:
   virtual osg::Group* createAnimationGroup(osg::Group& parent);
 private:
   class UpdateCallback;
-  class Transform;
   SGSharedPtr<const SGCondition> _condition;
-  SGSharedPtr<const SGDoubleValue> _animationValue[3];
+  SGSharedPtr<const SGExpressiond> _animationValue[3];
   SGVec3d _initialValue;
   SGVec3d _center;
 };
@@ -250,8 +219,8 @@ public:
 private:
   class UpdateCallback;
   SGSharedPtr<const SGCondition> _condition;
-  SGSharedPtr<const SGDoubleValue> _minAnimationValue;
-  SGSharedPtr<const SGDoubleValue> _maxAnimationValue;
+  SGSharedPtr<const SGExpressiond> _minAnimationValue;
+  SGSharedPtr<const SGExpressiond> _maxAnimationValue;
   SGVec2d _initialValue;
 };
 
@@ -295,7 +264,7 @@ public:
 private:
   class BlendVisitor;
   class UpdateCallback;
-  SGSharedPtr<SGDoubleValue> _animationValue;
+  SGSharedPtr<SGExpressiond> _animationValue;
 };
 
 \f
@@ -355,10 +324,12 @@ private:
 class SGShaderAnimation : public SGAnimation {
 public:
   SGShaderAnimation(const SGPropertyNode* configNode,
-                    SGPropertyNode* modelRoot);
+                    SGPropertyNode* modelRoot,
+                    const osgDB::ReaderWriter::Options* options);
   virtual osg::Group* createAnimationGroup(osg::Group& parent);
 private:
   class UpdateCallback;
+  osg::ref_ptr<osg::Texture2D> _effect_texture;
 };
 
 \f