I'm trying to use the code found at this link: http://www.irrforge.org/index.php/Custo ... ra_control
The problem is that if the mouse cursor isn't inside the window and sitting still when the program starts, the camera control doesn't work right. That seems to be the reason. It only rotates in 2 directions.
It happens in windowed and full screen.
Any information on this i'm missing?
Custom camera control
After going over the code some more, I found the problem.
I'd checked every other part of the program, but overlooked that one line at first.
Code: Select all
//************************************************
// MAIN LOOP
while(device->run() && driver){
if (device->isWindowActive())
{
driver->beginScene(true, true, SColor(255,0,0,0));
smgr->drawAll();
//edit - The line below needed to be commented out for rotation to work
//camMain->setTarget(camChild->getAbsolutePosition());
//Draw GRID
driver->setTransform(video::ETS_WORLD, core::matrix4());
video::SMaterial m;
m.Lighting = false;
driver->setMaterial(m);
for(float i = -50; i <= 50; i += 10){
driver->draw3DLine(vector3df(-50,0,i),vector3df(50,0,i));
driver->draw3DLine(vector3df(i,0,-50),vector3df(i,0,50));
}
driver->endScene();
myEvents.manageEvents();
}
}