Summary
In this chapter, we improved animation processing efficiency and added gameplay-like controls to map animation clips to the current animation state. We started by moving the computational work of animation blending from the CPU to the GPU and created lookup tables to reduce the amount of work for the GPU (at the cost of memory usage). Then, we added the different movement states to the code, including a UI-based mapping between states and animation clips. As the last step, we added the new mappings to the YAML configuration file, allowing us to save and restore the mappings.
In the next chapter, we will take a closer look at collision detection. After we can move the instance in the virtual world, we need to avoid just running through other instances on the screen. As the first step, we will explore the theoretical background of collision detection and discuss the problems of a naive implementation. Then, we will add spatial partitioning to the virtual world and instance...