Outerra forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Outerra Tech Demo download. Help with graphics driver issues

Author Topic: TrackIR 5 with FreePIE  (Read 9273 times)

PaulMoffat

  • Full Member
  • ***
  • Posts: 108
  • Modeller
    • Paul Moffat's Website
TrackIR 5 with FreePIE
« on: February 10, 2014, 02:04:39 am »

I've been trying to get TrackIR to work within Outerra and finally stumbled across a solution called FreePIE which in my case atleast did the trick. Obviously without in-built support for TrackIR by Outerra I was left to try and find alternatives.

My first attempt was the mouse emulator which came with the TrackIR software but that is as good as useless. A little research into that software brought about the revelation that any game which indirectly supports it must use DirectInput for their mouse control for it to have any effect in the first place. A fair amount of games cannot even use that simple mouse emulation for that very reason.

I've seen some posts here by others who have had success using TrackIR with a software application called FreeTrack, which incidentally borked the whole thing with a recent build when bringing in support for Occulus Rift. I tell ya, that device is the bain for TrackIR I tell ya. I'm definitely getting me one when they come out. I tried FreeTrack anyway but could not get it to recognise my TrackIR unit for some reason.

Anyway, FreePIE (http://andersmalmgren.github.io/FreePIE) is an Input Scripting Interface which uses the Python programming language, which thankfully for me is very similiar to C/C++. It allows one to script input control scripts for various input devices including TrackIR.

Here is a TrackIR Script I ripped of their website and then slightly modified to remove the need to hold down the hotkey which in this case was the right mouse button.

Code: [Select]
#Use Z to toggle on/off [DISABLED:and right mouse to activate head tracking]
#(Good for games like Outerra)
def update():
    yaw = trackIR.yaw
    pitch = trackIR.pitch
   
    deltaYaw = filters.delta(yaw)
    deltaPitch = filters.delta(pitch)   
     
    if (enabled): #if (enabled and hotkey)
        mouse.deltaX = deltaYaw*multiply
        mouse.deltaY = -deltaPitch*multiply

if starting:
    enabled = False
    multiply = 20
    trackIR.update += update

#hotkey = mouse.rightButton
toggle = keyboard.getPressed(Key.Z)

if toggle:
    enabled = not enabled

Something I noticed when using this script is that it even allows TrackIR to reset the viewpoint back to some pre-designated datum point which is usually by the F12 key. There is a bit of a trick here though. Because of the lack of support in-game for TrackIR any truelook feature does not exist, meaning all view navigation is relative. With that in mind, everytime you activate TrackIR immediately press F12. This will reset the viewpoint to that current direction and any subsequent F12 presses from that point will return the view to that original direction.

ie. the front facing cockpit view for example.

The above script uses Z as the toggle button to enable/disable TrackIR. This was the original key in the script but can obviously be changed if you feel the need.

I am going to experiment further with this and will update if I come across any other relevant information/insights.
Logged
Who said there were no real predators in New Zealand? Us Kiwis don't just fly, we bite hard too!

PaulMoffat

  • Full Member
  • ***
  • Posts: 108
  • Modeller
    • Paul Moffat's Website
Re: TrackIR 5 with FreePIE
« Reply #1 on: February 10, 2014, 02:18:27 am »

Yeah I feel like a tool, I just read the Natural Fail post and found there is plugin support for TrackIR. I restarted FreeTrack and found ya had to actually press the START button before it works, and that an even new build has got rid of the problems experienced previously by some people. Man do I feel like an idiot.

Well, atleast we now have a choice here. Nothing like more options anyway. I'm gonna try both see which one works better anyway.
Logged
Who said there were no real predators in New Zealand? Us Kiwis don't just fly, we bite hard too!

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6700
  • No sense of urgency.
    • outerra.com
Re: TrackIR 5 with FreePIE
« Reply #2 on: February 10, 2014, 02:21:25 am »

Yea, we must sticky a post somewhere in the support board, pointing at that 3rd party plugin and at the API that can be used to create other ones ...
Logged