[solved] bounce of a sphere

nord666

09-07-2008 23:35:18

Hi,

i created a sphere. When i throw it, it bounce a bit to much with every thing. How can i make it bounce less?

Thanks

walaber

10-07-2008 07:28:28

yes. you need to set the default material settings... if you are using the default material, you could do this:


const OgreNewt::MaterialID* mat = mWorld->getDefaultMaterialID();
OgreNewt::MaterialPair* matPair = new OgreNewt::MaterialPair( mWorld, mat, mat );

matPair->setDefaultElasticity( 0.2f );

delete matPair;


something like that. elasticity 0 = no bounce, 1 = full bounce.

nord666

10-07-2008 19:21:41

thanks again Walaber!

Just an other question: What is the "f" in 0.2f?
I saw that many times but never known the signification.

ProfesorX

10-07-2008 22:16:52

thanks again Walaber!

Just an other question: What is the "f" in 0.2f?


The "f" means that the constant is float, by default, real constants are of type double.

nord666

11-07-2008 19:12:27

Ok thank! :D