Hi not sure if this helps as Im getting back into GS after a hiatus of a year so I cannot guarantee it works now. This is some old code not made by me that works after a trace. Basically this can be converted to contain changes to the roll as it only currently converts the tilt of the surface to the player. The my.tilt += 0.1....is there to smoothly change the the tilt angle of the player.

Hope this helps...


temp.tilt = 0;
temp.roll = 0;
temp.pan = -my.pan;
vec_rotate(normal, temp);
temp.tilt = -asin(normal.x);
my.tilt += 0.1 * ang(temp.tilt - my.tilt); // play with 0.1
my.roll = 0;