Unreal
Unreal에서 로테이터(Ratator) 값으로 부터 Forward벡터와 Right벡터 얻기
myroad
2023. 12. 3. 22:29
1.해당 액터나 컨트롤러 로테이션의 Yaw값을 이용해 Yaw로테이터을 생성한다.
const FRotator Rotation = GetControlRotation();
const FRotator YawRotation(0.f, Rotation.Yaw, 0.f);
2.Yaw 로테이터을 행렬 연산하여 Forward벡터와 Right벡터을 얻는다.
const FVector FowardDir = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::X);
const FVector RightDir = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::Y);