voxolith

SceneResponse

A scene worker's answer to a bake or an encode.

type SceneResponse = 
  | {
  done: number;
  id: number;
  kind: "progress";
  total: number;
}
  | {
  bake: PlacementBake;
  cached?: boolean;
  id: number;
  kind: "baked";
  ms: number;
}
  | {
  cached?: boolean;
  encoded: EncodedModel;
  id: number;
  kind: "encoded";
  ms: number;
}
  | {
  id: number;
  kind: "miss";
}
  | {
  kind: "closed";
}
  | {
  id: number;
  kind: "error";
  message: string;
};

Defined in: engine/src/worker/scene.ts:112

Union Members

Type Literal

{
  done: number;
  id: number;
  kind: "progress";
  total: number;
}

The job is running: done of total opaque work units (read done / total as a fraction), posted from inside it, about every 50 ms. The first is done 0, the last done === total, and done never decreases.


Type Literal

{
  bake: PlacementBake;
  cached?: boolean;
  id: number;
  kind: "baked";
  ms: number;
}

The bake, its buffers transferred; ms is how long the worker spent on it; cached when it came from the worker's cache.


Type Literal

{
  cached?: boolean;
  encoded: EncodedModel;
  id: number;
  kind: "encoded";
  ms: number;
}

The encoded model, its buffers transferred; ms is how long the worker spent on it; cached when it came from the worker's cache.


Type Literal

{
  id: number;
  kind: "miss";
}

A lookup found nothing (or the worker has no cache): send the source.


Type Literal

{
  kind: "closed";
}

The answer to close: every cache write has finished.


Type Literal

{
  id: number;
  kind: "error";
  message: string;
}

The job failed (a bake names an unregistered model, a model has too many parts, ...).

On this page