How does Bepu compute the inertia tensor of a box?

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
run
Posts: 10
Joined: Thu Jun 02, 2011 8:36 am

How does Bepu compute the inertia tensor of a box?

Post 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
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

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

Post 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.
run
Posts: 10
Joined: Thu Jun 02, 2011 8:36 am

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

Post 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
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

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

Post 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
Post Reply