Runtime error : mass must be > 0

jams

15-07-2007 22:10:16

Hi,
I'm in the process of identifying which phyisics library I'm going to use in my project. My first try is OgreOde, but here is my problem. I'm trying in a very simple scene imported with oFusion to create a vehicle using OgreOde sample media. I almost copied and paste code from Landscape sample. I've tried with the Jeep and the subaru but it keep saying :

ODE Message 2: mass must be > 0 (..\..\ode\src\mass.cpp:44)
ODE Message 2: mass must be > 0 (..\..\ode\src\mass.cpp:44)

Although I made no modification to resources files !
I've tried with prebuild SDK and source file of Ogre. I can compile and run OgreOde samples with no problem :?
Any idea of what's wrong ?
Thanks.

rewb0rn

17-07-2007 20:35:10

I almost copied and paste code from Landscape sample.

Obviously you did not copy the part where the mass is set :) If you did, please show some code.

jams

17-07-2007 23:02:35

Here is the code :OgreOde_Prefab::Vehicle* vehicle = static_cast <OgreOde_Prefab::Vehicle*>(mDotOgreOdeLoader->loadObject("subaru.ogreode", "Subaru", "mycar"));The loader should manage mass settings for me, and nothing more is done in the sample (or I missed something ...)
I do have added the folder where all resources are, and I even tried to set manually the mass with that :vehicle->getBody()->setMass(OgreOde::Mass(1.5, Ogre::Vector3::ZERO, Ogre::Matrix3::IDENTITY));
vehicle->getWheel(0)->getBody()->setMass(OgreOde::Mass(0.1, Ogre::Vector3::ZERO, Ogre::Matrix3::IDENTITY));
vehicle->getWheel(1)->getBody()->setMass(OgreOde::Mass(0.1, Ogre::Vector3::ZERO, Ogre::Matrix3::IDENTITY));
vehicle->getWheel(2)->getBody()->setMass(OgreOde::Mass(0.1, Ogre::Vector3::ZERO, Ogre::Matrix3::IDENTITY));
vehicle->getWheel(3)->getBody()->setMass(OgreOde::Mass(0.1, Ogre::Vector3::ZERO, Ogre::Matrix3::IDENTITY));
But still get the same error message. I'd rather think of a problem between Ogre's Ode version and modified version used by OgreOde ?

rewb0rn

17-07-2007 23:23:54

that might be the reason, as ogreode uses the latest ode version from ode's svn, check it out. anyway i am not sure if you can use the class ogreode::Mass directly, try out ogreode::BoxMass and the other derivatives instead.

jams

18-07-2007 11:06:03

I'll try that, anyway, I may jump to PhysiX library using NxOgre wrapper ... thanks for your help :)

rewb0rn

18-07-2007 11:11:22

another one lost to the dark side :P