#Littlebobs Super Mouse Look Script!!!!
import Rasterizer
cont=GameLogic.getCurrentController()
camera = cont.owner
mouse=cont.sensors['mouse']


if hasattr(GameLogic,"center"):
    x,y=GameLogic.center[0]-mouse.position[0],GameLogic.center[1]-mouse.position[1]
    camera.applyRotation((0,0,x*.002),0)
    camera.applyRotation((y*.002,0,0),1)
    Rasterizer.setMousePosition(GameLogic.center[0],GameLogic.center[1])

else:
    GameLogic.center=Rasterizer.getWindowWidth()/2,Rasterizer.getWindowHeight()/2
    Rasterizer.setMousePosition(GameLogic.center[0],GameLogic.center[1])