Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What is inverse mass? How should I determine it?
#2
Inverse mass is literally 1/mass. Why not use mass instead then? for two reasons:
  • Efficiency. Internally, expressions like something / (1/massA + 1/massB + ... + 1/massN) are extremely common and happen literally tens of thousands of times each frame. By storing inverse masses instead of masses, we can skip all the divisions. This takes pressure off the ALU, reducing the amount of processor cycles used to calculate things, making the engine faster.

  •  Intuitiveness. Unlike mass, inverse mass is directly proportional to how sensitive a particle is to forces. Setting inverse mass to zero, is equivalent to giving a particle infinite mass (minus having to deal with the ugly and risky infinity/NaN values explicitly). This causes the particle to be impervious to forces. Setting it to a high value makes the particle very sensitive to forces.

Regarding your math: if you want to make an actor with 4 particles and a total mass of 150 kg, you'd simply do:

Code:
particleMass = 150/4; // total mass divided by the amount of particles, so we get the mass each particle needs to have
particleInverseMass = 1/particleMass; // calculate the reciprocal of the mass.

So the invMass for each particle needs to be 1/(150/4) = 0.02666.
You can check that this is correct by calculating the total mass of the 4 particles:

Code:
particleMass = 1/0.02666;
totalMass = particleMass * 4;

The result is 150.037, so we know our original formula is spot on.  (I truncated the inverse mass to five decimals, hence the .037 in the reconstructed total mass).

I don't know where the 600 value comes from in your formula.

Quote:In a ObiActorCenterOfMass.cs, I found a line below:
massAccumulator += 1.0f / invMass;
I understand above line as below:
Mass = 1.0f / (Sum of inverseMasses)

This is wrong. Keep in mind that 1/a + 1/b + 1/c  is not equivalent to  1/(a+b+c). It's easy to make this mistake.
Reply


Messages In This Thread
RE: What is inverse mass? How should I determine it? - by josemendez - 31-03-2020, 09:49 AM