Announcement

Collapse
No announcement yet.

FTransfom and coordinate translations

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    FTransfom and coordinate translations

    Hello everyone!

    I've encountered some problems with understanding some basic coordinates translations. Currently, my problem is: I have a parent component, which is rotated by specific angle and child component. I need to move child component, but i don't know new coordinates, because movement of this component need to be done with another rotation of the parent component. I tried simply rotate parent first, and move child, and finally roll back parent rotation, but it didn't work. And something telling me, that's not good approach. It's pretty basic stuff, but i can't figure out how to do this. I found FTransform class and some translation functions in it, but with my level of vector math knowledge it's hard to understand.

    My guess with FTransform was like this: Set coordinates in FTransform, set FRotator in it, some magic transformation, and get new coordinates, which respected rotation info. Sorry if i missed something...

    So there's a couple questions:
    • Where i can found some vector math basics in context of Unreal Engine
    • How translate coordinates with new rotation info
    • Can FTransform class help me with that?

    #2
    There's a method in USceneComponent called SetWorldLocation which takes a location vector in world space and transforms it to the component's local space for you. Ditto SetWorldRotation. These functions are very brief and if you look at the implementations they should provide a clear illustration of how to achieve what you're describing.

    Comment

    Working...
    X