I have a question regarding the order of events in the game loop.
I want to do my own simulation of physics (sort of, partially), so I want to run a function at a particular point in the game loop. It is my understanding that the following events take place in the following order:
(1) input events
(2) animation update
(3) thread safe animation update
(4) animation
(5) Actor’s tick
I am not clear on where the physics actually calculates in this list. If anyone can explain how it fits into the list, I would appreciate it.
For what I want to do, I want to use the (2) animation update to run the Actor’s function that does some calculations, then let the (3) thread safe animation update do the rest of the animation prepping in a more thread optimized fashion. But I also want to run another Actor’s function during (1), even when there is no user input. Any event that i can fire at the start of each frame would be the best, but I don’t know what type of event would work for this.
Can anyone tell me how to fire an event at the start of a frame for every frame reliably?
EDIT: It would seem that the physics always occurs after (4) animation, but that we can choose if it comes before or after (5) Actor’s tick. Is this correct?