Skip to content

@temporary-escape/mod-sdk / Vector2d

Class: Vector2d ​

Defined in: math/vector2d.ts:4

Constructors ​

Constructor ​

ts
new Vector2d(x?: number, y?: number): Vector2d;

Defined in: math/vector2d.ts:8

Parameters ​

ParameterTypeDefault value
xnumber0
ynumberx

Returns ​

Vector2d

Properties ​

PropertyTypeDefined in
xnumbermath/vector2d.ts:5
ynumbermath/vector2d.ts:6

Methods ​

get() ​

ts
get(i: number): number;

Defined in: math/vector2d.ts:21

Get an axis from the vector.

Parameters ​

ParameterTypeDescription
inumberAxis index in range [0, 1].

Returns ​

number


set() ​

ts
set(i: number, v: number): void;

Defined in: math/vector2d.ts:30

Set an axis value to the vector.

Parameters ​

ParameterTypeDescription
inumberAxis index in range [0, 1].
vnumberAxis value.

Returns ​

void


toString() ​

ts
toString(): string;

Defined in: math/vector2d.ts:13

Returns ​

string


fromFloat() ​

ts
static fromFloat(v: Vector2f): Vector2d;

Defined in: math/vector2d.ts:41

Convert a Vector2f to a Vector2d, preserving all values.

Parameters ​

ParameterType
vVector2f

Returns ​

Vector2d