UE4三种旋转(⼀)UE4 三种旋转(⼀)
FRotator
FRotator(Pitch,Yaw,Roll)
三个参数分别为:
Pitch:俯仰⾓,即绕Y轴旋转;
cre
Yaw:偏⾓,即绕Z轴旋转;
差旅费报销单Roll:滚⾓,即绕X轴旋转。岩羚羊
borntotry//绕`z`轴旋转10度
FRotator rotator(0,10,0);
AActorT->SetActorRotation(rotator);
FQuat
吊灯英文
FQuat(FVector Axis, float AngleRad)
//绕z轴旋转45度
FQuat quat =FQuat(FVector(0,0,1),PI /4.f);
GetOwner()->SetActorRotation(quat);
FMatrix
脸上出油旋转并⾯向targer。
FVector toFollow = target->GetActorLocation()-GetOwner()->GetActorLocation();
FMatrix rotationMatrix = FRotationMatrix::MakeFromXZ(toFollow,GetOwner()->GetActorUpVector()); GetOwner()->SetActorRotation(rotationMatrix.Rotator());
旋转矩阵
翻译论坛>海外考试报名中心根据任意两个⽅向向量构造旋转.
FRotator rotation = FRotationMatrix::MakeFromXZ(dir, up).Rotator();
FRotator rotation = FRotationMatrix::MakeFromXY(dir, right).Rotator();
supermarket的意思
FRotator rotation = FRotationMatrix::MakeFromYZ(right,up).Rotator();
whenyouaregone
参考