Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a line of sight finder between two cells in a two dimensional array using a simple linear interpolation.

Inspired by: https://www.redblobgames.com/grids/line-drawing.html#interpolation

const line = new LineLerp(
[
[0, 0, 0],
[0, 0, 0],
[0, 0, 0]
],
(c) => c === 1
);

const result = line.process({ x: 0, y: 0 }, { x: 2, y: 2 });

console.log(result);

{
status: 'Complete',
positions: [ { x: 0, y: 0 }, { x: 1, y: 1 }, { x: 2, y: 2 } ]
}

Type parameters

  • T

    Any type of data.

Hierarchy

Index

Constructors

Methods

Constructors

Methods

Generated using TypeDoc