Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: how to simulate thrust vectoring for a spaceship. #296

Closed
adihodos opened this issue Dec 3, 2022 · 2 comments
Closed

Question: how to simulate thrust vectoring for a spaceship. #296

adihodos opened this issue Dec 3, 2022 · 2 comments

Comments

@adihodos
Copy link

adihodos commented Dec 3, 2022

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).

@DanielChappuis
Copy link
Owner

DanielChappuis commented Dec 6, 2022

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?

@adihodos
Copy link
Author

adihodos commented Dec 6, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants