hangchon18
12-02-2007 05:03:28
I test in Demo05_SimpleVehicle and I think make the "ellipsoid.mesh" in Demo05_SimpleVehicle to be seem
more spring and it is football.
Can you help me?
look forword...
more spring and it is football.
Ogre::Vector3 dir, vec;
Ogre::Quaternion camorient = msnCam->getWorldOrientation();
vec = Ogre::Vector3(0,0,-1);
dir = camorient * vec;
Entity* ent;
SceneNode* node;
Ogre::String name;
Ogre::Vector3 pos = msnCam->getWorldPosition();
name = "Body "+Ogre::StringConverter::toString( count++ );
ent = mSceneMgr->createEntity( name, "ellipsoid.mesh" );
node = mSceneMgr->getRootSceneNode()->createChildSceneNode( name );
node->attachObject( ent );
ent->setMaterialName( "Simple/dirt01" );
OgreNewt::Collision* col = new OgreNewt::CollisionPrimitives::Ellipsoid( m_World, Ogre::Vector3(1,1,1) );
OgreNewt::Body* body = new OgreNewt::Body( m_World, col );
Ogre::Vector3 inertia = OgreNewt::MomentOfInertia::CalcSphereSolid( 2.0, 0.1 );
body->setMassMatrix( 2.0, inertia );
body->attachToNode( node );
body->setStandardForceCallback();
body->setPositionOrientation( pos, camorient );
body->setVelocity( (dir * 50.0) );
Can you help me?
look forword...