Skip to content

package lighting

import "kaiju/engine/lighting"

Types

Collection

struct

type Collection[T any] struct {
    Cache []T

    // Has unexported fields.
}

Collection.Add

func (c *Collection[T]) Add(position matrix.Vec3, target T) EntryId

Collection.Clear

func (c *Collection[T]) Clear()

Collection.FindById

func (c *Collection[T]) FindById(id EntryId) *Entry[T]

Collection.FindClosest

func (c *Collection[T]) FindClosest(point matrix.Vec3, writeTo []T)

Collection.UpdateCache

func (c *Collection[T]) UpdateCache(point matrix.Vec3) []T

Entry

struct

type Entry[T any] struct {
    Position matrix.Vec3
    Target   T
    // Has unexported fields.
}

EntryId

int

type EntryId = int

LightCollection

Collectionrendering.[Light]

type LightCollection = Collection[rendering.Light]

NewLightCollection

func NewLightCollection(capacity int) LightCollection

LightingInformation

struct

type LightingInformation struct {
    Lights         LightCollection
    StaticShadows  PointShadowCollection
    DynamicShadows PointShadowCollection
}

NewLightingInformation

func NewLightingInformation(lightCapacity, shadowCapacity int) LightingInformation

LightingInformation.Update

func (l *LightingInformation) Update(point matrix.Vec3)

PointShadowCollection

Collectionrendering.[PointShadow]

type PointShadowCollection = Collection[rendering.PointShadow]

NewPointShadowCollection

func NewPointShadowCollection(capacity int) PointShadowCollection