ImmersiveApp

lumin. ImmersiveApp

Base class for Lumin Runtime immersive apps.

Constructor

new ImmersiveApp(a_fTimeDeltaopt)

Creates an immersive application instance.

Parameters:
Name Type Attributes Default Description
a_fTimeDelta number <optional>
0.0

the preferred update rate as a time interval in seconds.
As a special case, 0.0f represents event-based mode, where update callbacks
will not happen at regular intervals -- only in response to events.

Extends

Methods

checkPrivilege(privilegeId) → {lumin.PrivilegeResult}

Inherited From:

Checks if a privilege is currently granted.

Parameters:
Name Type Description
privilegeId lumin.PrivilegeId

The privilege ID to check

Returns:

Granted or Denied

Type
lumin.PrivilegeResult

deInit() → {number}

Overrides:
Returns:
Type
number

deletePrism(prism)

Inherited From:

Deletes the prism

Parameters:
Name Type Description
prism lumin.Prism

the Prism to delete

dismissAllNotifications()

Inherited From:

Dismss all notifications from this application

dismissNotification(notification) → {boolean}

Inherited From:

Dismiss the given notification

Parameters:
Name Type Description
notification lumin.Notification

the notification to dismiss

Returns:

true if the notification was dismissed, false otherwise

Type
boolean

eventListener(a_pEvent) → {boolean}

Overrides:
Parameters:
Name Type Description
a_pEvent lumin.ServerEvent
Returns:
Type
boolean

getComponentName() → {string}

Inherited From:

Returns the name of the component this application instance belongs to.

Returns:
Type
string

getCurrentLocaleHelper() → {lumin.utils.LocaleHelper}

Inherited From:

Gets the LocaleHelper that's set to the current system locale

Returns:

the current system LocaleHelper

Type
lumin.utils.LocaleHelper

getFloorHeight() → {number}

Inherited From:

Returns the height (y-value) of the floor, if known, in world coordinates.

Returns:

Returned floor height.

Type
number

getHeadposeConfidence() → {number}

Inherited From:

Get the underlying system's confidence in the headpose values

Returns:

a value between 0.0 and 1.0 indicating the confidence

Type
number

getHeadposeError() → {lumin.headtracking.Error}

Inherited From:

Get the current headpose error (if any)

Returns:

the current headpose error

Type
lumin.headtracking.Error

getHeadposeMode() → {lumin.headtracking.Mode}

Inherited From:

Get the current headpose mode (6-DOF or 3-DOF)

Returns:

the current headpose mode

Type
lumin.headtracking.Mode

getHeadposeWorldForwardVector() → {vec3}

Inherited From:

Get the Headpose forward vector in world space.

Returns:

the world space headpose forward vector.

Type
vec3

getHeadposeWorldPosition() → {vec3}

Inherited From:

Get the Headpose position in world space.

Returns:

the world space headpose position.

Type
vec3

getHeadposeWorldUpVector() → {vec3}

Inherited From:

Get the Headpose up vector in world space.

Returns:

the world space headpose up vector.

Type
vec3

getLocaleCode() → {string}

Inherited From:

Get the system locale code

Returns:
Type
string

getPackageName() → {string}

Inherited From:

Returns the package name for this application.

Returns:
Type
string

getPackagePath() → {string}

Inherited From:

Returns the application's path

Returns:
Type
string

getPreloadedResources() → {lumin.resources.Preloaded}

Inherited From:

Get an object clients can use to find preloaded resources.

Returns:
Type
lumin.resources.Preloaded

getPrism(prismId) → {lumin.Prism}

Inherited From:

Returns pointer to the Prism

Parameters:
Name Type Description
prismId BigInt

the Id of the Prism

Returns:

The prism

Type
lumin.Prism

getPrismPosition(a_prism) → {vec3}

Inherited From:

Returns the position of a volume in world space

Parameters:
Name Type Description
a_prism lumin.Prism

the prism

Returns:
  • the prism position
Type
vec3

getPrismRotation(a_prism) → {quat}

Inherited From:

Returns the rotation of a volume in world space

Parameters:
Name Type Description
a_prism lumin.Prism

the prism

Returns:
  • the prism orientation quaternion
Type
quat

getPrismTransform(a_prism) → {mat4}

Inherited From:

Returns the transform of a volume in world space

Parameters:
Name Type Description
a_prism lumin.Prism

the prism

Returns:

The transform of the Prism in world space

Type
mat4

getTempPath() → {string}

Inherited From:

Returns the application's path for temporary files

Returns:
Type
string

getVisibleName() → {string}

Inherited From:

Returns the user-visible name for this application.

Returns:
Type
string

getWorldMeshBlockData(a_blockPos, a_blockData) → {boolean}

Returns the world mesh data for a block at a given location.

Parameters:
Name Type Description
a_blockPos vec3

Block position in world-space.

a_blockData lumin.WorldMeshBlockData

Class that will be filled in with the block data.

Returns:

true if blockData has valid data

Type
boolean

getWritablePath() → {string}

Inherited From:

Returns the application's writable path.

This folder is accessible to the application when the user has logged in once,
even if the device is locked and not in use.
An application that needs to write data when running in the background
(e.g. a music app) should use this path. The same application can continue
using this path when the device is unlocked afterwards.

Returns:
Type
string

getWritablePathWhenUnlocked() → {string}

Inherited From:

Returns the application's writable path while unlocked.

This folder is accessible to the application when the user has logged in and the
device is unlocked and being used.

Returns:
Type
string

isHandOcclusionEnabled() → {boolean}

Gets whether hand occlusion is currently enabled or not

Returns:

true if currently enabled, false otherwise

Type
boolean

isImageTrackingReady() → {boolean}

Inherited From:

Returns if the image tracking system is ready to be used. Do not call any image tracking functions
until this function returns true.

Returns:

true if we can start tracking images.

Type
boolean

isShareableApp() → {boolean}

Inherited From:

Returns if the app running is a Shareable app

Returns:
Type
boolean

isSkipRaycast(a_prism) → {boolean}

Returns the skip raycast state of the volume.

Parameters:
Name Type Description
a_prism lumin.Prism

The Prism.

Returns:

true if the prism is skipped during raycasting

Type
boolean

lockCurrentLocaleHelperToLocale(localeCode)

Inherited From:

Lock the LocaleHelper to the given locale. It will no longer change when the system locale is changed

Parameters:
Name Type Description
localeCode string

the lock that the LocaleHelper will be locked to

onAppPause()

Overrides:

onAppResume()

Overrides:

onAppStart(initArg)

Overrides:
Parameters:
Name Type Description
initArg lumin.InitArg

onAppUnloadResources()

Overrides:

onDeviceActive()

Overrides:

onDeviceReality()

Overrides:

onDeviceStandby()

Overrides:

onSharingStart(sessionId, sceneGraphIDs)

Overrides:
Parameters:
Name Type Description
sessionId BigInt
sceneGraphIDs Array.<BigInt>

onSharingStop(sessionId)

Overrides:
Parameters:
Name Type Description
sessionId BigInt

orientPrism(a_prism, a_orientation)

Inherited From:

Sets the Orientation of the Prism

Parameters:
Name Type Description
a_prism lumin.Prism

the prism

a_orientation quat

the new prism orientation quaternion

orientPrismRelativeToCamera(a_prism, a_orientation)

Inherited From:

Sets the Orientation of the Prism relative to the Camera

Parameters:
Name Type Description
a_prism lumin.Prism

the prism

a_orientation quat

the new prism orientation quaternion

positionPrism(a_prism, a_position)

Inherited From:

Sets the Prism Position

Parameters:
Name Type Description
a_prism lumin.Prism

the prism

a_position vec3

the new prism position

positionPrismRelativeToCamera(a_prism, a_position)

Inherited From:

Sets the Prism Position relative to the camera

Parameters:
Name Type Description
a_prism lumin.Prism

the prism

a_position vec3

the new prism position, relative to the camera

postNotification(notification) → {boolean}

Inherited From:

Post the given notification

Parameters:
Name Type Description
notification lumin.Notification

the notification to post

Returns:

true if the notification was posted successfully, false otherwise

Type
boolean

quit()

Inherited From:

The application will terminate on the next update loop when this is called.

raycastNodes(a_prism, a_rayStart, a_rayEnd) → {lumin.RayCastResultLight}

Inherited From:

Do a raycast in a prism and return the results.

Parameters:
Name Type Description
a_prism lumin.Prism

Prism to do the ray in.

a_rayStart vec3

Ray starting position, in volume coordinates.

a_rayEnd vec3

Ray end position, in volume coordinates.

Returns:

Hit data.

Type
lumin.RayCastResultLight

registerOnLocaleChangedCallback(callbackFunction) → {lumin.utils.CallbackID}

Inherited From:

Register a callback for when the system locale is changed

Parameters:
Name Type Description
callbackFunction callable

the function to be called (the new locale code is given as a parameter)

Returns:

the internal ID of the callback, can be used to unregister the callback

Type
lumin.utils.CallbackID

requestNewPrism(a_size, a_ePrismTypeopt) → {lumin.Prism}

Get a new Prism for use by the Application

Parameters:
Name Type Attributes Default Description
a_size vec3

width, height, and breadth of the prism.

a_ePrismType lumin.PrismType <optional>
PrismType.kWorld

Type of Prism (eg: Tied to Headpose or Fixed in the world)

Returns:

Prism - The prism

Type
lumin.Prism

requestPrivilege(privilegeId)

Inherited From:

Asynchronously requests a privilege.

The result will be returned on the main thread as a PrivilegeEvent.

Parameters:
Name Type Description
privilegeId lumin.PrivilegeId

The privilege ID to request

requestPrivilegeBlocking(privilegeId) → {lumin.PrivilegeResult}

Inherited From:

Makes a blocking request for a privilege (may require user interaction).

Parameters:
Name Type Description
privilegeId lumin.PrivilegeId

The privilege ID to check

Returns:

Granted or Denied

Type
lumin.PrivilegeResult

requestWorldMeshBlockUpdates(a_prism) → {boolean}

Request to get updates when world mesh block data has changed. WorldMeshBlockEventData messages
will be sent to the app's eventListener function when there is a change to the mesh blocks.

Parameters:
Name Type Description
a_prism lumin.Prism

Prism used to send the event messages.

Returns:

true if the request was made successfully

Type
boolean

requestWorldPlaneCast(center, maxDistance, maxPlaneCount, flags, userValue) → {boolean}

Inherited From:

Sends a request to the server to search for planes in the environment that match given
criteria. A WorldPlaneCastEventData instance will be sent to the app's eventListener
function when the data is ready.

Parameters:
Name Type Description
center vec3

Position in world-space that is the center of the search space.

maxDistance number

Max distance from the center to search for planes.

maxPlaneCount number

Maximum number of planes to return.

flags lumin.PlanecastFlags

Flags to determine what kind of planes to look for.

userValue BigInt

Value that will be sent back in the WorldPlaneCastEventData instance.

Returns:

true if the request was sent, false on error

Type
boolean

requestWorldRayCast(rayStart, rayDir, userValue, confidenceThresholdopt) → {boolean}

Overrides:

Performs a single ray cast against the world around you. Results are returned as a WorldRayCastEventData
to the app's eventListener function.

Parameters:
Name Type Attributes Default Description
rayStart vec3

The start point of the ray, in world space.

rayDir vec3

Direction to shoot the ray

userValue BigInt

Custom data that you wish to record with this request

confidenceThreshold number <optional>
0.199

Confidence level (between 0 and 1) that must be reached for the
raycast to be considered valid

Returns:

true if the request was sent, false on error

Type
boolean

resizePrism(a_prism, a_size)

Inherited From:

Resizes the Prism

Parameters:
Name Type Description
a_prism lumin.Prism

the prism to resize

a_size vec3

the new size of the prism

selectPrism(a_prism, a_bSelected)

Selects or deselects the specified prism.

Input and other events are delivered only to the selected prism.

Parameters:
Name Type Description
a_prism lumin.Prism

the prism

a_bSelected boolean

true to select; false to deselect

setEventSleepTime(a_fSleepTime)

Inherited From:

Set the Event Sleep Time

This is the amount of time the client should sleep before firing
the updateloop callback, if no other events have occured.

Parameters:
Name Type Description
a_fSleepTime number

Time to sleep in seconds, or 0.0f to sleep
indefinitely, until an event occurs.

setHandOcclusionEnabled(a_enable)

Enables or disables hand occlusion

Parameters:
Name Type Description
a_enable boolean

Set to true to enable hand occlusion, false to disable

setOcclusionEnabled(a_enabled)

Toggles occlusion.

Parameters:
Name Type Description
a_enabled boolean

true to enable occlusion, false to disable

setSkipRaycast(a_prism, a_skipRaycast)

Sets the skip raycast state of the prism. If the prism is skipped, all its Nodes will be as
well.

Parameters:
Name Type Description
a_prism lumin.Prism

The Prism.

a_skipRaycast boolean

Raycast skip flag.

startExclusiveModeGL(options, ctxGl) → {lumin.ExclusiveRender}

Start a full screen exclusive mode for a landscape app which does its own rendering full screen

Parameters:
Name Type Description
options lumin.ExclusiveRender.ClientOptions

exclusive client options

ctxGl unknown

OpenGL render context

Returns:

exclusive mode renderer

Type
lumin.ExclusiveRender

stopExclusiveMode() → {boolean}

Stop full screen exclusive mode

Returns:
Type
boolean

stopTrackImage(imageName) → {boolean}

Inherited From:

Stops tracking an image. If no images are being tracked, will disable tracking.

Parameters:
Name Type Description
imageName string

Name of the image. Should be the same as the name passed to one of the the
trackImage functions.

Returns:

true if tracking the image was stopped

Type
boolean

stopWorldMeshBlockUpdates(a_prism) → {boolean}

Request to stop getting updates when world mesh block data has changed.

Parameters:
Name Type Description
a_prism lumin.Prism

Prism used to make the requestWorldMeshBlockUpdates call.

Returns:

true if the request was made successfully

Type
boolean

trackMovingImage(imageName, dimensions, file, prism) → {boolean}

Inherited From:

Starts a request to track a moving image, based on an image file. Moving images are harder to
track than non-moving ones; use this function only if sure the image is moving. This will enable
tracking if it is not already enabled.

Parameters:
Name Type Description
imageName string

Unique name for the image.

dimensions vec2

Approximate size of the image, in meters. This is used to help identify the image.

file string

File name of the image to track. Name is relative to the app's location.

prism lumin.Prism

Where to send the image position info

Returns:

true if tracking was started, false if there was an error.

Type
boolean

trackStaticImage(imageName, dimensions, file, prism) → {boolean}

Inherited From:

Starts a request to track an non-moving image, based on an image file. Static images are easier
to track than moving ones, so use this method if possible. This will enable tracking if it is
not already enabled.

Parameters:
Name Type Description
imageName string

Unique name for the image.

dimensions vec2

Approximate size of the image, in meters. This is used to help identify the image.

file string

File name of the image to track. Name is relative to the app's location.

prism lumin.Prism

Where to send the image position info

Returns:

true if tracking was started, false if there was an error.

Type
boolean

triggerControlBodyHaptics(pattern, durationopt, intensityopt, controlIDopt, deviceIDopt)

Inherited From:

Request vibration haptics on the body of the control device

Parameters:
Name Type Attributes Default Description
pattern lumin.haptics.VibePattern

the vibration pattern to use

duration number <optional>
100

the duration to play the pattern over (ms)

intensity lumin.haptics.VibeIntensity <optional>
haptics.VibeIntensity.MEDIUM

the intensity of the vibration

controlID number <optional>
INVALID_CONTROL_ID

the ID of the control to use (0 will be the primary control)

deviceID number <optional>
INVALID_DEVICE_ID

the internal ID of the device to use (note, this takes precedence over the control ID)

triggerControlCustomHaptic(haptic, controlIDopt, deviceIDopt)

Inherited From:

Trigger a custom control haptic

Parameters:
Name Type Attributes Default Description
haptic lumin.HapticInfo

and individual custom haptic

controlID number <optional>
INVALID_CONTROL_ID

the ID of the control to use (0 will be the primary control)

deviceID number <optional>
INVALID_DEVICE_ID

the internal ID of the device to use (note, this takes precedence over the control ID)

triggerControlCustomHaptics(haptics, controlIDopt, deviceIDopt)

Inherited From:

Trigger a list of custom control haptics

Parameters:
Name Type Attributes Default Description
haptics Array.<lumin.HapticInfo>

the combined list of haptics

controlID number <optional>
INVALID_CONTROL_ID

the ID of the control to use (0 will be the primary control)

deviceID number <optional>
INVALID_DEVICE_ID

the internal ID of the device to use (note, this takes precedence over the control ID)

triggerControlHaptic(haptic, controlIDopt, deviceIDopt)

Overrides:

Trigger a control vibration haptic

Parameters:
Name Type Attributes Default Description
haptic lumin.haptics.VibePattern

the VibePattern to trigger

controlID number <optional>
INVALID_CONTROL_ID

the ID of the control to use (0 will be the primary control)

deviceID number <optional>
INVALID_DEVICE_ID

the internal ID of the device to use (note, this takes precedence over the control ID)

triggerControlLEDHaptics(pattern, durationopt, intensityopt, controlIDopt, deviceIDopt)

Inherited From:

Request light haptics on the LEDs of the control device

Parameters:
Name Type Attributes Default Description
pattern lumin.haptics.LedPattern

the LED light pattern to use

duration number <optional>
100

the duration to play the pattern over (ms)

intensity lumin.haptics.VibeIntensity <optional>
haptics.VibeIntensity.MEDIUM

the intensity of the haptic

controlID number <optional>
INVALID_CONTROL_ID

the ID of the control to use (0 will be the primary control)

deviceID number <optional>
INVALID_DEVICE_ID

the internal ID of the device to use (note, this takes precedence over the control ID)

unlockCurrentLocaleHelper()

Inherited From:

Unlock the locale of the LocaleHelper. This will set the LocaleHelper back to the current system locale

unregisterOnLocaleChangedCallback(callbackID) → {boolean}

Inherited From:

Unregister a callback for when the system locale is changed

Parameters:
Name Type Description
callbackID lumin.utils.CallbackID

the ID of the callback to unregister

Returns:

true if succesfully unregistered, false otherwise

Type
boolean

updateLoop(a_fDelta) → {boolean}

Overrides:
Parameters:
Name Type Description
a_fDelta number
Returns:
Type
boolean

waitForTermination()

Inherited From:

This call will block the caller thread until the app has finished running.
It must NOT be called from the client update thread or it will assert.