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.visibilityfor every entity that has anObject3DRefcomponent. - Setting
object.visibletoBoolean(visibility)whenever it differs from the current THREE.js value.
Queried components
| Component | Access |
|---|---|
Object3DRef | Read + mutate (visibility → object.visible) |
Behavior notes
- Change-only writes — the system only assigns
object.visiblewhen the value differs from the current state, preventing unnecessary scene graph dirty flags. - Hierarchy inheritance — THREE.js propagates
visible = falseto all children automatically, so hiding a parent entity hides its entire subtree without additional logic here.
API reference
- Class:
Object3DRef - Source:
core/systems/ObjectVisibilitySystem.ts

