Jump to content

GetAnimationFrame is missing


tumira
 Share

Recommended Posts

7 minutes ago, Josh said:

I'm thinking about making a frame event system where every time a frame is passed your function gets called, or something like that.

I think we need to somehow know the relative position that an animation is in, relative to the start or end of an animation. Then we can trigger events based on it. And that's why I would propse the 0.0 to 1.0 float range for start and end of an animation. This way, regardless how fast or slow an animation is, triggering things would always happen on the same place in the animation cycle. Leadwerks already knows what an animation start and end IS, since it has the ability to loop an animation, and for that it needs to be able to track the first and last defined position and something needs to trigger to go back to the first bone position.

I feel like a Frame Event is pretty much the same as the main game loop. And we already have that by default. 

Link to comment
Share on other sites

Eh, I tend to gravitate toward event driven models.  Would definitely be a use-case, when the animation loops to the start again just emit oncomplete event, or whatever.  C++ we used to call this slots/hooks (dating myself here); in Node it is just the EventEmitter and part of the base package.  Someone wrote it for C++ though if you guys wanna add similar functionality to your own classes.

https://gist.github.com/rioki/1290004d7505380f2b1d

 

 

Coding for Christ.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...