B@z wrote:but why dont make an animator?
you can check how the createDeleteAnimator made, you have to do the same, just not delete, but set it invisible
lol, finally a reusable, sensible solution that isn't game-specific
What he's trying to do is actually game specific.
What? Are you always going to set every node visible after 2 seconds?
Man, I suppose it can be put in the engine, but it's only a function. Not much to it!
We already have an answer for it that is simple and scalable.
... thinking more about it... (as I don't know about the animators yet) ..
if making an animator is simple as inheriting a class, and changing the update function or something like that, then it's useful.
I agree that writing an animator to do something does indeed solve the problem. If that is all the user wants, and ever wants to do, that is an excellent solution. Unfortunately, it makes the assumption that everything the user might ever want to do periodically relates to manipulating a scene node. This is clearly not always going to be the case.
A simple timer callback system is more generic and can be quite a bit cleaner. It is also more easily testable (if you're into that kind of thing).
// make node invisible in 2 seconds, only do it once
timerQueue.insert(make_node_invisible(node), 2000);
// update proximity engine every second, repeate indefinitely
timerQueue.insert(update_proximity_engine(), 1000, TQ_REPEAT);
The implementation I suggested.. and Brainsaws or Viteks... is good and more than good enough.. and it is simple as can be... nothing to it.
Once again, I want to say,,, this thread should be closed as we have the answer, and the ideas about integrating into the engine or making animators is going to far I think!
I haven't heard from Seraph for a while
Brainsaw, Vitek and I know what's happening here..
Ulf wrote:this thread should be closed as we have the answer
Uhm, no. Seraph might have questions, post a status report or whatever.
Besides, there's so much room for more suggestions on ways to solve this problem.
Uhm, no. Seraph might have questions, post a status report or whatever.
Besides, there's so much room for more suggestions on ways to solve this problem.
Yea true, it's not just about me. haha. it's not even my post.