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

    Class Scene

    A scene that holds a collection of 3D objects.

    Index
    brdfLUT?: Texture
    dynamicOctree: Octree | undefined = undefined
    environmentIntensity: number = 1.0
    fog?: Fog
    irradianceMap?: CubeTexture
    joints: Joint[] = []

    Physics joints / articulated constraints evaluated by PhysicsSystem.

    lastFrustumVisibleObjects: Object3D[] = []

    Every isVisible && inFrustum object from the last getVisibleObjectsSorted() call -- i.e. _collectVisible()'s own visibility/frustum gate, captured as a byproduct of that walk, before its occlusionCulled gate (lastOcclusionCulledCount's check) filters anything further. Populated for every object regardless of whether it has geometry/material (unlike RenderList, which only batches drawable objects), so a consumer that needs "what's in frustum" without "and also drawable" -- e.g. WebGPURenderer._dispatchHzbTest()'s HZB candidate list, which must include currently-occlusion-culled objects too so they can be re-tested and un-culled -- can read this instead of walking the scene tree a second time.

    lastOcclusionCulledCount: number = 0

    How many objects _collectVisible() skipped this call because occlusionCulled was set (WebGPU Hierarchical-Z culling, see docs/adr/0008-...). Reset at the top of getVisibleObjectsSorted(); always 0 on WebGL1/WebGL2, where occlusionCulled is never set. Reflects whichever of getVisibleObjectsSorted()'s per-frame callers (DepthPrePassGPU, then MainRenderPass) ran last.

    prefilterMap?: CubeTexture
    root: Object3D = ...
    spatialHash: SpatialHash | undefined = undefined
    staticColliders: Collidable[] = []

    Lightweight static colliders (e.g. StaticCollider) that aren't part of the Object3D scene graph. PhysicsSystem reads this in addition to walking objects, so non-Object3D obstacles participate in collision resolution too.

    staticOctree: Octree | undefined = undefined
    • Drains and returns the objects removed from this scene since the last call. Renderers call this once per frame to release GPU resources tied to objects that have actually left the scene graph.

      Returns Object3D[]

    • Returns visible objects, respecting BOTH user visibility and frustum state. Separates opaque and transparent objects. Opaque Grouping: shaderId -> topology -> matUuid -> Object3D[] Transparent: Object3D[] sorted back-to-front

      Parameters

      • vp: Float32Array
      • camPos: Vector3D
      • forceRefresh: boolean = false

      Returns RenderList

    • Invalidates the cached RenderList, forcing getVisibleObjectsSorted() to re-traverse the scene graph on its next call.

      Returns void

    • Parameters

      • deltaTime: number = 0

      Returns void

    • True for auto-generated debug visuals (e.g. OctreeVisualizer/CollisionVisualizer wireframes), identified by the debug_ name prefix convention. Centralized here so every consumer of this convention checks it the same way, rather than each re-testing the prefix independently.

      Parameters

      Returns boolean