engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
IARSystemSupport类 参考abstract

Implement IARSystemSupport for any platform that wants to be an Unreal Augmented Reality System. 更多...

#include <ARSystem.h>

被 FARSystemSupportBase 继承.

Public 成员函数

 DEFINE_AR_DELEGATE_ONE_PARAM (OnTrackableAdded, UARTrackedGeometry *)
 Delegate called when an ar item is added to the scene 更多...
 
 DEFINE_AR_DELEGATE_ONE_PARAM (OnTrackableRemoved, UARTrackedGeometry *)
 Delegate called when an ar item is removed from the scene 更多...
 
 DEFINE_AR_DELEGATE_ONE_PARAM (OnTrackableUpdated, UARTrackedGeometry *)
 Delegate called when an ar item is updated 更多...
 
virtual UARPin * FindARPinByComponent (const USceneComponent *Component) const =0
 Given a scene component find the ARPin which it is pinned by, if any.
 
virtual bool IsARAvailable () const =0
 Returns true/false based on whether AR features are available
 
virtual bool OnAddManualEnvironmentCaptureProbe (FVector Location, FVector Extent)=0
 Tells the ARSystem to generate a capture probe at the specified location if supported
 
virtual bool OnAddRuntimeCandidateImage (UARSessionConfig *SessionConfig, UTexture2D *CandidateTexture, FString FriendlyName, float PhysicalWidth)=0
 Add candidate image at runtime 更多...
 
virtual void OnARSystemInitialized ()
 Invoked after the base AR system has been initialized.
 
virtual TArray< UARPin * > OnGetAllPins () const =0
 
virtual TArray< UARTrackedGeometry * > OnGetAllTrackedGeometries () const =0
 
virtual FARSessionStatus OnGetARSessionStatus () const =0
 
virtual UARTexture * OnGetARTexture (EARTextureType TextureType) const
 
virtual TSharedPtr< FARGetCandidateObjectAsyncTask, ESPMode::ThreadSafe > OnGetCandidateObject (FVector Location, FVector Extent) const =0
 Generates a UARCandidateObject from the point cloud data within the location and its extent using an async task
 
virtual UARLightEstimate * OnGetCurrentLightEstimate () const =0
 
virtual int32 OnGetNumberOfTrackedFacesSupported () const
 
virtual TArray< FVector > OnGetPointCloud () const =0
 
virtual TArray< FARVideoFormat > OnGetSupportedVideoFormats (EARSessionType SessionType) const =0
 
virtual TArray< FARPose2D > OnGetTracked2DPose () const
 
virtual EARTrackingQuality OnGetTrackingQuality () const =0
 
virtual EARTrackingQualityReason OnGetTrackingQualityReason () const =0
 
virtual EARWorldMappingState OnGetWorldMappingStatus () const =0
 
virtual bool OnIsSceneReconstructionSupported (EARSessionType SessionType, EARSceneReconstruction SceneReconstructionMethod) const
 
virtual bool OnIsSessionTrackingFeatureSupported (EARSessionType SessionType, EARSessionTrackingFeature SessionTrackingFeature) const
 
virtual bool OnIsTrackingTypeSupported (EARSessionType SessionType) const =0
 
virtual TArray< FARTraceResult > OnLineTraceTrackedObjects (const FVector2D ScreenCoord, EARLineTraceChannels TraceChannels)=0
 Trace all the tracked geometries and determine which have been hit by a ray cast from ScreenCoord. 更多...
 
virtual void OnPauseARSession ()=0
 Stop the AR system but leave its internal state intact.
 
virtual UARPin * OnPinComponent (USceneComponent *ComponentToPin, const FTransform &PinToWorldTransform, UARTrackedGeometry *TrackedGeometry=nullptr, const FName DebugName=NAME_None)=0
 Pin an Unreal Component to a location in the world. 更多...
 
virtual bool OnPinComponentToARPin (USceneComponent *ComponentToPin, UARPin *Pin)=0
 Pin a component to an existing ARPin. 更多...
 
virtual void OnRemovePin (UARPin *PinToRemove)=0
 Given a pin, remove it and stop updating the associated component based on the tracked geometry. 更多...
 
virtual TSharedPtr< FARSaveWorldAsyncTask, ESPMode::ThreadSafe > OnSaveWorld () const =0
 Saves the AR world to a byte array using an async task
 
virtual void OnSetAlignmentTransform (const FTransform &InAlignmentTransform)=0
 Set a transform that will align the Tracking Space origin to the World Space origin. 更多...
 
virtual void OnStartARSession (UARSessionConfig *SessionConfig)=0
 Start the AR system. 更多...
 
virtual void OnStopARSession ()=0
 Stop the AR system and reset its internal state; this task must succeed.
 
virtual bool OnTryGetOrCreatePinForNativeResource (void *InNativeResource, const FString &InPinName, UARPin *&OutPin)
 Given the platform specific native resource for a pin, create a pin. 更多...
 

详细描述

Implement IARSystemSupport for any platform that wants to be an Unreal Augmented Reality System.

e.g. AppleARKit, GoogleARCore. This interface is included as part of the abstract class FARSupportInterface . The functions you must override are coalesced here for clarity.

Augmented Reality Spaces

Engineers working on supporting Augmented Reality must be aware of three spaces:

TrackingSpace : This is the space defined by the underlying AR system (e.g. ARKit, ARCore, etc.) Unreal has no control over the origin of this space.

AlignedTrackingSpace : To regain control of TrackingSpace, Unreal applies the AlignmentTransform so bend TrackingSpace to its will. If you are implementing IARSystemSupport, you will need to understand this transform and apply it accordingly.

WorldSpace : This is Unreal's coordinate system. Coordinates from Tracking Space can be translated into WorldSpace by using the AlignmentTransform and the TrackingToWorldTransform.

* [TrackingSpace]--(AlignmentTransform)-->[AlignedTrackingSpace]--(TrackingToWorld)-->[WorldSpace]
* 

成员函数说明

◆ DEFINE_AR_DELEGATE_ONE_PARAM() [1/3]

IARSystemSupport::DEFINE_AR_DELEGATE_ONE_PARAM ( OnTrackableAdded  ,
UARTrackedGeometry *   
)

Delegate called when an ar item is added to the scene

参数
Addedthe item that was added

◆ DEFINE_AR_DELEGATE_ONE_PARAM() [2/3]

IARSystemSupport::DEFINE_AR_DELEGATE_ONE_PARAM ( OnTrackableRemoved  ,
UARTrackedGeometry *   
)

Delegate called when an ar item is removed from the scene

参数
Removedthe item that was removed

◆ DEFINE_AR_DELEGATE_ONE_PARAM() [3/3]

IARSystemSupport::DEFINE_AR_DELEGATE_ONE_PARAM ( OnTrackableUpdated  ,
UARTrackedGeometry *   
)

Delegate called when an ar item is updated

参数
Updatedthe item that was updated

◆ OnAddRuntimeCandidateImage()

virtual bool IARSystemSupport::OnAddRuntimeCandidateImage ( UARSessionConfig *  SessionConfig,
UTexture2D *  CandidateTexture,
FString  FriendlyName,
float  PhysicalWidth 
)
pure virtual

Add candidate image at runtime

返回
True if it added the iamge successfully

◆ OnGetAllPins()

virtual TArray< UARPin * > IARSystemSupport::OnGetAllPins ( ) const
pure virtual
返回
a TArray of all the pins that attach components to TrackedGeometries

◆ OnGetAllTrackedGeometries()

virtual TArray< UARTrackedGeometry * > IARSystemSupport::OnGetAllTrackedGeometries ( ) const
pure virtual
返回
a TArray of all the tracked geometries known to your ar system

◆ OnGetARSessionStatus()

virtual FARSessionStatus IARSystemSupport::OnGetARSessionStatus ( ) const
pure virtual
返回
the info about whether the session is running normally or encountered some kind of error.

◆ OnGetARTexture()

virtual UARTexture * IARSystemSupport::OnGetARTexture ( EARTextureType  TextureType) const
inlinevirtual
返回
the AR texture for the specified type

◆ OnGetCurrentLightEstimate()

virtual UARLightEstimate * IARSystemSupport::OnGetCurrentLightEstimate ( ) const
pure virtual
返回
the best available light estimate; nullptr if light estimation is inactive or not available

◆ OnGetNumberOfTrackedFacesSupported()

virtual int32 IARSystemSupport::OnGetNumberOfTrackedFacesSupported ( ) const
inlinevirtual
返回
the max number of faces can be tracked at the same time

◆ OnGetPointCloud()

virtual TArray< FVector > IARSystemSupport::OnGetPointCloud ( ) const
pure virtual
返回
the current point cloud data for the ar scene

◆ OnGetSupportedVideoFormats()

virtual TArray< FARVideoFormat > IARSystemSupport::OnGetSupportedVideoFormats ( EARSessionType  SessionType) const
pure virtual
返回
The list of supported video formats for this device and session type

◆ OnGetTracked2DPose()

virtual TArray< FARPose2D > IARSystemSupport::OnGetTracked2DPose ( ) const
inlinevirtual
返回
all the tracked 2D poses in AR

◆ OnGetTrackingQuality()

virtual EARTrackingQuality IARSystemSupport::OnGetTrackingQuality ( ) const
pure virtual
返回
the tracking quality; if unable to determine tracking quality, return EARTrackingQuality::NotAvailable

◆ OnGetTrackingQualityReason()

virtual EARTrackingQualityReason IARSystemSupport::OnGetTrackingQualityReason ( ) const
pure virtual
返回
the reason of limited tracking quality; if the state is not limited, return EARTrackingQualityReason::None

◆ OnGetWorldMappingStatus()

virtual EARWorldMappingState IARSystemSupport::OnGetWorldMappingStatus ( ) const
pure virtual
返回
the current mapping status

◆ OnIsSceneReconstructionSupported()

virtual bool IARSystemSupport::OnIsSceneReconstructionSupported ( EARSessionType  SessionType,
EARSceneReconstruction  SceneReconstructionMethod 
) const
inlinevirtual
返回
the required scene construction method is supported

◆ OnIsSessionTrackingFeatureSupported()

virtual bool IARSystemSupport::OnIsSessionTrackingFeatureSupported ( EARSessionType  SessionType,
EARSessionTrackingFeature  SessionTrackingFeature 
) const
inlinevirtual
返回
if a particular session feature is supported on this device

◆ OnIsTrackingTypeSupported()

virtual bool IARSystemSupport::OnIsTrackingTypeSupported ( EARSessionType  SessionType) const
pure virtual
返回
whether the specified tracking type is supported by this device

◆ OnLineTraceTrackedObjects()

virtual TArray< FARTraceResult > IARSystemSupport::OnLineTraceTrackedObjects ( const FVector2D  ScreenCoord,
EARLineTraceChannels  TraceChannels 
)
pure virtual

Trace all the tracked geometries and determine which have been hit by a ray cast from ScreenCoord.

Only geometries specified in TraceChannels are considered.

返回
a list of all the geometries that were hit, sorted by distance

◆ OnPinComponent()

virtual UARPin * IARSystemSupport::OnPinComponent ( USceneComponent *  ComponentToPin,
const FTransform &  PinToWorldTransform,
UARTrackedGeometry *  TrackedGeometry = nullptr,
const FName  DebugName = NAME_None 
)
pure virtual

Pin an Unreal Component to a location in the world.

Optionally, associate with a TrackedGeometry to receive transform updates that effectively attach the component to the geometry.

返回
the UARPin object that is pinning the component to the world and (optionally) a TrackedGeometry

◆ OnPinComponentToARPin()

virtual bool IARSystemSupport::OnPinComponentToARPin ( USceneComponent *  ComponentToPin,
UARPin *  Pin 
)
pure virtual

Pin a component to an existing ARPin.


If the component is alreayd pinned it will first be removed from that pin, which will be left empty. If the target Pin is already in use the component previously pinned to it will be unpinned.

返回
true if the operation was successful

◆ OnRemovePin()

virtual void IARSystemSupport::OnRemovePin ( UARPin *  PinToRemove)
pure virtual

Given a pin, remove it and stop updating the associated component based on the tracked geometry.

The component in question will continue to track with the world, but will not get updates specific to a TrackedGeometry.

◆ OnSetAlignmentTransform()

virtual void IARSystemSupport::OnSetAlignmentTransform ( const FTransform &  InAlignmentTransform)
pure virtual

Set a transform that will align the Tracking Space origin to the World Space origin.

This is useful for supporting static geometry and static lighting in AR. Note: Usually, an app will ask the user to select an appropriate location for some experience. This allows us to choose an appropriate alignment transform.

◆ OnStartARSession()

virtual void IARSystemSupport::OnStartARSession ( UARSessionConfig *  SessionConfig)
pure virtual

Start the AR system.

参数
SessionTypeThe type of AR session to create
返回
true if the system was successfully started

◆ OnTryGetOrCreatePinForNativeResource()

virtual bool IARSystemSupport::OnTryGetOrCreatePinForNativeResource ( void *  InNativeResource,
const FString &  InPinName,
UARPin *&  OutPin 
)
inlinevirtual

Given the platform specific native resource for a pin, create a pin.

返回
true when a pin is successfully created, otherwise false

该类的文档由以下文件生成: