Skip to content

ObjectVisibilitySystem

Synchronizes the visibility flag on Object3DRef to the visible property of the underlying THREE.js Object3D each frame.

Overview

ObjectVisibilitySystem runs every frame and is responsible for:

  • Reading Object3DRef.visibility for every entity that has an Object3DRef component.
  • Setting object.visible to Boolean(visibility) whenever it differs from the current THREE.js value.

Queried components

ComponentAccess
Object3DRefRead + mutate (visibilityobject.visible)

Behavior notes

  • Change-only writes — the system only assigns object.visible when the value differs from the current state, preventing unnecessary scene graph dirty flags.
  • Hierarchy inheritance — THREE.js propagates visible = false to all children automatically, so hiding a parent entity hides its entire subtree without additional logic here.

API reference