Skip to main content

LightOccluderComponent

Marks an entity as a light-blocking obstacle that projects dynamic shadows in the LightingSystem.

Box shapes are centered on the transform origin by default (anchor: Vector.Half, matching Shape.Box). Polygon and circle shapes are positioned by their own vertex/center coordinates, same as Shape.Polygon and Shape.Circleoffset shifts any shape further from the transform origin in local space.

Hierarchy

Index

Constructors

constructor

Properties

publiccastShadows

castShadows: boolean

optionalreadonlyinheriteddependencies

dependencies?: ComponentCtor<Component>[]

Optionally list any component types this component depends on If the owner entity does not have these components, new components will be added to the entity

Only components with zero-arg constructors are supported as automatic component dependencies

inheritedowner

owner: Entity<any> | null = null

Current owning Entity, if any, of this component. Null if not added to any Entity

Accessors

publicoffset

publicshape

Methods

publicclone

  • Clones any properties on this component, if that property value has a clone() method it will be called


    Returns LightOccluderComponent

inheriteddeserialize

  • deserialize(data: Record<string, any>): void
  • Parameters

    • data: Record<string, any>

    Returns void

publiclocalVertices

  • Evaluates the bounding shape vertices in local space, factoring in local offsets. Returns an empty array for circular primitives. Cached until shape or offset are reassigned.


    Returns Vector[]

optionalinheritedonAdd

  • Optional callback called when a component is added to an entity


    Parameters

    Returns void

optionalinheritedonRemove

  • onRemove(previousOwner: Entity): void
  • Optional callback called when a component is removed from an entity


    Parameters

    Returns void

inheritedserialize

  • serialize(): Record<string, any>
  • Returns Record<string, any>

inheritedtoJSON

  • toJSON(pretty?: boolean): string
  • Parameters

    • pretty: boolean = false

    Returns string