简体   繁体   中英

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 ..

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM