15-07-2021, 08:54 AM
(15-07-2021, 08:29 AM)josemendez Wrote: Density = mass/volume. mass is expressed in Kilograms, volume in cubic meters (m3). So density is expressed in Kg/m3.I was wondering if there was an easy way to compare densities.
To calculate the density of a rigidbody, you divide its mass by its volume. For 3D colliders, unity does not include any means to calculate its volume (though you can directly specify a density using Rigidbody.SetDensity). Fortunately most collider shapes (cubes, spheres, capsules) have very simple analytical formulas for volumes:
https://www.varsitytutors.com/hotmath/ho...rea-volume
I should calculate it myself.
Thank you for your polite commentary.
It was very helpful!