
; Mouse handling

	0.01 exec "..\fwatch\data\InputMulti.sqs"

	#Loop
	~0.01
	keyboard = FWATCH_INPUT_MULTI select 0
	_mouse   = FWATCH_INPUT_MULTI select 3
	MSX      = _mouse select 2
	MSY      = _mouse select 3
	LBUTTON  = ("LBUTTON" in keyboard)
	RBUTTON  = ("RBUTTON" in keyboard)


	
; 2D to 3D conversion
	
	? MSY < 0.5  : _fy=(0.009467 * (MSY*100)^2) + (-1.317333 * (MSY*100)) + 42.2
	? MSY >= 0.5 : _fy=(0.002189 * (MSY*100)^2) + (-0.6315 * (MSY*100)) + 25.961111

	_findA = 0.009411 * _fy + 0.444194
	_findB = -0.470543 * _fy - 22.209643
	_fx    = _findA * (MSX*100) + _findB
	
	
	
; Find pos

	CUX = (getPos camtarget select 0) + _fx
	CUY = (getPos camtarget select 1) + _fy
	
	_dir = (getDir camtarget)
	CUX  = (getPos camtarget select 0) + _fy * sin(_dir) + _fx * cos(_dir)
	CUY  = (getPos camtarget select 1) + _fy * cos(_dir) - _fx * sin(_dir)
	CUZ  = 0	
	
	
	goto "Loop" 