본문 바로가기
언리얼

언리얼 백터의 축 회전 RotateAngleAxis()

by 안선생 2023. 6. 24.

RotateAngleAxis(  const float AngleDeg,  const FVector & Axis)

 

AngleDeg 회전할 각도(도 단위).
Axis 회전할 축입니다.

 

ex

const FVector MeshForward = GetItemMesh()->GetForwardVector();
const FVector MeshRight = GetItemMesh()->GetRightVector();
//앞축 방향으로 -20 회전시킴
FVector ImpulseDirection = MeshRight.RotateAngleAxis(-20.f, MeshForward);


//z축 기준으로 30도 회전 즉 오른쪽방향으로 횐전함
ImpulseDirection = ImpulseDirection.RotateAngleAxis(30.f, FVector(0.f, 0.f, 1.f));
ImpulseDirection *= 20'000.f;