I’ve got a tricky problem. Or maybe its not tricky at all and I’m just experiencing noob pains?
I drew a picture to avoid a long descriptive post, see attached. Simply stated I want to achieve simulated flight in blender by using simple local z force in the Bullet engine. If the thruster or propeller turn, the craft turns, due to thrust being pointed in a different direction. Simply see the picture.
I ran into problems simulating this when I started parenting stuff. And yet one solid object doesn’t seem to make a provision for multiple thrusting points - at least that I know of.
The question boils down to this: How do I achieve this simulation? I want to have various thrusters attached to central object. The player enjoys a fairly realistic flight simulation.
What a great concept unfortunately, the only way I can think to achieve this is to have each group of thrusters be linked to a keyboard (or joystick or whatever) sensor directly. Have the actuator be motion and link the key press to whatever you want the plane to do. Hope this helps
What it sounds like you want is to use Python, particularly the applyImpulse function. The impulse point is relative to the calling object’s position, I believe.
I have an idea, however ambitious it might be!
Lets suppose you have x amount of engines, like on this flier… (watch this amazing video )
What I can do is build a script that uses xyz force and xyz torque based on what your simulated thrusters/propellers are doing. So if one of four rotors spins slower, then a corresponding torque is created.
Or in another case if an engine/thruster rotates from up and down to left and right, then thrust is adjusted for the object.
I guess ultimately I need to construct a formula to plug into python that can take any number of thrusters at various points to the center of gravity and calculate them to assign force properly to that single object.
However it would be far more desireable to have separate thrust points, as this would be a truer simulation.
Why not just use applyImpulse as many times as there are engines, and as the impulse point use the engine’s position? For the force, you should probably use the opposite of the facing direction (-localOrientation.col[1], I think), with the magnitude set to the engines’ power levels.
That simulation is absolutely awesome! Thanks for sharing – gonna pack it away for reference.
When I was punching my cube around with applyImpulse I noticed when I scaled down the cube it would hit the ground and do this infinite vibration thing…what causes that?
I was also curious - how can I get the bullet physics engine to mirror real-world values? applyImpulse with a value of 6 gave a nice bat to the object, whereas holding the “force” key down with the same value gave a steady rise.
Nice that you like the helicopter.
originally it was meant for a demo of something completely different. After a while it was more work on the helicopter rather than the things it should show. Then the helicopter was the only thing left ;).
Try to avoid object scaling whenever possible (on interactive objects). Better apply the scale <ctrl+A>.
flat objects (rigid body) tend to vibrate on flat ground. I guess this is due to precision of the force calculation. I do not know a solution for that. I usually play with the physics setting (object and materials) until it nearly fits my needs.