TrackIR FPS Script with Auto Pan

Official forum for open source FreePIE discussion and development.
Post Reply
Idealius
One Eyed Hopeful
Posts: 1
Joined: Thu Oct 08, 2015 9:21 pm

TrackIR FPS Script with Auto Pan

Post by Idealius »

I made this script based on the example script to copy the TrackIR product's 'mouse emulator' app so that I can use similar functionality in any game.

Cheers!

Code: Select all

#Use Z to toggle on/off [DISABLED:and right mouse to activate head tracking]
#(Good for games like EMPYRION)
deltaYaw = 0
def update():
    global deltaYaw
	
    cur_yaw = trackIR.yaw
    deltaYaw = filters.delta(cur_yaw)
    
    if cur_yaw > threshold:
    	deltaYaw += (cur_yaw - threshold) / 75 #.6
    elif cur_yaw < -threshold:
    	deltaYaw -= -(cur_yaw + threshold) / 75 #.6
    #diagnostics.watch(origin_yaw)
    
    deltaPitch = filters.delta(trackIR.pitch)
	 
    if (enabled): 
        mouse.deltaX = deltaYaw*multiply_x
        mouse.deltaY = -deltaPitch*multiply_y
        
if starting:
    enabled = False
    multiply_x = 15
    multiply_y = 15
    trackIR.update += update
    threshold = 45
   	
toggle = keyboard.getPressed(Key.Z)

if toggle:
    enabled = not enabled
phlaange
One Eyed Hopeful
Posts: 1
Joined: Thu May 28, 2020 11:00 am

Re: TrackIR FPS Script with Auto Pan

Post by phlaange »

Thank you! This is just what I was looking for.
Post Reply

Return to “FreePIE”