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.How exactly would I get sun intensity for the spot below the aircraft?
It'd give more realistic thermals.
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;
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;
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
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
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.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
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
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)
BTW, to better advertise your glider, I think you'd better update the first post with a fresh screenshot.