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 44 45 46 47 48 49 50 51 52 53 54 55
| class LLOEPlayerController extends UTPlayerController;
var private float viewRotationPitch; //Used to store view pitch. Used in GetAdjustedAimFor
function UpdateRotation( float DeltaTime )
{
local Rotator DeltaRot, newRotation, ViewRotation;
ViewRotation = Rotation;
if (Pawn!=none)
{
Pawn.SetDesiredRotation(ViewRotation);
}
// Calculate Delta to be applied on ViewRotation
DeltaRot.Yaw = PlayerInput.aTurn;
DeltaRot.Pitch = PlayerInput.aLookUp;
ProcessViewRotation( DeltaTime, ViewRotation, DeltaRot );
SetRotation(ViewRotation);
// Store adjusted pitch in our class variable so we can use it outside of the method.
self.viewRotationPitch = ViewRotation.Pitch;
ViewShake( deltaTime );
NewRotation = ViewRotation;
NewRotation.Roll = Rotation.Roll;
// Change our pawn's direction only if we are currently moving.
if ( Pawn != None && (PlayerInput.RawJoyRight != 0.0 || PlayerInput.RawJoyUp != 0.0))
Pawn.FaceRotation(NewRotation, deltatime);
}
function Rotator GetAdjustedAimFor( Weapon W, vector StartFireLoc )
{
local Rotator adjustedAimRotator;
// Use our adjusted pitch along with our pawns orientation.
adjustedAimRotator.Pitch = viewRotationPitch;
adjustedAimRotator.Roll = Pawn.Rotation.Roll;
adjustedAimRotator.Yaw = Pawn.Rotation.Yaw;
return adjustedAimRotator;
}
//---------------------------------------------------------------------------------------------------
DefaultProperties
{
CameraClass = class'GameFramework.GamePlayerCamera'
bBehindView = true
InputClass=class'LLOE.LLOEPlayerInput'
Name="Default__LLOEPlayerController"
} |
Partager