[SOLVED]MaterialID problem when ID is set manually

Drakon

05-04-2007 18:18:38

I want to set ID for MaterialID by myself so I'm doing:


int id = 10;
OgreNewt::MaterialID* floor = new OgreNewt::MaterialID(nWorld,id);
bod->setMaterialGroupID(floor);


now everything is working fine, but if there is a collision between floor and another object I have an error...

If I make my floor material like this :


OgreNewt::MaterialID* floor = new OgreNewt::MaterialID(nWorld);
bod->setMaterialGroupID(floor);


everything is fine at the collision...

Anybody know why it is happening??

walaber

05-04-2007 18:50:30

you cannot choose your own ID. that function is only for use by the OgreNewt::World to generate the defaultMaterialID.

the correct way to create a material is to use the standard Constructor that only accepts a pointer to the World object.

Drakon

05-04-2007 18:52:27

hmmm

Thank you :) Now I see this clear.