How to do make the "ellipsoid.mesh" seem spring?

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.


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...

hangchon18

14-02-2007 03:04:05

walaber:
I view your materials and collision in past newton "NDB_v130demos" example.
the ball in materials and collision is enough spring and is like football.
But the "ellipsoid.mesh"'s ball is'n enough spring in the Demo05_SimpleVehicle.
How to do the "ellipsoid.mesh"'s ball in the Demo05_SimpleVehicle the same as materials and collision in past newton "NDB_v130demos" example?

Looking earnest forword to your help...

walaber

14-02-2007 21:41:26

you need to create material objects, then create a MaterialPair, and set the default elasticity and softness for that material pair.

afterwards, don't forget to assign the proper materials to the rigid bodies.

have a look at the material demo w/ OgreNewt to see how to create materials.

hangchon18

23-02-2007 15:03:29

:D
This probrem is solved.
Thanks a ton for walaber's particular solution!