Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Calculate floor angle using single line trace

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 bad at drawing too

I'm really bad at Vectors so,

  1. If I add Down Vector and Impact Normal together, do I get the vector parallel to the floor?

  2. How do I use [1] to make a rotator with vehicle's forward vector to calculate the slope angle and bank angle?

  3. 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.

Product Version: UE 4.18
more ▼

asked May 06 '18 at 06:45 AM in Blueprint Scripting

avatar image

18 1 2 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first
  1. Yes that should give the correct vector. One parallel to the floor. I'd normalize this for safety.

  2. 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.

  3. 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.

more ▼

answered May 07 '18 at 10:28 AM

avatar image

1.4k 2 14 17

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question