Class: XRBlocksEnvironmentPort
Defined in: xrblocks-environment/src/environment-port.ts:75
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.
Extends
Constructors
Constructor
new XRBlocksEnvironmentPort(
scene: Scene,
context: XRBlocksEnvironmentContext,
options?: ThreeEnvironmentPortOptions
): XRBlocksEnvironmentPort;
Defined in: xrblocks-environment/src/environment-port.ts:83
Parameters
| Parameter | Type |
|---|---|
scene | Scene |
context | XRBlocksEnvironmentContext |
options | ThreeEnvironmentPortOptions |
Returns
XRBlocksEnvironmentPort
Overrides
ThreeEnvironmentPort.constructor
Accessors
root
Get Signature
get root(): Group;
Defined in: threejs-environment/src/environment-port.ts:167
The group holding everything this port created. Read-only in practice.
Returns
Group
Inherited from
Methods
applyAmbient()
applyAmbient(light: AmbientLightSpec | null): void;
Defined in: threejs-environment/src/environment-port.ts:248
Parameters
| Parameter | Type |
|---|---|
light | AmbientLightSpec | null |
Returns
void
Inherited from
ThreeEnvironmentPort.applyAmbient
applyFog()
applyFog(fog: FogSpec | null): void;
Defined in: threejs-environment/src/environment-port.ts:224
Parameters
| Parameter | Type |
|---|---|
fog | FogSpec | null |
Returns
void
Inherited from
applyIbl()
applyIbl(ibl: IblSpec | null): void;
Defined in: threejs-environment/src/environment-port.ts:308
The environment map: what shiny things reflect, and what lights everything the key light does not.
Three kinds, three routes. A gradient is the same generated equirect the sky uses, regenerated in place across a transition. An image is loaded once and swapped in when it lands. A room is three.js's own RoomEnvironment, which has to be prefiltered by a renderer this port does not have - so it is used when the app supplied a prefilter, and approximated with a neutral ramp when it did not.
Parameters
| Parameter | Type |
|---|---|
ibl | IblSpec | null |
Returns
void
Inherited from
applyKeyLight()
applyKeyLight(light: KeyLightSpec | null): void;
Defined in: threejs-environment/src/environment-port.ts:266
Parameters
| Parameter | Type |
|---|---|
light | KeyLightSpec | null |
Returns
void
Inherited from
ThreeEnvironmentPort.applyKeyLight
applyLightEstimation()
applyLightEstimation(estimation:
| ResolvedLightEstimation
| null): void;
Defined in: xrblocks-environment/src/environment-port.ts:177
Light estimation, read out of the XR Blocks lighting manager.
XR Blocks does the WebXR half itself - it owns the XREstimatedLight and
updates its own directional light and probe every frame. This port reads
that and turns it into specs, so the estimate lands in the same document
everything else in this package goes through.
Parameters
| Parameter | Type |
|---|---|
estimation | | ResolvedLightEstimation | null |
Returns
void
Overrides
ThreeEnvironmentPort.applyLightEstimation
applyOcclusion()
applyOcclusion(spec: OcclusionSpec | null): void;
Defined in: xrblocks-environment/src/environment-port.ts:109
Occlusion, through the XR Blocks depth manager.
XR Blocks builds its occlusion pass during init, so this can start and stop depth and choose how the depth texture is blurred, and it cannot conjure an occlusion pass that was never built. When it was not, the report says exactly which option to set.
Parameters
| Parameter | Type |
|---|---|
spec | OcclusionSpec | null |
Returns
void
Overrides
ThreeEnvironmentPort.applyOcclusion
applySky()
applySky(sky: SkySpec | null): void;
Defined in: threejs-environment/src/environment-port.ts:171
Parameters
| Parameter | Type |
|---|---|
sky | SkySpec | null |
Returns
void
Inherited from
dispose()
dispose(): void;
Defined in: xrblocks-environment/src/environment-port.ts:219
Release anything the port created. Optional.
Returns
void
Overrides
getSensingState()
getSensingState(feature: string): string | undefined;
Defined in: xrblocks-environment/src/environment-port.ts:281
Parameters
| Parameter | Type |
|---|---|
feature | string |
Returns
string | undefined
observe()
observe(host: EnvironmentPortHost): () => void;
Defined in: xrblocks-environment/src/environment-port.ts:92
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
| Parameter | Type |
|---|---|
host | EnvironmentPortHost |
Returns
() => void
Overrides
update()
update(): void;
Defined in: xrblocks-environment/src/environment-port.ts:214
Poll both managers. Called by the director's update.
Returns
void