# when is "center of gravity" simplification false?

This topic is 660 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

In almost all 3D physics we treat 3D objects as point masses, and in most cases this is either correct or "close enough".  I know of one physical configuration this simplification is totally wrong, but wonder whether others exist (including a specific one I'll mention).

The case I've known about is a hollow sphere (with one or more holes in the surface).  When any other object is outside the skin of the hollow sphere, gravity can be computed as if the object is a point mass per usual practice.  However, if another object passes through the hole in the skin, all of a sudden the gravitational attraction becomes zero... everywhere inside the hollow sphere.  A bit strange, but I can see why that's true.

While testing the physics engine in my 3D game engine, I noticed what appears to be strange behavior when flat triangles come close to each other.  In my tests, the triangles have mass, as if they are very thin.  In fact they are infinitely thin, because they are simply triangles, but they behave the same when I make them very thin [3-or-more-sided] disks.  Sometimes they even explode apart (I think when the centers come close together).

I realized this might be slightly similar to the hollow sphere situation in a way.  When the centers of the triangles come closer than the radius of the triangles, the point mass representation seems to have the same characteristic that makes the hollow sphere case change behavior, namely (some physical parts of each object is in opposite directions from the center of gravity (or more precisely, "some physical parts of") the other object.  It doesn't feel like exactly the same situation as the hollow sphere, but the behavior is strange and I wonder if that's because this assumption (that point masses are a valid representation) is failing big time in a similar way as the hollow sphere case.

PS:  The rigid body physics and contact routines seem to work and behave properly with thick objects (where the center of masses are not super close to the external surfaces).  I don't have code to handle stacking (objects with contacts with multiple other objects), but the behavior I am seeing happens with only two objects.

BTW, on a separate issue, what's the best place to read about going from "simple contacts" like I have (only 1~4 contact points on each of any two objects) to support for "arbitrary stacking"?  I'm guessing "stacking" refers to the situation where more than two objects are in contact with each other, with each contact pair having 1~4 points in contact.  I say "not more than 4 contacts" simply because my code reduces cases of more-than-4 contacts to 4 contacts to simplify processing.

Thanks in advance for any tips, ideas, references.

##### Share on other sites
(Disclaimer: This is specific to Newtonian physics)

Center of gravity of a single object is the integral of all of the mass of the object.

Gravitational force between two objects can be approximated by:
- Taking the smallest elements of each object that cause and are affected by gravity.
- Summing up all of the forces between every pairwise combination of these elements.

The shell theorem only works on perfectly symmetric shapes like circles and spheres. This is because of how the integrals for that particular shape can be simplified.

Other shapes act differently. For example: https://en.wikipedia.org/wiki/Bouguer_anomaly#Simple_reduction

The forces between objects in reality also don't act as point forces. The particles closer to the other object experience more attraction than the particles further away. https://en.wikipedia.org/wiki/Tidal_force There's a gradient of force felt by the object. With a steep enough gradient, you get scenarios like https://en.wikipedia.org/wiki/Spaghettification

Also, real objects are not rigid bodies. This means that different forces can bend the object or tear it apart in other ways. https://en.wikipedia.org/wiki/Roche_limit is an interesting case. Edited by Nypyren

##### Share on other sites

The case I've known about is a hollow sphere (with one or more holes in the surface).  When any other object is outside the skin of the hollow sphere, gravity can be computed as if the object is a point mass per usual practice.  However, if another object passes through the hole in the skin, all of a sudden the gravitational attraction becomes zero... everywhere inside the hollow sphere.  A bit strange, but I can see why that's true.
Similarly for a solid sphere, the force of gravity gradually reduces to zero as you travel through the surface and approach the center...

...but most physics engines do not simulate the force of gravity between objects because gravity is too weak to be of any effect (instead we just simulate the force of gravity from the earth) so this is irrelevant :) Are you simulating gravity between objects?

It sounds like your actual problem is do to with resolving collisions? In general, resolving object penetrations is a difficult problem, and is made easier by having thick objects that only ever penetrate a small amount. You can limit penetration by increasing the time-step, or using swept-collision detection and resolving collisions at the moment that they occur instead of after penetration has occurred.

##### Share on other sites

The case I've known about is a hollow sphere (with one or more holes in the surface).  When any other object is outside the skin of the hollow sphere, gravity can be computed as if the object is a point mass per usual practice.  However, if another object passes through the hole in the skin, all of a sudden the gravitational attraction becomes zero... everywhere inside the hollow sphere.  A bit strange, but I can see why that's true.
Similarly for a solid sphere, the force of gravity gradually reduces to zero as you travel through the surface and approach the center...

...but most physics engines do not simulate the force of gravity between objects because gravity is too weak to be of any effect (instead we just simulate the force of gravity from the earth) so this is irrelevant :) Are you simulating gravity between objects?

It sounds like your actual problem is do to with resolving collisions? In general, resolving object penetrations is a difficult problem, and is made easier by having thick objects that only ever penetrate a small amount. You can limit penetration by increasing the time-step, or using swept-collision detection and resolving collisions at the moment that they occur instead of after penetration has occurred.

We do swept-collision detection and we do push objects back to t=toi before we compute collision response.  So I don't think that's the problem.  All collision response seems to work fine, but when these super-thin (well, infinitely thin) objects come together, you can see that their centers seem to pull together more quickly than you'd expect (they slide face-against-face to pull the centers together, which is correct behavior if you buy into the nominal center-of-mass simplification).  And when the centers do meet, there is that crazy explosion apart that happens.  I mean, it makes sense in a way that something wacko would happen when you think about (G*m1*m2)/(d*d).  When d approaches zero, any non-zero value divided by (d*d) quickly surges towards infinity.

Yes, our engine supports gravity, because our first games will take place in outer space, and we want our game/physics engine to automatically support gravity (when the game designers want and enable gravity).  Even on conventional earth-surface games, don't you need some force to push objects towards the ground (or center of earth)?

Edited by maxgpgpu

##### Share on other sites

In a conventional earth-surface game you can treat gravity much the same way that they treat sunlight in graphics, i.e. as a simple directional effect. It's a simplification which works well enough at the relative scales involved.

##### Share on other sites

Yes, our engine supports gravity [between obecjts]
...but when these super-thin (well, infinitely thin) objects come together...
I mean, it makes sense in a way that something wacko would happen when you think about (G*m1*m2)/(d*d).  When d approaches zero, any non-zero value divided by (d*d) quickly surges towards infinity.

Ah ok.
A few things stop that happening in nature -
- your infinitely thin objects have zero volume, so should have zero mass, giving you 0/0, which is still nonsense but safe to call zero in this case...
- gravity is absurdly weak, and as two objects approach in reality, the other forces of nature will push them apart, so distance won't be zero.
- if gravity is somehow strong enough to overcome the other forces and force the distance to zero, then black holes are going to happen and physics breaks in real life too :lol: Make an event horizon to cover up the bugs :D

##### Share on other sites
This theorem has been mentioned in this thread already, but I think we should have a link to it: https://en.wikipedia.org/wiki/Shell_theorem

That's the only context in which the simplification really works: A sphere whose density is rotationally symmetric can be replaced by a single point mass at the center of gravity, for interactions with objects outside the sphere.

##### Share on other sites

If your time step is small then as the point masses approach each other, the squared distance starts to dominate the fixed values of your point masses.  At very small distances the F will tend towards infinity.

I imagine, for true accuracy, you'd need to break each body into a collection of point masses and sum over each point mass to point mass between the bodies.  That sounds like O(n^2) complexity.

##### Share on other sites

(Disclaimer: This is specific to Newtonian physics)

Center of gravity of a single object is the integral of all of the mass of the object.

Gravitational force between two objects can be approximated by:
- Taking the smallest elements of each object that cause and are affected by gravity.
- Summing up all of the forces between every pairwise combination of these elements.

The shell theorem only works on perfectly symmetric shapes like circles and spheres. This is because of how the integrals for that particular shape can be simplified.

Other shapes act differently. For example: https://en.wikipedia.org/wiki/Bouguer_anomaly#Simple_reduction

The forces between objects in reality also don't act as point forces. The particles closer to the other object experience more attraction than the particles further away. https://en.wikipedia.org/wiki/Tidal_force There's a gradient of force felt by the object. With a steep enough gradient, you get scenarios like https://en.wikipedia.org/wiki/Spaghettification

Also, real objects are not rigid bodies. This means that different forces can bend the object or tear it apart in other ways. https://en.wikipedia.org/wiki/Roche_limit is an interesting case.

Interesting stuff.

However, none of these pages answers the primary question I wanted to ask (unless I missed something).  If we ignore any twisting or stretching of objects as they pass near each other, and only pay attention to the centers of mass, in what situations do the centers-of-mass actually in reality not move in the way indicated by treating them both as point masses at their centers-of-mass?  We know for the hollow and solid sphere cases that "things change when the objects overlap", but what about other shapes like the one I mentioned, namely "two triangles" or "two round disks"?

Yes, I do realize I need to decide what second, third, fourth, twenty-third order effects to ignore, but this question seems to be the first I need to resolve.  After that, I will need to decide where to draw the line and accept approximations.  One factoid that I am hoping someone can confirm is... that the centers-of-mass approximation is accurate (in terms of positions of the two centers-of-mass) at least up until the centers of mass come closer than the sum of the maximum "radius" of the two centers-of-mass (where "radius" just means the distance from either center-of-mass to the furthest point on the object).

Edited by maxgpgpu

##### Share on other sites
I don't understand what part of the question remains unanswered. Other than in the case of rotationally-symmetric objects (i.e., spheres whose density can depend on distance to the center only), the field will not be equivalent to that generated by a single particle. Of course you can still use the substitution as an approximation, but whether the approximation is good enough or not depends on your needs.

Now, this is a game development forum. Do you have a game in mind where these kinds of mechanics would be relevant? If you don't, that's OK with me; I am just curious.

1. 1
2. 2
Rutin
19
3. 3
khawk
18
4. 4
A4L
14
5. 5

• 12
• 16
• 26
• 10
• 44
• ### Forum Statistics

• Total Topics
633767
• Total Posts
3013737
×