Heres the code for the gun:
Code: Select all
//Weapon
irr::scene::IAnimatedMesh* wepMeshRifle;
irr::scene::IAnimatedMeshSceneNode* wepNodeRifle;
wepMeshRifle = smgr->getMesh("rifle.md2"); //The Rifle is loaded here.
wepNodeRifle = smgr->addAnimatedMeshSceneNode(wepMeshRifle, camera, -1); //The camera is now the Rifles parent.
wepNodeRifle->setScale(core::vector3df(100,100,100));
wepNodeRifle->setPosition(core::vector3df(150,-400,450));
wepNodeRifle->setRotation(core::vector3df(0,0,0));
wepNodeRifle->setMaterialTexture(0, driver->getTexture("rifle.bmp"));
It says it loads it, then it crash's without giving an error in the console.