toglia
17-05-2008 07:36:25
I thought it was a good idea to group all before and after code questions and answers in one thread for the people changing to bleeding, like me.
[with Bleeding 1.0.20]
First up. I have noticed that sometimes my string params don't work like on 0.9:
That gravity parameter doesn't seem to work, (bodies fall very slowly).
I solved it this way:
Second, I used to assign my Nx-material in the shape parameter this way (Bleeding way now):
But that sphere doesn't bounce...
Solved this way:
That's what I have found so far, but I would like to know how to use the string parameters again to assign materials and gravity.
I will probably be adding more stuff to this topic while I learn, others could join too.
[with Bleeding 1.0.20]
First up. I have noticed that sometimes my string params don't work like on 0.9:
mWorld->createScene("myScene", "gravity: 0 -100 0, floor: yes, renderer: ogre");
That gravity parameter doesn't seem to work, (bodies fall very slowly).
I solved it this way:
NxOgre::SceneParams sceneParams;
sceneParams.setToDefault();
sceneParams.mGravity = NxVec3(0,-100,0);
sceneParams.mFloor = true;
sceneParams.mRenderer = NxOgre::SceneParams::RN_OGRE;
mScene = mWorld->createScene("myScene",sceneParams);
Second, I used to assign my Nx-material in the shape parameter this way (Bleeding way now):
NxOgre::Material * mMat = mScene->createMaterial("myMat");
mMat->setRestitution(1);
mScene->createBody("myBody",new NxOgre::Sphere(1,"material:myMat"), Vector3(0,10,0),"model:sphere.mesh","mass: 1");
But that sphere doesn't bounce...
Solved this way:
NxOgre::ShapeParams matParam;
matParam.setToDefault();
matParam.mMass = 1;
matParam.mMaterial = mMat->getMaterialIndex();
... new NxOgre::Sphere(1,mParam) ...
or
myBody->getCollisionModel().Get(0)->getNxShape()->setMaterial(mMat->getMaterialIndex());
That's what I have found so far, but I would like to know how to use the string parameters again to assign materials and gravity.
I will probably be adding more stuff to this topic while I learn, others could join too.
