Game Programming using Qt 5 Beginner's Guide - Second Edition
by Pavel Strakhov, Witold Wysota, Lorenz Haas
What just happened?
We have set the property value sources on needle rotations that are triggered whenever a new value for the property is requested. Instead of immediately accepting the new value, the Behavior element intercepts the request and starts the SmoothedAnimation class to gradually reach the requested value. The SmoothedAnimation class is an animation type that animates numeric properties. The speed of the animation is not determined by its duration; instead, a velocity property is set. This property dictates how fast a value is to be changed. However, the animation is using a non-linear path—it starts slowly, then accelerates to the given velocity, and, near the end of the animation, decelerates in a smooth fashion. This yields ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access