Skip to content

Anatomy of a JanusWeb page load

James Baicoianu edited this page Jun 12, 2016 · 12 revisions

Overview

In order to maintain interactivity, all assets in JanusWeb are loaded asynchronously. This introduces a lot of complexity into how assets are processed, and the current code is a bit hacky. This page is an attempt to document how it SHOULD work, so that we can apply that to the working codebase, enabling better performance and more complex features which depend on having more visibility into the loading process.

Concepts and Classes

engine.assets.base

Base class for assets, which represent an external resource, usually referenced by a URL. Inherited by engine.assets.model, engine.assets.sound, engine.assets.image, etc.

janusweb.room

Represents a specific room, referenced by a URL.

janusweb.object

Represents an instance of an engine.assets.model asset. Each object has its own independent position and orientation within the room, as well as any other properties which control the styling of this object. Objects can reference engine.assets.image and engine.assets.video assets as textures.

janusweb.video

Represents an instance of an engine.assets.video asset mapped to a simple plane.

janusweb.image

Represents an instance of an engine.assets.image asset mapped to a simple plane.

janusweb.sound

Represents an instance of an engine.assets.sound asset. There is no geometry associated with a sound.

Events

  • janusweb.room

    • room_load_start
    • room_load_progress
    • room_load_end
  • janusweb.object

    • object_load_start
    • object_load_progress
    • object_load_end
  • engine.assets.base

    • asset_load_start
    • asset_load_progress
    • asset_load_end

Clone this wiki locally