Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PreciseShadowcasting

FOV Algorithm that calculates angles of shadows and merges them together.

Hierarchy

  • PreciseShadowcasting

Index

Constructors

constructor

Methods

calculateArray

  • Calculates an array of visible Vectors. Same as calculateCallback, but returns an Array instead.

    Parameters

    • origin: Vector2

      Vector2 - The position to start from.

    • range: number

      Number - The range of vision

    Returns VisibilityStruct[]

calculateCallback

  • Calculates visible positions, and invokes the given callback for each one.

    Parameters

    • origin: Vector2

      Vector2 - The position to start from

    • range: number

      Number - The range of vision

    • callback: VisibilityCallback

      (pos: Vector2, range: number, visibility: number) => void - The function to call for each visible tile

    Returns void

Generated using TypeDoc