Constructors
constructor
- new b2Vec2(): b2Vec2
- newb2Vec2(data: Float32Array): b2Vec2
- newb2Vec2(x: number, y: number): b2Vec2
-
-
Parameters
-
Parameters
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
Static Readonly s_t1
Static Readonly s_t2
Static Readonly s_t3
Accessors
x
- get x(): number
- set x(value: number): void
-
Returns number
-
Parameters
Returns void
y
- get y(): number
- set y(value: number): void
-
Returns number
-
Parameters
Returns void
Methods
Clone
-
Copy
-
Parameters
Returns this
Cross
-
Parameters
Returns number
Dot
-
Parameters
Returns number
IsValid
-
Returns boolean
Length
-
Returns number
LengthSquared
-
Returns number
Normalize
-
Returns number
SelfAbs
-
Returns this
SelfAdd
-
Parameters
Returns this
SelfAddXY
- SelfAddXY(x: number, y: number): this
-
Parameters
Returns this
SelfCrossSV
- SelfCrossSV(s: number): this
-
Parameters
Returns this
SelfCrossVS
- SelfCrossVS(s: number): this
-
Parameters
Returns this
SelfMaxV
-
Parameters
Returns this
SelfMinV
-
Parameters
Returns this
SelfMul
-
Parameters
Returns this
SelfMulAdd
- SelfMulAdd(s: number, v: XY): this
-
Parameters
Returns this
SelfMulSub
- SelfMulSub(s: number, v: XY): this
-
Parameters
Returns this
SelfNeg
-
Returns this
SelfNormalize
-
Returns this
SelfRotate
- SelfRotate(radians: number): this
-
Parameters
Returns this
SelfRotateCosSin
- SelfRotateCosSin(c: number, s: number): this
-
Parameters
Returns this
SelfSkew
-
Returns this
SelfSub
-
Parameters
Returns this
SelfSubXY
- SelfSubXY(x: number, y: number): this
-
Parameters
Returns this
Set
- Set(x: number, y: number): this
-
Parameters
Returns this
SetZero
-
Returns this
Static AbsV
- AbsV<T>(v: XY, out: T): T
-
Type parameters
Parameters
Returns T
Static AddVCrossSV
- AddVCrossSV<T>(a: XY, s: number, v: XY, out: T): T
-
Type parameters
Parameters
Returns T
Static AddVMulSV
- AddVMulSV<T>(a: XY, s: number, b: XY, out: T): T
-
Type parameters
Parameters
Returns T
Static AddVV
- AddVV<T>(a: XY, b: XY, out: T): T
-
Type parameters
Parameters
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
Returns T
Static CrossSV
- CrossSV<T>(s: number, v: XY, out: T): T
-
Type parameters
Parameters
Returns T
Static CrossVOne
- CrossVOne<T>(v: XY, out: T): T
-
Type parameters
Parameters
Returns T
Static CrossVS
- CrossVS<T>(v: XY, s: number, out: T): T
-
Type parameters
Parameters
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
Returns T
Static IsEqualToV
- IsEqualToV(a: XY, b: XY): boolean
-
Parameters
Returns boolean
Static MakeArray
- MakeArray(length: number): b2Vec2[]
-
Parameters
Static MaxV
- MaxV<T>(a: XY, b: XY, out: T): T
-
Type parameters
Parameters
Returns T
Static MidVV
- MidVV<T>(a: XY, b: XY, out: T): T
-
Type parameters
Parameters
Returns T
Static MinV
- MinV<T>(a: XY, b: XY, out: T): T
-
Type parameters
Parameters
Returns T
Static MulSV
- MulSV<T>(s: number, v: XY, out: T): T
-
Type parameters
Parameters
Returns T
Static MulVS
- MulVS<T>(v: XY, s: number, out: T): T
-
Type parameters
Parameters
Returns T
Static NegV
- NegV<T>(v: XY, out: T): T
-
Type parameters
Parameters
Returns T
Static RotateV
- RotateV<T>(v: XY, radians: number, out: T): T
-
Type parameters
Parameters
Returns T
Static SubVMulSV
- SubVMulSV<T>(a: XY, s: number, b: XY, out: T): T
-
Type parameters
Parameters
Returns T
Static SubVV
- SubVV<T>(a: XY, b: XY, out: T): T
-
Type parameters
Parameters
Returns T