This project is read-only.

Newbie question (XPA)

Jan 2, 2008 at 3:45 PM

First of all I'd like to say I like what you guys are doing :) XPA is friendly to a beginner (as far as programming goes), though severely lacking in documentation :P
I know, I know, you're on a limited time budget, but I really wish this project would sky-rocket!

Anyways, I've been playing around a bit and getting rather unpredictable results. One thing that might explain that is the message I keep getting:
"ODE Message 2: inertia must be positive definite (c:\devel\ode-0.6\ode\src\mass.cpp:43 (and 410))"

Now, I am most certainly a beginner, so I'm not entirely sure how I would set a proper inertia if that is indeed a problem. Even using XPA in its simplest form, just setting up the sim with some gravity and letting some balls collide with a plane, I get that message. Just one ball at a time, with no initial forces attached works just fine.
Then I made it so when you press space, it makes a new ball, and adds an initial force to it with x/y set to random.nextDouble() + 0.5f, duration 0.1f, force type Force.GlobalForce. Now, the first ball I make goes TROUGH the plane, for some reason.. the second ball just flies off with an insane velocity in some direction :P
So I thought, just to make it work, I changed the forcetype to GlobalTorque, and it worked as expected.. somewhat. I set the force direction in x/y to 0.1, 0.2 respectively, just a slight force to make them not stack perfectly on top of eachother. The first two balls were fine I suppose, the third made the balls actually bore trough the ground, though sometimes it'd just bounce up and down until it stopped and started sleeping, though it shouldve bounced off in another direction. Now when they start sticking together like this, the entire stack starts to rotate slowly, and it keeps rotating with the balls sticking together until the stack is about horisontal, when they finally start falling trough the plane.

Now I wonder if there's some properties which shouldve been set, which I didnt? The "tutorial" demo you supplied didnt bother setting up any properties, but then there was just 1 ball and static boxes and plane. Applying forces seems to be a straight-forward concept which doesnt warrant much explanation, though I wouldnt mind some :)

With regards,
Jan 3, 2008 at 3:20 PM
Edited Jan 3, 2008 at 6:44 PM
Well I fixed most of my issues, and introduced some new ones :P
First of all, it would seem the forces proportions are out of scale, though i cant quite figure why. I have to use a gravity of 100+, and pretty much multiply all forces by a factor of 10.. this isnt really a problem but Id like to use normal sized forces.. Also the friction seems to be very low, even if I add a material with friction 1.0f on both ground and spheres.. this might be related to the forces being out of proportion.
Secondly, when I tried using a MeshShapeData as a shape for a solid (a terrain i made), It didnt quite seem to be in the correct position, i did get some collisions but then ODE started reporting "vector has zero size" .. The poster beneath me asked if XPA supports triangle mesh collisions, and I'd also like an answer to that :)

PS: Im still getting the inertia must be positive definite message

Jan 6, 2008 at 10:17 PM
We are currently working on a game project with xpa, too.

And we do have the same problem with the inertia message.

like: "ODE Message 2: inertia must be positive definite (c:\devel\ode-0.6\ode\src\mass.cpp:43 (and 410))"

One of my team members found anywhere else out, that it has something todo with the ODE-Version and how it was compiled.
It must be compiled with float, but the version of the ode.dll is compiled with double.

We compiled the dll on our self, but it does not work, because we got an exception HRESULT: 0x8007007E.

Any help would be great to fix this problem.
This Problem and its solution should be added also to the FAQ.

BTW, Thx for this great Physics Adapter!
Jan 7, 2008 at 9:42 AM
Hey Hefti!

I dont know if the message actually affects anything, but I did notice that the demo in one of the versions did not produce that message, but that was XNA 1.0 though. I've been looking at other physics API's due to the problems I described in my second post :/ I think this one is gonna be very slowly updated if not abandoned, sadly.. Hopefully I'm wrong :)

Anyways, if you manage to fix it, I'd love it if you could publish it somewhere :)