Small World Engine API Reference - v0.78.00
    Preparing search index...

    Class PlanarReflectionNode

    A node that renders the scene from a mirrored perspective into a RenderTarget.

    Hierarchy (View Summary)

    Index
    animations: AnimationClip[] = []
    behaviors: Behavior[] = []
    bounds: BoundingVolume | undefined = undefined

    The physical bounding volume of the object.

    castShadow: boolean = false
    children: Object3D[] = []
    collisionLayer: number = 1

    32-bit collision layer bitmask this object belongs to (default: 1).

    collisionMask: number = 0xffffffff

    32-bit collision mask specifying which layers this object interacts with (default: 0xFFFFFFFF).

    excludedObjects: Object3D[] = []

    Objects to hide (alongside this node itself) while rendering the reflection -- typically the visible mesh whose material samples renderTarget (e.g. a mirror floor's reflectionMap). Unlike DynamicReflectionProbe, which can just hide its own parent (a probe is always a child of the reflective object it orbits), a PlanarReflectionNode and the mesh that samples its texture are typically unrelated siblings in the scene graph, so there's no structural relationship to hide automatically. Leaving the reflective mesh visible during its own reflection sub-render both looks wrong (it would show its own stale reflection recursively) and is invalid on WebGPU: renderTarget's texture would be bound as a RenderAttachment (this render) and a TextureBinding (this mesh's material) in the same pass.

    frustumCulled: boolean = true
    geometry: GeometryDataInterface | undefined = undefined
    id: number = ...

    Optional integer identifier for deterministic physics solver sorting and netcode lockstep.

    inFrustum: boolean = true
    isCollidable: boolean = true

    Whether this object should generate bounds and participate in physics/raycasting. Defaults to true.

    isPickable: boolean = false
    isStatic: boolean = false
    isTrigger: boolean = false

    If true, this object acts as a trigger/sensor (fires trigger events without physical force).

    isVisible: boolean = true
    localMatrix: Matrix4 = ...
    material: AbstractMaterial | undefined = undefined
    mirrorCamera: Camera
    name: string = ""
    onPointerClick?: () => void
    onPointerEnter: (() => void) | undefined
    onPointerLeave: (() => void) | undefined
    parent: Object3D | undefined = undefined
    pendingRemovalSink?: (obj: Object3D) => void

    Set by Scene on its hidden root object. Lets remove() notify the owning scene to queue GPU-resource release for a discarded subtree even when called on a nested object directly (someParent.remove(child)) instead of through Scene.remove() -- see remove()/add().

    position: Vector3D = ...
    prefabSource?: string

    Name of the Maker prefab this node was instantiated from, if any -- provenance only, per ADR 0010's Phase 2 "stamped copies" decision: no live link back to the source, just a record of where this subtree came from. Round-tripped via the SW_prefab_instance glTF extension (WorldWriter/GltfLoader).

    quaternion?: Quaternion
    receiveShadow: boolean = false
    renderTarget: RenderTarget
    rigidBody?: RigidBody
    rotation: Vector3D = ...
    scale: Vector3D = ...
    tag?: string

    Optional app-defined category tag, for typed identification instead of matching on name.

    userData: Record<string, unknown> = {}

    Custom user-defined data storage dictionary.

    uuid: string = ...
    worldMatrix: Matrix4 = ...
    inspector: Record<string, InspectorField> = ...

    Base schema every object exposes regardless of subclass -- see collectInspectorSchema() in ./Inspectable.js, which merges this with whatever a subclass (e.g. AbstractLight, AbstractMaterial) declares on top. Transform fields use path since position/rotation/scale are nested Vector3D instances, not own properties.

    • get occlusionCulled(): boolean

      Set only by WebGPU Hierarchical-Z occlusion culling (see docs/adr/0008-...), one frame stale by design (mapAsync GPU->CPU readback is never synchronous). Unlike inFrustum, NOT reset every frame -- only WebGPURenderer.applyPendingOcclusionResults() writes it, for whichever objects it has a fresh readback for; everything else keeps its last known value. Always false on WebGL1/WebGL2 (never written there), making Scene._collectVisible()'s check a permanent no-op on those backends.

      Returns boolean

    • set occlusionCulled(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get onPointerDown(): | ((ray: Ray, intersectionPoint: Vector3D) => void)
      | undefined

      Returns ((ray: Ray, intersectionPoint: Vector3D) => void) | undefined

    • set onPointerDown(
          handler: ((ray: Ray, intersectionPoint: Vector3D) => void) | undefined,
      ): void

      Parameters

      • handler: ((ray: Ray, intersectionPoint: Vector3D) => void) | undefined

      Returns void

    • get onPointerMove(): ((ray: Ray) => void) | undefined

      Returns ((ray: Ray) => void) | undefined

    • set onPointerMove(handler: ((ray: Ray) => void) | undefined): void

      Parameters

      • handler: ((ray: Ray) => void) | undefined

      Returns void

    • get onPointerUp(): (() => void) | undefined

      Returns (() => void) | undefined

    • set onPointerUp(handler: (() => void) | undefined): void

      Parameters

      • handler: (() => void) | undefined

      Returns void

    • Returns an independent copy of this object's subtree -- own uuid, own transform, own material (via AbstractMaterial.clone()), own behaviors (via Behavior.clone(), re-attached so onAttach() runs against the new instance), and a recursive clone of every child. Used by Maker's Duplicate command.

      geometry and any texture references stay shared by reference -- immutable data, same as every other "place another instance" workflow in the engine. parent/bounds reset (the caller reparents and bounds recompute lazily); rigidBody is deliberately dropped rather than shared, since two objects driven by the same live physics body would move together.

      Known gap: skinned meshes aren't specially handled -- a cloned SkinnedMesh's skeleton would still reference the original subtree's bones, not the freshly cloned ones alongside it. Not a concern for Maker's realistic Duplicate targets (props, lights, prefab instances); character rigs go through the Prefab/glTF pipeline instead.

      Returns Object3D

    • Reads this object's position in world space, i.e. after resolving the full parent chain -- unlike position, which is always local to its immediate parent. Requires worldMatrix to be current (see updateMatrixWorld()).

      Parameters

      • out: Vector3D = _scratchWorldPosition

        Optional vector to write into, to avoid allocating one per call. If omitted, a shared module-level scratch is used and overwritten by the next call.

      Returns Vector3D

    • Traverses the object and all its descendants in depth-first order, executing the callback for each.

      Parameters

      Returns void