FORGE. ViewBase

new ViewBase(viewer, optionsnullable, className, type)

Abstract base class for projeted views. Should be subclassed for every supported projection / view type.
Parameters:
Name Type Attributes Description
viewer FORGE.Viewer FORGE.Viewer reference.
options ViewOptionsConfig <nullable>
The view options.
className string object className.
type string object view type.
Source:

Extends

Members

(readonly) alive :boolean

Get the alive flag value of the object.
Type:
  • boolean
Inherited From:
Source:

(readonly) className :string

Get the class name of the object.
Type:
  • string
Inherited From:
Source:

data :*

Get and set any custom data you want to associate to this object.
Type:
  • *
Inherited From:
Source:

debug :boolean

Get and set the debug flag.
Type:
  • boolean
Inherited From:
Source:

(readonly) fovMax :number

Get maximum fov for current view in radians.
Type:
  • number
Source:

(readonly) fovMin :number

Get minimum fov for current view in radians.
Type:
  • number
Source:

(readonly) onDestroy :FORGE.EventDispatcher

Get the onDestroy FORGE.EventDispatcher, this event is emitted at the end of the destroy sequence.
Type:
Inherited From:
Source:

(readonly) options :ViewOptionsConfig

Options getter
Type:
  • ViewOptionsConfig
Source:

pitchMax :number

Get the maximum pitch value in radians.
Type:
  • number
Source:

pitchMin :number

Get the minimum pitch value in radians.
Type:
  • number
Source:

rollMax :number

Get the maximum roll value in radians.
Type:
  • number
Source:

rollMin :number

Get the minimum roll value in radians.
Type:
  • number
Source:

(readonly) shaderSTW :ScreenToWorldProgram

Shader screen to world
Type:
  • ScreenToWorldProgram
Source:

(readonly) shaderWTS :WorldToScreenProgram

Shader world to screen
Type:
  • WorldToScreenProgram
Source:

(readonly) tags :Array

Get the tags associated to this object.
Type:
  • Array
Inherited From:
Source:

(readonly) type :string

Get the view type.
Type:
  • string
Source:

(readonly) uid :string

Get the uid of the object.
Type:
  • string
Inherited From:
Source:

warning :boolean

Get and set the warning flag.
Type:
  • boolean
Inherited From:
Source:

yawMax :number

Get the maximum yaw value in radians.
Type:
  • number
Source:

yawMin :number

Get the minimum yaw value in radians.
Type:
  • number
Source:

Methods

destroy()

Destroy method.
Overrides:
Source:

getProjectionFov()

Get fov computed for projection.
Source:

log(value)

Basic log method, log a string in the console if debug is enabled.
Parameters:
Name Type Description
value * The value you want to log in the console.
Inherited From:
Source:

screenToWorld(screenPt) → (nullable) {THREE.Vector3}

Convert a point from screen space to world space. Abstract method that should be implemented by subclass.
Parameters:
Name Type Description
screenPt THREE.Vector2 point in screen space
Source:
To Do:
  • Implement screenToWorld
Returns:
Point in world space or null if the screenPt is out of bounds.
Type
THREE.Vector3

updateUniforms(uniforms)

Update uniforms. Abstract method that should be implemented by subclass.
Parameters:
Name Type Description
uniforms FORGEUniform
Source:

warn(valuenullable)

Basic warn method, log a warn string in the console if warning is enabled.
Parameters:
Name Type Attributes Description
value string | Object <nullable>
The value you want to warn in the console.
Inherited From:
Source:

worldToScreen(worldPt, parallax) → (nullable) {THREE.Vector2}

Convert a point from world space to screen space. Abstract method that should be implemented by subclass.
Parameters:
Name Type Description
worldPt THREE.Vector3 Point in world space
parallax number Parallax factor [0..1]
Source:
To Do:
  • Implement worldToScreen
Returns:
Point in screen coordinates or null if the point is out of bounds.
Type
THREE.Vector2

FORGE. ViewBase

Members
Methods