1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
function UpdateRotation( float DeltaTime )
{
local Rotator DeltaRot, newRotation, ViewRotation;
local vector X, Y, Z, FinalRot;
local Quat XQuat, YQuat, ZQuat, EndQuat;
ViewRotation = Rotation;
if (Pawn!=none)
{
Pawn.SetDesiredRotation(ViewRotation);
}
GetAxes(Rotation, X, Y, Z);
YQuat = QuatFromAxisAndAngle( Y, PlayerInput.aLookUp );
ZQuat = QuatFromAxisAndAngle( Z, PlayerInput.aTurn * - 1.0);
EndQuat = QuatProduct( YQuat, ZQuat );
DeltaRot = QuatToRotator(EndQuat);
//FinalRot = PlayerInput.aTurn*Y + PlayerInput.aLookUp*Z;
//DeltaRot.Roll = 0;
DeltaRot.Yaw /= 100;
DeltaRot.Pitch /= 100;
ProcessViewRotation( DeltaTime, ViewRotation, DeltaRot );
SetRotation(ViewRotation);
ViewShake( deltaTime );
//NewRotation = ViewRotation;
//NewRotation.Roll = Rotation.Roll;
//NewRotation.Roll = 0;
if ( Pawn != None )
Pawn.FaceRotation(ViewRotation, deltatime);
GetAxes(Pawn.Rotation, X, Y, Z);
} |
Partager