MRApp

MRApp ⇐ MRElement

The engine handler for running MRjs as an App. mr-app

Kind: global class
Extends: MRElement

mrApp.MRApp

Kind: instance class of MRApp

new exports.MRApp()

Constructs the base information of the app including system, camera, engine, xr, and rendering defaults.

mrApp.appWidth() ⇒ number

Kind: instance method of MRApp
Returns: number - width in 3d or pixel space (depending on if in xr) of the current open app

mrApp.appHeight() ⇒ number

Kind: instance method of MRApp
Returns: number - height in 3d or pixel space (depending on if in xr) of the current open app

mrApp.mutatedAttribute(mutation)

Kind: instance method of MRApp

Param Type Description
mutation object TODO

mrApp.mutatedChildList(mutation)

Kind: instance method of MRApp

Param Type Description
mutation object TODO

mrApp.mutationCallback(mutationList, observer)

The mutationCallback function that runs whenever this entity component should be mutated.

Kind: instance method of MRApp

Param Type Description
mutationList object the list of update/change/mutation(s) to be handled.
observer object w3 standard object that watches for changes on the HTMLElement

mrApp.init()

Initializes the engine state for the MRApp. This function is run whenever the MRApp is connected.

Kind: instance method of MRApp

mrApp.initCamera()

Initializes the user information for the MRApp including appropriate HMD direction and camera information and the default scene anchor location.

Kind: instance method of MRApp

mrApp.initLights(data)

Initializes default lighting and shadows for the main scene.

Kind: instance method of MRApp

Param Type Description
data object the lights data (color, intensity, shadows, etc)

mrApp.denit()

De-initializes rendering and MR

Kind: instance method of MRApp

mrApp.registerSystem(system)

Registers a new system addition to the MRApp engine.

Kind: instance method of MRApp

Param Type Description
system MRSystem the system to be added.

mrApp.unregisterSystem(system)

Unregisters a system from the MRApp engine.

Kind: instance method of MRApp

Param Type Description
system MRSystem the system to be removed.

mrApp.add(entity)

Adding an entity as an object in this MRApp engine’s scene.

Kind: instance method of MRApp

Param Type Description
entity MREntity the entity to be added.

mrApp.removeEntity(entity)

Removing an entity as an object in this MRApp engine’s scene.

Kind: instance method of MRApp

Param Type Description
entity MREntity the entity to be removed.

mrApp.onWindowResize()

Handles what is necessary rendering, camera, and user-wise when the viewing window is resized.

Kind: instance method of MRApp

mrApp.render(timeStamp, frame)

Default function header needed by threejs. The render function that is called during ever frame. Calls every systems’ update function.

Kind: instance method of MRApp

Param Type Description
timeStamp number timeStamp of the current frame.
frame object given frame information to be used for any feature changes

MRApp.Connected()

The connectedCallback function that runs whenever this entity component becomes connected to something else.

Kind: static method of MRApp

MRApp.Disconnected()

The disconnectedCallback function that runs whenever this entity component becomes connected to something else.

Kind: static method of MRApp