Updates to the alpha-test animation class

This commit is contained in:
ehofman
2004-01-08 10:25:23 +00:00
parent 3d43bc0480
commit 40414f2823
3 changed files with 7 additions and 13 deletions
+4 -9
View File
@@ -872,10 +872,8 @@ SGTexMultipleAnimation::update()
// Implementation of SGAlphaTestAnimation // Implementation of SGAlphaTestAnimation
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
SGAlphaTestAnimation::SGAlphaTestAnimation (SGPropertyNode *prop_root, SGAlphaTestAnimation::SGAlphaTestAnimation(SGPropertyNode_ptr props)
SGPropertyNode_ptr props) : SGAnimation(props, new ssgBranch)
: SGAnimation(props, new ssgBranch),
_done(false)
{ {
_alpha_clamp = props->getFloatValue("alpha-factor", 0.0); _alpha_clamp = props->getFloatValue("alpha-factor", 0.0);
} }
@@ -884,12 +882,9 @@ SGAlphaTestAnimation::~SGAlphaTestAnimation ()
{ {
} }
void SGAlphaTestAnimation::update() void SGAlphaTestAnimation::init()
{ {
if (!_done) { setAlphaClampToBranch(_branch,_alpha_clamp);
_done = true;
setAlphaClampToBranch(_branch,_alpha_clamp);
}
} }
void SGAlphaTestAnimation::setAlphaClampToBranch(ssgBranch *b, float clamp) void SGAlphaTestAnimation::setAlphaClampToBranch(ssgBranch *b, float clamp)
+2 -3
View File
@@ -387,10 +387,9 @@ private:
class SGAlphaTestAnimation : public SGAnimation class SGAlphaTestAnimation : public SGAnimation
{ {
public: public:
SGAlphaTestAnimation (SGPropertyNode *prop_root, SGAlphaTestAnimation(SGPropertyNode_ptr props);
SGPropertyNode_ptr props);
virtual ~SGAlphaTestAnimation (); virtual ~SGAlphaTestAnimation ();
virtual void update(); virtual void init();
private: private:
void setAlphaClampToBranch(ssgBranch *b, float clamp); void setAlphaClampToBranch(ssgBranch *b, float clamp);
bool _done; bool _done;
+1 -1
View File
@@ -131,7 +131,7 @@ sgMakeAnimation( ssgBranch * model,
} else if (!strcmp("blend", type)) { } else if (!strcmp("blend", type)) {
animation = new SGBlendAnimation(prop_root, node); animation = new SGBlendAnimation(prop_root, node);
} else if (!strcmp("alpha-test", type)) { } else if (!strcmp("alpha-test", type)) {
animation = new SGAlphaTestAnimation(prop_root, node); animation = new SGAlphaTestAnimation(node);
} else { } else {
animation = new SGNullAnimation(node); animation = new SGNullAnimation(node);
SG_LOG(SG_INPUT, SG_WARN, "Unknown animation type " << type); SG_LOG(SG_INPUT, SG_WARN, "Unknown animation type " << type);