i am stuck trying to think about how i am going to work out the movement for a vehicle i want to simulate. The vehicle is an underwater vehicle with twin thrusters (one on each side). They will be fixed in place so the direction of one is always the same as the other. Of course, to turn the vehicle will adjust the amount of thrust generated from each thruster. So, since i have two velocities that have the same directions but different magnitudes how do i work out the resulting velocity so i can correctly move the vehicle.
He is a diagram of what i mean, since the left thruster has more force than the right one, the object will both rotate and move, will i need to work out moments or something like this??
Finally, whats the best way to implement this all in JME?
So, since i have two velocities that have the same directions but different magnitudes how do i work out the resulting velocity so i can correctly move the vehicle.
No, you have two forces, not velocities. These forces will cause the object to accelerate: a = F/m where a is acceleration, F is force and m is mass. This is valid for a particle. For a whole object in 3D you need the inertia tensor instead of the mass, and then it starts getting complicated.
What I would do is:
Construct the object from a couple of particles and some constraints between them
Apply forces on those particles instead of on an entire object
you could read up on "conservation of momentum" to work out the rotation, and just apply the sum of the forces onto the center of mass of the object.
So this isn't something simple that is already available in the api??
I am still confused, i thought it would be possible to use vector addition to work out the resultant velocity but i guess not, i am seeing why it's complicated now though.
Since, the thrusters are forces (with a direction) but they do not tell you the current velocity of the object itself… I am not sure how conservation of momentum is involved though?
Is there not a simple way for this to be built into JME using the api?? I.e i describe the points on the object where the forces are exerted from (the thruster positions) and the engine works the rest out for me??
Well, can't you just cheat a bit and not use "real" forces. Since it's underwater you'd have to calculate medium friction and all that. Ditch the forces and just move and rotate the object, finetune until it feels right…
Why not using jME-physics you can add your forces and even friction and everything else.
It should be no big problem 2 forces 2 physicsboxes and 1 dynamic node and everything is done.