Calculating MomentOfInertia of multiple boxes

PJani

22-04-2009 20:23:52

How can i calculate moment of inertia if have 5 cubes diferent sizes in one same object!? I can calculate MomentOfInetia::SolidBox for each body, but i dont know how to calculate them together in one moment of inertia...

Virginie

23-04-2009 08:20:32

There is a function :
void NewtonConvexCollisionCalculateInertialMatrix(const NewtonCollision* convexCollision,dFloat* inertia,dFloat* origin);

I'm not very good in English so it's possible that this don't answer at your question.

PJani

23-04-2009 11:07:36

thnx i was looking for that its used in OgreNewt::ConvexCollison::calculateInertialMatrix

Virginie

23-04-2009 11:17:08

Yes, excuse me, I navigate betwen forums and I don't see I was in ogrenewt forum ^^.

PJani

23-04-2009 15:19:26

no problem, thnx to you i found out i can even get volume of convex hull which makes my work even easier.

So if i understand clearly when using OgreNewt::ConvexCollison::calculateInertialMatrix() i get two things out the moment of inertia and center of mass!? is that corect!?

And i have another question. How can i convert compound collision to ConvexCollison!?

Virginie

23-04-2009 15:46:26

I don't know but me I think that you get only moment of inertia and you must give the good center of masse but I don't sure.
Your center of masse can take with body::getCenterOfMasse()

Virginie

24-04-2009 12:43:58

No, you are true, OgreNewt::ConvexCollison::calculateInertialMatrix() gives the moment of inertia and center of mass.
For your conversion I don't know maybe with ConvexModifierCollision.

PJani

24-04-2009 14:17:32

i will try with cast from OgreNewt::Collsion to OgreNewt::ConvexCollison. Im completly restructuring code so i will see effect when it will be complited...till then...thx

PJani

28-04-2009 18:14:11

its looks like cast its working...

Virginie

29-04-2009 08:21:16

yes il's good if it works!