Hey guys
My app compiles ok but when i run the program it's says that my setTriangleSelector has a Access violation.
I tried a lot of thing, i spent half a day trying to fix it.
I hope you can help me, here is my code where the problem occured:
ISceneNode* node2;
IAnimatedMeshSceneNode* anms = smgr->addAnimatedMeshSceneNode(smgr->getMesh("Data/ast.ms3d"));
IAnimatedMesh* ast = smgr->getMesh("Data/ast.ms3d");
if (node2)
{
anim = smgr->createFlyStraightAnimator(vector3df(-2000,-230,-1249),
core::vector3df(40000,100,-700), 50000, false);
anms->setMaterialTexture(0, driver->getTexture("Data/ast.bmp"));
anms->addAnimator(anim);
anim->drop();
anms->setMaterialFlag(EMF_LIGHTING, false);
anms->setAnimationSpeed(10);
selector = smgr->createOctTreeTriangleSelector(ast->getMesh(0), node2, 128);
node2->setTriangleSelector(selector);
selector->drop();
anim = smgr->createCollisionResponseAnimator(
selector, node2,vector3df(5,3,5),vector3df(0,-10,0), 50.0f, vector3df(0,0,7), 0.5);
node2->addAnimator(anim);
anim->drop();
};
Any ideas?
Thanks
triangleselector problems
-
hearsedriver
- Posts: 81
- Joined: Fri Aug 22, 2003 12:06 pm
- Location: Germany
- Contact:
node2 is uninitialized and points into Nirvana, so node2->setTriangleSelector(selector); will cause a crash.
Cheers.
Cheers.
matthias gall, lead programmer at sechsta sinn - email matthias@sechsta-sinn.de