Options
All
  • Public
  • Public/Protected
  • All
Menu

A 2D column vector.

Hierarchy

  • b2Vec2

Index

Constructors

  • new b2Vec2(x?: number, y?: number): b2Vec2
  • Creates a new vector 2.

    Parameters

    • Optional x: number

      x value, default = 0.

    • Optional y: number

      y value, default = 0.

    Returns b2Vec2

Properties

x: number

x value

y: number

y value

Methods

  • Abs(): void
  • Adds the vector 2 to this vector 2. The result is stored in this vector 2.

    Parameters

    Returns void

  • CrossFV(s: number): void
  • CrossVF(s: number): void
  • IsValid(): boolean
  • True if the vector 2 is valid, otherwise false. A valid vector has finite values.

    Returns boolean

    True if the vector 2 is valid, otherwise false.

  • Length(): number
  • LengthSquared(): number
  • Calculates the length squared of the vector2.

    Returns number

    The length squared of the vector 2.

  • Calculates which vector has the maximum values and sets this vector to those values.

    Parameters

    • b: b2Vec2

      Vector 2 to compare for maximum values.

    Returns void

  • Calculates which vector has the minimum values and sets this vector to those values.

    Parameters

    • b: b2Vec2

      Vector 2 to compare for minimum values.

    Returns void

  • Multiply(a: number): void
  • Vector multiplication. Stores the result in this vector 2.

    Parameters

    • a: number

      Value to multiple the vector's values by.

    Returns void

  • NegativeSelf(): void
  • Normalize(): number
  • Set(x?: number, y?: number): void
  • Sets the vector 2.

    Parameters

    • Optional x: number

      x value, default is 0.

    • Optional y: number

      y value, default is 0.

    Returns void

  • SetZero(): void
  • Subtracts the vector 2 from this vector 2. The result is stored in this vector 2.

    Parameters

    • v: b2Vec2

      Vector 2 to subtract.

    Returns void

  • Make(x: number, y: number): b2Vec2

Generated using TypeDoc