Hide menu
Loading...
Searching...
No Matches
PhongMaterial

Defines a material based on the Phong reflection model.

Extends

Constructors

Constructor

new PhongMaterial(ambientColor?, diffuseColor?, specularColor?, emissionColor?, shininess?, opacity?): PhongMaterial

Creates a Phong material.

Default values correspond to a neutral opaque material with shininess 30.

Parameters

ambientColor?

Color = ...

Ambient color.

diffuseColor?

Color = ...

Diffuse color.

specularColor?

Color = ...

Specular color.

emissionColor?

Color = ...

Emissive color.

shininess?

number

Shininess value.

opacity?

number

Material opacity.

Returns

PhongMaterial

Overrides

VisualMaterial.constructor

Accessors

ambientColor

Get Signature

get ambientColor(): Color

Returns the ambient color.

Returns

Color

Set Signature

set ambientColor(color): void

Sets the ambient color. Component values are copied from the provided color.

Parameters

color

Color

Ambient color.

Returns

void


diffuseColor

Get Signature

get diffuseColor(): Color

Returns the diffuse color.

Returns

Color

Set Signature

set diffuseColor(color): void

Sets the diffuse color. Component values are copied from the provided color.

Parameters

color

Color

Diffuse color.

Returns

void


emissionColor

Get Signature

get emissionColor(): Color

Returns the emission color.

Returns

Color

Set Signature

set emissionColor(color): void

Sets the emission color. Component values are copied from the provided color.

Parameters

color

Color

Emission color.

Returns

void


id

Get Signature

get id(): bigint

Returns the unique identifier of the object.

Returns

bigint

Inherited from

VisualMaterial.id


opacity

Get Signature

get opacity(): number

Returns the material opacity.

Returns

number

Set Signature

set opacity(opacity): void

Sets the material opacity. The value is clamped to the [0, 1] range.

Parameters

opacity

number

Material opacity.

Returns

void

Inherited from

VisualMaterial.opacity


shininess

Get Signature

get shininess(): number

Returns the material shininess.

Returns

number

Set Signature

set shininess(shininess): void

Sets the material shininess. The value is clamped to the [0, 128] range.

Parameters

shininess

number

Material shininess.

Returns

void


specularColor

Get Signature

get specularColor(): Color

Returns the specular color.

Returns

Color

Set Signature

set specularColor(color): void

Sets the specular color. Component values are copied from the provided color.

Parameters

color

Color

Specular color.

Returns

void

Methods

clone()

clone(): PhongMaterial

Creates a new material with the same properties as this material.

Returns

PhongMaterial

Overrides

VisualMaterial.clone


copy()

copy(other): this

Copies the properties of another Phong material to this material.

Parameters

other

PhongMaterial

Source material.

Returns

this

Overrides

VisualMaterial.copy