Page 1 of 1

How does Bepu compute the inertia tensor of a box?

Posted: Thu Jan 26, 2012 6:21 pm
by run
My focus has been else where for the last few months but I've recently started doing some physics experiments again.
Things have going very well, but I've run into something with the inertia tensor I just don't understand.

I have a square box whose width/height/depth are 1 unit with a mass of 114, gravity is set 9.81.
Bepu computes the inertia at 47.5 per plane (of course the inertia tensor is actually a Matrix3x3, not sure is this is valid shorthand, but hopefully it makes sense)
In my experiments with angular momentum this value works very well and is very close to a stall torque that I computed manually.

But when I compute the moment manually or with the online calculator at wolframalpha.com I always get an inertia of 19 per plane.
And that value works well with impulse or linear momentum.

This has me pretty confused.

I've done some digging through the source and found the inertia tensor computation for some of the shapes; capsule, cone, etc.,
but not the box.

Any insight would be greatly appreciated.

Thanks,

-Jeff

Re: How does Bepu compute the inertia tensor of a box?

Posted: Thu Jan 26, 2012 6:30 pm
by Norbo
It uses the usual box inertia tensor, but all automatically computed inertia tensors are scaled by the InertiaHelper.InertiaTensorScale which defaults to 2.5. The scaling helps improve stiffness and stability in some situations.

The BoxShape.ComputeVolumeDistribution shows the actual calculation before scaling of any kind. It assumes a mass of 1 and uniform density so that it can be later scaled by the entity mass to get the proper inertia tensor.

Re: How does Bepu compute the inertia tensor of a box?

Posted: Thu Jan 26, 2012 6:52 pm
by run
Ahh, now it makes sense! Thank you.

BTW that "very important huge performance gains" that happened
in the Dec 28 update to the development fork is pretty darned great.

-J

Re: How does Bepu compute the inertia tensor of a box?

Posted: Thu Jan 26, 2012 6:56 pm
by Norbo
BTW that "very important huge performance gains" that happened
in the Dec 28 update to the development fork is pretty darned great.
:D