Home Reference Source Repository
import Light from 'dh3dlib/js/base/Light.js'
public class | source

Light

Light class

Constructor Summary

Public Constructor
public

constructor

Member Summary

Public Members
public
public

ambient: *

public

diffuse: *

public
public
public

Method Summary

Public Methods
public

get ambient value

public

get diffuse value

public

get position of light

public

get specular value

public

getType(): int

get type of light

public

setAmbient(r: float, g: float, b: float, a: float): void

set ambient value

public

setDiffuse(r: float, g: float, b: float, a: float): void

set diffuse value

public

setPosition(x: float, y: float, z: float): void

set position of Light

public

setSpecular(r: float, g: float, b: float, a: float): void

set specular value

public

setType(type: int): void

set type of light

Public Constructors

public constructor source

constructor

Public Members

public LIGHT_TYPE_DIRECTIONAL: number source

public ambient: * source

public diffuse: * source

public position: * source

public specular: * source

public type: number source

Public Methods

public getAmbient(): Float32Array source

get ambient value

Return:

Float32Array

ambient value

public getDiffuse(): Float32Array source

get diffuse value

Return:

Float32Array

diffuse value

public getPosition(): Float32Array source

get position of light

Return:

Float32Array

position of light

public getSpecular(): Float32Array source

get specular value

Return:

Float32Array

specular value

public getType(): int source

get type of light

Return:

int

type of light

public setAmbient(r: float, g: float, b: float, a: float): void source

set ambient value

Params:

NameTypeAttributeDescription
r float

red value (0.0 - 1.0)

g float

green value (0.0 - 1.0)

b float

blue value (0.0 - 1.0)

a float

alpha value (0.0 - 1.0)

Return:

void

public setDiffuse(r: float, g: float, b: float, a: float): void source

set diffuse value

Params:

NameTypeAttributeDescription
r float

red value (0.0 - 1.0)

g float

green value (0.0 - 1.0)

b float

blue value (0.0 - 1.0)

a float

alpha value (0.0 - 1.0)

Return:

void

public setPosition(x: float, y: float, z: float): void source

set position of Light

Params:

NameTypeAttributeDescription
x float

X value

y float

Y value

z float

Z value

Return:

void

public setSpecular(r: float, g: float, b: float, a: float): void source

set specular value

Params:

NameTypeAttributeDescription
r float

red value (0.0 - 1.0)

g float

green value (0.0 - 1.0)

b float

blue value (0.0 - 1.0)

a float

alpha value (0.0 - 1.0)

Return:

void

public setType(type: int): void source

set type of light

Params:

NameTypeAttributeDescription
type int

type of light

Return:

void