separate(adagate)



procedure handle_mouse_move( nowTime : gldouble ) is

	mousedx, mousedy : gldouble;
	dt : gldouble := nowTime-oldMmTime;
	et : float := float(dt);
	xpos,ypos : aliased gldouble;

	ff : float := 1.0; --speedup factor
	--want quicker response @ 3rd person,
	--want slower response @ hiDpi on osx

begin


	if thirdperson then ff:=ff*1.2; end if; -- 20% faster response
	--if hidpi then ff:=ff*2.0; end if; 

	if et>0.1 then et:=0.0; end if; 
	--prohibit large jumps due to stale oldMmTime.

	glfwgetcursorpos(mainWindow,xpos'access,ypos'access);

	mousedx:=xpos-xold;
	mousedy:=ypos-yold;
	xold:=xpos;
	yold:=ypos;
	oldMmTime:=nowTime;


	-- should include factor (et) that makes response
	-- proportional to time since last update.
	horiAng := horiAng - 0.05 *et*ff*mslu* float(mousedx);
	vertAng := vertAng - 0.05 *et*ff*mslu* float(mousedy);

	slewToAv; --27jan18

	xlook := fmath.cos(vertAng)*fmath.sin(horiAng);
	cylook := fmath.sin(vertAng);
	zlook := fmath.cos(vertAng)*fmath.cos(horiAng);

	--see also @ gameutils.handle_gc_look
	if( not forwardOk 
		and (abs(badHoriAng-horiAng)>fourthpi) 
		and not pauseAtLevelChange )  then
		forwardOk:=true;
		badHoriAng:=-10.0*twopi;
	end if;

	--updategamestate;


end handle_mouse_move;




