shoki
20-05-2006 18:30:22
Hi there!
So I've got a problem. I'm using OgreNewt and I import a OSM scene from ofusion. Each component from the static scene is declared as a tree collision like that :
Else I declare a cylinder who normally has to fall on the floor of my scene... I declare it like that :
It's the same code as the wiki tutorial, this to only try to have a gravity in my world declared like that :
The problem is that gravity doesn't work when I'm importing an OSM Scene, else (without importation) all works perfectly. I don't understand so maybe you can light me
I just want to remind that OSMScene importer works with TinyXML, maybe it comes from that.
So thx for your help,
++ Shoki
So I've got a problem. I'm using OgreNewt and I import a OSM scene from ofusion. Each component from the static scene is declared as a tree collision like that :
OgreNewt::Collision* mCol = new OgreNewt::CollisionPrimitives::TreeCollision(mWorld,pObjNode,true);
OgreNewt::Body* mBody = new OgreNewt::Body(mWorld,mCol);
mBody->attachToNode(pObjNode);
delete mCol;Else I declare a cylinder who normally has to fall on the floor of my scene... I declare it like that :
Entity* floor;
SceneNode* floornode;
floor = mSceneMgr->createEntity("Floor", "cylinder.mesh" );
floor->setNormaliseNormals(true);
floornode = mSceneMgr->getRootSceneNode()->createChildSceneNode( "FloorNode" );
floornode->attachObject( floor );
Ogre::Vector3 siz(20,5,5);
floornode->setScale( siz );
OgreNewt::Collision* col = new OgreNewt::CollisionPrimitives::Cylinder(mWorld, 2.5, 5);
OgreNewt::Body* bod = new OgreNewt::Body( mWorld, col );
delete col;
bod->attachToNode( floornode );
bod->setPositionOrientation( Ogre::Vector3(0.0,50,0.0), Ogre::Quaternion::IDENTITY );
Real mass = 20.0;
Vector3 inertia = OgreNewt::MomentOfInertia::CalcCylinderSolid( mass, 2.5, 5 );
bod->setMassMatrix( mass, inertia );
bod->attachToNode( floornode );
bod->setStandardForceCallback();It's the same code as the wiki tutorial, this to only try to have a gravity in my world declared like that :
mWorld = new OgreNewt::World();
mWorld->setWorldSize(Vector3(-2000,-100,-2000),Vector3(2000,1000,2000));The problem is that gravity doesn't work when I'm importing an OSM Scene, else (without importation) all works perfectly. I don't understand so maybe you can light me
I just want to remind that OSMScene importer works with TinyXML, maybe it comes from that.
So thx for your help,
++ Shoki