Mouselook is really...odd.

BlitzMax Modules Forums/MiniB3D/Mouselook is really...odd.

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I still had to use a custom MouseXSpeed because the built in keeps returning the mouse position.

Getting better:

'mouselook
mxspd:Float = MouseXSpeed2() / 10.0
myspd:Float = MouseYSpeed2() / 10.0
If mxspd <> 0 Or myspd <> 0 Then
	MoveMouse 400,300
	lastMX = MouseX()
	lastMY = MouseY()
EndIf
yaw:Float :- mxspd
pitch:Float :+ myspd
If pitch => 89 Then pitch = 89
If pitch =< -89 Then pitch = -89
yaw2:Float :+ ((yaw - yaw2) * 20.0) * dt
pitch2:Float :+ ((pitch - pitch2) * 20.0) * dt
RotateEntity camera,pitch2,yaw2,0


Function MouseXSpeed2:Int()
	Local mxcur:Int = MouseX() - lastMX
	lastMX = MouseX()
	Return mxcur
End Function

Function MouseYSpeed2:Int()
	Local mycur:Int = MouseY() - lastMY
	lastMY = MouseY()	
	Return mycur
End Function