I’m finally at the point where I’m feel secure enough with Java3D to start creating my physics engine.
(I went to gamedev.net and almost shot myself to head due the fact that every 14-year-old is creating a mmorpg.)
For now, I start with flat grid-landscape where I drop items. My attempt is to implements Newtons 3 first laws of dynamics.
-
Object in uniform motion keeps its velocity if no force affects it. Same with objects with velocity of 0.
-
Acceleration is directly porpotional to the sum of new forces divided by mass.
-
If object excerts force on another object, equal force is excerted back.
I believe these all can be done with the simple collision detection thingies provided by Java3D.
One thing I need to know is though, how do I handle objects moving on rough ground? Should I put all the objects “glide” on top of the surface and just give the illusion that they are gliding/moving on it?
How do I implement multiple forces on one object? Lets say I take my cube up to 20 pixels high and drop it from there, but also give it initial velocity with a bearing of 45 degrees. While the gravity would be certainly moving it downwards, how does I set movement with the vi in 45 degrees. I believe I need to calculate the relative velocity. Isn’t that correct?
I have thought about the code in following way:
interface PhysicalConstants
-mass
-distance
-time(I’m not sure about this)
-velocity
-acceleration
-force
Now this interface would be the core of any object, whether it is geometry or model.
Could someone who has little knowledge in physics to revieve the list as I wrote it at my (soon to be girl)friends party when others were doing drugs and performing pre-marriatal sex. If I’m missing some basic element please tell me.