Class: View

View(reporter, settings)

new View(reporter, settings)

Parameters:
Name Type Description
reporter Reporter
settings Object
Properties
Name Type Attributes Description
id UUID <optional>
name string <optional>
scene Scene
renderer WebGLRenderer
rendererOrtho WebGLRenderer
timer Timer
cameraSettings Object.<string, any>
passes Array.<Pass>
findConfigurator function
addConfigurator function
findComponentById function
Source:

Members

camTween :Tween

Type:
Source:

domElement :HTMLDivElement

Type:
  • HTMLDivElement
Source:

domElementDimensions :DOMRect

Type:
  • DOMRect
Source:

intersect

intersects a ray with objects in the scene and returns an array with intersection data objects
Source:

lastPerspectiveCameraPosition :Vector3

The 'previous' camera position
Type:
  • Vector3
Source:

lastPerspectiveCameraQuaternion :Quaternion

The 'previous' camera quaternion
Type:
  • Quaternion
Source:

lastPointerDown :Object

Data about the last mousedown event on the output canvas
Type:
  • Object
Properties:
Name Type Description
x number
y number
timestamp number
Source:

lastPointerMove :Object

Data about the last mousemove event on the output canvas
Type:
  • Object
Properties:
Name Type Description
x number
y number
Source:

lastPointerUp :Object

Data about the last mouseup event on the output canvas
Type:
  • Object
Properties:
Name Type Description
x number
y number
timestamp number
Source:

mouseoverActor :Actor

Type:
Source:

mouseoverBlockInstance :BlockInstance

Type:
Source:

mouseoverMesh :WrappedMesh

Type:
Source:

passes :Array.<Pass>

Type:
  • Array.<Pass>
Source:

perspectiveCamera :PerspectiveCamera

Type:
  • PerspectiveCamera
Source:

rayCaster :Raycaster

Type:
  • Raycaster
Source:

renderer :WebGLRenderer

Type:
  • WebGLRenderer
Source:

renderPass :RenderPass

Type:
  • RenderPass
Source:

scene :Scene

Type:
  • Scene
Source:

timer :Timer

Type:
Source:

tweens :Object.<UUID, Tween>

Type:
Source:

Methods

(static) findBlockInstanceParent(intersections, find)

Finds the first intersections with a block instance and returns that one along with the block instance's id
Parameters:
Name Type Default Description
intersections Array.<Object>
find 'first' | 'all' first
Source:

(async) adddimensionFrame(configurator) → {Promise.<DimensionFrame>}

Parameters:
Name Type Description
configurator Configurator
Source:
Returns:
Type
Promise.<DimensionFrame>

(async) addMarker(data) → {Promise.<Marker>}

Parameters:
Name Type Description
data Object
Properties
Name Type Attributes Description
position Vector3
HTMLElement HTMLElement
blockInstance BlockInstance <optional>
Source:
Returns:
Type
Promise.<Marker>

appendPass(pass)

Add a THREE.Pass to the end of the chain and rebuild the composer
Parameters:
Name Type Description
pass Pass
Source:

emitIntersectedBlocks()

Emits the 'blockinstancehover' event if the mouse is hovering over a blockInstance. It only 'looks for' the first intersection block.
Source:
Fires:
  • View#event:blockinstancehover

findFirstIntersectedBlockInstance() → {Object}

Finds the block instance that is intersected closest to the perspective camera by a ray cast from that camera on the projected position of the last mouse move. Returns the intersected blockInstance's id and the intersection data.
Source:
Returns:
Type
Object

onClick()

Finds the block 'under' the current (last known) mouse coordinates and emits an event with that data, if anyone is listening
Source:
Fires:
  • View#event:click

(async) onDragEnter()

Can receive data in the form of a coomponent. Evaluates the data and makes distinction between a wrapped material or a block.
Source:
Fires:
  • View#event:dragenter

(async) onDragOver()

Finds the block 'under' the current (last known) mouse coordinates when a drag is happening and emits an event with that data and the original dragover event
Source:
Fires:
  • View#event:dragover

(async) onDrop()

Finds the block 'under' the drop location and emits an event with that data and the drop event
Source:
Fires:

onPointerDown()

Stores the pointer down coordinates and timestamp. Finds the block 'under' the current (last known) mouse coordinates and emits an event with that data, if anyone is listening
Source:
Fires:
  • View#event:pointerdown

onPointerUp()

Stores the pointer up coordinates and timestamp. If the mouse hasnt move (a lot) since mouse down, it find the block 'under' the last known mouse coordinates and emits an event with that data, if anyone is listening
Source:
Fires:
  • View#event:fastclick

onSceneUpdate()

Called after the scene was changed by the engine, triggers a view update
Source:

onTouchStart()

Touch events
Source:

prependPass(pass)

Add a THREE.Pass to the front of the chain and rebuild the composer
Parameters:
Name Type Description
pass Pass
Source:

rebuildComposer()

Rebuilds the Effect Composer that is used to produce renders
Source:

removeMarker(marker)

Parameters:
Name Type Description
marker Marker
Source:

render()

Render a new image from the scene and the perspective camera
Source:

tween(callback, lengthMs, easingFnopt)

Tweens camera to a standard view point
Parameters:
Name Type Attributes Default Description
callback function
lengthMs number 250
easingFn function <optional>
Tween.easeInOutCubic
Source:

update()

Updates the view (render) and orbit controls (if enabled) and removes the timer update request if the camera isn't moving
Source:

updateDOMElementDimensions()

Finds the coordinates and dimensions of the output canvas, updates the camera and renderer accordingly and triggers one view update (including render)
Source:

Events

drop

View base class
Source: