RenderLists

View source

The base opaque-pass list for material-keyed RenderType entries. RenderLists2D and RenderLists3D provide camera render-list components for the dimensional transform types.

Pass arrays are shared with callers, so a retrieved pass can be inspected or extended directly before the list is cleared or replaced.

Examples

import { RenderLists2D } from '@wimaengine/render-core'
import { typeid } from '@wimaengine/type'

class BasicMaterial {}
const lists = new RenderLists2D()
const materialTypeId = typeid(BasicMaterial)
const pass = lists.setOpaquePass(materialTypeId)

// Callers can append RenderType values to the shared pass.
console.log(lists.getOpaquePass(materialTypeId) === pass) // true
lists.clear()
console.log(lists.getOpaquePass(materialTypeId)) // undefined

Constructor


constructor<T>()

Type Parameters

T

Methods


getOpaquePass(id: TypeId): RenderType<T>[]

View source

Returns the existing opaque pass for a material type ID.

The returned array is the same array held by the map, so callers can read or append its RenderType entries. No pass is created when id is absent; the method returns undefined instead.

Parameters

NameDescriptionDefault
id——

setOpaquePass(id: TypeId): RenderType<T>[]

View source

Creates and stores an empty opaque pass for a material type ID.

The new array is stored directly under id and returned for appending RenderType entries. If a pass already exists for that key, it is replaced by a new empty array rather than appended to or merged.

Parameters

NameDescriptionDefault
id——

clear(): void

View source

Removes every material-keyed opaque pass from this render list.

After clearing, RenderLists#getOpaquePass returns undefined for the removed keys. Arrays returned before the clear remain unchanged as ordinary arrays, but they are no longer stored in this map.