Class: Portal

Portal(scene, serverFolder, callback, shadowGenerator)

Portal is an entrance to other worlds, disabled by default. Once enabled, user enters by clicking on it, or by voice command. Voice activation is by command + name, or by command + prefix, since names may hard to pronounce/recognize. Portal prefix+name, subtitle and description are displayed above the portal. Portal thumbnail is used as emissive texture on enabled portal, automatically set from relatedUrl of provided serverFolder. Enabled portals play default sound. General usage is simple: construct, optionally set parameters, call loadAt().

Constructor

new Portal(scene, serverFolder, callback, shadowGenerator)

Create a portal
Parameters:
Name Type Description
scene babylonjs scene
serverFolder ServerFolder containing world class and content
callback to execute when portal is activated (clicked, tapped)
shadowGenerator optionally, portal can cast shadows
Source:

Classes

Portal

Members

prefix

If set, portal name is prefixed by this prefix
Source:

serverFolder :ServerFolder

Type:
Source:

Methods

dispose()

dispose of everything
Source:

enabled(enable)

Enables or disables the portal
Parameters:
Name Type Description
enable
Source:

enter()

Executes callback on entry
Source:

(async) loadAt(x, y, z, angle)

Load and display portal at given coordinates. Copies existing portal mesh to new coordinates and angle.
Parameters:
Name Type Description
x
y
z
angle
Source:

worldUrl()

handy, returns base url and folder name
Source: