Files
UnrealEngineUWP/Engine/Source/Runtime/AugmentedReality/Public/ARSharedWorldPlayerController.h
ryan durand 0f0464a30e Updating copyright for Engine Runtime.
#rnx
#rb none


#ROBOMERGE-OWNER: ryan.durand
#ROBOMERGE-AUTHOR: ryan.durand
#ROBOMERGE-SOURCE: CL 10869210 via CL 10869511 via CL 10869900
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870549 by ryan durand in Main branch]
2019-12-26 14:45:42 -05:00

63 lines
1.8 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "GameFramework/PlayerController.h"
#include "ARSharedWorldPlayerController.generated.h"
class AARSharedWorldGameState;
UCLASS()
class AUGMENTEDREALITY_API AARSharedWorldPlayerController :
public APlayerController
{
GENERATED_UCLASS_BODY()
public:
/**
* Tells the server it is ready for receiving any shared world data
*/
UFUNCTION(Reliable, Server, WithValidation)
void ServerMarkReadyForReceiving();
/**
* Used to setup the initial values and size the arrays (client)
*
* @param PreviewImageSize the total size in bytes of the image data that will be sent
* @param ARWorldDataSize the total size in bytes of the AR world data that will be sent
*/
UFUNCTION(Reliable, Client, WithValidation)
void ClientInitSharedWorld(int32 PreviewImageSize, int32 ARWorldDataSize);
/**
* Copies the buffer into the image data (client)
*
* @param Offset where in the buffer to start the copying
* @param Buffer the chunk of data to copy
* @param BufferSize the amount of data to copy
*/
UFUNCTION(Reliable, Client, WithValidation)
void ClientUpdatePreviewImageData(int32 Offset, const TArray<uint8>& Buffer);
/**
* Copies the buffer into the AR world data (client)
*
* @param Offset where in the buffer to start the copying
* @param Buffer the chunk of data to copy
* @param BufferSize the amount of data to copy
*/
UFUNCTION(Reliable, Client, WithValidation)
void ClientUpdateARWorldData(int32 Offset, const TArray<uint8>& Buffer);
/** @return whether this player can start receiving the ar world data */
bool IsReadyToReceive() const { return bIsReadyToReceive; }
private:
virtual void Tick(float DeltaSeconds) override;
AARSharedWorldGameState* GetGameState();
bool IsGameStateReady();
bool bIsReadyToReceive;
};