Class

Vec2

Vec2(x, y)

Represent a 2d Vector

Constructor

# new Vec2(x, y)

Parameters:
Name Type Description
x number

The x value

y number

The y value

Implements:

View Source core/src/Utils/Vec2.ts, line 10

Members

number

# x

Get the x value

View Source core/src/Utils/Vec2.ts, line 21

number

# y

Get the y value

View Source core/src/Utils/Vec2.ts, line 28

Methods

# add(addVector) → {void}

add The coordinate of the param vector to the coordinates of this vector

Parameters:
Name Type Description
addVector Vec2

The add vector.

View Source core/src/Utils/Vec2.ts, line 87

void

# copy() → {Vec2}

Create a copy of this vector

Implements:

View Source core/src/Utils/Vec2.ts, line 94

A copy of this vector

Vec2

# isEqual(other) → {boolean}

Check if the param vector is equal to this vector

Parameters:
Name Type Description
other Vec2

The other vector to compare

Implements:

View Source core/src/Utils/Vec2.ts, line 102

True if the compared vectors are equal.

boolean

# x() → {number}

Get the x value

View Source core/src/Utils/Vec2.ts, line 71

number

# y() → {number}

Get the y value

View Source core/src/Utils/Vec2.ts, line 79

number