So how does ephemesis/sun/local work?
Is it a vector in geocentric coord system to the sun? And if so, is it always a unit vector?
Thank you for the confirmation, I just take the vector then and multiply it with a big factor, and add it to the aircraft position, then looking at that new position should be approx same as looking at the sun I reckon.
var sun_vec = [getprop("/ephemeris/sun/local/x"), getprop("/ephemeris/sun/local/y"), getprop("/ephemeris/sun/local/z")];
var sun_angle_to_tracker = SpaceShuttle.dot_product(me.world_pointing_vec, sun_vec);
#print (sun_angle_to_tracker);
if ((me.manual == 0) and (sun_angle_to_tracker > 0.93))
{me.shutter = "CL"; return;}
else
{me.shutter = "OP";}
Hmm, you don't happen to have how to take a position, pitch, heading and then a distance away in the direction of the pitch and heading to get a new position (in FG-world coords)?
pos.apply_course_distance(heading, distance * math.cos(pitch_rad));
pos.set_alt(pos.alt() + math.sin(pitch_rad) * distance);
To get the me.world_pointing_vec could bring me some trouble though.
To get the me.world_pointing_vec could bring me some trouble though.
Users browsing this forum: No registered users and 9 guests