Collision of multi nodes. Another problem

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Jasper

Collision of multi nodes. Another problem

Post 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
CZestmyr
Posts: 72
Joined: Sat Feb 12, 2005 7:11 pm
Location: Czech Republic
Contact:

Post 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:
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

Code: Select all

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