md = base.win.getPointer(0)
x = md.getX()
y = md.getY()
if base.win.movePointer(0, base.win.getXSize()/2, base.win.getYSize()/2):
self.playerNP.setH(self.playerNP.getH() - (x - base.win.getXSize()/2)*0.1)
base.camera.setP(base.camera.getP() - (y - base.win.getYSize()/2)*0.1)
This python code is meant to rotate the character controller left and right when the mouse moves left and right, and rotate the camera that is attached to it up and down when the mouse moves up and down, to give a first person view / control. The camera moves fine with the mouse. The controller seems to jump to completely random values of H when I move the mouse along the x axis. How do I fix this, or is this a bug? I am using Panda3d with Bullet.