Skip to content

@relu-interactives/spatial-ecs


@relu-interactives/spatial-ecs / components / EnvironmentState

Type Alias: EnvironmentState ​

ts
type EnvironmentState = {
  skybox: EnvironmentSkyboxState;
  fog: EnvironmentFogState;
  gravity: EnvironmentGravityState;
  fixedTimeStep: number;
  interpolatePhysics?: boolean;
  maxPhysicsSteps?: number;
  lighting?: EnvironmentLightingState;
};

Defined in: components/Environment.ts:121

Aggregated authoring state owned by Environment.

Properties ​

PropertyTypeDescriptionDefined in
skyboxEnvironmentSkyboxStateSkybox configuration.components/Environment.ts:123
fogEnvironmentFogStateFog configuration.components/Environment.ts:125
gravityEnvironmentGravityStateWorld gravity.components/Environment.ts:127
fixedTimeStepnumberFixed timestep (seconds) used by the physics accumulator loop. Physics is stepped in fixed increments of this size each frame. Default is 0.02 (50 Hz).components/Environment.ts:133
interpolatePhysics?booleanShow moving rigid bodies between physics steps, so they move evenly at any screen rate. On unless set to false; a body's Transform then trails its rigid body by up to one step, and rigidBody.translation() is the exact value physics has.components/Environment.ts:140
maxPhysicsSteps?numberMost physics steps one frame may take to catch up after a slow frame (default 4). Time beyond that is dropped, so one hitch can't make the frames after it slow too.components/Environment.ts:146
lighting?EnvironmentLightingStateImage-based lighting, tone mapping and exposure. Optional: absent means the scene's environment map and the renderer's tone mapping stay untouched, which is how every scene saved before 0.5.4 renders.components/Environment.ts:152