Search Unity

Mass in Unity

Discussion in 'Editor & General Support' started by Jason210, Apr 8, 2013.

  1. Jason210

    Jason210

    Joined:
    Oct 14, 2012
    Posts:
    131
    Hi

    This link states a recommended range of mass between 0.01 and 10. That means a working range of 1000. That's not a lot:

    http://docs.unity3d.com/Documentation//ScriptReference/Rigidbody-mass.html

    How do you deal with large objects, for example like a ship that has a mass that lies beyond this range? Even in tonnes, a large ship may have a mass of 40000, while a small ship 10. That's a range of 4000. Bring smaller objects into play and then the range may increase to hundreds of thousands.

    Not sure how to deal with this? What happens if you go below 0.01, say down to 0.0001? Does that freak it out also?

    /Jason
     
    Last edited: Apr 8, 2013
  2. Chris-Herold

    Chris-Herold

    Joined:
    Nov 14, 2011
    Posts:
    116
    Floating point data types have only so much accuracy, and in order to maintain computational integrity and physical accuracy the range of mass has to be limited. It's not a Unity problem per-se, it's a problem that you will find in every single physics engine available.

    Also the job of the phyics engine is not to simulate reality, which is literally impossible,
    but to aid you in creating smoke&mirror techniques that create a believable physics behaviour.

    In other words: You have to fake it. Chose values that create your desired behaviour, rather than thinking about kilograms and tons.
     
    Last edited: Apr 8, 2013
  3. Jason210

    Jason210

    Joined:
    Oct 14, 2012
    Posts:
    131
    Thanks. I don't mind what units I use, but even if I measure mass in 1000s of tonnes, it does not help, because while I might be able to express the huge weight of my ship in as 10, the smaller objects would need to be scaled down accordingly. A small boat weighing 10 tonnes would seem to be the lower limit as it could be expressed as 0.01; but a buoy would be down to 0.001, well below the Unity reference recommendation.
     
    Last edited: Apr 8, 2013