Crash when using MaterialIDs and MaterialPairs

hubbel

08-01-2007 21:40:09

Hi everyone!

Has anyone ever had a problem like this? My app using OgreNewt works fine, but when I apply an MaterialID and a MaterialPair (in this case to remove friction between the floor and the camera-object), I get an access violation inside the Newton.dll. Since Newton itself is closed source, I cannot debug this any further.

Any ideas?

Btw: Thanks to Walaber for his great work!


m_pFloorMaterial = new OgreNewt::MaterialID(m_pPhysicsWorld, 100);
m_pPlayerMaterial = new OgreNewt::MaterialID(m_pPhysicsWorld, 200);

OgreNewt::MaterialPair* material_pair2 = new OgreNewt::MaterialPair( m_pPhysicsWorld, m_pFloorMaterial, m_pPlayerMaterial);

material_pair2->setDefaultFriction(0.0f, 0.0f);
material_pair2->setDefaultSoftness(1);
material_pair2->setDefaultElasticity(0);
material_pair2->setContinuousCollisionMode(0);


All necessary variables are initialized. The first command issued at the material_pair2 (setDefaultFriction) works fine, execution crashes when invoking the second command (setDefaultSoftness).

If I delete those calls to the materialpair-functions, in the later-on code the physics-world does exactly one loop and in the second one it crashes. It appears that no matter what I do, when using materials, the second call to a function inside newton.dll crashes.

Maklaud

09-01-2007 04:24:50

Hi! I have similar problem. But I do like this:

m_pFloorMaterial = new OgreNewt::MaterialID(m_pPhysicsWorld);
m_pPlayerMaterial = new OgreNewt::MaterialID(m_pPhysicsWorld);
(...) // and so on like your code

And my app dosen't crash, but it dosen't work correctly. My camera is stay in one point and I can't move it. When I did like you code (with int parameters in OgreNewt::MaterialID() ), my app crashed too. But my problem is in camera collisions. Can you give me your sample, how can I do it??? Please!

hubbel

09-01-2007 13:21:27

Well, my camerasystem is not ready yet (not working and still buggy) so I cannot give you any code. Thanks for pointing out that these integer parameters aren't necessary. I wonder where I got them from (some tutorial?), and I wonder even more why my compiler doesn't complain about them, since there is actually no such function that takes 2 arguments...