API Docs for: 0.5.5
Show:

kick.scene.SceneLights Class

Datastructure used pass light information

Constructor

kick.scene.SceneLights

(
  • maxNumerOfLights
)

Parameters:

  • maxNumerOfLights Number

    (value from config)

Methods

addPointLight

(
  • pointLight
)

Parameters:

recomputeLight

(
  • viewMatrix
)

Recompute the light based on the view-matrix. This method is called from the camera when the scene is rendered, to transform the light into eye coordinates and compute the half vector for directional light

Parameters:

removePointLight

(
  • pointLight
)

Parameters:

resetPointLight

(
  • index
)
private

Set the point light to have not contribution this means setting the position 1,1,1, the color to 0,0,0 and attenuation to 1,0,0.
This is needed since the ecLight position would otherwise be in 0,0,0 which is invalid

Parameters:

  • index Number

    of point light

Properties

ambientLight

kick.scene.Light

The ambient light in the scene.

directionalLight

kick.scene.Light

The directional light in the scene.

directionalLightData

kick.math.Mat3

Matrix of directional light data. Column 1 contains the light-direction in eye space, column 2 color intensity and column 3 half vector

directionalLightWorld

kick.math.Vec3

Return the directional light in world space

pointLightData

Array of Mat3

Matrices of point light data. Each matrix (mat3) contains:
Column 1 vector: point light position in eye coordinates
Column 2 vector: color intensity
Column 3 vector: attenuation vector