reactphysics3d icon indicating copy to clipboard operation
reactphysics3d copied to clipboard

Question: how to simulate thrust vectoring for a spaceship.

Open adihodos opened this issue 4 years ago • 2 comments

Hi, so I have this spaceship with 4 engines each having 4 nozzles, In total 16 nozzles that can produce thrust (see the link for pictures https://imgur.com/a/ThWIIbi ). My question is how can I simulate it with this physics library. What I'd like to do for example is to spin the ship around the Y-axis (yaw basically) by applying thrust to the front nozzle of the upper left engine and to the back nozzle of the lower right engine).

adihodos avatar Dec 03 '22 08:12 adihodos

Hello.

Once you a have created a RigidBody for your spaceship, you should be able to apply forces and torques onto it. Take a look at all the methods available on the RigidBody class here in the documentation.

For instance, you can apply a local force at the center of mass location with:

rp3d::Vector3 force(4, 0, 0);
spaceShipBody->applyLocalForceAtCenterOfMass(force);

There are other methods to apply a force/torque at different location of your body.

Note: Can I please ask you to post your questions in the Discussions section instead of creating a new issue?

DanielChappuis avatar Dec 06 '22 11:12 DanielChappuis

Thank you for the answer, I will move to the Discussions section.

adihodos avatar Dec 06 '22 13:12 adihodos