I’ve been working on a Simple Physics Library, as the one built-in to JME, though excellent, is overkill for my needs. I wanted something that handled collisions and simple gravity and bouncing. I plan to use it in my forthcoming open-source multiplayer game, but for now here’s the source code for anyone who wants something like this.
It looks to me like spatials are your game objects?! I would not have any spatial thing in a physic system as it is then hard or cumbersome to us with in a ECS or server. Just shape, position and rotation. Just a thought.
There’s no multiplayer in this demo, it’s just to show bouncing, collision and gravity. The multiplayer game is coming soon, but things like lag-compensation and client-correction are making things as difficult as I thought they would be, which is to say “very”.
This did cross my mind, as if I could detach it from JME-specific code it could be more generic and used elsewhere. This would mean writing my own collision detection code though (not hard, but…) and as it is, in my multiplayer game at least, I used a headless JME server and all my physical entities have a spatial attached to them. Suggestions welcome though.
yeah exactly, it saved me all the headache I would have had doing this myself from scratch (I guess I never ever would have start with a multiplayer game without). I took the more advanced sim-eth-es as a base and customized it to my need, a great example with a simple physic system in it ECS based, I mean how cool is that