I have a problem with collision detection of multi nodes
I have used the methodes like this (I also have found this in one example)
scene::IAnimatedMesh* mesh = smgr->getMesh("kk.bsp");
if (mesh)
node = smgr->addOctTreeSceneNode(mesh->getMesh(0));
scene::IMetaTriangleSelector *Meta = 0;
scene::ITriangleSelector *selector = 0;
if (node)
{
selector = smgr->createOctTreeTriangleSelector(q3levelmesh->getMesh(0), node, 128);
node->setTriangleSelector(selector);
Meta->addTriangleSelector(selector);
}
scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
Meta, camera, core::vector3df(30,50,30),
core::vector3df(0,-0.003,0), // früher 0,-3,0 Grafitationsbeschleunigung
core::vector3df(0,50,0));
camera->addAnimator(anim);
anim->drop();
The problem now is that I got runtime error because of zero pointer
at the line "Meta->addTriangleSelector(selector);"
But the pointer selector was not zero!
I used VC6.0
Greetings
Jasper
Collision of multi nodes. Another problem
Code: Select all
scene::IMetaTriangleSelector *Meta = smgr->createMetaTriangleSelector();