Been looking at my code for a couple days now and it SHOULD work, if my math is correct, which after many sit downs, I think it is.
The goal:Get my model to tilt properly to the terrain under it (without using the physics engine)
The technique:I started off with just the tilt and would move on to the roll after the tilt was working.
I started with using c_trace to find the distance to the ground from the center of my model. Then use another c_trace to find the distance to the ground from the front of my model. Once I had those two distances, I could get the difference between them, and use atan to find the angle that the model should be angled to.
Here's a picture to show what I mean:

The formula based on the picture would be:
theta = atan((A-B)/L)
I think this is correct... but for some reason I'm not getting the angle I think I should be.
I know the slope my model is standing on is exactly 15 degrees, but it constantly returns 7.125
Can anyone see anything wrong with my method here, or if there is an easier way to do this (without using the physics system).
Thanks in advance for any help.