-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|592|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Snippet Home -> Timing


 
Cower
Created : 21 November 2010
Edited : 21 November 2010
System : Mac
Language : C#

Animatable Value

Simple class to animate between two values over a set amount of time using GLFW's timing API

This is a fairly simple bit of code to animate between two values over a set amount of time (in seconds as far as I'm concerned, since that's what GLFW is using, but the units are completely arbitrary). Simple as it is, it's fairly handy to have as far as I'm concerned (I use stuff like this a lot in my code).

Basically, you call [NAnimation setTime:time] each frame to keep all animations in sync (that is, one animation won't end up 3 milliseconds ahead of another), and the other stuff is all fairly self-explanatory (comments explain them).

NAnimation.h


NAnimation.m

 

Comments