Page 1 of 1

Collision of multi nodes. Another problem

Posted: Mon Sep 26, 2005 12:54 pm
by Jasper
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

Posted: Mon Sep 26, 2005 5:01 pm
by CZestmyr
And what about the other pointer - Meta? Have you not initialized it with zero yourself in this line:

scene::IMetaTriangleSelector *Meta = 0;

:wink:

Posted: Mon Sep 26, 2005 5:24 pm
by Spintz

Code: Select all

scene::IMetaTriangleSelector *Meta = smgr->createMetaTriangleSelector();