Options
All
  • Public
  • Public/Protected
  • All
Menu

Class b2VoronoiDiagram

A field representing the nearest generator from each point.

Hierarchy

  • b2VoronoiDiagram

Index

Constructors

constructor

  • Parameters

    • generatorCapacity: number

    Returns b2VoronoiDiagram

Properties

m_countX

m_countX: number = 0

m_countY

m_countY: number = 0

m_diagram

m_diagram: b2VoronoiDiagramGenerator[] = []

m_generatorBuffer

m_generatorBuffer: b2VoronoiDiagramGenerator[]

m_generatorCapacity

m_generatorCapacity: number = 0

m_generatorCount

m_generatorCount: number = 0

Methods

AddGenerator

  • AddGenerator(center: b2Vec2, tag: number, necessary: boolean): void
  • Add a generator.

    Parameters

    • center: b2Vec2

      the position of the generator.

    • tag: number

      a tag used to identify the generator in callback functions.

    • necessary: boolean

      whether to callback for nodes associated with the generator.

    Returns void

Generate

  • Generate(radius: number, margin: number): void
  • Generate the Voronoi diagram. It is rasterized with a given interval in the same range as the necessary generators exist.

    Parameters

    • radius: number

      the interval of the diagram.

    • margin: number

      margin for which the range of the diagram is extended.

    Returns void

GetNodes

  • Enumerate all nodes that contain at least one necessary generator.

    Parameters

    Returns void

Generated using TypeDoc