Moment Of Inertia
yan007
12-04-2006 19:56:45
i have a .mesh (no standard form like a box) but i would like ogrenewt to calculate the Moment Of Inertia,
i've tryed OgreNewt::MomentOfInertia::CalcBoxSolid(mass, size);
but that isn't realistic
second question: my object has a mass of 80kg,
should ik take mass=80.0 or is that incorrect?,
thx
OvermindDL1
12-04-2006 20:39:55
If you want the mass to be 80kg, then that is how you would do it, just be consistent with your measurements everywhere.
Try this for a test, make a sphere that is 2 mm large (0.002f), and set it's mass to 2 billion (kg), it doesn't form a black hole, which with those measurements it should.
(sorry, little joke, but would be interesting if it followed physics that well.
)
yan007
12-04-2006 22:28:36
f? in 0.002f
OvermindDL1
12-04-2006 22:41:44
'f' meaning float, as in a C float. Just a little joke showing that although newton is accurate, it is not that accurate. A black hole would form at roughly 1.8 billion units in mass if the size was 0.002 radius sphere.
walaber
13-04-2006 00:25:56
use the new OgreNewt::ConvexCollision::calculateInertia (i believe that is the function name).
then take the resulting vector, and multiply by the mass of the object, and pass the result as the inertia for setMassMatrix().
nathanwilliams6
13-04-2006 12:35:34
I have the same question, is there a function to automatically calculate the moment of inertia given a convex hull ? i looked into OgreNewt::ConvexCollision for a function to do it, i only found OgreNewt::ConvexCollision::calculateInertialMatrix
which requires the inertia and offset. which means i need to provide an inertia value ....
guess what i am asking, is if theres a function to calculate the inertia based on teh size of the mesh (as convex hull) and its mass.
walaber
13-04-2006 16:28:01
I have the same question, is there a function to automatically calculate the moment of inertia given a convex hull ? i looked into OgreNewt::ConvexCollision for a function to do it, i only found OgreNewt::ConvexCollision::calculateInertialMatrix
which requires the inertia and offset. which means i need to provide an inertia value ....
guess what i am asking, is if theres a function to calculate the inertia based on teh size of the mesh (as convex hull) and its mass.
no no, that function returns the inertia and offset. pass it 2 local variables, and it will fill them with the right values for you.
maxwave
15-04-2006 18:43:14
Hello ALL.
OgreNewt::ConvexCollision::calculateInertialMatrix method set the values of inertia and offset. But this code don't compile:
Vector3 inertia;
Vector3 offset;
conv->calculateInertialMatrix (&inertia,&offset );
Or this code:
Vector3 *inertia;
Vector3 *offset;
conv->calculateInertialMatrix (inertia,offset );
But this code compile without errors but vectors of inertia don't right.
Vector3 inertia;
Vector3 offset;
conv->calculateInertialMatrix (inertia,offset );
How this methon can set the right values, if arguments of this method is not pointers??? However VC 7.1 show that arguments is adresses on vectors.
I want to ask one more question. For what the vector of offset is necessary?
maxwave
15-04-2006 18:55:45
Sorry, thats all right, vectors changed, but inertia is not right. My app: the Ring fall on terrain(mesh), but FPS is very LOW and object have very bad physics. What I should to do for fix it? And answer for my two recent question of my up post please.
walaber
15-04-2006 19:57:46
Vector3 inertia;
Vector3 offset;
conv->calculateInertialMatrix (inertia,offset );
after this, make sure you do this:
body->setMassMatrix( mass, inertia * mass );
maxwave
15-04-2006 22:44:22
oh, thanks, thats allright!
maxwave
16-04-2006 18:25:36
How to calculate inertia vector of compoind collision?
walaber
17-04-2006 07:50:56
i thought it worked right away on a compound collision, but I haven't checked myself...
I'm currently trying to compute the correct moment of inertia for some arbitrary compound collision objects - currently I'm thinking I should be calculating the MoI for each convex collision in the compound and then somehow (How??) combine them.
Is this the right approach? If so, how would I combine inertial matrices?
calculateInertialMatrix is not directly applicable as it is a method on ConvexCollision which is not a parent class of CompoundCollision. (although of course I could call this on each member in the compound...)
To give a concrete example, here are three such compound collision shapes hitting each other:
(each one is composed of a randomly generated set of multicoloured hexagons)
lance
26-04-2006 03:52:28
Try this for a test, make a sphere that is 2 mm large (0.002f), and set it's mass to 2 billion (kg), it doesn't form a black hole, which with those measurements it should.
(sorry, little joke, but would be interesting if it followed physics that well. )
I have to say that in the age of Newton, human have no knowledge of black hole...
(little joke too
)
walaber
26-04-2006 05:59:14
when I get a chance I will review the officla way to use the calculateInertia function on compounds, and make sure OgreNewt can be friends with it... I'm sorry, but I don't have the time this week to look over it.
That would be great. I've found something that looks pretty useful on the Newton forums:
http://www.newtondynamics.com/forum/viewtopic.php?t=1199
I'm going to have a look at implementing this once i've fixed a few other issues - I'll post the results here if I get any worth posting
nathanwilliams6
26-04-2006 16:38:46
Vector3 inertia;
Vector3 offset;
conv->calculateInertialMatrix (inertia,offset );
after this, make sure you do this:
body->setMassMatrix( mass, inertia * mass );
ok, may sound like a silly question, but where does the offset factor into the calculations ? where do i provide the body with the offset (if its needed)
also, what type of object is conv ? and where did you get it/create it ?