Skip to main content

Class: IWSDKEnvironmentPort

Defined in: packages/iwsdk-environment/src/environment-port.ts:101

Applies an environment to a scene.

Every method takes the whole slot, or null to remove it. The director calls a method ONLY when that slot's value actually changed, so an adapter may treat each call as "this is new, act on it" and does not need to diff. That matters on IWSDK, where applying a change means setting _needsUpdate and re-running a system.

Implements

Constructors

Constructor

new IWSDKEnvironmentPort(world: World, options?: IWSDKEnvironmentPortOptions): IWSDKEnvironmentPort;

Defined in: packages/iwsdk-environment/src/environment-port.ts:117

Parameters

ParameterType
worldWorld
optionsIWSDKEnvironmentPortOptions

Returns

IWSDKEnvironmentPort

Methods

applyAmbient()

applyAmbient(light: AmbientLightSpec | null): void;

Defined in: packages/iwsdk-environment/src/environment-port.ts:351

Parameters

ParameterType
lightAmbientLightSpec | null

Returns

void

Implementation of

EnvironmentPort.applyAmbient


applyFog()

applyFog(fog: FogSpec | null): void;

Defined in: packages/iwsdk-environment/src/environment-port.ts:326

Parameters

ParameterType
fogFogSpec | null

Returns

void

Implementation of

EnvironmentPort.applyFog


applyIbl()

applyIbl(ibl: IblSpec | null): void;

Defined in: packages/iwsdk-environment/src/environment-port.ts:189

The environment map, as IWSDK's own image-based lighting components.

room is not an approximation here: IWSDK's IBLTexture takes the string "room" for its built-in probe, so the one kind three.js has to fake is the one kind this host has natively.

Parameters

ParameterType
iblIblSpec | null

Returns

void

Implementation of

EnvironmentPort.applyIbl


applyKeyLight()

applyKeyLight(light: KeyLightSpec | null): void;

Defined in: packages/iwsdk-environment/src/environment-port.ts:364

Parameters

ParameterType
lightKeyLightSpec | null

Returns

void

Implementation of

EnvironmentPort.applyKeyLight


applyLightEstimation()

applyLightEstimation(estimation:
| ResolvedLightEstimation
| null): void;

Defined in: packages/iwsdk-environment/src/environment-port.ts:310

IWSDK 0.5.3 has no light estimation at all - no probe, no session hook, nothing in its typings. This says so instead of leaving the app to wonder why the room never lights anything, and the request is recorded in docs/UPSTREAM_ENHANCEMENTS.md.

Parameters

ParameterType
estimation| ResolvedLightEstimation | null

Returns

void

Implementation of

EnvironmentPort.applyLightEstimation


applyOcclusion()

applyOcclusion(spec: OcclusionSpec | null): void;

Defined in: packages/iwsdk-environment/src/environment-port.ts:244

Depth occlusion, through IWSDK's DepthSensingSystem and the per-entity DepthOccludable component.

IWSDK patches the materials under each opted-in entity, which is why the scope matters more here than on three.js: there is no global mode to turn on, and an entity nobody opted in is an entity the real world will not hide. Whatever this port adds, it remembers, so turning occlusion off never strips a component the app put there itself.

Parameters

ParameterType
specOcclusionSpec | null

Returns

void

Implementation of

EnvironmentPort.applyOcclusion


applySky()

applySky(sky: SkySpec | null): void;

Defined in: packages/iwsdk-environment/src/environment-port.ts:131

Parameters

ParameterType
skySkySpec | null

Returns

void

Implementation of

EnvironmentPort.applySky


dispose()

dispose(): void;

Defined in: packages/iwsdk-environment/src/environment-port.ts:388

Release anything the port created. Optional.

Returns

void

Implementation of

EnvironmentPort.dispose


observe()

observe(host: EnvironmentPortHost): () => void;

Defined in: packages/iwsdk-environment/src/environment-port.ts:124

Hand the port the object it talks back through.

Called once, at construction, before anything is applied. The returned function is called on dispose. This is the ONLY inbound path: see sensing.ts for why there is one and why it carries what it does.

Parameters

ParameterType
hostEnvironmentPortHost

Returns

() => void

Implementation of

EnvironmentPort.observe