Project Glider for O2016

zachary77

New member
Joined
Aug 31, 2017
Messages
80
Reaction score
1
Points
0
I’ve just added more realistic stall characteristics. One wing now stalls before the other.
 

zachary77

New member
Joined
Aug 31, 2017
Messages
80
Reaction score
1
Points
0
Fixed sound bug (playing at start of simulation). Auto-trim modified to help with aircraft upset situations.
 

BrianJ

Addon Developer
Addon Developer
Joined
Apr 19, 2008
Messages
1,679
Reaction score
902
Points
128
Location
Code 347
How exactly would I get sun intensity for the spot below the aircraft?
It'd give more realistic thermals.
Some code to get Sun intensity on spot below aircraft. Accounts for local slope. I haven't checked it - hope it works! You could use it in PreStep{} section.


Code:
OBJHANDLE hSun = oapiGetObjectByName("Sun");
VECTOR3 sun_global_pos;
oapiGetGlobalPos(hSun, &sun_global_pos); // global frame

VECTOR3 sun_local_pos;
Global2Local(sun_global_pos, sun_local_pos); // vessel frame

VECTOR3 sun_horizon_pos;
HorizonRot(sun_local_pos,sun_horizon_pos); // local horizon frame

VECTOR3 surface_normal = GetSurfaceNormal(); // local horizon frame

normalise(sun_horizon_pos);
normalise(surface_normal);

// sun intensity 0.0 -> 1.0
double sun_intensity = dotp(sun_horizon_pos, surface_normal);

// check if sun below horizon
 if (sun_horizon_pos.y < 0) sun_intensity = 0;


// check if slope is in shadow
if (sun_intensity  < 0) sun_intensity = 0;
 

zachary77

New member
Joined
Aug 31, 2017
Messages
80
Reaction score
1
Points
0
Some code to get Sun intensity on spot below aircraft. Accounts for local slope. I haven't checked it - hope it works! You could use it in PreStep{} section.


Code:
OBJHANDLE hSun = oapiGetObjectByName("Sun");
VECTOR3 sun_global_pos;
oapiGetGlobalPos(hSun, &sun_global_pos); // global frame

VECTOR3 sun_local_pos;
Global2Local(sun_global_pos, sun_local_pos); // vessel frame

VECTOR3 sun_horizon_pos;
HorizonRot(sun_local_pos,sun_horizon_pos); // local horizon frame

VECTOR3 surface_normal = GetSurfaceNormal(); // local horizon frame

normalise(sun_horizon_pos);
normalise(surface_normal);

// sun intensity 0.0 -> 1.0
double sun_intensity = dotp(sun_horizon_pos, surface_normal);

// check if sun below horizon
 if (sun_horizon_pos.y < 0) sun_intensity = 0;


// check if slope is in shadow
if (sun_intensity  < 0) sun_intensity = 0;

Thanks so much! Works perfectly!
 

zachary77

New member
Joined
Aug 31, 2017
Messages
80
Reaction score
1
Points
0
Glider V0.8 Released

Glider V0.8 is released!
This release has quite a few additions including;
  • Thermals that vary with time of day
  • Flap/trim readouts on HUD (no more debug string)
  • More realistic stall characteristics (one wing stalls first)
  • Better warning sounds

A big thanks to BrianJ who helped me with the thermals and HUD and dbeachy1 who assisted with the HUD font. this release wouldn't have been possible without them.

Keys, etc. are the same as last release.

To-do: better mesh

Happy Soaring,
zachary77
 

Attachments

  • Glider V0.80.zip
    850.8 KB · Views: 9

BrianJ

Addon Developer
Addon Developer
Joined
Apr 19, 2008
Messages
1,679
Reaction score
902
Points
128
Location
Code 347
Hey, glad I could help. Am having fun gliding around the Alps :)
Although, I keep getting into a STALL and then an OVERSPEED and then crunch!
Well, I'm no glider pilot!
I notice the glider tends "slide" a bit when landed - are you calling "AddForce()" when on the ground? That can stop a vessel ever achieving "landed" status.
Cheers,
Brian
 

dbeachy1

O-F Administrator
Administrator
Orbiter Contributor
Addon Developer
Donator
Beta Tester
Joined
Jan 14, 2008
Messages
9,218
Reaction score
1,566
Points
203
Location
VA
Website
alteaaerospace.com
Preferred Pronouns
he/him
I notice the glider tends "slide" a bit when landed - are you calling "AddForce()" when on the ground? That can stop a vessel ever achieving "landed" status.
Cheers,
Brian

Unfortunately, that is a known bug with Orbiter 2016 and is not vessel-specific. It is possible to add a hack workaround for it, but it's a pain (at least it was for the XRs -- Orbiter tends to make the vessel "bounce" a tiny bit whenever the landed scenario loads, and so it tends to make the vessel start sliding around again -- so you have apply the hack a second or two after the scenario loads *if* ground velocity is below a small threshold).
 

zachary77

New member
Joined
Aug 31, 2017
Messages
80
Reaction score
1
Points
0
Hey, glad I could help. Am having fun gliding around the Alps :)
Although, I keep getting into a STALL and then an OVERSPEED and then crunch!
Well, I'm no glider pilot!
I notice the glider tends "slide" a bit when landed - are you calling "AddForce()" when on the ground? That can stop a vessel ever achieving "landed" status.
Cheers,
Brian

Could you provide more detail? When does the stall and overspeed occur? Might be a bug...
 

BrianJ

Addon Developer
Addon Developer
Joined
Apr 19, 2008
Messages
1,679
Reaction score
902
Points
128
Location
Code 347
Could you provide more detail? When does the stall and overspeed occur? Might be a bug...
Hi, I can't reproduce the OVERSPEED->STALL situation precisely, but if I start from the "Glider over the Alps" scenario, and just fool around doing some figure-of-eights, max. bank angle ~30deg, it happens eventually.
My feeling is it's something to do with turning to fly in the same direction as the wind - or maybe against the wind. Auto-trim ON, flaps 0.
Once the OVERSPEED happens, I can't recover control(but I'm not a glider pilot so maybe I'm not doing the right thing!).
Cheers,
Brian
 

zachary77

New member
Joined
Aug 31, 2017
Messages
80
Reaction score
1
Points
0
Hi, I can't reproduce the OVERSPEED->STALL situation precisely, but if I start from the "Glider over the Alps" scenario, and just fool around doing some figure-of-eights, max. bank angle ~30deg, it happens eventually.
My feeling is it's something to do with turning to fly in the same direction as the wind - or maybe against the wind. Auto-trim ON, flaps 0.
Once the OVERSPEED happens, I can't recover control(but I'm not a glider pilot so maybe I'm not doing the right thing!).
Cheers,
Brian

Hmm, I'll look into it. The damage code might need to be revised with more tolerance...
 

zachary77

New member
Joined
Aug 31, 2017
Messages
80
Reaction score
1
Points
0
I thought of something. Do you have atmospheric wind on? That might be the issue (its rather problematic).
 

BrianJ

Addon Developer
Addon Developer
Joined
Apr 19, 2008
Messages
1,679
Reaction score
902
Points
128
Location
Code 347
Hi,
yes, I had Atmospheric Wind on.

If I have Wind on, and start from Glider over Alps scenario, bank left 30deg, by the time I am heading ~180deg it's getting to OVERSPEED (~57.5m/s) and failure(~62.5m/s), happens quite quickly.

With Wind off, it takes long time for the glider to pick up enough speed for OVERSPEED warning, and you have to ignore the warning for a long time before failure.

I'm probably just being a careless pilot!

Cheers,
Brian
 

zachary77

New member
Joined
Aug 31, 2017
Messages
80
Reaction score
1
Points
0
I'd recommend wind be turned off for now, as it yields rather unpredictable results when flying.

In other news, I've added a vertical speed gauge to the HUD. What do you guys think about others? Like airspeed in knots or alt. in feet?
picture.php
 
Last edited:

zachary77

New member
Joined
Aug 31, 2017
Messages
80
Reaction score
1
Points
0
Hotfix: Glider V0.85

I've decided to release this in response to feedback about the damage model.

It's now completely revamped. Instead of instant loss of control, there's realistic gradual loss. You have about 15 minutes to land before bad stuff happens. During that time, it'll get harder to fly. Please try it out! Or not, because that's horrible advice. Please instead accidentally overspeed your aircraft until there's a CRUNCH, and then try to land safely. Good luck!
 

Attachments

  • Glider V0.85.zip
    851.5 KB · Views: 3

BrianJ

Addon Developer
Addon Developer
Joined
Apr 19, 2008
Messages
1,679
Reaction score
902
Points
128
Location
Code 347
Hi,
I tried out v0.85 and it's much more survivable for me.
There's more time to get out of the overspeed before damage becomes catastrophic.
The increasing loss of control after damage occurs is good - I managed to land, not safely, but possibly survivably.
Cheers,
Brian
 

zachary77

New member
Joined
Aug 31, 2017
Messages
80
Reaction score
1
Points
0
Hi,
I tried out v0.85 and it's much more survivable for me.
There's more time to get out of the overspeed before damage becomes catastrophic.
The increasing loss of control after damage occurs is good - I managed to land, not safely, but possibly survivably.
Cheers,
Brian

Glad you like it! I think it's more realistic now.
 

zachary77

New member
Joined
Aug 31, 2017
Messages
80
Reaction score
1
Points
0
Glider V0.9 Released

Here it is guys! The final version before official release on OHM!
The highlights are:
  • Reworked damage model (thanks BrianJ for feedback)
  • MUCH better mesh (thanks Marijn)
  • Acro mode*
  • Better trim response

Keys are as before, with [A] now used for acro mode.
Thanks to gattispilot for help with troubleshooting and exporting the mesh.

* A mode that turns off auto-trim and bank angle callouts.

To do: nothing:)
 

Attachments

  • Glider V0.90.zip
    1.5 MB · Views: 11
Last edited:

zachary77

New member
Joined
Aug 31, 2017
Messages
80
Reaction score
1
Points
0
Oh yeah, forgot to mention that D3D9 is now fully supported. It's highly recomended.
 

Ripley

Tutorial translator
Donator
Joined
Sep 12, 2010
Messages
3,133
Reaction score
407
Points
123
Location
Rome
Website
www.tuttovola.org
Awesome!
The screenshot you attached to your previous post still shows the reversed "D-8088" label. Is it an old screenshot?
(I'm not at my pc)

---------- Post added at 23:47 ---------- Previous post was at 14:30 ----------

BTW, to better advertise your glider, I think you'd better update the first post with a fresh screenshot.
 

zachary77

New member
Joined
Aug 31, 2017
Messages
80
Reaction score
1
Points
0
Awesome!
The screenshot you attached to your previous post still shows the reversed "D-8088" label. Is it an old screenshot?
(I'm not at my pc)

I'm pretty sure that issue's fixed.

BTW, to better advertise your glider, I think you'd better update the first post with a fresh screenshot.

Thanks, completely forgot about that! Post updated.:tiphat:
 
Top