External Publication
Visit Post

applyCentralForce() in simpleUpdate or prePhysicsTick

jMonkeyEngine Hub June 26, 2026
Source
Indeed I wanted to follow the documentation as I moved on to update and extend the example and I turned that into my project. I had been fine using the tick listener for a very long time, but the framerate was vsynced to 60FPS, it is only when I was finally able to test on my M1 Macbook Air (120fps default) that I noticed some problems with my physics timing. Then I tested on Windows with 30FPS and the physics was broken again. I changed things around left and right, but it took some time to realize that the forces are cleared only once before the very first substep of a frame and gravity is applied only once per frame. I could not simply clear all forces because then the follow up substeps wouldn’t have gravity. I tried to search the Minie code base for this, but I could not see where these forces are cleared or applied, I supposed it is in the C++ code base. I had no more time to check and I generally think I do something incorrectly here, but using simpleUpdate worked well enough, so I went ahead with that and the original post was created.

Discussion in the ATmosphere

Loading comments...