# How does the mass of jointed objects acculumate over hierarchy

Consider a robot of the kind in robot contests, not humanoid robots but a bot on 4 wheels with some attached equipment like an arm.

Say the base of the robot is about 2 KG, the arm is in 3 sections, from the shoulder to the elbow to the wrist.

The entire arms is about 1 KG, about .3 KG for section 1 (between shoulder and elbow), then about .4 KG for the forearm, and about .3 KG for the “hand” attached to the wrist.

There are hinge joints at each arm section, one at the shoulder, which is anchored on the bot, one at the elbow and one at the wrist, each with their own rigidbody - where mass is to be set.

For, say, section 2, between should and wrist, should I give that rigidbody, owned by the shoulder’s joint, the mass of just section 2, or the mass of everything from section to through to the hand?

For that matter, the base of the bot is 2KG, but the arm ads another 1KG in 3 sections. Should I put the bot’s mass at 3KG, or 2KG?

I’ve just seen you also posted some questions^^.

Well the issue here is that rigidbody physics doesn’t allow parenting. Each rigidbody is it’s own standalone object. A rigidbody can not change shape which it would do when you consider the base of your robot as rigidbody that should include “child rigidbodies” as it’s own mass. All rigidbodies are always simulated in worldspace. So each rigidbody has a worldspace position, rotation, linear velocity and angular velocity regardless of any of its parents. All settings of a rigidbody stay the same unless manually changed. This includes the mass, center of mass, intertia tensor (and its rotation), drag and angular drag.

The set mass of a rigidbody is thought of to be uniformly distributed through all colliders which belong to the rigidbody. The center of mass as well as the intertia tensor is usually calculated once in the beginning from all colliders which belong to the rigidbody.

As i initially said rigidbodies should never be parented to another rigidbody as they wouldn’t be considered at all from the parents rigidbodies point of view. They would just be “moved” or “rotated” along with the parent. Though a child rigidbody does not exchange any forces or energy unless they actually collide with each other.

A robot arm is usually modeled as a kinematic chain. Though modelling such a chain with rigidbodies and joints is most likely way to unstable. You could just get rid of the rigidbodies and just setup a hierarchical chain of objects. You could attach kinematic rigidbodies to each section. Kinematic rigidbodies are not “simulated” in the traditional sense. Applying forces or setting the velocity of a kinematic rigidbody has no effect. It’s meant to just be moved / rotated manually. The only reason why you want to add a kinematic rigidbody is that it is able to wake up other rigidbodies on collision.

Note that kinematic rigidbodies can not receive any penalty / seperation forces due to collisions or overlaps. That means if you move your rigidbody straight into a static wall / collider you just move through it. Also if you collide / overlap with a normal rigidbody it might get a violent push depending on the speed you bump into. The actual collision does not have an impact force. It’s just the normal rigidbody that is reacting to the overlap.

Finally i should mention that PhysX is only an approximation of real world physics. It can not be used for real world physics simulations. This has several reasons. The most obvious one is that the simulation it time discrete at fix intervals. This automatically limits the max velocities you can use. (The well known bullet goes through wall problem). Next problem is that drag and angular drag are just arbitrary linear factors. Realworld drag (mostly talking about air resistance) has a quadratic relationship with velocity. Finally PhysX doesn’t preserve angular momentum of a rigidbody but only angular velocity. For a more correct simulation the angular velocity would depend on the angular momentum and in some cases that could have a heavy impact on the actual behaviour. This video shows one of those cases at the end in the middle lower figure. Such tumbling can’t happen in Unity unless you apply a changing torque to mimic it.

So to finally address the title: No, it doesn’t. Though it doesn’t in the real world either. Mass it a physical property of an object that never changes. If you have a table that has a mass of 20kg the mass of the table doesn’t change if you put a 50kg mass on top. Keep in mind that mass and weight are two seperate things. Weight is just the force an object applies to another due to a force (usually gravity). In the real world the force that the 50kg mass applies to the table is transferred through the table so the ground gets a total force of 70kg. However the mass of each object always stays the same. Note that this transfer of forces only works partially for PhysX. The longer or complex the transfer chain is the more unstable it gets.