API Docs for: 1.0.2
Show:

GIScene.Control.CameraLight Class

A control which adds a sprite to the viewport for interactive movement of a directional light source. The Light will always stay relative to the camera. This ensures to keep a chosen lighting angle while moving the camera. Changing interactively the lighting angle gives the user a good impression of surface characteristics.

Constructor

GIScene.Control.CameraLight

(
  • camera
  • light
  • [config]
)

Parameters:

  • camera THREE.Camera
  • light THREE.DirectionalLight
  • [config] Object optional

    config. are: maxHorizontalAngle, maxVerticalAngle both Numbers in degrees between 0..90

Methods

activate

()

Inherited from GIScene.Control but overwritten in GIScene\Control\CameraLight.js:204

Activates this Control

deactivate

()

Inherited from GIScene.Control but overwritten in GIScene\Control\CameraLight.js:247

Deactivates this Control

getIlluminationAngles

() Object

Returns the position of the light in polar angles relative to the light.target and the camera.position

Returns:

Object:

illuminationAngles an object with two properties: "theta" and "phi" containing the actual values in degrees

panSprite

(
  • panDelta
)

Moves the UI graphic sprite and changes the light position accordingly

Parameters:

  • panDelta THREE.Vector2()

    A Vector used to translate the UI-graphic in Pixels

setScene

(
  • scene
)
Sets the scene property. This is automatically called on scene.addControl()

Parameters:

  • scene Object

updateLightPosition

()

Updates the light position to the correct angle according to sprite.position

Properties

config

Object

The config which is used to initialize the CameraLight-Control. Merged from defaults and passed config Object.

isActive

Boolean

Events

pan

Fires while panning

panend

Fires on mouse up after a pan operation

panstart

Fires on mouse down but before mouse moved