Options
All
  • Public
  • Public/Protected
  • All
Menu

Class b2Vec2

Hierarchy

  • b2Vec2

Implements

Index

Constructors

constructor

  • new b2Vec2(): b2Vec2
  • newb2Vec2(data: Float32Array): b2Vec2
  • newb2Vec2(x: number, y: number): b2Vec2
  • Returns b2Vec2

  • Parameters

    • data: Float32Array

    Returns b2Vec2

  • Parameters

    • x: number
    • y: number

    Returns b2Vec2

Properties

Readonly data

data: Float32Array

Static Readonly UNITX

UNITX: Readonly<b2Vec2> = new b2Vec2(1, 0)

Static Readonly UNITY

UNITY: Readonly<b2Vec2> = new b2Vec2(0, 1)

Static Readonly ZERO

ZERO: Readonly<b2Vec2> = new b2Vec2(0, 0)

Static Readonly s_t0

s_t0: b2Vec2 = new b2Vec2()

Static Readonly s_t1

s_t1: b2Vec2 = new b2Vec2()

Static Readonly s_t2

s_t2: b2Vec2 = new b2Vec2()

Static Readonly s_t3

s_t3: b2Vec2 = new b2Vec2()

Accessors

x

  • get x(): number
  • set x(value: number): void
  • Returns number

  • Parameters

    • value: number

    Returns void

y

  • get y(): number
  • set y(value: number): void
  • Returns number

  • Parameters

    • value: number

    Returns void

Methods

Clone

  • Returns b2Vec2

Copy

  • Copy(other: XY): this
  • Parameters

    • other: XY

    Returns this

Cross

  • Cross(v: XY): number
  • Parameters

    Returns number

Dot

  • Dot(v: XY): number
  • Parameters

    Returns number

IsValid

  • IsValid(): boolean
  • Returns boolean

Length

  • Length(): number
  • Returns number

LengthSquared

  • LengthSquared(): number
  • Returns number

Normalize

  • Normalize(): number
  • Returns number

SelfAbs

  • SelfAbs(): this
  • Returns this

SelfAdd

  • SelfAdd(v: XY): this
  • Parameters

    Returns this

SelfAddXY

  • SelfAddXY(x: number, y: number): this
  • Parameters

    • x: number
    • y: number

    Returns this

SelfCrossSV

  • SelfCrossSV(s: number): this
  • Parameters

    • s: number

    Returns this

SelfCrossVS

  • SelfCrossVS(s: number): this
  • Parameters

    • s: number

    Returns this

SelfMaxV

  • SelfMaxV(v: XY): this
  • Parameters

    Returns this

SelfMinV

  • SelfMinV(v: XY): this
  • Parameters

    Returns this

SelfMul

  • SelfMul(s: number): this
  • Parameters

    • s: number

    Returns this

SelfMulAdd

  • SelfMulAdd(s: number, v: XY): this
  • Parameters

    • s: number
    • v: XY

    Returns this

SelfMulSub

  • SelfMulSub(s: number, v: XY): this
  • Parameters

    • s: number
    • v: XY

    Returns this

SelfNeg

  • SelfNeg(): this
  • Returns this

SelfNormalize

  • SelfNormalize(): this
  • Returns this

SelfRotate

  • SelfRotate(radians: number): this
  • Parameters

    • radians: number

    Returns this

SelfRotateCosSin

  • SelfRotateCosSin(c: number, s: number): this
  • Parameters

    • c: number
    • s: number

    Returns this

SelfSkew

  • SelfSkew(): this
  • Returns this

SelfSub

  • SelfSub(v: XY): this
  • Parameters

    Returns this

SelfSubXY

  • SelfSubXY(x: number, y: number): this
  • Parameters

    • x: number
    • y: number

    Returns this

Set

  • Set(x: number, y: number): this
  • Parameters

    • x: number
    • y: number

    Returns this

SetZero

  • SetZero(): this
  • Returns this

Static AbsV

  • AbsV<T>(v: XY, out: T): T
  • Type parameters

    Parameters

    • v: XY
    • out: T

    Returns T

Static AddVCrossSV

  • AddVCrossSV<T>(a: XY, s: number, v: XY, out: T): T
  • Type parameters

    Parameters

    • a: XY
    • s: number
    • v: XY
    • out: T

    Returns T

Static AddVMulSV

  • AddVMulSV<T>(a: XY, s: number, b: XY, out: T): T
  • Type parameters

    Parameters

    • a: XY
    • s: number
    • b: XY
    • out: T

    Returns T

Static AddVV

  • AddVV<T>(a: XY, b: XY, out: T): T
  • Type parameters

    Parameters

    • a: XY
    • b: XY
    • out: T

    Returns T

Static ClampV

  • ClampV<T>(v: XY, lo: XY, hi: XY, out: T): T
  • Type parameters

    Parameters

    Returns T

Static CrossOneV

  • CrossOneV<T>(v: XY, out: T): T
  • Type parameters

    Parameters

    • v: XY
    • out: T

    Returns T

Static CrossSV

  • CrossSV<T>(s: number, v: XY, out: T): T
  • Type parameters

    Parameters

    • s: number
    • v: XY
    • out: T

    Returns T

Static CrossVOne

  • CrossVOne<T>(v: XY, out: T): T
  • Type parameters

    Parameters

    • v: XY
    • out: T

    Returns T

Static CrossVS

  • CrossVS<T>(v: XY, s: number, out: T): T
  • Type parameters

    Parameters

    • v: XY
    • s: number
    • out: T

    Returns T

Static CrossVV

  • CrossVV(a: XY, b: XY): number
  • Parameters

    Returns number

Static DistanceSquaredVV

  • DistanceSquaredVV(a: XY, b: XY): number
  • Parameters

    Returns number

Static DistanceVV

  • DistanceVV(a: XY, b: XY): number
  • Parameters

    Returns number

Static DotVV

  • DotVV(a: XY, b: XY): number
  • Parameters

    Returns number

Static ExtVV

  • ExtVV<T>(a: XY, b: XY, out: T): T
  • Type parameters

    Parameters

    • a: XY
    • b: XY
    • out: T

    Returns T

Static IsEqualToV

  • IsEqualToV(a: XY, b: XY): boolean
  • Parameters

    Returns boolean

Static MakeArray

  • MakeArray(length: number): b2Vec2[]
  • Parameters

    • length: number

    Returns b2Vec2[]

Static MaxV

  • MaxV<T>(a: XY, b: XY, out: T): T
  • Type parameters

    Parameters

    • a: XY
    • b: XY
    • out: T

    Returns T

Static MidVV

  • MidVV<T>(a: XY, b: XY, out: T): T
  • Type parameters

    Parameters

    • a: XY
    • b: XY
    • out: T

    Returns T

Static MinV

  • MinV<T>(a: XY, b: XY, out: T): T
  • Type parameters

    Parameters

    • a: XY
    • b: XY
    • out: T

    Returns T

Static MulSV

  • MulSV<T>(s: number, v: XY, out: T): T
  • Type parameters

    Parameters

    • s: number
    • v: XY
    • out: T

    Returns T

Static MulVS

  • MulVS<T>(v: XY, s: number, out: T): T
  • Type parameters

    Parameters

    • v: XY
    • s: number
    • out: T

    Returns T

Static NegV

  • NegV<T>(v: XY, out: T): T
  • Type parameters

    Parameters

    • v: XY
    • out: T

    Returns T

Static RotateV

  • RotateV<T>(v: XY, radians: number, out: T): T
  • Type parameters

    Parameters

    • v: XY
    • radians: number
    • out: T

    Returns T

Static SubVMulSV

  • SubVMulSV<T>(a: XY, s: number, b: XY, out: T): T
  • Type parameters

    Parameters

    • a: XY
    • s: number
    • b: XY
    • out: T

    Returns T

Static SubVV

  • SubVV<T>(a: XY, b: XY, out: T): T
  • Type parameters

    Parameters

    • a: XY
    • b: XY
    • out: T

    Returns T

Generated using TypeDoc