Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Variables

Private Const PRECISION

PRECISION: 1000000000 = 1000000000

Functions

add

  • Adds two vectors and returns the result.

    Parameters

    Returns IVector2

distance

  • Returns the distance between two vectors.

    Parameters

    Returns number

divide

  • Divides two vectors and returns the result.

    Parameters

    Returns IVector2

dot

  • Returns the dot product of two vectors.

    Parameters

    Returns number

length

  • Returns length of a vector.

    Parameters

    Returns number

multiply

  • Multiplies two vectors and returns the result.

    Parameters

    Returns IVector2

negate

  • Returns the negated coordinated of a vector.

    Parameters

    Returns IVector2

pointIntersection

  • pointIntersection(vector1: IVector2, size1: number, vector2: IVector2, size2: number): boolean
  • Checks for intersection between two vectors.

    Parameters

    • vector1: IVector2

      First vector.

    • size1: number

      First size;

    • vector2: IVector2

      Second vector.

    • size2: number

      Second size.

    Returns boolean

positionAroundVector2

  • positionAroundVector2(vector: IVector2, distance: number, radian: number): IVector2
  • Returns a vector positioned around another vector.

    Parameters

    • vector: IVector2

      Center point position.

    • distance: number

      Distance from the center point.

    • radian: number

      Radian value.

    Returns IVector2

Private Const roundToPrecision

  • roundToPrecision(value: number): number
  • Parameters

    • value: number

    Returns number

scale

  • Scales a vector by a value.

    Parameters

    • vector: IVector2

      Vector to scale.

    • value: number

      Value to scale by.

    Returns IVector2

subtract

  • Subtracts two vectors and returns the result.

    Parameters

    Returns IVector2

traverse

  • traverse(vector: IVector2, callback: function, step?: number): void
  • Loops through the dimensions of a vector. Starts at zero, so keep in mind that the number of callbacks will be the dimension sizes +1;

    Parameters

    • vector: IVector2

      Vector to traverse.

    • callback: function

      Callback for each step.

    • Default value step: number = 1

      Step size (default: 1).

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc