Jump to content
Posted 29 January 2013 - 06:51 AM
Posted 29 January 2013 - 07:46 AM
this is also ok I guess, but it doesn't feel right
But it is the right way. The physics engine needs to integrate over time, this is done by an approximation of an integral. Smaller steps will result in a better approximation, and therefore more stable behaviour. Animation on the other hand is just an interpolation between given points, your are able to define the exact interpolation at every time.
Edited by Ashaman73, 29 January 2013 - 07:48 AM.
Posted 29 January 2013 - 08:09 AM
There's multiple parts to animation -
* choosing what animations are to be layered together at what time, is gameplay code.
* IK and rag-doll are probably physics code.
* Actually evaluating the animation layers to get a posed skeleton is rendering code (and is deterministic; you shouldn't need a dt here to advance a simulation).
* Using a skeleton to skin/render a mesh is rendering code.
You could put the first two in your fixed-step frame loop, and the bottom two in the rendering loop.
Edited by Hodgman, 29 January 2013 - 08:09 AM.
Posted 29 January 2013 - 10:41 AM