// Implementation of SGAlphaTestAnimation
////////////////////////////////////////////////////////////////////////
-SGAlphaTestAnimation::SGAlphaTestAnimation (SGPropertyNode *prop_root,
- SGPropertyNode_ptr props)
- : SGAnimation(props, new ssgBranch),
- _done(false)
+SGAlphaTestAnimation::SGAlphaTestAnimation(SGPropertyNode_ptr props)
+ : SGAnimation(props, new ssgBranch)
{
_alpha_clamp = props->getFloatValue("alpha-factor", 0.0);
}
{
}
-void SGAlphaTestAnimation::update()
+void SGAlphaTestAnimation::init()
{
- if (!_done) {
- _done = true;
- setAlphaClampToBranch(_branch,_alpha_clamp);
- }
+ setAlphaClampToBranch(_branch,_alpha_clamp);
}
void SGAlphaTestAnimation::setAlphaClampToBranch(ssgBranch *b, float clamp)
class SGAlphaTestAnimation : public SGAnimation
{
public:
- SGAlphaTestAnimation (SGPropertyNode *prop_root,
- SGPropertyNode_ptr props);
+ SGAlphaTestAnimation(SGPropertyNode_ptr props);
virtual ~SGAlphaTestAnimation ();
- virtual void update();
+ virtual void init();
private:
void setAlphaClampToBranch(ssgBranch *b, float clamp);
bool _done;
} else if (!strcmp("blend", type)) {
animation = new SGBlendAnimation(prop_root, node);
} else if (!strcmp("alpha-test", type)) {
- animation = new SGAlphaTestAnimation(prop_root, node);
+ animation = new SGAlphaTestAnimation(node);
} else {
animation = new SGNullAnimation(node);
SG_LOG(SG_INPUT, SG_WARN, "Unknown animation type " << type);