Skip to main content

A class that allows mesh to dynamically change brightness based on the voxel light level at their position.

By default, VOXELIZE.NameTag is ignored by this effect.

Example

// Create a light shined effect manager.
const lightShined = new VOXELIZE.LightShined();

// Add the effect to a mesh.
lightShined.add(character);

// In the render loop, update the effect.
lightShined.update();

Example

Constructors​

constructor​

• new LightShined(world, options?): LightShined

Construct a light shined effect manager.

Parameters​

NameTypeDescription
worldWorld<any>The world that the effect is applied to.
optionsPartial<LightShinedOptions>Parameters to customize the effect.

Returns​

LightShined

Properties​

ignored​

• ignored: Set<IgnoredType>

A list of types that are ignored by this effect.


list​

• list: Set<Object3D<Object3DEventMap>>

A list of meshes that are effected by this effect.


options​

• options: LightShinedOptions

Parameters to customize the effect.


world​

• world: World<any>

The world that the effect is applied to.

Methods​

add​

▸ add(obj): void

Add an object to be affected by this effect.

Parameters​

NameTypeDescription
objObject3D<Object3DEventMap>A THREE.JS object to be shined on.

Returns​

void


clearPositionOverride​

▸ clearPositionOverride(obj): void

Parameters​

NameType
objObject3D<Object3DEventMap>

Returns​

void


ignore​

▸ ignore(...types): void

Parameters​

NameType
...typesIgnoredType[]

Returns​

void


remove​

▸ remove(obj): void

Remove an object from being affected by this effect

Parameters​

NameTypeDescription
objObject3D<Object3DEventMap>The object to be removed from the effect.

Returns​

void


setPositionOverride​

▸ setPositionOverride(obj, position): void

Parameters​

NameType
objObject3D<Object3DEventMap>
positionVector3

Returns​

void


update​

▸ update(): void

Update the light shined effect. This fetches the light level at the position of each object and recursively updates the brightness of the object.

This should be called in the render loop.

Returns​

void