Abstract3DWorld

Abstract3DWorld

Abstracte class to create and monitor the THREE renderer. Component is used from https://www.npmjs.com/package/clulib

Constructor

new Abstract3DWorld()

Source:

Extends

  • Component

Members

(protected) antialiasDisabled_ :boolean

Description:
  • Defines if antialias should be activated for the WebGLRenderer

Source:

Defines if antialias should be activated for the WebGLRenderer

Type:
  • boolean

(protected) camera_ :THREE.Camera

Description:
  • Current camera object which is used in the render process.

Source:

Current camera object which is used in the render process.

Type:
  • THREE.Camera

(protected) checkFrames_ :boolean

Description:
  • Determines whether the application should monitor the framerate to decide if it is necessary to create a renderer with different settings with lower quality but better performance.

Source:

Determines whether the application should monitor the framerate to decide if it is necessary to create a renderer with different settings with lower quality but better performance.

Type:
  • boolean

(protected) clock_ :THREE.Clock

Source:
Type:
  • THREE.Clock

(protected) creationCompleter_ :Completer

Description:
  • Completer is a helper which returns a promise. Its solved if the creation of the 3D scene is completed.

Source:

Completer is a helper which returns a promise. Its solved if the creation of the 3D scene is completed.

Type:
  • Completer

(protected) currentFps_ :number

Description:
  • Current framerate

Source:

Current framerate

Type:
  • number

enabled

Description:
  • Setter

Source:

Setter

enabled

Description:
  • Getter

Source:

Getter

(protected) enabled_ :boolean

Description:
  • Defines if the rendering is active

Source:

Defines if the rendering is active

Type:
  • boolean

(protected) fpsThreshhold_ :number|Array.<number>

Description:
Source:

General limit or list of limits for the current Abstract3DWorld#lowSettingStep_ for the check if the current framerate is detected as a lower framerate.

Type:
  • number | Array.<number>

(protected) frames_ :number

Description:
  • Current frame count since rendering was started

Source:

Current frame count since rendering was started

Type:
  • number

(protected) lowFramerateCount_ :number

Description:
Source:

Frame count of lower frames than the defined Abstract3DWorld#fpsThreshhold_

Type:
  • number

(protected) lowSettingStep_ :number

Description:
  • Current step of the lower setting reduction

Source:

Current step of the lower setting reduction

Type:
  • number

(protected) lowSettingThreshhold_ :number|Array.<number>

Description:
Source:

Limit of Abstract3DWorld#lowFramerateCount_ for the current Abstract3DWorld#lowSettingStep_ of lower setting check

Type:
  • number | Array.<number>

(protected) maxPixelRatio_ :number

Description:
  • Defines if the rendering context should be rendered for retina in double resolution

Source:

Defines if the rendering context should be rendered for retina in double resolution

Type:
  • number

(protected) prevTime_ :number

Description:
  • Used as a value to check the framerate only in a certain time interval.

Source:

Used as a value to check the framerate only in a certain time interval.

Type:
  • number

(protected) raycaster_ :THREE.Raycaster

Source:
Type:
  • THREE.Raycaster

(protected) renderer_ :THREE.WebGLRenderer

Description:
  • Main WebGLRenderer

Source:

Main WebGLRenderer

Type:
  • THREE.WebGLRenderer

(protected, nullable) requestFrameId_ :number

Description:
  • Instance of the window.requestAnimationFrame call

Source:

Instance of the window.requestAnimationFrame call

Type:
  • number

(protected) resizeProvider_ :ResizeProvider

Description:
  • Reference to ResizeProvider for monitoring device size changes.

Source:

Reference to ResizeProvider for monitoring device size changes.

Type:

(protected) shouldBuildImmediately_ :boolean

Description:
  • Defines whether the 3D scene should be rendered immediately after the component is initialized.

Source:

Defines whether the 3D scene should be rendered immediately after the component is initialized.

Type:
  • boolean

(protected) stats_ :Stats

Description:
Source:
Type:
  • Stats

(protected) worldProvider_ :WorldProvider

Description:
  • Reference to the WorldProvider for monitoring actions, loading processes and status changes of the created THREE.Scene.

Source:

Reference to the WorldProvider for monitoring actions, loading processes and status changes of the created THREE.Scene.

Type:

Methods

(protected) activateInteraction_()

Description:
  • Activates interactivity within the 3D scene

Source:

(protected) activateScene_()

Description:
  • Enable the active scene for rendering and interaction.

Source:

(async, protected) buildScene_() → {Promise}

Description:
  • Loads and creates the 3D scene.

Source:
Returns:
Type
Promise

(protected) changeToLowSettings_(step)

Description:
  • Bad performance has been detected and the WebGLRenderer is being rebuilt with new settings to improve performance.

Source:
Parameters:
Name Type Description
step number

Current (already increased) Abstract3DWorld#lowSettingStep_

(protected) checkFramerate_()

Description:
Source:

(private) checkWebGlSupport_() → {boolean}

Description:
  • Checks if the browser supports WebGL

Source:
Returns:
Type
boolean

(protected) createRenderer_()

Description:
  • Creates the main WebGLRenderer

Source:

(protected) deactivateInteraction_()

Description:
  • Deactivates interactivity within the 3D scene

Source:

(protected) deactivateScene_()

Description:
  • Disable the active scene for rendering and interaction.

Source:

(protected) displayNoSupportMessage_()

Description:
  • Display a message if WebGL isn't supported.

Source:

(protected) drawScene_()

Source:

(protected) initScene_() → {Promise}

Description:
  • Initializes the renderer, creates the raycaster object and starts the creation of the 3D scene.

Source:
Returns:
Type
Promise

onInit()

Description:
  • Component is ready and had loaded all dependencies (inherit method waitFor and sub components).

Source:

(protected) pauseRenderer_()

Description:
  • Deactivates rendering

Source:

ready() → {Promise}

Description:
  • Can be called to receive a Promise that is triggered when the creation of the 3D scene is completed.

Source:
Returns:
Type
Promise

(protected) renderScene_(forcedRenderingopt)

Description:
  • Main render process (window.requestAnimationFrame call). Updates THREE clock, framerate check, stats and 3D scene Abstract3DWorld#updateScene_

Source:
Parameters:
Name Type Attributes Default Description
forcedRendering boolean <optional>
false

If it is set to true, a rendering will still take place even if Abstract3DWorld#enabled_ is set to false.

(protected) resize_()

Description:
  • Detects window size changes and therefore updates renderer sizes.

Source:

(protected) startRenderScene_()

Description:
  • Starts the rendering of the active 3D scene

Source:

(protected) startRenderer_()

Description:
  • Activates rendering

Source:

(protected) stopRenderScene_()

Description:
  • Stops the rendering of the active 3D scene

Source:

(protected) updateCameraMatrix_()

Description:
  • Updates the current camera aspect based on the window size.

Source:

(protected) updateScene_(delta)

Description:
  • Main call for 3D scene updates in the render process.

Source:
Parameters:
Name Type Description
delta number