currently I’m using libbulletjme using reflection in a project for another game
game has no native support for physics and has thread safety issues for alot of things.
current system
I’m making a thread safe copy of player locations/velocity (thread safety FTW)
teleporting objects to those locations every game tick, and giving it the linear velocity of the player.
it works, but it gets more and more glitchy the faster players move.
I’m fine cheating in terms of how physics should work
not sure if theres a way to move object to vector over X timespan
my libbuletjme and java experience is limited, did the first method i could think of
basically just checking if there’s a better way
They provide a thread safe way for one writer to update positions/rotations in time and another thread to read them back again with interpolation.
You can see sample usage in this game example. Here is where the transition buffer is filled from physics position updates:
And here is where the position for a particular time is read back again (interpolating between known good frames):
Maybe it’s helpful. It allows decoupling of the thing providing updates and the thing reading them back again… and is the cornerstone of all of my networked games and examples that use SimEthereal (Overview · Simsilica/SimEthereal Wiki · GitHub)