This is the part of my game loop that is supposed to execute this code.
Code: Select all
while(device->run())
if (device->isWindowActive())
{
rcv.endEventProcess();
smgr->addToDeletionQueue(beam);
ray.start = camera->getPosition();
if(camera->getPosition() == ninja->getPosition())
{
ninja->setFrameLoop(166,173);
}
//beam->setRotation(core::vector3df(0,0,0));
if(rcv.leftMouseReleased())
{
gun->setFrameLoop(40,41);
smgr->addToDeletionQueue(beam);
}
if(rcv.leftMouseDown())
{
gun->setFrameLoop(15, 25);
scene::CBeamNode* beam = new scene::CBeamNode
(q3node, smgr, -1,"media/red.jpg","media/red.jpg");
beam->setLine(ray.start, ray.end, 7.0f);
beam->addAnimator(ba);
//sound->play2D("media/impact.wav", false);
}