playcanvas-opti-pixel - v1.3.1
    Preparing search index...

    Class SoftwareOcclusionTester

    CPU software occlusion tester. Rasterizes primitive and mesh occluders and tests AABBs on a worker thread. Hi-Z is built only inside the worker.

    Implements

    Index
    _ocTesterType: "cpu_software_oct" = ...
    • Draws the last worker debug wireframe on the immediate layer. Call from update, before that layer is rendered. The GPU mesh is rebuilt only when the worker sends new debugLines.

      Parameters

      • app: AppBase
      • color: Color = pc.Color.YELLOW
      • depthTest: boolean = true

      Returns void

    • Adds the object to the queue for occlusion testing.

      Parameters

      • id: number

        The unique identifier returned earlier by the lock() method.

      • Optional_extra: number | number[]

      Returns number

      A queue index or -1 (if internal verification inconsistencies occur, for example, the tester is unavailable or the tester is waiting for synchronization).

    • Forwards AABB updates to the store and marks the id dirty for worker sync. Prefer this over calling IAABBStore.enqueueUpdate directly so the worker mirror stays incremental instead of a full resync.

      Parameters

      • id: number
      • boundingBox: BoundingBox
      • Optionalmatrix: Mat4
      • extra1: number = 0
      • extra2: number = 0

      Returns void

    • Registers a BoundingBox for subsequent occlusion testing.

      Parameters

      • boundingBox: BoundingBox

        The bounds of the object in local or world coordinates.

      • Optionalmatrix: Mat4

        Optional transformation matrix (if a local BoundingBox is used).

      • extra1: number = 0

        Optional extra data 1.

      • extra2: number = 0

        Optional extra data 2.

      Returns number

      A unique identifier for the registered object.

    • Registers a BoundingBox for subsequent occlusion testing.

      Parameters

      • data: ArrayLike<number>

        The array containing the bounding box data (min and max points) in local or world coordinates [minX, maxX, minY, maxY, minZ, maxZ].

      • offset: number

        The offset in the array where the bounding box data starts.

      • Optionalmatrix: Mat4

        Optional transformation matrix (if a local BoundingBox is used).

      • Optionalextra1: number

        Optional extra data 1.

      • Optionalextra2: number

        Optional extra data 2.

      Returns number

      A unique identifier for the registered object.