Each player that is active on the current client has a LocalPlayer. 更多...
#include <LocalPlayer.h>
继承自 UPlayer .
Public 成员函数 | |
| virtual FSceneView * | CalcSceneView (class FSceneViewFamily *ViewFamily, FVector &OutViewLocation, FRotator &OutViewRotation, FViewport *Viewport, class FViewElementDrawer *ViewDrawer=NULL, EStereoscopicPass StereoPass=eSSP_FULL) |
| Calculate the view settings for drawing from this view actor 更多... | |
| bool | CalcSceneViewInitOptions (struct FSceneViewInitOptions &OutInitOptions, FViewport *Viewport, class FViewElementDrawer *ViewDrawer=NULL, EStereoscopicPass StereoPass=eSSP_FULL) |
| Calculate the view init settings for drawing from this view actor 更多... | |
| void | CleanupViewState () |
| Clear cached view state. 更多... | |
| virtual void | FinishDestroy () override |
| Called to finish destroying the object. 更多... | |
| FUniqueNetIdRepl | GetCachedUniqueNetId () const |
| Retrieves this player's unique net ID that was previously cached 更多... | |
| int32 | GetControllerId () const |
| Returns the controller ID for the player | |
| UGameInstance * | GetGameInstance () const |
| Get the game instance associated with this local player 更多... | |
| virtual FString | GetGameLoginOptions () const |
| Retrieves any game-specific login options for this player if this function returns a non-empty string, the returned option or options be added passed in to the level loading and connection code. 更多... | |
| virtual FString | GetNickname () const |
| Retrieves this player's name/tag from the online subsystem if this function returns a non-empty string, the returned name will replace the "Name" URL parameter passed around in the level loading and connection code, which normally comes from DefaultEngine.ini 更多... | |
| bool | GetPixelBoundingBox (const FBox &ActorBox, FVector2D &OutLowerLeft, FVector2D &OutUpperRight, const FVector2D *OptionalAllotedSize=nullptr) |
| This function will give you two points in Pixel Space that surround the World Space box. 更多... | |
| bool | GetPixelPoint (const FVector &InPoint, FVector2D &OutPoint, const FVector2D *OptionalAllotedSize=nullptr) |
| This function will give you a point in Pixel Space from a World Space position 更多... | |
| FUniqueNetIdRepl | GetPreferredUniqueNetId () const |
| Retrieves the preferred unique net id. 更多... | |
| virtual bool | GetProjectionData (FViewport *Viewport, EStereoscopicPass StereoPass, FSceneViewProjectionData &ProjectionData) const |
| Helper function for deriving various bits of data needed for projection 更多... | |
| FReply & | GetSlateOperations () |
| Getter for slate operations. | |
| TSharedPtr< FSlateUser > | GetSlateUser () |
| Get the SlateUser that this LocalPlayer corresponds to | |
| template<typename TSubsystemClass > | |
| TSubsystemClass * | GetSubsystem () const |
| Get a Subsystem of specified type | |
| template<typename TSubsystemClass > | |
| const TArray< TSubsystemClass * > & | GetSubsystemArray () const |
| Get all Subsystem of specified type, this is only necessary for interfaces that can have multiple implementations instanced at a time. 更多... | |
| ULocalPlayerSubsystem * | GetSubsystemBase (TSubclassOf< ULocalPlayerSubsystem > SubsystemClass) const |
| Get a Subsystem of specified type | |
| FUniqueNetIdRepl | GetUniqueNetIdFromCachedControllerId () const |
| Retrieves this player's unique net ID from the online subsystem 更多... | |
| virtual UWorld * | GetWorld () const override |
| Get the world the players actor belongs to 更多... | |
| bool | HandleDNCommand (const TCHAR *Cmd, FOutputDevice &Ar) |
| Exec command handlers | |
| virtual void | InitOnlineSession () |
| Called to initialize the online delegates | |
| bool | IsCachedUniqueNetIdPairedWithControllerId () const |
| Returns true if the cached unique net id, is the one assigned to the controller id from the OSS | |
| bool | IsPrimaryPlayer () const |
| Determines whether this player is the first and primary player on their machine. 更多... | |
| virtual void | PlayerAdded (class UGameViewportClient *InViewportClient, int32 InControllerID) |
| Called at creation time for internal setup | |
| virtual void | PlayerRemoved () |
| Called when the player is removed from the viewport client | |
| virtual void | PostInitProperties () override |
| Called after the C++ constructor and after the properties have been initialized, including those loaded from config. 更多... | |
| virtual void | SendSplitJoin (TArray< FString > &Options) |
| Send a splitscreen join command to the server to allow a splitscreen player to connect to the game the client must already be connected to a server for this function to work 更多... | |
| void | SetCachedUniqueNetId (TSharedPtr< const FUniqueNetId > NewUniqueNetId) |
| Sets the players current cached unique net id | |
| virtual void | SetControllerId (int32 NewControllerId) |
| Change the ControllerId for this player; if the specified ControllerId is already taken by another player, changes the ControllerId for the other player to the ControllerId currently in use by this player. 更多... | |
| virtual bool | SpawnPlayActor (const FString &URL, FString &OutError, UWorld *InWorld) |
| Create an actor for this player. 更多... | |
| ULocalPlayer (FVTableHelper &Helper) | |
| DO NOT USE. 更多... | |
静态 Public 成员函数 | |
| template<typename TSubsystemClass > | |
| static FORCEINLINE TSubsystemClass * | GetSubsystem (const ULocalPlayer *LocalPlayer) |
| Get a Subsystem of specified type from the provided LocalPlayer returns nullptr if the Subsystem cannot be found or the LocalPlayer is null | |
Public 属性 | |
| TEnumAsByte< enum EAspectRatioAxisConstraint > | AspectRatioAxisConstraint |
| How to constrain perspective viewport FOV | |
| uint32 | bSentSplitJoin:1 |
| set when we've sent a split join request | |
| FUniqueNetIdRepl | CachedUniqueNetId |
| The FUniqueNetId which this player is associated with. | |
| FVector | LastViewLocation |
| The location of the player's view the previous frame. | |
| FVector2D | Origin |
| The coordinates for the upper left corner of the master viewport subregion allocated to this player. 更多... | |
| TSubclassOf< class APlayerController > | PendingLevelPlayerControllerClass |
| The class of PlayerController to spawn for players logging in. | |
| FVector2D | Size |
| The size of the master viewport subregion allocated to this player. 更多... | |
| class UGameViewportClient * | ViewportClient |
| The master viewport containing this player's view. | |
Protected 成员函数 | |
| void | ExecMacro (const TCHAR *Filename, FOutputDevice &Ar) |
| virtual void | GetViewPoint (FMinimalViewInfo &OutViewInfo, EStereoscopicPass StereoPass=eSSP_FULL) const |
| Retrieve the viewpoint of this player. 更多... | |
Protected 属性 | |
| FReply | SlateOperations |
| FReply used to defer some slate operations. | |
友元 | |
| class | FLockedViewState |
| Locked view state needs access to GetViewPoint. | |
Each player that is active on the current client has a LocalPlayer.
It stays active across maps There may be several spawned in the case of splitscreen/coop. There may be 0 spawned on servers.
|
inline |
DO NOT USE.
This constructor is for internal usage only for hot-reload purposes.
|
virtual |
Calculate the view settings for drawing from this view actor
| View | - output view struct |
| OutViewLocation | - output actor location |
| OutViewRotation | - output actor rotation |
| Viewport | - current client viewport |
| ViewDrawer | - optional drawing in the view |
| StereoPass | - whether we are drawing the full viewport, or a stereo left / right pass |
| bool ULocalPlayer::CalcSceneViewInitOptions | ( | struct FSceneViewInitOptions & | OutInitOptions, |
| FViewport * | Viewport, | ||
| class FViewElementDrawer * | ViewDrawer = NULL, |
||
| EStereoscopicPass | StereoPass = eSSP_FULL |
||
| ) |
Calculate the view init settings for drawing from this view actor
| OutInitOptions | - output view struct. Not every field is initialized, some of them are only filled in by CalcSceneView |
| Viewport | - current client viewport |
| ViewDrawer | - optional drawing in the view |
| StereoPass | - whether we are drawing the full viewport, or a stereo left / right pass |
| void ULocalPlayer::CleanupViewState | ( | ) |
Clear cached view state.
Suitable for calling when cleaning up the world but the view state has some references objects (usually mids) owned by the world (thus preventing GC)
|
protected |
|
overridevirtual |
Called to finish destroying the object.
After UObject::FinishDestroy is called, the object's memory should no longer be accessed.
重载 UObject .
| FUniqueNetIdRepl ULocalPlayer::GetCachedUniqueNetId | ( | ) | const |
Retrieves this player's unique net ID that was previously cached
| UGameInstance * ULocalPlayer::GetGameInstance | ( | ) | const |
Get the game instance associated with this local player
|
inlinevirtual |
Retrieves any game-specific login options for this player if this function returns a non-empty string, the returned option or options be added passed in to the level loading and connection code.
Options are in URL format, key=value, with multiple options concatenated together with an & between each key/value pair
|
virtual |
Retrieves this player's name/tag from the online subsystem if this function returns a non-empty string, the returned name will replace the "Name" URL parameter passed around in the level loading and connection code, which normally comes from DefaultEngine.ini
| bool ULocalPlayer::GetPixelBoundingBox | ( | const FBox & | ActorBox, |
| FVector2D & | OutLowerLeft, | ||
| FVector2D & | OutUpperRight, | ||
| const FVector2D * | OptionalAllotedSize = nullptr |
||
| ) |
This function will give you two points in Pixel Space that surround the World Space box.
| ActorBox | The World Space Box |
| OutLowerLeft | The Lower Left corner of the Pixel Space box |
| OutUpperRight | The Upper Right corner of the pixel space box |
| bool ULocalPlayer::GetPixelPoint | ( | const FVector & | InPoint, |
| FVector2D & | OutPoint, | ||
| const FVector2D * | OptionalAllotedSize = nullptr |
||
| ) |
This function will give you a point in Pixel Space from a World Space position
| InPoint | The point in world space |
| OutPoint | The point in pixel space |
| FUniqueNetIdRepl ULocalPlayer::GetPreferredUniqueNetId | ( | ) | const |
Retrieves the preferred unique net id.
This is for backwards compatibility for games that don't use the cached unique net id logic
|
virtual |
Helper function for deriving various bits of data needed for projection
| Viewport | The ViewClient's viewport |
| StereoPass | Whether this is a full viewport pass, or a left/right eye pass |
| ProjectionData | The structure to be filled with projection data |
|
inline |
Get all Subsystem of specified type, this is only necessary for interfaces that can have multiple implementations instanced at a time.
Do not hold onto this Array reference unless you are sure the lifetime is less than that of ULocalPlayer
| FUniqueNetIdRepl ULocalPlayer::GetUniqueNetIdFromCachedControllerId | ( | ) | const |
Retrieves this player's unique net ID from the online subsystem
|
protectedvirtual |
Retrieve the viewpoint of this player.
| OutViewInfo | - Upon return contains the view information for the player. |
| StereoPass | - Which stereoscopic pass, if any, to get the viewport for. This will include eye offsetting |
|
overridevirtual |
Get the world the players actor belongs to
| bool ULocalPlayer::IsPrimaryPlayer | ( | ) | const |
Determines whether this player is the first and primary player on their machine.
|
overridevirtual |
Called after the C++ constructor and after the properties have been initialized, including those loaded from config.
This is called before any serialization or other setup has happened.
重载 UObject .
Send a splitscreen join command to the server to allow a splitscreen player to connect to the game the client must already be connected to a server for this function to work
| Options | array of URL options to append. |
|
virtual |
Change the ControllerId for this player; if the specified ControllerId is already taken by another player, changes the ControllerId for the other player to the ControllerId currently in use by this player.
| NewControllerId | the ControllerId to assign to this player. |
|
virtual |
Create an actor for this player.
| URL | - The URL the player joined with. |
| OutError | - If an error occurred, returns the error description. |
| InWorld | - World in which to spawn the play actor |
| FVector2D ULocalPlayer::Origin |
The coordinates for the upper left corner of the master viewport subregion allocated to this player.
0-1
| FVector2D ULocalPlayer::Size |
The size of the master viewport subregion allocated to this player.
0-1