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 optionalconfig.
are: maxHorizontalAngle, maxVerticalAngle both Numbers in degrees between 0..90
Item Index
Methods
activate
()
Activates this Control
deactivate
()
Deactivates this Control
getIlluminationAngles
()
Object
Returns the position of the light in polar angles relative to the light.target and the camera.position
Returns:
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
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