You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#lockdown: Nick.Penwarden #rb Integration #ROBOMERGE-OWNER: ryan.gerleve #ROBOMERGE-AUTHOR: ryan.vance #ROBOMERGE-SOURCE: CL 4824851 in //UE4/Main/... #ROBOMERGE-BOT: ENGINE (Main -> Dev-Networking) [CL 4824878 by ryan vance in Dev-Networking branch]
122 lines
4.9 KiB
C++
122 lines
4.9 KiB
C++
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "ARTypes.h"
|
|
#include "ARSessionConfig.h"
|
|
#include "ARTextures.h"
|
|
#include "Engine/Engine.h" // for FWorldContext
|
|
|
|
class IARSystemSupport;
|
|
|
|
DECLARE_MULTICAST_DELEGATE(FARSystemOnSessionStarted);
|
|
DECLARE_MULTICAST_DELEGATE_OneParam(FARSystemOnAlignmentTransformUpdated, const FTransform&);
|
|
|
|
/**
|
|
* Composition Components for tracking system features
|
|
*/
|
|
|
|
class AUGMENTEDREALITY_API FARSupportInterface : public FGCObject, public IModularFeature
|
|
{
|
|
public:
|
|
FARSupportInterface (IARSystemSupport* InARImplementation, IXRTrackingSystem* InXRTrackingSystem);
|
|
virtual ~FARSupportInterface ();
|
|
|
|
|
|
static FName GetModularFeatureName()
|
|
{
|
|
static const FName ModularFeatureName = FName(TEXT("ARSystem"));
|
|
return ModularFeatureName;
|
|
}
|
|
|
|
void InitializeARSystem();
|
|
IXRTrackingSystem* GetXRTrackingSystem();
|
|
|
|
bool StartARGameFrame(FWorldContext& WorldContext);
|
|
|
|
const FTransform& GetAlignmentTransform() const;
|
|
const UARSessionConfig& GetSessionConfig() const;
|
|
UARSessionConfig& AccessSessionConfig();
|
|
|
|
/** \see UARBlueprintLibrary::GetTrackingQuality() */
|
|
EARTrackingQuality GetTrackingQuality() const;
|
|
/** \see UARBlueprintLibrary::StartARSession() */
|
|
void StartARSession(UARSessionConfig* InSessionConfig);
|
|
/** \see UARBlueprintLibrary::PauseARSession() */
|
|
void PauseARSession();
|
|
/** \see UARBlueprintLibrary::StopARSession() */
|
|
void StopARSession();
|
|
/** \see UARBlueprintLibrary::GetARSessionStatus() */
|
|
FARSessionStatus GetARSessionStatus() const;
|
|
/** \see UARBlueprintLibrary::IsSessionTypeSupported() */
|
|
bool IsSessionTypeSupported(EARSessionType SessionType) const;
|
|
|
|
/**
|
|
* \see UARBlueprintLibrary::SetAlignmentTransform()
|
|
* \see IARSystemSupport
|
|
* To understand the various spaces involved in Augmented Reality system, \see IARSystemSupport.
|
|
*/
|
|
void SetAlignmentTransform(const FTransform& InAlignmentTransform);
|
|
|
|
/** \see UARBlueprintLibrary::LineTraceTrackedObjects() */
|
|
TArray<FARTraceResult> LineTraceTrackedObjects(const FVector2D ScreenCoords, EARLineTraceChannels TraceChannels);
|
|
/** \see UARBlueprintLibrary::LineTraceTrackedObjects() */
|
|
TArray<FARTraceResult> LineTraceTrackedObjects(const FVector Start, const FVector End, EARLineTraceChannels TraceChannels);
|
|
/** \see UARBlueprintLibrary::GetAllTrackedGeometries() */
|
|
TArray<UARTrackedGeometry*> GetAllTrackedGeometries() const;
|
|
/** \see UARBlueprintLibrary::GetAllPins() */
|
|
TArray<UARPin*> GetAllPins() const;
|
|
/** \see UARBlueprintLibrary::GetCameraImage() */
|
|
UARTextureCameraImage* GetCameraImage();
|
|
/** \see UARBlueprintLibrary::GetCameraDepth() */
|
|
UARTextureCameraDepth* GetCameraDepth();
|
|
/**\see UARBlueprintLibrary::IsEnvironmentCaptureSupported() */
|
|
bool IsEnvironmentCaptureSupported() const;
|
|
/**\see UARBlueprintLibrary::AddEnvironmentCaptureProbe() */
|
|
bool AddManualEnvironmentCaptureProbe(FVector Location, FVector Extent);
|
|
/** Creates an async task that will perform the work in the background */
|
|
TSharedPtr<FARGetCandidateObjectAsyncTask, ESPMode::ThreadSafe> GetCandidateObject(FVector Location, FVector Extent) const;
|
|
/** Creates an async task that will perform the work in the background */
|
|
TSharedPtr<FARSaveWorldAsyncTask, ESPMode::ThreadSafe> SaveWorld() const;
|
|
/** @return the current mapping status */
|
|
EARWorldMappingState GetWorldMappingStatus() const;
|
|
|
|
/** \see UARBlueprintLibrary::GetCurrentLightEstimate() */
|
|
UARLightEstimate* GetCurrentLightEstimate() const;
|
|
|
|
/** \see UARBlueprintLibrary::PinComponent() */
|
|
UARPin* PinComponent(USceneComponent* ComponentToPin, const FTransform& PinToWorldTransform, UARTrackedGeometry* TrackedGeometry = nullptr, const FName DebugName = NAME_None);
|
|
/** \see UARBlueprintLibrary::PinComponentToTraceResult() */
|
|
UARPin* PinComponent(USceneComponent* ComponentToPin, const FARTraceResult& HitResult, const FName DebugName = NAME_None);
|
|
/** \see UARBlueprintLibrary::RemovePin() */
|
|
void RemovePin(UARPin* PinToRemove);
|
|
|
|
/** \see UARBlueprintLibrary::GetSupportedVideoFormats() */
|
|
TArray<FARVideoFormat> GetSupportedVideoFormats(EARSessionType SessionType = EARSessionType::World) const;
|
|
|
|
/** @return the current point cloud data for the ar scene */
|
|
TArray<FVector> GetPointCloud() const;
|
|
|
|
/** \see UARBlueprintLibrary::AddRuntimeCandidateImage() */
|
|
UARCandidateImage* AddRuntimeCandidateImage(UARSessionConfig* SessionConfig, UTexture2D* CandidateTexture, FString FriendlyName, float PhysicalWidth);
|
|
|
|
void* GetARSessionRawPointer();
|
|
void* GetGameThreadARFrameRawPointer();
|
|
|
|
//~ FGCObject
|
|
virtual void AddReferencedObjects(FReferenceCollector& Collector) override;
|
|
//~ FGCObject
|
|
|
|
FARSystemOnSessionStarted OnARSessionStarted;
|
|
FARSystemOnAlignmentTransformUpdated OnAlignmentTransformUpdated;
|
|
|
|
private:
|
|
IARSystemSupport* ARImplemention;
|
|
IXRTrackingSystem* XRTrackingSystem;
|
|
|
|
/** Alignment transform between AR System's tracking space and Unreal's World Space. Useful in static lighting/geometry scenarios. */
|
|
FTransform AlignmentTransform;
|
|
UARSessionConfig* ARSettings;
|
|
};
|
|
|