I forgot, c_trace detecting backfaces was phased out AGES ago.. sorry.
[EDIT] A way around this is to reverse the c-trace vectors, ie "c_trace(outside_sphere, vehicle.x, blah)", but who cares now...
But if you got the detection running thats a start.
Importantly, is the planet model PERFECTLY smooth? Otherwise you may get odd behaviour.
Even more odd than when it works RIGHT! Normals are strange little beasties.
So to start getting you to understand normals, we will go a step at a time...
First we will capture the normal, and convert it to an angle.
So if you are getting the normals OK, remember they will need INVERTING as they are
INSIDE faces, and therefore upside-down to what you want. So firstly you need to do this...
...
VECTOR temp;
vec_inverse(vec_set(temp, hit.nx)); //invert direction vector
vec_to_angle(Vehicle.pan, temp);
...
to get the corrected vector, and force it into the Vehicle.
It may be worth TEMPORARILY increasing the gap between the vehicle and the surface
so when the vehicle performs 'odd' rotations, it wont collide with the surface, and 'disturb' the results.
Or at least make the planet PASSABLE to avoid the above...
While doing this test, put a DEBUG_VAR display showing the pan/tilt/roll of the vehicle.
Then have a fly around the planet, observing the vehicle rotations, and try to figure out the pattern.
(YES, I know. The vehicle's x-axis will currently be pointing UPWARD from the core, thats expected at this point)
HINT: Keep a CLOSE eye on the ROLL value when approaching the poles,
or when the pan or tilt values suddenly "jump' ...
I'll be waiting...