Rotating about a vector, Blueprints Unreal Engine 4

3.7k views Asked by At

I have a problem where I want to rotate an Actor about an arbitrary vector, I wonder if there's a standard way of using Blueprints to achieve that, in case I have the vector's coordinates. I didn't find anything useful online.

One more smaller issue I encountered, regarding the extraction of that vector: Is there a way to extract world coordinates of some key-points of an Actor using Blueprints or the UE4 interface?

For example, given a door frame which is rotated 5 degrees around the X axis, can I extract the world coordinates of one of its corners using simple tools such as Blueprints or the interface?

1

There are 1 answers

0
Fritz On

Assuming you are rotating an actor (in this case, by your example that actor should be the door) you can take multiple approaches, but I'll list only three:

Option 1

First, define a Socket in the door mesh, in the position you want to obtain. Then, get its current position with a GetSocketLocation node.

Option 2

If your door is intended to be a blueprint and you need to get a specific point, you can define a Scene Component in that Blueprint in the specific position you want it and then create a function that returns the World Location of that component. This is particularly useful if that position can change in time.

Option 3

Simply have a Vector parameter defining the offset of your given point in the actor's local space. You'll still need a function to translate that offset from Local to World or World to Local, highly depending on your approach.

With your given context, this is a way to interpret your situation.