World

World

Includes the application's AR logic.


Constructor

new World()

Source:

Properties

(static) boxImageTrackable :ImageTrackable

The trackable of the router box.

Type:
  • ImageTrackable
Source:

(static) currentTracker :BaseTracker

Gets or sets the currently active tracker. Can be set to null to deactivate all trackers.

Type:
  • BaseTracker
Source:

(static) defaultPositionable :ARgoPositionable

Source:

(static) drawables :Array.<Drawable>

The application's loaded drawables.

Type:
  • Array.<Drawable>
Source:

(static) modelArrow :ARgoModel

The 3D model of an arrow.

Type:
Source:

(static) modelBlock :ARgoModel

The 3D model of the ports' frame.

Type:
Source:

(static) modelCharger :ARgoModel

The 3D model of the transformer plug.

Type:
Source:

(static) modelMarker :ARgoModel

The 3D model of a marker.

Type:
Source:

(static) modelRJ45 :ARgoModel

The 3D model of the RJ45 cable.

Type:
Source:

(static) modelRouterAR :ARgoModel

The 3D model of the router in AR.

Type:
Source:

(static) portsLabel :Label

The router's ports.

Type:
  • Label
Source:

(static) routerImageTrackable :ImageTrackable

The trackable of the router.

Type:
  • ImageTrackable
Source:

(static) sounds :Array.<Sound>

The application's loaded sounds.

Type:
  • Array.<Sound>
Source:

(static) targetRecognized :boolean

Indicates if a visual target is currently recognized by a tracker.

Type:
  • boolean
Source:

(static) trackers :Array.<BaseTracker>

The application's loaded trackers.

Type:
  • Array.<BaseTracker>
Source:

Methods

(static) addARCableConnectionAnimation(model)

Creates and starts a connection animation for a model in AR Presentation Mode.

Parameters:
Name Type Description
model ARgoModel
Source:

(static) addFlashingAnimation(model)

Creates and starts a flashing animation for a 3D model.

Parameters:
Name Type Description
model Model
Source:

(static) adjustPresentationTransform(model) → {ARgoAnimationGroup}

Adjusts the presentationLayout according to the Presentation Mode step.

Parameters:
Name Type Description
model ARgoModel
Source:
Returns:
Type
ARgoAnimationGroup

(static) canRotateSnappedModel() → {boolean}

Gets if snapped models can be rotated.

Source:
Returns:
Type
boolean

(static) createAppearingAnimation(model) → {ARgoAnimationGroup}

Creates an appearing animation for a positionable 3D model.

Parameters:
Name Type Description
model ARgoModel

The model to animate.

Source:
Returns:

An instance of ARgoAnimationGroup

Type
ARgoAnimationGroup

(static) createARAppearingAnimation(model, scale) → {ARgoAnimationGroup}

Creates the first appearance animation for a 3D model.

Parameters:
Name Type Description
model Model

The model to animate.

scale number

The maximum scale of the animation.

Source:
Returns:

An instance of ARgoAnimationGroup

Type
ARgoAnimationGroup

(static) createCableConnectionAnimation(model) → {ARgoAnimationGroup}

Creates a connection animation for a model in 3D Presentation Mode.

Parameters:
Name Type Description
model ARgoModel
Source:
Returns:
Type
ARgoAnimationGroup

(static) createOverlays()

Creates all AR overlays (models, trackers, trackables and animations).

Source:

(static) createPositionableOverlays()

Add our models' specifications to the default Positionable managed by the native plugin.

Source:

(static) createSound(uri, cacheopt) → {Sound}

Creates and loads an AR.Sound.

Parameters:
Name Type Attributes Description
uri string

The path to the sound file.

cache boolean <optional>

Whether to cache the sound to World.sounds. For constantly loaded sounds this should be false.

Source:
Returns:
Type
Sound

(static) createSounds(pageopt)

Creates and loads the application's sounds. These are accessed by ARgo.SOUNDS and listed in World.sounds.

Parameters:
Name Type Attributes Description
page string <optional>

The sounds to load based on the specified app stage.

Source:

(static) destroyAnimation(animation)

Stops and destroys an animation assigned to a model.

Parameters:
Name Type Description
animation ARgoAnimationGroup
Source:

(static) destroySounds()

Unloads and destroys all currently loaded sounds.

Source:

(static) fixTheSourceOfAllEvil() → {boolean}

Speaks for itself!

Source:
Returns:
Type
boolean

(static) getObjectLoadedHandler(loggingMessage)

Gets a callback that handles the onLoaded event of an AR object.

Parameters:
Name Type Description
loggingMessage string
Source:
Returns:

(static) init()

Initializes the World singleton.

Source:

(static) isTargetRecognized() → {boolean}

Helper method returning if a target is currently recognized.

Source:
Returns:
Type
boolean

(static) onError(erroropt)

Called in response to AR errors.

Parameters:
Name Type Attributes Description
error ARError <optional>
Source:

(static) onInit(debuggable)

Called by the native client on initialization.

Parameters:
Name Type Description
debuggable boolean

Indicates if the native client is debuggable.

Source:

(static) onModelAppearingComplete(model)

Parameters:
Name Type Description
model ARgoModel
Source:

(static) onModelClick(arObject, modelPart)

Listens to the AR.Model.onClick event.

Parameters:
Name Type Description
arObject Object
modelPart string
Source:

(static) onModelPresentationComplete(model, presentedModel)

Fires when a model moves to presentation mode.

Parameters:
Name Type Description
model ARgoModel
presentedModel string
Source:

(static) onObjectLoaded(loggingMessage)

Handles the onLoaded event of AR objects.

Parameters:
Name Type Description
loggingMessage string
Source:

(static) onTargetLost(targetopt)

Listens to the AR.ImageTrackable.onImageLost event.

Parameters:
Name Type Attributes Description
target ImageTarget <optional>
Source:
Listens to Events:
  • AR:ImageTrackable~event:onImageLost

(static) onTargetRecognized(target)

Listens to the AR.ImageTrackable.onImageRecognized event.

Parameters:
Name Type Description
target ImageTarget
Source:
Listens to Events:
  • AR:ImageTrackable~event:onImageRecognized

(static) playSound(sound, nextSoundsopt, conditionCallbackopt)

Plays an application's sound (see: ARgo.SOUNDS).

Parameters:
Name Type Attributes Description
sound Sound

The sound to play. (see: ARgo.SOUNDS)

nextSounds Array.<Sound> <optional>

The sound to play right after sound has finished.

conditionCallback conditionCallback <optional>

A callback that checks whether each of nextSound should be played or not. If specified, this is called when each sound finishes playing.

Source:

(static) stopSounds()

Stops any currently playing sounds.

Source: