簡體   English   中英

Rotation和getComponentRotation有什么區別?

[英]What is the difference between Rotation and getComponentRotation?

在UE4游戲引擎中,Rotation和GetComponentRotation有什么區別?

嘗試通過以下位置的文檔來了解這一點

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

但是我不能嗎?

我需要一些細節和解釋。

這兩種方法來自不同的對象:

FVector ::旋轉
USceneComponent :: GetComponentRotation

兩者都返回一個旋轉對象( FRotator ),該對象以Yaw / Pitch / Roll表示形式對旋轉進行編碼。

區別在於Rotation返回一個FRotator對象,該對象如果應用於組件,將使該組件在向量方向上“看起來”。 例如,如果您將球體的位置與播放器的位置之間的差值計算在內,請使用“旋轉”,然后將旋轉應用於播放器,播放器將面對球體。

GetComponentRotation返回組件在全局空間中的當前方向。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM