Class: MoooiView

MoooiView(reporter, settings)

Default View

Constructor

new MoooiView(reporter, settings)

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

Extends

Members

camTween :Tween

Type:
Overrides:
Source:

domElement :HTMLDivElement

Type:
  • HTMLDivElement
Overrides:
Source:

domElementDimensions :DOMRect

Type:
  • DOMRect
Overrides:
Source:

dragState :Object

All the different states to track and control the status of the drag events. These are needed to prevent conflicts with click / dblclick events (maybe )
Type:
  • Object
Source:

expectedComponentDrag :Object

Type:
  • Object
Source:

intersect

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

lastPerspectiveCameraPosition :Vector3

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

lastPerspectiveCameraQuaternion :Quaternion

The 'previous' camera quaternion
Type:
  • Quaternion
Overrides:
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
Overrides:
Source:

lastPointerMove :Object

Data about the last mousemove event on the output canvas
Type:
  • Object
Properties:
Name Type Description
x number
y number
Overrides:
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
Overrides:
Source:

matOptions :Array

Type:
  • Array
Source:

mouseoverActor :Actor

Type:
Overrides:
Source:

mouseoverBlockInstance :BlockInstance

Type:
Overrides:
Source:

mouseoverMesh :WrappedMesh

Type:
Overrides:
Source:

passes :Array.<Pass>

Type:
  • Array.<Pass>
Overrides:
Source:

perspectiveCamera :PerspectiveCamera

Type:
  • PerspectiveCamera
Overrides:
Source:

rayCaster :Raycaster

Type:
  • Raycaster
Overrides:
Source:

renderer :WebGLRenderer

Type:
  • WebGLRenderer
Overrides:
Source:

renderPass :RenderPass

Type:
  • RenderPass
Overrides:
Source:

scene :Scene

Type:
  • Scene
Overrides:
Source:

timer :Timer

Type:
Overrides:
Source:

tweens :Object.<UUID, Tween>

Type:
Overrides:
Source:

Methods

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

Parameters:
Name Type Description
configurator Configurator
Overrides:
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>
Overrides:
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
Overrides:
Source:

emitIntersectedBlocks()

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

expectComponentDrag(component) → {Promise.<Configuration>}

Parameters:
Name Type Description
component Component
Source:
Returns:
Type
Promise.<Configuration>

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.
Overrides:
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
Overrides:
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.
Overrides:
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
Overrides:
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
Overrides:
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
Overrides:
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
Overrides:
Source:
Fires:
  • View#event:fastclick

onSceneUpdate()

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

onTouchStart()

Touch events
Overrides:
Source:

prependPass(pass)

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

rebuildComposer()

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

removeMarker(marker)

Parameters:
Name Type Description
marker Marker
Overrides:
Source:

render()

Render a new image from the scene and the perspective camera
Overrides:
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
Overrides:
Source:

update()

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

updateDOMElementDimensions()

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

Events

drop

View base class
Overrides:
Source: