makr
24-04-2008 20:24:39
Hello all!
I'm currently trying to implement some dumbed-down physics for an airplane game that I am working on. Currently this is what I'm doing in my physics call back:
- Adding global force of gravity on the global Y-axis.
- Adding local force of thrust Vec(0.0, 0.0, X.X) on plane's orientation at the plane's local origin.
- Adding local force of roll Vec(0.0, X.X, 0.0) on plane's orientation at a offset of (size.x, 0.0, 0.0) relative to the plane's local origin.
- Ading local force of pitch Vec(0.0, X.X, 0.0) on plane's orientation at a offset of (0.0, 0.0, size.z) relative to the plane's local origin.
I have yet to "simulate" drag and lift. Does this approach sound ideal? I have read that you should never setForce or setOmega. I believe that I have read on the Newton Dynamics forums that to "turn" an object, I should be using local forces (as I am).
If this is an decent approach, I have the following problem: my roll and pitch functions apply a force that give it some inertia that takes some time to neutralize. For a plane's pitch and roll, I want to have a direct and immediate effect (more of a setLocalForce), but it seems that this will affect other forces (like my gravity, and thrust, and soon-to-be pseudo-drag/lift).
Could someone steer me along the correct path? Also, would implementing a form of drag and lift solve this problem? It doesn't seem so, but I could be wrong.
Thanks.
Edit: Another question. My body size is roughly ( 100, 20, 100 ). To perform the roll/pitch, the mass had to be set to an insane amount (size * 10000000). Otherwise, the addLocalForce() for the roll/pitch had no visible effect. Where is my fault in this logic?
I'm currently trying to implement some dumbed-down physics for an airplane game that I am working on. Currently this is what I'm doing in my physics call back:
- Adding global force of gravity on the global Y-axis.
- Adding local force of thrust Vec(0.0, 0.0, X.X) on plane's orientation at the plane's local origin.
- Adding local force of roll Vec(0.0, X.X, 0.0) on plane's orientation at a offset of (size.x, 0.0, 0.0) relative to the plane's local origin.
- Ading local force of pitch Vec(0.0, X.X, 0.0) on plane's orientation at a offset of (0.0, 0.0, size.z) relative to the plane's local origin.
I have yet to "simulate" drag and lift. Does this approach sound ideal? I have read that you should never setForce or setOmega. I believe that I have read on the Newton Dynamics forums that to "turn" an object, I should be using local forces (as I am).
If this is an decent approach, I have the following problem: my roll and pitch functions apply a force that give it some inertia that takes some time to neutralize. For a plane's pitch and roll, I want to have a direct and immediate effect (more of a setLocalForce), but it seems that this will affect other forces (like my gravity, and thrust, and soon-to-be pseudo-drag/lift).
Could someone steer me along the correct path? Also, would implementing a form of drag and lift solve this problem? It doesn't seem so, but I could be wrong.
Thanks.
Edit: Another question. My body size is roughly ( 100, 20, 100 ). To perform the roll/pitch, the mass had to be set to an insane amount (size * 10000000). Otherwise, the addLocalForce() for the roll/pitch had no visible effect. Where is my fault in this logic?