# Rigid Body dynamics question

Hello,

I have a question related to the physics engine in unity. In another thread I talked about a flight simulator I have in mind and I want to setup a simple aircraft model to check out a few concepts. Well, the simple model will not be as simple as you might think, but simpler than the final version.

OK here comes my question:

I would like to setup a body with a certain Center of Gravity (C.G) position. I want all the forces and moments acting on this C.G. and let do the physics engine do its work, based on these forces and moments.

Is it possible to do something like this?

1. Setup a rigid body and set its center of gravity position.

2. Feed Forces and Moments acting on this C.G. into the physics engine, in order to get translational and rotational movement.

All my forces and moments will be claculated in a more complicated way, but I know how to do it. Currently I just have now clue how to work with the physics engine and what would be possible.

It would be great if you can point me to another thread if this has been handeled before or some sample C# code would be great as well.

Thank you all for your time.

-Pete

You find all the necessary information in the official documentation. What you need is the documentation of class ‘Rigidbody’ which can be found here: Unity - Scripting API: Rigidbody.
In that class you find all you need. Use ‘centerOfMass’ for your center of gravity. ‘AddForce’ and ‘AddTorque’ are for forces and torques relative to the center of mass.
If you visit the mentioned webpage, you can just click on those names to get short examples and more detailed descriptions.

Thanks Dantus!

That really helps.

-Pete

I had a look at it, but I am not sure if I can do all I want with it. For example the inertia tensor is just a vector three, while I need a 3x3 matrix for an aircraft.

Guess I have to play around a little, but I also might end up using my own small physics engine, solving the aero equations of motion.

Time for a play around.

-Pete

If I use AddForce() or Add Torque() etc. will the values have specific units?

For example, if I use AddForce(10, 0, 0) and AddTorque(10, 0, 0), will that force be in [N] (newtons) and the torque be in [Nm]?

Or are all the variables like mass, force, torque etc. without units?

Couldn’t find any reference to the units used.

-Pete

The units are arbitrary…an object with mass of 1 has 1/10th the mass of an object with a mass of 10, but what the mass actually is depends on what you’re defining it as. It’s generally best to model around a mass of 1 since very small/large values can result in wonkiness.

–Eric

Thanks Eric.

-Pete