This may be a silly question. I’m working on a Hover Vehicle Project and I want to calculate the floor angle using a single line trace for vehicle’s pitch, yaw etc. like this.

I’m really bad at Vectors so,

- If I add Down Vector and Impact Normal together, do I get the vector parallel to the floor?
- How do I use [1] to make a rotator with vehicle’s forward vector to calculate the slope angle and bank angle?
- If [2] is a stupid way to do this, or if you have a better idea on how to calculate this, explain.

Thanks if you read this so far.

- Yes that should give the correct vector. One parallel to the floor. I’d normalize this for safety.
- You can use a Find look at rotation node using the vector from part 1 as the target and a zero vector as the start, that should give you a rotator for the floor. You can grab the pitch and roll from that and do some calculations on it to convert it to get your pitch and roll (slope and bank) angles.
- Your way is not stupid just not how I would approach this. If you instead traced from the four corners of your vehicle you could get some more information you might want later as well as some slightly simpler to understand math.

Using the hit locations of both the left sides you can make a vector (Back - Front) then using the vector from the start locations (Back - Front again) you can do some lovely trig to get the angle difference. You can do the same on the right side and average it for a more accurate result. Using the same method but going left to right will give you the bank angle you need.

1 Like