well it does not need to be a car, jsu a simple platform
a triangle would be simpele enough, but I want 4 wheels, a rectangular platform
so if i cast 4 rays from each corners, I can use F=-kx formula to create springs
but I need to figure out a way to figure wich wheel is on the ground and wich wheel is not in cas of non flat ground
(not even talking about inertia, center of mass, lateral drag… dont really need them at first)
back in the days there were a couple of websites talking about that or even making some tutorials
cant find them anymore
didn’t mean any disrespect, to bullet or anything
my game is more a 3D zelda than a complex sport simulation
so if I could simulate little wagon or something… could use the heightmap normal, but I dont want part of the vehicules
or wheels going in the ground when the landscape gets irregular
JME includes both a java-only and a native version of bullet. The native version is faster.
Whatever approach you go with, 100 spheres rolling around on a height map will be kind of slow. Will you really have 100 wagons rolling around?
Having been down this path once already myself, try to work out the math of how you will make sure the wagon wheels don’t go into the ground. You can even make the math simpler by only using two wheels at first… then if you actually manage to figure that out try adding a third… then a fourth…
A 2D, two wheel simulation, is kind of possible to kludge. I suspect when you add a third dimension that you will find it difficult. It’s complicated figuring out how a wagon should tip and move to solve for some random terrain. This is 50% of what a physics engine does, really.
the spheres test was for characters, I thing I used charactercontroller with rigid bodies, back in the day
for the vehicle,a long time ago, I used newtondynamic to have a similar simulation, but I dont like physics engine, they are unpredictable
and even if it works 99% all the time, there was always once the rigid body was going out of wack (event by providing regular time steps), good luck trying to figure out why when the problem only occurs rarely
So why are you asking about ray cast cars when you don’t want to use physics oO Casting a ray to determine the terrain height and just putting your car there isn’t exactly complicated…
telling myself, hey why not giving another try, but I dont really understand how to use native bullet in JME
I also checked JME test project, could not find anything about native JME
So where do you want to get your data for the forces for springs etc. from? You’ll end up implementing your own physics engine which brings me back to my “good luck doing something more efficient than bullet”.
What does the tank “ending up with its cannon towards the ground” have to do with efficiency? In GTA my cars end up on their roof or side as well…
To use native bullet you just have to replace the jbullet libraries with the bullet libraries, see “Application deployment” in the manual. Its described in the post you linked btw… :chimpanzee_rolleyes:
but the jmetests use jbullet, not jme3-libraries-physics …?
is there a tutorial on how to use jme3-libraries-physics or jme3-libraries-physics-native ?
There is a reason physics engines can become unstable and you’ll figure it out as you go down your custom solution and have to solve stability issues. I wrote my own physics engine. I’m intimately familiar with this issue.
If all you want to do is plop a wagon on some point then you’ll be fine. As soon as you want to angle and move it so that all four wheels sit on the ground, you are back in the land of potential instability… or really odd behavior.
It’s worth doing it just to know why it happens, I guess.