ghiboz
02-05-2007 22:53:59
hi!
i'm trying to drop a ball, but nothing....
here is my code:
in createScene:
and after:
after, in the framelistener:
i inserted the breakpoint in the framelistener and the program go on, but the spere stay on fly and doesn't go down for gravity...
what's the error??
thanks
i'm trying to drop a ball, but nothing....
here is my code:
in createScene:
Entity* floor = mSceneMgr->createEntity("Floor", "Plane01.mesh" );
SceneNode* floornode = mSceneMgr->getRootSceneNode()->createChildSceneNode( "FloorNode" );
floornode->attachObject( floor );
floor->setMaterialName( "Simple/dirt01" );
OgreNewt::Collision* col = new OgreNewt::CollisionPrimitives::TreeCollision( m_World, floornode, false );
OgreNewt::Body* bod = new OgreNewt::Body( m_World, col );
delete col;
bod->attachToNode( floornode );
bod->setPositionOrientation( Ogre::Vector3(0.0,0.0,0.0), Ogre::Quaternion::IDENTITY );
and after:
Entity* entTest = mSceneMgr->createEntity( "Test", "sphere.mesh" );
SceneNode* nodeTest = mSceneMgr->getRootSceneNode()->createChildSceneNode( "Test" );
entTest->setMaterialName( "Simple/BumpyMetal" );
nodeTest->attachObject( entTest );
nodeTest->setScale( Vector3(0.05, 0.05, 0.05) );
nodeTest->setPosition( Vector3(0.0, 25.0, 0.0));
after, in the framelistener:
bool TestFrameListener::frameStarted(const FrameEvent &evt)
{
OgreNewt::Collision* colTest = new OgreNewt::CollisionPrimitives::Ellipsoid( m_World, Ogre::Vector3(1,1,1) );
OgreNewt::Body* bodyTest = new OgreNewt::Body( m_World, colTest );
Ogre::Vector3 inertia = OgreNewt::MomentOfInertia::CalcSphereSolid( 10.0, 1.0 );
bodyTest->setMassMatrix( 10.0, inertia );
bodyTest->attachToNode( msnCam );
bodyTest->setStandardForceCallback();
bodyTest->setVelocity( Ogre::Vector3(0,0,0) );
return true;
}
i inserted the breakpoint in the framelistener and the program go on, but the spere stay on fly and doesn't go down for gravity...
what's the error??
thanks