anyone know please post
Okay guys I’m in the middle of developing my FPS camera Code and I’m SO CLOSE I can taste it!
I have 1 problem though, is there a way to confine the mouse to the render window or to reset the position of the mouse every frame?
base.win.movePointer(0, base.win.getXSize()/2, base.win.getYSize()/2)
Hey cool thanks. So I don’t have to ask stupid questions like this again where can I find all the info on base.everything? I can’t find any of it in the manual or the API.
The base builtin is an instance of the ShowBase class, which you can find here:
spinning a object by moving the mouse
environ = loader.loadModel(“object”)
mx = base.mouseWatcherNode.getMouseX()
my = base.mouseWatcherNode.getMouseY()
dis = mx * 2 dis2= my * 2 time = task.time * 2 angledegrees = time* 6.0 * mx angledegrees1 = time* 6.0 * my angleradians = angledegrees * (math.pi / 180.0) environ.setHpr(angledegrees,-angledegrees1, 0) print mx print my return Task.cont
hope that helps a bit
be sure that your mouse cursor is in the engine window by starting up, instead the programm crashs