RealityAPI¶
Interface RealityAPI
Hierarchy
- RealityAPI
Methods
connectXRSession
- connectXRSession(): Promise<XRSessionState>
Experimental
Returns Promise<XRSessionState>
returns a Promise
enterXRMember Init Mode
- enterXRMember
Init Mode(memberId: number, xrInitOptions?: XRInitOptions): Promise<boolean> Experimental
enters the initialization phase for modeltracking, this is also used to reset the current modeltracking. It will also trigger REALITY_MODELTRACKERSTATE_CHANGED event with the ModelTrackingState.INIT set to true By default the modeltracking will be softreset. If you choose to reset different data on the modeltracker you can do so by specifying the xrInitOptions.
Parameters
-
memberId: number
the XRMember that the operation should be applied on
-
Optional
xrInitOptions: XRInitOptionsSpecify initOptions. E.g. reset behavior of modeltracker. Default is softreset.
Returns Promise<boolean>
returns a Promise which reports wether the operation was successful or not
-
exitXRMember Init Mode
- exitXRMember
Init Mode(memberId: number): Promise<boolean> Experimental
leaves the initialization phase for modeltracking, this will also fixate the model at the current position
Parameters
-
memberId: number
the XRMember that the operation should be applied on
Returns Promise<boolean>
returns a Promise which reports wether the operation was successful or not
-
fixateXRMember
- fixateXRMember(memberId: number): Promise<boolean>
Experimental
Fixates the model at the current position. It will also trigger REALITY_XRSTATE_CHANGED event with the XRState.FIXATED set to true
Parameters
-
memberId: number
the XRMember that the operation should be applied on
Returns Promise<boolean>
returns a Promise which reports wether the operation was successful or not
-
getXRMember Info
- getXRMember
Info(memberId: number): XRMemberInfo Experimental
list all the available XR members in the current session
Parameters
-
memberId: number
the XRMember that the operation should be applied on
Returns XRMemberInfo
returns a struct containing all relevant infos (memberId, XRCapabilities, sessionMemberData) for the given member
-
getXRMember State
- getXRMember
State(memberId: number): XRMemberState Experimental
Get the runtime state of a XR Member
Parameters
-
memberId: number
the XRMember that the state should be queried from
Returns XRMemberState
returns either the member state if the member exist or return undefined if xr is not connected or memberId does not exist
-
getXRMembers
getXRSession State
- getXRSession
State(): XRSessionState Experimental
Get current state if XR functionality
Returns XRSessionState
returns a Promise
requestXMember Capabilities
- requestXMember
Capabilities(memberId: number): Promise<boolean> Experimental
execute whatever is necessary to enable XRCapbilities on the given member, e.g. start the camera or forward to the booster
Parameters
-
memberId: number
the XRMember that the operation should be applied on
Returns Promise<boolean>
returns a Promise which reports wether the operation was successful or not
-
resetAR
setXRMember Settings
- setXRMember
Settings(memberId: number, settings: XRMemberSettings): Promise<boolean> Experimental
This will set settings for the specific xr member.
modeltrackerQualityThreshold sets a normalized threshold for the modeltracker. The threshold determines the actual correspondence of the generated line model to the real world. A value of 1 means total correspondence, while a value of zero means no correspondence at all. Depending on that value the tracker will trigger a REALITY_MODELTRACKERSTATE_CHANGED event with the ModelTrackingState.SNAPPED to true and a REALITY_XRSTATE_CHANGED event with XRState.FIXATED set to true
enableDebugImages will enable or disable the edge images to be send from the modeltracker. If set to true it will trigger REALITY_MODELTRACKER_EDGEIMG_RECEIVED events once an debug image arrives. Note: When enabled this will impact bandwidth and perfomance of the application, so we recommand using this only on demand.
Parameters
-
memberId: number
the XRMember that the operation should be applied on
-
settings: XRMemberSettings
The quality threshold for the modeltracker must be between 0 and 1
Returns Promise<boolean>
returns a Promise which reports wether the operation was successful or not
-
show Expert Dialog
startAR
- startAR(): Promise<boolean>
-
Deprecated
start AR. Projects the camera stream in the background and starts searching for the given reference. The reference is defined by setting the realproperty on the particular node via the webvis API. E.g. webvis.setProperty(0, pluginAPI.realProperty, pluginAPI.realState.Enabled)
Returns Promise<boolean>
returns true if starting was successfull or false if it could not start AR
startXRMember Spectate
- startXRMember
Spectate(memberId: number): Promise<boolean> Experimental
Puts the image stream in the background of the renderer. It will also trigger REALITY_XRSTATE_CHANGED event with the XRState.FOLLOWING set to true
Parameters
-
memberId: number
the XRMember that the operation should be applied on
Returns Promise<boolean>
returns a Promise which reports wether the operation was successful or not
-
stopAR
stopXRMember Spectate
- stopXRMember
Spectate(memberId: number): Promise<boolean> Experimental
Stops the image stream in the background of the renderer. It will also trigger REALITY_XRSTATE_CHANGED event with the XRState.FOLLOWING set to false
Parameters
-
memberId: number
the XRMember that the operation should be applied on
Returns Promise<boolean>
returns a Promise which reports wether the operation was successful or not
-
unfixateXRMember
- unfixateXRMember(memberId: number): Promise<boolean>
Experimental
Unfixates the model. The model will move with the device. It will also trigger REALITY_XRSTATE_CHANGED event with the XRState.FIXATED set to false
Parameters
-
memberId: number
the XRMember that the operation should be applied on
Returns Promise<boolean>
returns a Promise which reports wether the operation was successful or not
-