x

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"

How to determine the thickness of a mesh along a path

Hi-- I'm trying to find a way to determine the relative thickness of a mesh along a path (a raycast, for instance, but other means are useful too). Basically I want a function that returns the effective thickness oin Unreal Units of a mesh along a segment. I tried to use a multiline trace by channel creating a new channel and setting all collisions to "overlap", but given the point where the first collision with the mesh occurs, I don't know how to figure out where the raycast "exits" the mesh. Does anybody have any idea?alt text

Product Version: UE 4.12
Tags:
wallthickness.png (12.3 kB)
more ▼

asked Aug 03 '16 at 08:27 AM in Blueprint Scripting

avatar image

Hurricane80
26 2 3 3

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

2 answers: sort voted first

Hey Hurricane,

You are looking in the right direction!

So your raycast gives an array of different FHitResult's, these are all the 'hits' unreal calculated. They save some usefull information but we only need 2 variables from them, the location and the actor/mesh they hitted.

So to find the width of the mesh you need to check each hit's actor and if it is the actor you want to calculate it's width from you store the hit's location.
This will give you 2 points (A,B) and then you just have to calculate the length between them ((B-A).length)

This is an example that will save the width of the first actor it hits:

alt text

hope this helps :)
Elias

calcwidth.jpg (286.6 kB)
more ▼

answered Aug 03 '16 at 11:37 AM

avatar image

PasteDog
1.2k 24 18 53

avatar image Hurricane80 Aug 03 '16 at 01:06 PM

Beautiful, thanks! I thought that the hit result in a raycast only returned the entry location, not the entry AND exit location.

avatar image Ineni.Realtime Aug 16 '16 at 06:02 AM

Am I missing something here? I can't get a multitrace to collide with the same mesh twice.

avatar image Shohei Aug 16 '16 at 06:29 AM

You aren't missing anything. FHitResult only gives you the impact point and trace doesn't hit the same actor twice.

avatar image PasteDog Aug 17 '16 at 07:31 AM

Oh really? Well you can simulate it yourself using 2 traces. I do everything in c++ so I don't always test it fully and just explain the expected behavior of these functions...

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

As PasteDog mentioned, do 2 traces, one trace from start to end, another trace from end to start. Then check if both trace hit same object. So the first trace gives you entry point, and second gives you exit point. Hope it helps.

Frank

more ▼

answered Aug 22 '17 at 01:52 AM

avatar image

franklmb
6 1

(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