density of rigid body

density of rigid body

Bild des Benutzers 1000devilsinthejar


Is there a way to create a rigid body using given density rather than
given mass? The only thing related (somehow) to density, that I have
found is hkpInertiaTensorComputer::setAndScaleToDensity() method, but I
have no idea how to use it :( Please anyone could help with this?

And another question, is there a point in setting mass/density
attribute to rigid body that has hkpPlaneShape shape? Does greater
mass/density of plane change behavior of objects during collisions?

Thanks in advance,



3 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.
Bild des Benutzers havokchris

Hi Konrad,
I would

  1. Compute the volume with hkpInertiaTensorComputer::computeShapeVolumeMassProperties, using a dummy mass of 1.0
  2. Set the hkpRigidBodyCinfo::m_mass to (computed volume ) * (desired density). Make sure the computed volume != 0.
  3. Multiply the inertia tensor by the new mass (since it was computed with mass=1)

Mass doesn't matter for fixed bodies. I wouldn't trust a dynamic hkpPlaneShape. I don't really trust them in general, for that matter - if you can get away with a two-triangle mesh instead, go with that.


Bild des Benutzers 1000devilsinthejar

Mmm... that is smart :-) Thanks again! It's definitely saved me a lot of time ;-)

And regarding this plane issue, I think I have to stay with Plane, as I
used Plane shape in other programs to which I try to compare this one
I'm writing now.



Melden Sie sich an, um einen Kommentar zu hinterlassen.