TrackIR Support

Discussion in 'The Hangar Bay' started by idealius, Oct 8, 2015.

  1. idealius

    idealius Ensign

    Joined:
    Sep 30, 2015
    Messages:
    4
    Likes Received:
    5
    I created a trackIR script to allow headtracking to control the mouse in the game.

    How do I get started?
    1. Own trackIR
    2. Google and download FreePIE
    3. Copy and paste the below script into FreePIE then save it somewhere and hit F5 to run it (Shift+F5) will disable it.
    4. While in-game hit 'Z' on your keyboard to toggle it on and off. Beware you will actually have to adjust your key settings because this is assigned to an in-game key for Empyrion (I can't remember which.) It isn't hard to adjust the code or to change that key binding in game, but just so you know....

    Code:
    #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
    Additional question about using it:
    1. Do you use it often? About 1/3rd of the time playing it. Crafting doesn't work well with trackIR because it's all UI stuff.
    2. Feel free to use the toggle on off key (Z) to re-center it's reference point... and well to turn it on and off...
    3. Track-IR has a deadzone feature built into it, you may want to play with that... Or the script might be easily modified to include it too. Check out FreePIE and see if you can figure it out?
    4. Feel free to adjust 'threshold' under 'starting:' in the script... this is the angle on the horizontal axis before the script initiates auto-panning.

    If you're not familiar with trackIR....

    It is a sort of camera that detects IR light reflectors / emitters attached to your head in the form of "clips" (like to your headphones) so that it can detect where you are facing and move the field of view in the game to match it. So it's like virtual reality with your monitor... in a way.

    More:
    It is about $130-140 US dollars with the trackIR pro, an IR emitter. I think it's closer to 100 with only the camera and a hat reflector..

    Anyhow, it is integrated in a lot of simulator games and even some FPS games!!

    BUT, not Empyrion... which is both!

    So I created a script using an input emulator called FreePIE.
    It is based on the sample script from the FreePIE website, but it also copies the "mouse emulation" app included with trackIR in that it can continuously pan (or yaw) on the horizontal plane so that you aren't anchored to one field of view on the horizontal axis...I.e. it works more like trackIR's API was added to the game!

    Bonus: The trackIR mouse emulation app only works for games using DirectInput. Because the power of FreePIE, This will work in ANY FPS! :)
     
    #1
  2. David Hollis

    David Hollis Commander

    Joined:
    Nov 2, 2014
    Messages:
    114
    Likes Received:
    75
    Excellent work. Always good to see additional apps and tweaks to add immersion to an already amazing game. :)

    If and when joystick support is added, I imagine my underused EDtracker unit will be dusted off. :)
     
    #2
    idealius likes this.
  3. idealius

    idealius Ensign

    Joined:
    Sep 30, 2015
    Messages:
    4
    Likes Received:
    5
    Thanks!

    FreePIE works with joysticks to convert them to emulate mice as well. I think with EDtracker that's all you would need to get started?

    It also works with vJoy, a joystick emulator which happens to work well with UJR, an auto-hotkey joystick remapper.
     
    #3
    David Hollis likes this.
  4. David Hollis

    David Hollis Commander

    Joined:
    Nov 2, 2014
    Messages:
    114
    Likes Received:
    75
    Outstanding, always good to know this kind of info. Many thanks :)
     
    #4
  5. Taun Hawk

    Taun Hawk Lieutenant

    Joined:
    Nov 26, 2015
    Messages:
    22
    Likes Received:
    17
    Is anyone still using this created script for Track IR? I tried this with my Track IR5 last night for the first time and get the following error after running the script: "unexpected indent"

    Also do I need to run the Natural Point Track IR software in the background too? Or does FreePIE actually run the hardware?

    Here is a copy of my script and error:
    FreePIE error.jpg
     
    #5
    Last edited: Feb 16, 2016
  6. stampeete

    stampeete Ensign

    Joined:
    Apr 30, 2016
    Messages:
    1
    Likes Received:
    0
    Impressive ! I own a tobii eyex myself... Will this work too with
    empyrion? I wondered why nobody else has done a script like infinite screen before for empyrion. Ill try it out this evening!
     
    #6
    Last edited: May 2, 2016
  7. NeilF

    NeilF Lieutenant

    Joined:
    Nov 28, 2016
    Messages:
    2
    Likes Received:
    0
    LOL! So I have an EdTracker, so my workings would be...

    EdTracker-->EdTracker Software-->OpenTrack (TrackIR emulator)-->FreePie-->Empyrion



    Would be so much easier (for all of us) if a key option simply enabled/disabled head look for TrackerIR in Empyrion :)
     
    #7

Share This Page