I copy/pasted my code from a single file into multiple files to make it cleaner, I haven't changed anything from the collision animators and triangle selectors and it does that...
http://www.youtube.com/watch?v=b2hrP48w72E
I don't bounce on the ground but I bounce on the floor, weird...
I'm sure I missed something but I don't really see what.
Here's the ground's code (where I don't bounce):
Code: Select all
IAnimatedMesh * groundMesh = CynEngine->getScene()->addHillPlaneMesh("Plane", dimension2d<f32>(100.0f, 100.0f), dimension2d<u32>(100,100), 0, 0, dimension2d<f32>(0,0), dimension2d<f32>(250,250));
ground = CynEngine->getScene()->addAnimatedMeshSceneNode(groundMesh);
ground->setPosition(vector3df(0,0,0));
ground->setMaterialTexture(0, CynEngine->getDriver()->getTexture("./assets/textures/grass/grass002.jpg"));
groundSelector = CynEngine->getScene()->createOctTreeTriangleSelector(groundMesh->getMesh(0), ground, 128);
ground->setTriangleSelector(groundSelector);
ISceneNodeAnimator *groundAnim = CynEngine->getScene()->createCollisionResponseAnimator(
groundSelector, CynEngine->getCamera()->getNode(), vector3df(3,5,3),
core::vector3df(0,-5,0));
CynEngine->getCamera()->getNode()->addAnimator(groundAnim);
groundAnim->drop();
groundSelector->drop();
Code: Select all
node = CynEngine->getScene()->addMeshSceneNode(mesh);
node->setPosition(position);
selector = CynEngine->getScene()->createTriangleSelector(mesh, node);
node->setTriangleSelector(selector);
anim = CynEngine->getScene()->createCollisionResponseAnimator(selector, CynEngine->getCamera()->getNode(), vector3df(3,5,3), vector3df(0,-5,0));
CynEngine->getCamera()->getNode()->addAnimator(anim);
anim->drop();
selector->drop();