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"

Breakpoint conditions for UStructs? (Debugger thinks FVector is a "union_128")

I have what seems like it'd be a fairly common problem - a player's position getting set... somewhere... to an invalid value. I'm trying to track it down.

I'd like to set a data breakpoint which triggers if the player's RootComponent's ComponentToWorld transform's Translation.Z value is < 0. (In my test level, the player ends up underground.)

However, while I can set the data breakpoint to watch the ComponentToWorld.Translation FVector, any time I try to go deeper into the nested structures I run into problems. The core issue seems to be that for some reason the C++ debugger thinks that ComponentToWorld.Translation is something called a "union_m128" rather than am FVector, and therefore doesn't have a .Z member.

I've tried casting the ComponentToWorld.Translation back to an FVector, and it didn't help. I'm assuming that the problem is related to some sort of low-level platform math issue, where every platform has, under the hood, a different implementation of some basic math functions, but I have no idea how to work around that.

Has anyone gotten this working, or have any idea how to work around it? It seems like a really common problem, and exactly what data breakpoints are meant to solve.

Product Version: UE 4.17
Tags:
more ▼

asked Oct 17 '17 at 10:03 PM in C++ Programming

avatar image

Teiwaz
639 26 29 57

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

1 answer: sort voted first

I never found a way to convert the __m128 back to an FVector, but by examining the value with a watch, I was able to find the data.

The __m128 appears to be a generic structure which just... contains 128 bytes of data in various configurations for reasons I don't understand, in the form of multiple arrays which store various basic data types of different sizes.

I found the Z-value of the vector here: Translation.m128_f32[2]

more ▼

answered Oct 17 '17 at 11:07 PM

avatar image

Teiwaz
639 26 29 57

(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