tanaka
26-07-2008 07:39:53
Hello everybody. In the project I am currently working on I am having some trouble setting up some materials to use in a custom callback.
The program crashes when I try to call setMaterialGroupID.
Here is the test class which inherits from the newton callback class.
In my createScene() function I create the materials:
And eventually pass them through to my vehicle class:
This is where the problem occurs, after setting up the body for a vehicle:
Finally, here is a screenshot of the debug output:

Thank you very much for any assistance.
The program crashes when I try to call setMaterialGroupID.
Here is the test class which inherits from the newton callback class.
#include <OgreNewt.h>
using namespace Ogre;
using namespace OgreNewt;
class CarCollision : public ContactCallback
{
int UserProcess();
};
#include <OgreNewt.h>
#include "CarCollision.h"
using namespace Ogre;
using namespace OgreNewt;
int UserProcess(){
printf("test\n");
return 0;
}
In my createScene() function I create the materials:
carMID = new MaterialID(m_World);
matPair = new MaterialPair(m_World, carMID, carMID);
matPair->setContactCallback(customCar);
And eventually pass them through to my vehicle class:
RallyCar::RallyCar(Ogre::SceneManager* mgr, OgreNewt::World* world, Ogre::Vector3& position, Ogre::Quaternion& orient, OgreNewt::MaterialID* material) : OgreNewt::Vehicle()
{
// save the scene manager
mSceneMgr = mgr;
mWorld = world;
carMaterial = material;
//...
This is where the problem occurs, after setting up the body for a vehicle:
bod->setMaterialGroupID(carMaterial);
Finally, here is a screenshot of the debug output:
Thank you very much for any assistance.