rUmbl3
31-10-2006 13:26:07
I am currently loading some entitys and a terrain from file and create respective box collisions and bodys and for the terrain a treecollision. The loading works pretty well, but my problem is that the boxes fall through the terrain and they don't match the models. see this picture showing the boxes lying at the bottom of the OgreNewt::World:
Picture
And now the code to load the boxes:
The variables should be self-descriptive i think.
And now the loading code for the terrain:
The terrain code is perfectly matching the terrain. And i even get a collision with my character. Only the boxes are a problem.
Picture
And now the code to load the boxes:
col = new OgreNewt::CollisionPrimitives::Box(mWorld, StringConverter::parseVector3(shape), orientation, position);
body = new OgreNewt::Body(mWorld, col);
body->attachToNode(node);
body->setPositionOrientation(position, orientation);
body->setMassMatrix(density, Vector3(0,0,0));
body->setStandardForceCallback();
delete col;
The variables should be self-descriptive i think.
And now the loading code for the terrain:
col = new OgreNewt::CollisionPrimitives::TreeCollision(mWorld, node, false);
body = new OgreNewt::Body(mWorld, col);
body->attachToNode(node);
body->setPositionOrientation(position, Quaternion::IDENTITY);
delete col;
The terrain code is perfectly matching the terrain. And i even get a collision with my character. Only the boxes are a problem.