Skip to main content

Class: Lighting

Defined in: src/core/Lighting.ts:73

Lighting system for 3D manimweb scenes. Manages multiple lights attached to a Three.js scene.

Constructors​

Constructor​

new Lighting(threeScene): Lighting

Defined in: src/core/Lighting.ts:81

Create a new lighting system.

Parameters​

threeScene​

Scene

The Three.js scene to add lights to

Returns​

Lighting

Methods​

addAmbient()​

addAmbient(options?): AmbientLight

Defined in: src/core/Lighting.ts:91

Add an ambient light to the scene. Ambient lights illuminate all objects equally from all directions.

Parameters​

options?​

AmbientLightOptions

Light configuration options

Returns​

AmbientLight

The created AmbientLight


addDirectional()​

addDirectional(options?): DirectionalLight

Defined in: src/core/Lighting.ts:104

Add a directional light to the scene. Directional lights emit parallel rays, like sunlight.

Parameters​

options?​

DirectionalLightOptions

Light configuration options

Returns​

DirectionalLight

The created DirectionalLight


addPoint()​

addPoint(options?): PointLight

Defined in: src/core/Lighting.ts:121

Add a point light to the scene. Point lights emit in all directions from a single point.

Parameters​

options?​

PointLightOptions

Light configuration options

Returns​

PointLight

The created PointLight


addSpot()​

addSpot(options?): SpotLight

Defined in: src/core/Lighting.ts:143

Add a spot light to the scene. Spot lights emit in a cone from a single point.

Parameters​

options?​

SpotLightOptions

Light configuration options

Returns​

SpotLight

The created SpotLight


dispose()​

dispose(): void

Defined in: src/core/Lighting.ts:209

Dispose of all lights and clean up resources.

Returns​

void


getLights()​

getLights(): Light[]

Defined in: src/core/Lighting.ts:180

Get all lights in the system.

Returns​

Light[]

Array of all lights


remove()​

remove(light): void

Defined in: src/core/Lighting.ts:188

Remove a specific light from the scene.

Parameters​

light​

Light

The light to remove

Returns​

void


removeAll()​

removeAll(): void

Defined in: src/core/Lighting.ts:199

Remove all lights from the scene.

Returns​

void


setupDefault()​

setupDefault(): void

Defined in: src/core/Lighting.ts:170

Set up default 3-point lighting. Creates ambient light plus two directional lights for balanced illumination.

Returns​

void