Larles
11-08-2008 20:33:22
hi there... I'm an OgreBullet beginner and I have small troubles with OgreBulletDynamics::setShape.
Actually I've copied the code that I found in the examples sourcecode for world creation :
and the object creation :
but when I try my code, I have some troubles with an unhandlerd exception (reading violation) in Object::_notifyAttached from the ogreBulletCollisionsObject.cpp.
Really, I can't found what I've done wrong.
Any suggestion ?
Actually I've copied the code that I found in the examples sourcecode for world creation :
Ogre::SceneManager *scene = QCore->getModule<cRenderer>(RENDERER)->getSceneManager("Main"); //getting my main sceneManager.
Ogre::AxisAlignedBox bounds = Ogre::AxisAlignedBox(Ogre::Vector3 (-10000, -10000, -10000),Ogre::Vector3 (10000, 10000, 10000));
Ogre::Vector3 gravity = Ogre::Vector3(0,-9.81,0);
this->mWorld = new OgreBulletDynamics::DynamicsWorld(scene, bounds, gravity);
and the object creation :
Ogre::Entity *e = mgr->createEntity("cube", "Cube.mesh");
e->setQueryFlags(QueryFlags::GEOMETRY_QUERY_MASK);
Ogre::SceneNode *n = mgr->getRootSceneNode()->createChildSceneNode();
n->attachObject(e);
Ogre::Vector3 bBoxSize = e->getBoundingBox().getSize();
OgreBulletCollisions::BoxCollisionShape *s = new OgreBulletCollisions::BoxCollisionShape(bBoxSize);
OgreBulletDynamics::RigidBody *body = new OgreBulletDynamics::RigidBody("cubeBody", this->mWorld);
Ogre::Vector3 pos = n->getPosition();
Ogre::Quaternion or = n->getOrientation();
but when I try my code, I have some troubles with an unhandlerd exception (reading violation) in Object::_notifyAttached from the ogreBulletCollisionsObject.cpp.
Really, I can't found what I've done wrong.
Any suggestion ?