Mohammed K. Abushawish
Mohammed K. Abushawish

Reputation: 127

What is the difference between Rotation and getComponentRotation?

In the UE4 game engine What is the difference between Rotation and GetComponentRotation?

Try to understand this by documentation on at

https://api.unrealengine.com/INT/API/Runtime/Core/Math/FVector/Rotation/index.html

But I could not?

I need some details and explanation about this ..

Upvotes: 0

Views: 1200

Answers (1)

These two methods are from different objects:

FVector::Rotation
USceneComponent::GetComponentRotation

Both return a rotation object (FRotator) that encodes the rotation in the Yaw/Pitch/Roll representation.

The difference is that the Rotation returns an FRotator object that, if applied to a component, will make the component "look" in the direction of the vector. For example, if you take the difference between the position of a sphere and the position of a player, use Rotation, and then apply the rotation to the player, the player will face the sphere.

GetComponentRotation returns the current orientation of the component in global space.

Upvotes: 2

Related Questions