Cockpit-View now supports HeadTracking (via a Virtual Joystick).
Setup your favorite HeadTracking software (TrackIR, OpenTrack, FreeTrack, LinuxTrack) to output to a virtual Joystick (vJoy, PPJoy). And set āCenter-Buttonā to the same as in this game (Joystick-Button 2)
E.g. on Windows I use TrackIR->FreePie->vJoy. For FreePie the Python script from here is used:
You can find a copy of that script in this blend here.
(vJoy has the big advantage that it is recognized by UPBGE out of the box.)
The Joystick Configuration menu now allows to enable/disable different connected Joysticks.
Lots of small improvements for Propeller start/stop, Enter/Exit animation etc.
Outside view can now also be rotated by HeadTracking:
Instead of the old TrackIR3 Software Iām now using this old Camera with Freetrack which gives more precision (because I can use it with a homebuilt 3point system which really are only some reflective dots on a cap, you would laugh seeing it)
The Python script for FreePie to read Freetrack is now also included in the blend.
It bothered me that my SuperGuepard always fell like a wet sack at low speeds.
As I said the flight model is very simple.
It still is but now got much better especially at low speeds.
A wing behaves differently at different Angles of Attack due to its airfoil.
I had no idea how to implement airfoil data and used a simple sinus function before.
This is now replaced by using an animation action graph as data source for the lift coefficient at different angles of attack:
This is the python line: Coefficient_Lift=bpy.data.actions["Airfoil"].fcurves[0].evaluate(math.degrees(AngleOfAttack)+1)
My (manually editable) graph is inspired by the graphs shown and mentioned in this video (the author implemented a much more sophisticated/complicated system)
Starting at minute 6.09
I just took the black version and now SuperGuepard can glide much better at lower speeds and land more safely on Piazza San Marco in Venetia
Original SuperGuepard can fly really slow.
Both demo files are updated with better flight physics and low-fps-compensation.
A bit of slipstream
and much better handling at low speed and when falling or near stall. Also the yaw now works properly. You can now fly beautiful U-Turns.
The compensation of lower fps (like in the Venetia-demo) sets LogicTicRate to the Average FrameRate, calculates Delta-time and multiplies all Movements of static objects like Camera with it. Physics and animations donāt need to be multiplied with Delta-Time.
This is the code:
import bge
cont = bge.logic.getCurrentController()
own = cont.owner
# give 60 frames time to get a reliable AverageFrameRate
if "AVRskip" not in own:
own['AVRskip']=60
own["AVR"]=bge.logic.getAverageFrameRate()
if own['AVRskip']<0 and own["AVR"]>0:
bge.logic.deltaTime=1/own["AVR"]
else:
bge.logic.deltaTime=1/60
if own["AVR"]<=0.0: own["AVR"]=60
if own['AVRskip']<0 and 0<own["AVR"] < 60:
bge.logic.setLogicTicRate(own["AVR"]+1)
own['AVRskip']-=1
As reference Framerate I use 60 fps so deltatime can be applied like eg.: Propeller.applyRotation([0,PropellerSpeed*bge.logic.deltaTime*60,0],True)
For the first demo I had to disable the logicTic Rate setting because the Trails are somehow incompatible with it and slow down the framerate massively doen to 35fps.
I usually get 60 Frames and with Trails 50 so it is ok.
For the Venetia demo it is enabled because there I get 30fps anyway and the Trails donāt have an impact. But the physics feel much better.
(UPBGE 0.36 has problems with the Trails in Venetia. UPBGE 0.3 is better here)
Trails-Performance increasement 10% faster
No Physics slow down despite low fps.
Better rendering of Water vs Ground (no more Z-fighting flickering).
The fix for that was to increase the cameras āstartā-value.