Legacy:PlayerInput

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to navigation Jump to search
UT2003 :: Object >> PlayerInput (Package: Engine)

The PlayerInput class processes the input from the player. Pretty straight forward.

PlayerInput is declared as within PlayerController. This gives it access to all of PlayerController's variables. As far as I can tell, the player inputs are stored in PlayerController and PlayerInput uses the following variables in PlayerController as the player's input.

<uscript> var input float

   aBaseX, aBaseY, aBaseZ, aMouseX, aMouseY,
   aForward, aTurn, aStrafe, aUp, aLookUp;

var input byte

   bStrafe, bSnapLevel, bLook, bFreeLook, bTurn180, bTurnToNearest, bXAxis, bYAxis;

var EDoubleClickDir DoubleClickDir; // direction of movement key double click (for special moves) </uscript>

So far it only appears as though the PlayerInput class applies mouse smoothing, inverting, acceleration, and handles dodging. So this class appears to be more of an input post-processor than an input handler. Another thing is how exactly does this class neutralize input if it simply conditions already defined input. For example:

<uscript> // Ignore input if we're playing back a client-side demo. if( Outer.bDemoOwner && !Outer.default.bDemoOwner )

    return;

</uscript>

The PlayerController class applies the inputs processed by the PlayerInput class to the viewscreen. For this it uses the UpdateRotation function. The UpdateRotation function applies the mouse movement using the following two statements.

<uscript>

   ViewRotation.Yaw += 32.0 * DeltaTime * aTurn;
   ViewRotation.Pitch += 32.0 * DeltaTime * aLookUp;

</uscript>

As you can see the aTurn and aLookUp variables of the PlayerInput class are used. So if one would like to override a players input it would be advisable to override UpdateRotation for that purpose.

Known Subclasses

  • XBoxPlayerInput

Discussion

JoeDark: Please excuse this page, I've been away from uscript for quite a while and this is my start back into it. This page is more a stream of conciousness and observations than any sort of reference. I'm hoping someone with some working knowledge of this class will contribute.

Foxpaw: This looks like it is in fact the class that does the actual reading of inputs. (hence the input variables) That would also explain how it could modify the inputs.

Rbabiak: The Input varaibles are declared in the playercontroller class and not the input. I believe that the input modifyer is also a native referance. This means these values are filled in from within the native code. The native code could be part of the Input class though as this would make sence from the point of changeing the input hardware.