LandscapeApp

lumin. LandscapeApp

Base class for Lumin Runtime landscape apps.

Constructor

new LandscapeApp(a_fTimeDeltaopt)

Creates a landscape 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

disableContentPersistence(a_prism) → {boolean}

Stops persisting a given Prism's content across reboots

By default a Prism's content persists across reboots. This means that all opened Prisms are
saved when the device shuts down. Prisms that are explicitly closed by the user or app prior
to shutdown are not saved. When the device boots up, and the area (dense mesh) is recognized,
then all saved Prisms are restored by automatically starting the apps associated with the
Prisms and asking them to request new Prisms. If the app saved their content persistence ID
locally prior to shutdown, then for each restored Prism they can figure out how exactly to
restore it.

Parameters:
Name Type Description
a_prism lumin.Prism

the Prism

Returns:

whether this call was successful or not

Type
boolean

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

getBodyDynamic(a_prism) → {lumin.BodyDynamicType}

Retrieves the current body dynamic type for the Prism

See setBodyDynamic for information on body dynamics.

Parameters:
Name Type Description
a_prism lumin.Prism

the Prism

Returns:

the body dynamic of the Prism

Type
lumin.BodyDynamicType

getCollisionsEnabled(a_prism) → {boolean}

Get whether the given prism participates in collisions when prisms are in motion.

Parameters:
Name Type Description
a_prism lumin.Prism

Prism to get whether collisions are enabled.

Returns:

True if collisions are enabled
for the given prism; false otherwise.

Type
boolean

getComponentName() → {string}

Inherited From:

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

Returns:
Type
string

getContentPersistenceId(a_prism) → {string}

Gets the Content Persistence ID assigned to the Prism

This is the ID assigned to a Prism that is saved across reboots. Note that if this Prism
is destroyed before the device shuts down, then this ID is no longer valid. See
disableContentPersistence for more information on content persistence.

Parameters:
Name Type Description
a_prism lumin.Prism

the Prism

Returns:

the Content Persistence ID assigned to this Prism

Type
string

getDirectManipulationEnabled(a_prism) → {boolean}

Gets the bool for whether direct manipulation is enabled or not for this Prism

See setDirectManipulationEnabled for information on direct manipulation.

Parameters:
Name Type Description
a_prism lumin.Prism

the Prism

Returns:

whether direct manipulation is enabled for the prism

Type
boolean

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

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

getPhysicalSizeRange(a_prism) → {vec2}

Gets the physical size range of the Prism

See setPhysicalSizeRange for information on size ranges.

Parameters:
Name Type Description
a_prism lumin.Prism

the Prism

Returns:

pair of minimum/maximum phisical size this prism can be, in meters
or null if call was not successful

Type
vec2

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 number

the Id of the Prism

Returns:

The prism

Type
lumin.Prism

getScaleMode(a_prism) → {lumin.ScaleModeType}

Gets the scale mode of the Prism

See setBodyDynamic for information on scale modes.

Parameters:
Name Type Description
a_prism lumin.Prism

the Prism

Returns:

the scale mode retrieved from the Prism

Type
lumin.ScaleModeType

getSnap(a_prism) → {boolean}

Gets whether this Prism should snap while being moved or not

See setSnap for information on snapping.

Parameters:
Name Type Description
a_prism lumin.Prism

the Prism

Returns:

whether this Prism is snapping or not

Type
boolean

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

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

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

onAppPause()

Overrides:

onAppResume()

Overrides:

onAppStart(initArg)

Overrides:
Parameters:
Name Type Description
initArg lumin.InitArg

onAppUnloadResources()

Overrides:

onSharingStart(sessionId, sceneGraphIDs)

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

onSharingStop(sessionId)

Overrides:
Parameters:
Name Type Description
sessionId number

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.

requestNewPrism(a_size) → {lumin.Prism}

Get a new Prism for use by the Application

Parameters:
Name Type Description
a_size vec3

width, height, and breadth of the prism.

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

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 number

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 number

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

setBodyDynamic(a_prism, a_bodyDynamicType) → {boolean}

Sets a body dynamic with the given parameters to the Prism

A body dynamic is how the Prism behaves passively in the landscape. For example, one body
dynamic can make a Prism rotate (billboard) towards the user as they walk around the Prism.
By default Prisms are static (un-moving) once placed in the landscape.

Parameters:
Name Type Description
a_prism lumin.Prism

the Prism

a_bodyDynamicType lumin.BodyDynamicType

the body dynamic type to set to the prism

Returns:

whether this call was successful or not

Type
boolean

setCollisionsEnabled(a_prism, a_enableCollisions) → {boolean}

Set whether the given prism participates in collisions when prisms are in motion.

This capability has been provided for app developers to handle edge cases
involving multi-prism apps. By default, collisions are enabled when new
prisms are created. It is recommended to change it only with discretion.

Parameters:
Name Type Description
a_prism lumin.Prism

Prism to enable/disable collisions.

a_enableCollisions boolean

Collisions will be enabled if true; disabled if false.

Returns:

True if this call was successful; false otherwise.

Type
boolean

setDirectManipulationEnabled(a_prism, a_enableDirectManipulation) → {boolean}

Sets whether this Prism can be directly manipulated while being moved or not

Whether to support direct manipulation of the Prism's position in 6dof. Direct manipulation
is analogous to grabbing an object with your hand, but using the Control instead. The
grabbed prism is attached to the Control's pose while moving it. This is true by default.

Parameters:
Name Type Description
a_prism lumin.Prism

the Prism

a_enableDirectManipulation boolean

Whether this prism can be directly manipulated or not.

Returns:

whether this call was successful or not

Type
boolean

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.

setPhysicalSizeRange(a_prism, a_min, a_max) → {boolean}

Sets the physical size range for the Prism

The range of physical sizes (extent * scale) that this prism's largest extent can be scaled to.

Parameters:
Name Type Description
a_prism lumin.Prism

the Prism

a_min number

the minimum physical size this prism can be, in meters

a_max number

the maximum physical size this prism can be, in meters

Returns:

whether this call was successful or not

Type
boolean

setScaleMode(a_prism, a_scaleModeType) → {boolean}

Sets the scale mode for the Prism

When a Prism is directly manipulated, the user can scale it. This sets which dimension for the
Prism to be scaled (by default width, height, and depth are scaled).

Parameters:
Name Type Description
a_prism lumin.Prism

the Prism

a_scaleModeType lumin.ScaleModeType

the scale mode to set to the Prism

Returns:

whether this call was successful or not

Type
boolean

setSnap(a_prism, a_snap) → {boolean}

Sets whether this Prism should snap while being moved or not

"snapping" basically means that while a Prism is being moved by the user and it is near a
stationary Prism, then the moving Prism will suddenly move adjacent to the stationary Prism.

Parameters:
Name Type Description
a_prism lumin.Prism

the Prism

a_snap boolean

whether this Prism should snap or not

Returns:

whether this call was successful or not

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

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)

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>
0

the id of the device to send the haptic request to

triggerControlCustomHaptic(haptic, controlIDopt)

Inherited From:

Trigger a custom control haptic

Parameters:
Name Type Attributes Default Description
haptic lumin.HapticInfo

and individual custom haptic

controlID number <optional>
0

id of control device

triggerControlCustomHaptics(haptics, controlIDopt)

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>
0

id of control device

triggerControlHaptic(haptic, controlIDopt)

Overrides:

Trigger a control vibration haptic

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

the VibePattern to trigger

controlID number <optional>
0

id of control device

triggerControlLEDHaptics(pattern, durationopt, intensityopt, controlIDopt)

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>
0

the id of the device to send the haptic request to

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.