Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

  • new Vector2(x?: number, y?: number): Vector2

Properties

x: number = 0
y: number = 0

Methods

  • Returns the dot product (scale) of the vector dot another vector.

    Parameters

    Returns number

    number

  • Checks if the vector is equal to the one passed in.

    Parameters

    Returns boolean

    boolean

  • magnitude(): number
  • Returns the magnitude (length) of the vector.

    Returns number

    number

  • set(__namedParameters?: { x?: number; y?: number }): void
  • Sets the values of x,y

    Parameters

    • __namedParameters: { x?: number; y?: number } = {}
      • Optional x?: number
      • Optional y?: number

    Returns void

    void

  • setFromJson(json: any): void
  • Sets a Vector2 object with json data.

    Parameters

    • json: any

    Returns void

    void

  • toArray(): number[]
  • Gets the Vector2 object and returns it as a numbers array.

    Returns number[]

    Array

  • toFloat32Array(): Float32Array
  • Gets the Vector2 object and returns it as a float32 array.

    Returns Float32Array

    Float32Array

Generated using TypeDoc