Based upon the debug values I have for the c_trace distance returns, the paper math is giving me the same answer as the engine.

That is what led me to believe it was a problem with the c_trace function. I don't think it's giving me accurate distance values. frown

Here's the code I have for c_trace and setting up the vectors to use in it. Let me know if I've done something wrong here, please.

vec_set(t_vec.x,vector(0,0,-500));
vec_for_ent(t_vec.x,me);
floor_dist_center = c_trace(me.x,t_vec.x,IGNORE_ME | IGNORE_PASSABLE | IGNORE_PASSENTS | IGNORE_MODELS | IGNORE_SPRITES);
vec_set(t_vec.x,vector(60,0,-500));
vec_for_ent(t_vec.x,me);
vec_set(t2_vec.x,vector(60,0,0));
vec_for_ent(t2_vec.x,me);
floor_dist_front = c_trace(t2_vec.x,t_vec.x,IGNORE_ME | IGNORE_PASSABLE | IGNORE_PASSENTS | IGNORE_MODELS | IGNORE_SPRITES);

if (floor_dist_center != 0 && floor_dist_front != 0)
{
targtilt = atan((floor_dist_center-floor_dist_front)/60);
}

Last edited by Plystire; 07/03/09 00:29.

The one and only,
~Plystire