@temporary-escape/mod-sdk / Vector4i
Class: Vector4i
Defined in: math/vector4i.ts:7
Constructors
Constructor
ts
new Vector4i(
x?: number,
y?: number,
z?: number,
w?: number
): Vector4i;Defined in: math/vector4i.ts:13
Parameters
| Parameter | Type | Default value |
|---|---|---|
x | number | 0 |
y | number | x |
z | number | x |
w | number | x |
Returns
Vector4i
Properties
| Property | Type | Defined in |
|---|---|---|
w | number | math/vector4i.ts:11 |
x | number | math/vector4i.ts:8 |
y | number | math/vector4i.ts:9 |
z | number | math/vector4i.ts:10 |
Methods
get()
ts
get(i: number): number;Defined in: math/vector4i.ts:42
Get an axis from the vector.
Parameters
| Parameter | Type | Description |
|---|---|---|
i | number | Axis index in range [0, 3]. |
Returns
number
set()
ts
set(i: number, v: number): void;Defined in: math/vector4i.ts:51
Set an axis value to the vector.
Parameters
| Parameter | Type | Description |
|---|---|---|
i | number | Axis index in range [0, 3]. |
v | number | Axis value. |
Returns
void
toString()
ts
toString(): string;Defined in: math/vector4i.ts:20
Returns
string
xy()
ts
xy(): Vector2i;Defined in: math/vector4i.ts:27
Returns a vector containing the x and y components of this vector.
Returns
xyz()
ts
xyz(): Vector3i;Defined in: math/vector4i.ts:34
Returns a vector containing the x, y and z components of this vector.
Returns
abs()
ts
static abs(x: Vector4i): Vector4i;Defined in: math/vector4i.ts:145
Returns x if x >= 0; otherwise, it returns -x.
Parameters
| Parameter | Type |
|---|---|
x | Vector4i |
Returns
Vector4i
add()
ts
static add(a: Vector4i, b: Vector4i): Vector4i;Defined in: math/vector4i.ts:89
Returns addition of two vectors.
Parameters
| Parameter | Type |
|---|---|
a | Vector4i |
b | Vector4i |
Returns
Vector4i
cmpEqual()
ts
static cmpEqual(a: Vector4i, b: Vector4i): Vector4b;Defined in: math/vector4i.ts:131
Component-wise comparison of two vectors.
Parameters
| Parameter | Type |
|---|---|
a | Vector4i |
b | Vector4i |
Returns
cmpNotEqual()
ts
static cmpNotEqual(a: Vector4i, b: Vector4i): Vector4b;Defined in: math/vector4i.ts:138
Component-wise comparison of two vectors.
Parameters
| Parameter | Type |
|---|---|
a | Vector4i |
b | Vector4i |
Returns
div()
ts
static div(a: Vector4i, b: Vector4i): Vector4i;Defined in: math/vector4i.ts:110
Returns division of two vectors.
Parameters
| Parameter | Type |
|---|---|
a | Vector4i |
b | Vector4i |
Returns
Vector4i
eq()
ts
static eq(a: Vector4i, b: Vector4i): boolean;Defined in: math/vector4i.ts:117
Returns true if two vectors are equal.
Parameters
| Parameter | Type |
|---|---|
a | Vector4i |
b | Vector4i |
Returns
boolean
fromFloat()
ts
static fromFloat(v: Vector4f): Vector4i;Defined in: math/vector4i.ts:75
Convert a Vector4f to a Vector4i, losing precision.
Parameters
| Parameter | Type |
|---|---|
v | Vector4f |
Returns
Vector4i
max()
ts
static max(x: Vector4i, y: Vector4i): Vector4i;Defined in: math/vector4i.ts:176
Returns y if x < y; otherwise, it returns x.
Parameters
| Parameter | Type |
|---|---|
x | Vector4i |
y | Vector4i |
Returns
Vector4i
min()
ts
static min(x: Vector4i, y: Vector4i): Vector4i;Defined in: math/vector4i.ts:169
Returns y if y < x; otherwise, it returns x.
Parameters
| Parameter | Type |
|---|---|
x | Vector4i |
y | Vector4i |
Returns
Vector4i
mul()
ts
static mul(a: Vector4i, b: Vector4i): Vector4i;Defined in: math/vector4i.ts:103
Returns multiplication of two vectors.
Parameters
| Parameter | Type |
|---|---|
a | Vector4i |
b | Vector4i |
Returns
Vector4i
ne()
ts
static ne(a: Vector4i, b: Vector4i): boolean;Defined in: math/vector4i.ts:124
Returns true if two vectors are not equal.
Parameters
| Parameter | Type |
|---|---|
a | Vector4i |
b | Vector4i |
Returns
boolean
sign()
ts
static sign(a: Vector4i): Vector4i;Defined in: math/vector4i.ts:157
Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0.
Parameters
| Parameter | Type |
|---|---|
a | Vector4i |
Returns
Vector4i
sub()
ts
static sub(a: Vector4i, b: Vector4i): Vector4i;Defined in: math/vector4i.ts:96
Returns subtraction of two vectors.
Parameters
| Parameter | Type |
|---|---|
a | Vector4i |
b | Vector4i |
Returns
Vector4i
unm()
ts
static unm(a: Vector4i): Vector4i;Defined in: math/vector4i.ts:82
Returns the negation of the vector.
Parameters
| Parameter | Type |
|---|---|
a | Vector4i |
Returns
Vector4i
