X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fscene%2Fmodel%2Fanimation.hxx;h=d5063feb221e30803ef6f9929e301c478ac6b1eb;hb=3d43bc04801e9c3b54d298a031467971cd0d3366;hp=f365ec970fc21965a48ee03bdb2ec384045ea60b;hpb=17e247852231f83d9c5c5d02f789e789ea40763b;p=simgear.git diff --git a/simgear/scene/model/animation.hxx b/simgear/scene/model/animation.hxx index f365ec97..d5063feb 100644 --- a/simgear/scene/model/animation.hxx +++ b/simgear/scene/model/animation.hxx @@ -1,3 +1,4 @@ + // animation.hxx - classes to manage model animation. // Written by David Megginson, started 2002. // @@ -98,8 +99,17 @@ public: class SGRangeAnimation : public SGAnimation { public: - SGRangeAnimation (SGPropertyNode_ptr props); + SGRangeAnimation (SGPropertyNode *prop_root, + SGPropertyNode_ptr props); virtual ~SGRangeAnimation (); + virtual void update(); +private: + SGPropertyNode_ptr _min_prop; + SGPropertyNode_ptr _max_prop; + float _min; + float _max; + float _min_factor; + float _max_factor; }; @@ -220,6 +230,65 @@ private: sgVec3 _axis; }; +/** + * Animation to blend an object. + */ +class SGBlendAnimation : public SGAnimation +{ +public: + SGBlendAnimation( SGPropertyNode *prop_root, + SGPropertyNode_ptr props ); + virtual ~SGBlendAnimation (); + virtual void update(); +private: + SGPropertyNode_ptr _prop; + SGInterpTable * _table; + double _prev_value; + double _offset; + double _factor; + bool _has_min; + double _min; + bool _has_max; + double _max; +}; + +/** + * Animation to scale an object. + */ +class SGScaleAnimation : public SGAnimation +{ +public: + SGScaleAnimation( SGPropertyNode *prop_root, + SGPropertyNode_ptr props ); + virtual ~SGScaleAnimation (); + virtual void update(); +private: + SGPropertyNode_ptr _prop; + double _x_factor; + double _y_factor; + double _z_factor; + double _x_offset; + double _y_offset; + double _z_offset; + SGInterpTable * _table; + bool _has_min_x; + bool _has_min_y; + bool _has_min_z; + double _min_x; + double _min_y; + double _min_z; + bool _has_max_x; + bool _has_max_y; + bool _has_max_z; + double _max_x; + double _max_y; + double _max_z; + double _x_scale; + double _y_scale; + double _z_scale; + sgMat4 _matrix; +}; + /** * Animation to rotate texture mappings around a center point. * @@ -259,16 +328,74 @@ public: virtual void update(); private: SGPropertyNode_ptr _prop; - double _offset_m; + double _offset; double _factor; + double _step; + double _scroll; SGInterpTable * _table; bool _has_min; - double _min_m; + double _min; bool _has_max; - double _max_m; - double _position_m; + double _max; + double _position; sgMat4 _matrix; sgVec3 _axis; }; + + +/** + * Classes for handling multiple types of Texture translations on one object + */ + +class SGTexMultipleAnimation : public SGAnimation +{ +public: + SGTexMultipleAnimation( SGPropertyNode *prop_root, + SGPropertyNode_ptr props ); + virtual ~SGTexMultipleAnimation (); + virtual void update(); +private: + class TexTransform + { + public: + SGPropertyNode_ptr prop; + int subtype; // 0=translation, 1=rotation + double offset; + double factor; + double step; + double scroll; + SGInterpTable * table; + bool has_min; + double min; + bool has_max; + double max; + double position; + sgMat4 matrix; + sgVec3 center; + sgVec3 axis; + }; + SGPropertyNode_ptr _prop; + TexTransform* _transform; + int _num_transforms; +}; + + +/** + * An animation to enable the alpha test + */ +class SGAlphaTestAnimation : public SGAnimation +{ +public: + SGAlphaTestAnimation (SGPropertyNode *prop_root, + SGPropertyNode_ptr props); + virtual ~SGAlphaTestAnimation (); + virtual void update(); +private: + void setAlphaClampToBranch(ssgBranch *b, float clamp); + bool _done; + float _alpha_clamp; +}; + + #endif // _SG_ANIMATION_HXX