Home Reference Source
import Engine from 'potassium-es/src/Engine.js'
public class | source

Engine

Extends:

EventHandler → Engine

Engine wraps up the THREE.Renderer and manages moving into and out of WebXR or WebVR Sessions

Static Method Summary

Static Public Methods
public static

async chooseDisplays(portalEngine: Engine, immersiveEngine: Engine)

Determines the available display APIs (WebXR or WebVR) and uses that info to set up an appropriate SceneDisplay for each Engine

Constructor Summary

Public Constructor
public

constructor(scene: THREE.Scene, mode: string, tickCallback: function)

Member Summary

Public Members
public get

camera: *

public get

el: *

public get
public get

scene: *

public get
public set
public get

Method Summary

Public Methods
public

pickPose(pointObject3D: *): *

public

pickScreen(normalizedMouseX: *, normalizedMouseY: *): *

public

start(): *

public

stop(): *

Inherited Summary

From class EventHandler
public get

listeners: EventListener[]: *

public

addListener(callback: function(eventName: string, eventSource: EventHandler), eventName: Object | Symbol, once: bool)

public
public

removeListener(callback: *, eventName: undefined)

public

trigger(eventName: *, params: ...*)

Send an event to listeners

Static Public Methods

public static async chooseDisplays(portalEngine: Engine, immersiveEngine: Engine) source

Determines the available display APIs (WebXR or WebVR) and uses that info to set up an appropriate SceneDisplay for each Engine

Params:

NameTypeAttributeDescription
portalEngine Engine
immersiveEngine Engine

Public Constructors

public constructor(scene: THREE.Scene, mode: string, tickCallback: function) source

Params:

NameTypeAttributeDescription
scene THREE.Scene
mode string

Engine.PORTAL or Engine.IMMERSIVE

tickCallback function
  • optional
  • default: null

this is called while rendering each frame

Public Members

public get camera: * source

public get el: * source

public get hasDisplay: * source

public get scene: * source

public get sceneDisplay: * source

public set sceneDisplay source

public get tickCallback: * source

Public Methods

public pickPose(pointObject3D: *): * source

Params:

NameTypeAttributeDescription
pointObject3D *

Return:

*

public pickScreen(normalizedMouseX: *, normalizedMouseY: *): * source

Params:

NameTypeAttributeDescription
normalizedMouseX *
normalizedMouseY *

Return:

*

public start(): * source

Return:

*

public stop(): * source

Return:

*