@nativewrappers/common 0.0.131 → 0.0.133
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +1 -52
- package/index.js +1 -52
- package/package.json +1 -1
- package/common-game/CommonGameConstants.d.ts +0 -7
- package/common-game/CommonGameConstants.js +0 -24
- package/common-game/CommonModel.d.ts +0 -99
- package/common-game/CommonModel.js +0 -172
- package/common-game/CommonTasks.d.ts +0 -44
- package/common-game/CommonTasks.js +0 -233
- package/common-game/cfx/StateBagChangeHandler.d.ts +0 -1
- package/common-game/cfx/StateBagChangeHandler.js +0 -0
- package/common-game/cfx/cfx.d.ts +0 -6
- package/common-game/cfx/cfx.js +0 -4
- package/common-game/common/Command.d.ts +0 -77
- package/common-game/common/Command.js +0 -152
- package/common-game/common/Convar.d.ts +0 -13
- package/common-game/common/Convar.js +0 -58
- package/common-game/common/GlobalData.d.ts +0 -12
- package/common-game/common/GlobalData.js +0 -20
- package/common-game/common/Kvp.d.ts +0 -69
- package/common-game/common/Kvp.js +0 -137
- package/common-game/common/Resource.d.ts +0 -14
- package/common-game/common/Resource.js +0 -54
- package/common-game/common/decors/ConVar.d.ts +0 -14
- package/common-game/common/decors/ConVar.js +0 -70
- package/common-game/common/decors/Events.d.ts +0 -66
- package/common-game/common/decors/Events.js +0 -163
- package/common-game/common/decors/Exports.d.ts +0 -1
- package/common-game/common/decors/Exports.js +0 -53
- package/common-game/common/decors/Permissions.d.ts +0 -3
- package/common-game/common/decors/Permissions.js +0 -49
- package/common-game/common/decors/Resources.d.ts +0 -8
- package/common-game/common/decors/Resources.js +0 -94
- package/common-game/common/decors/Ticks.d.ts +0 -9
- package/common-game/common/decors/Ticks.js +0 -32
- package/common-game/common/net/NetworkedMap.d.ts +0 -28
- package/common-game/common/net/NetworkedMap.js +0 -262
- package/common-game/common/types.d.ts +0 -5
- package/common-game/common/types.js +0 -0
- package/common-game/common/utils/ClassTypes.d.ts +0 -11
- package/common-game/common/utils/ClassTypes.js +0 -15
- package/common-game/common/utils/Color.d.ts +0 -14
- package/common-game/common/utils/Color.js +0 -33
- package/common-game/common/utils/Delay.d.ts +0 -1
- package/common-game/common/utils/Delay.js +0 -6
- package/common-game/common/utils/Maths.d.ts +0 -4
- package/common-game/common/utils/Maths.js +0 -18
- package/common-game/common/utils/Point.d.ts +0 -9
- package/common-game/common/utils/Point.js +0 -36
- package/common-game/common/utils/PointF.d.ts +0 -7
- package/common-game/common/utils/PointF.js +0 -18
- package/common-game/common/utils/Quaternion.d.ts +0 -10
- package/common-game/common/utils/Quaternion.js +0 -33
- package/common-game/common/utils/Vector.d.ts +0 -429
- package/common-game/common/utils/Vector.js +0 -589
- package/common-game/common/utils/cleanPlayerName.d.ts +0 -6
- package/common-game/common/utils/cleanPlayerName.js +0 -17
- package/common-game/common/utils/enumValues.d.ts +0 -12
- package/common-game/common/utils/enumValues.js +0 -20
- package/common-game/common/utils/getStringFromUInt8Array.d.ts +0 -8
- package/common-game/common/utils/getStringFromUInt8Array.js +0 -6
- package/common-game/common/utils/getUInt32FromUint8Array.d.ts +0 -8
- package/common-game/common/utils/getUInt32FromUint8Array.js +0 -6
- package/common-game/common/utils/randomInt.d.ts +0 -1
- package/common-game/common/utils/randomInt.js +0 -9
- package/common-game/definitions/index.d.js +0 -0
- package/common-game/definitions/redm.d.js +0 -0
- package/common-game/entities/CommonBaseEntity.d.ts +0 -116
- package/common-game/entities/CommonBaseEntity.js +0 -266
- package/common-game/entities/CommonBaseEntityBone.d.ts +0 -11
- package/common-game/entities/CommonBaseEntityBone.js +0 -32
- package/common-game/entities/CommonBaseEntityBoneCollection.d.ts +0 -9
- package/common-game/entities/CommonBaseEntityBoneCollection.js +0 -17
- package/common-game/entities/CommonEntityBone.d.ts +0 -5
- package/common-game/entities/CommonEntityBone.js +0 -14
- package/common-game/entities/CommonEntityBoneCollection.d.ts +0 -9
- package/common-game/entities/CommonEntityBoneCollection.js +0 -24
- package/common-game/entities/CommonEntityType.d.ts +0 -4
- package/common-game/entities/CommonEntityType.js +0 -0
- package/common-game/entities/CommonPed.d.ts +0 -16
- package/common-game/entities/CommonPed.js +0 -52
- package/common-game/entities/CommonPedBone.d.ts +0 -6
- package/common-game/entities/CommonPedBone.js +0 -17
- package/common-game/entities/CommonPedBoneCollection.d.ts +0 -10
- package/common-game/entities/CommonPedBoneCollection.js +0 -31
- package/common-game/entities/CommonPlayer.d.ts +0 -61
- package/common-game/entities/CommonPlayer.js +0 -156
- package/common-game/entities/CommonProp.d.ts +0 -15
- package/common-game/entities/CommonProp.js +0 -43
- package/common-game/entities/CommonVehicle.d.ts +0 -11
- package/common-game/entities/CommonVehicle.js +0 -36
- package/common-game/entities/GetEntityClassIdFromHandle.d.ts +0 -2
- package/common-game/entities/GetEntityClassIdFromHandle.js +0 -23
- package/common-game/entities/IHandle.d.ts +0 -6
- package/common-game/entities/IHandle.js +0 -20
- package/common-game/enums/VehicleSeat.d.ts +0 -13
- package/common-game/enums/VehicleSeat.js +0 -17
- package/common-game/index.d.ts +0 -50
- package/common-game/index.js +0 -50
- package/common-game/interfaces/Dimension.d.ts +0 -5
- package/common-game/interfaces/Dimension.js +0 -0
- package/common-game/utils/Animations.d.ts +0 -19
- package/common-game/utils/Animations.js +0 -43
|
@@ -1,429 +0,0 @@
|
|
|
1
|
-
import type { MsgpackBuffer } from "../types";
|
|
2
|
-
import { ClassTypes } from "./ClassTypes";
|
|
3
|
-
declare const size: unique symbol;
|
|
4
|
-
/**
|
|
5
|
-
* Represents a 2-dimensional vector.
|
|
6
|
-
*/
|
|
7
|
-
export interface Vec2 {
|
|
8
|
-
x: number;
|
|
9
|
-
y: number;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Represents a 3-dimensional vector.
|
|
13
|
-
*/
|
|
14
|
-
export interface Vec3 extends Vec2 {
|
|
15
|
-
z: number;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Represents a 4-dimensional vector.
|
|
19
|
-
*/
|
|
20
|
-
export interface Vec4 extends Vec3 {
|
|
21
|
-
w: number;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* An object with vector components.
|
|
25
|
-
*/
|
|
26
|
-
export interface Vec extends Vec2 {
|
|
27
|
-
z?: number;
|
|
28
|
-
w?: number;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Represents a vector of variable dimensions.
|
|
32
|
-
*/
|
|
33
|
-
type VectorN<L extends number, T = number> = L extends 2 ? [T, T] : L extends 3 ? [T, T, T] : L extends 4 ? [T, T, T, T] : never;
|
|
34
|
-
/**
|
|
35
|
-
* An array that can be converted to a vector.
|
|
36
|
-
*/
|
|
37
|
-
type VectorArray<T> = T extends Vec4 ? VectorN<4> : T extends Vec3 ? VectorN<3> : T extends Vec2 ? VectorN<2> : number[];
|
|
38
|
-
/**
|
|
39
|
-
* The constructor type of the Vector class.
|
|
40
|
-
*/
|
|
41
|
-
type VectorType = typeof Vector;
|
|
42
|
-
/**
|
|
43
|
-
* Represents an object or class that can be treated as a vector.
|
|
44
|
-
*/
|
|
45
|
-
type VectorLike = Vec | Vector;
|
|
46
|
-
/**
|
|
47
|
-
* Utility type to get the vector type of an object based on its component.
|
|
48
|
-
*/
|
|
49
|
-
type InferVector<T> = T extends Vec4 | VectorN<4> ? Vector4 : T extends Vec3 | VectorN<3> ? Vector3 : T extends Vec2 | VectorN<2> ? Vector2 : any;
|
|
50
|
-
type VectorKey = "x" | "y" | "z" | "w";
|
|
51
|
-
type VectorSwizzle = Vec2Swizzle | Vec3Swizzle | Vec4Swizzle;
|
|
52
|
-
type Vec2Swizzle = `${VectorKey}${VectorKey}`;
|
|
53
|
-
type Vec3Swizzle = `${VectorKey}${VectorKey}${VectorKey}`;
|
|
54
|
-
type Vec4Swizzle = `${VectorKey}${VectorKey}${VectorKey}${VectorKey}`;
|
|
55
|
-
/**
|
|
56
|
-
* A base vector class inherited by all vector classes.
|
|
57
|
-
*/
|
|
58
|
-
declare abstract class Vector {
|
|
59
|
-
protected static create<T>(this: T, x: number | Vec, y?: number, z?: number, w?: number): Vector4 | Vector3 | Vector2;
|
|
60
|
-
/**
|
|
61
|
-
* Creates a deep copy of the provided vector.
|
|
62
|
-
* @param obj The vector to clone.
|
|
63
|
-
* @returns A new vector instance that is a copy of the provided vector.
|
|
64
|
-
*/
|
|
65
|
-
static clone<T extends VectorType, U extends VectorLike>(this: T, obj: U): Vector4 | Vector3 | Vector2;
|
|
66
|
-
/**
|
|
67
|
-
* Creates a vector from binary data in a MsgpackBuffer.
|
|
68
|
-
* @param msgpackBuffer The buffer containing binary data.
|
|
69
|
-
* @returns A new vector instance.
|
|
70
|
-
*/
|
|
71
|
-
static fromBuffer<T extends VectorType>(this: T, { buffer, type }: MsgpackBuffer): InstanceType<T>;
|
|
72
|
-
/**
|
|
73
|
-
* Performs an operation between a vector and either another vector or scalar value.
|
|
74
|
-
* @param a - The first vector.
|
|
75
|
-
* @param b - The second vector or scalar value.
|
|
76
|
-
* @param operator - The function defining the operation to perform.
|
|
77
|
-
* @returns A new vector resulting from the operation.
|
|
78
|
-
*/
|
|
79
|
-
private static operate;
|
|
80
|
-
/**
|
|
81
|
-
* Adds two vectors or a scalar value to a vector.
|
|
82
|
-
* @param a - The first vector or scalar value.
|
|
83
|
-
* @param b - The second vector or scalar value.
|
|
84
|
-
* @returns A new vector with incremented components.
|
|
85
|
-
*/
|
|
86
|
-
static add<T extends VectorType, U extends VectorLike>(this: T, a: U, b: VectorLike | number): U;
|
|
87
|
-
/**
|
|
88
|
-
* Adds a scalar value to the x-component of a vector.
|
|
89
|
-
* @param obj - The vector.
|
|
90
|
-
* @param x - The value to add to the x-component.
|
|
91
|
-
* @returns A new vector with the x-component incremented.
|
|
92
|
-
*/
|
|
93
|
-
static addX<U extends VectorLike>(obj: U, x: number): U;
|
|
94
|
-
/**
|
|
95
|
-
* Adds a scalar value to the y-component of a vector.
|
|
96
|
-
* @param obj - The vector.
|
|
97
|
-
* @param y - The value to add to the y-component.
|
|
98
|
-
* @returns A new vector with the y-component incremented.
|
|
99
|
-
*/
|
|
100
|
-
static addY<T extends VectorType, U extends VectorLike>(this: T, obj: U, y: number): U;
|
|
101
|
-
/**
|
|
102
|
-
* Adds a scalar value to the z-component of a vector.
|
|
103
|
-
* @param obj - The vector.
|
|
104
|
-
* @param z - The value to add to the z-component.
|
|
105
|
-
* @returns A new vector with the z-component incremented.
|
|
106
|
-
*/
|
|
107
|
-
static addZ<T extends VectorType, U extends Vec3 | Vec4>(this: T, obj: U, z: number): U;
|
|
108
|
-
/**
|
|
109
|
-
* Adds a scalar value to the w-component of a vector.
|
|
110
|
-
* @param obj - The vector.
|
|
111
|
-
* @param w - The value to add to the w-component.
|
|
112
|
-
* @returns A new vector with the w-component incremented.
|
|
113
|
-
*/
|
|
114
|
-
static addW<T extends VectorType, U extends Vec4>(this: T, obj: U, w: number): U;
|
|
115
|
-
/**
|
|
116
|
-
* Subtracts one vector from another or subtracts a scalar value from a vector.
|
|
117
|
-
* @param a - The vector.
|
|
118
|
-
* @param b - The second vector or scalar value.
|
|
119
|
-
* @returns A new vector with subtracted components.
|
|
120
|
-
*/
|
|
121
|
-
static subtract<T extends VectorType, U extends VectorLike>(this: T, a: U, b: VectorLike | number): U;
|
|
122
|
-
/**
|
|
123
|
-
* Multiplies two vectors by their components, or multiplies a vector by a scalar value.
|
|
124
|
-
* @param a - The vector.
|
|
125
|
-
* @param b - The second vector or scalar value.
|
|
126
|
-
* @returns A new vector with multiplied components.
|
|
127
|
-
*/
|
|
128
|
-
static multiply<T extends VectorType, U extends VectorLike>(this: T, a: U, b: VectorLike | number): U;
|
|
129
|
-
/**
|
|
130
|
-
* Divides two vectors by their components, or divides a vector by a scalar value.
|
|
131
|
-
* @param a - The vector.
|
|
132
|
-
* @param b - The second vector or scalar vector.
|
|
133
|
-
* @returns A new vector with divided components.
|
|
134
|
-
*/
|
|
135
|
-
static divide<T extends VectorType, U extends VectorLike>(this: T, a: U, b: VectorLike | number): U;
|
|
136
|
-
/**
|
|
137
|
-
* Performs an operation between a vector and either another vector or scalar value converting the vector into absolute values.
|
|
138
|
-
* @param a - The first vector.
|
|
139
|
-
* @param b - The second vector or scalar value.
|
|
140
|
-
* @param operator - The function defining the operation to perform.
|
|
141
|
-
* @returns A new vector resulting from the operation.
|
|
142
|
-
*/
|
|
143
|
-
private static operateAbsolute;
|
|
144
|
-
/**
|
|
145
|
-
* Adds two vectors or a scalar value to a vector.
|
|
146
|
-
* @param a - The first vector or scalar value.
|
|
147
|
-
* @param b - The second vector or scalar value.
|
|
148
|
-
* @returns A new vector with incremented components.
|
|
149
|
-
*/
|
|
150
|
-
static addAbsolute<T extends VectorType, U extends VectorLike>(this: T, a: U, b: VectorLike | number): U;
|
|
151
|
-
/**
|
|
152
|
-
* Subtracts one vector from another or subtracts a scalar value from a vector.
|
|
153
|
-
* @param a - The vector.
|
|
154
|
-
* @param b - The second vector or scalar value.
|
|
155
|
-
* @returns A new vector with subtracted components.
|
|
156
|
-
*/
|
|
157
|
-
static subtractAbsolute<T extends VectorType, U extends VectorLike>(this: T, a: U, b: VectorLike | number): U;
|
|
158
|
-
/**
|
|
159
|
-
* Multiplies two vectors by their components, or multiplies a vector by a scalar value.
|
|
160
|
-
* @param a - The vector.
|
|
161
|
-
* @param b - The second vector or scalar value.
|
|
162
|
-
* @returns A new vector with multiplied components.
|
|
163
|
-
*/
|
|
164
|
-
static multiplyAbsolute<T extends VectorType, U extends VectorLike>(this: T, a: U, b: VectorLike | number): U;
|
|
165
|
-
/**
|
|
166
|
-
* Divides two vectors by their components, or divides a vector by a scalar value
|
|
167
|
-
* @param a - The vector.
|
|
168
|
-
* @param b - The second vector or scalar vector.
|
|
169
|
-
* @returns A new vector with divided components.
|
|
170
|
-
*/
|
|
171
|
-
static divideAbsolute<T extends VectorType, U extends VectorLike>(this: T, a: U, b: VectorLike | number): U;
|
|
172
|
-
/**
|
|
173
|
-
* Calculates the dot product of two vectors.
|
|
174
|
-
* @param a - The first vector.
|
|
175
|
-
* @param b - The second vector.
|
|
176
|
-
* @returns A scalar value representing the degree of alignment between the input vectors.
|
|
177
|
-
*/
|
|
178
|
-
static dotProduct<T extends VectorType, U extends VectorLike>(this: T, a: U, b: U): number;
|
|
179
|
-
/**
|
|
180
|
-
* Calculates the cross product of two vectors in three-dimensional space.
|
|
181
|
-
* @param a - The first vector.
|
|
182
|
-
* @param b - The second vector.
|
|
183
|
-
* @returns A new vector perpendicular to both input vectors.
|
|
184
|
-
*/
|
|
185
|
-
static crossProduct<T extends VectorType, U extends Vec3 | Vec4>(this: T, a: U, b: U): U;
|
|
186
|
-
/**
|
|
187
|
-
* Normalizes a vector, producing a new vector with the same direction but with a magnitude of 1.
|
|
188
|
-
* @param vector - The vector to be normalized.
|
|
189
|
-
* @returns The new normalized vector.
|
|
190
|
-
*/
|
|
191
|
-
static normalize<T extends VectorType, U extends VectorLike>(this: T, a: U): U;
|
|
192
|
-
/**
|
|
193
|
-
* Creates a vector from an array of numbers.
|
|
194
|
-
* @param primitive An array of numbers (usually returned by a native).
|
|
195
|
-
*/
|
|
196
|
-
static fromArray<T extends VectorType, U extends VectorArray<T> | number[]>(this: T, primitive: U): InstanceType<T>;
|
|
197
|
-
/**
|
|
198
|
-
* Creates a vector from an array or object containing vector components.
|
|
199
|
-
* @param primitive The object to use as a vector.
|
|
200
|
-
*/
|
|
201
|
-
static fromObject<T extends VectorType, U extends InferVector<T> | VectorArray<T>>(this: T, primitive: U | MsgpackBuffer): InstanceType<T>;
|
|
202
|
-
/**
|
|
203
|
-
* Creates an array of vectors from an array of number arrays
|
|
204
|
-
* @param primitives A multi-dimensional array of number arrays
|
|
205
|
-
*/
|
|
206
|
-
static fromArrays<T extends VectorType, U extends VectorArray<T>[]>(this: T, primitives: U): InstanceType<T>[];
|
|
207
|
-
/**
|
|
208
|
-
* Calculates the length (magnitude) of a vector.
|
|
209
|
-
* @param obj - The vector for which to calculate the length.
|
|
210
|
-
* @returns The magnitude of the vector.
|
|
211
|
-
*/
|
|
212
|
-
static Length<T extends VectorType, U extends VectorLike>(this: T, obj: U): number;
|
|
213
|
-
type: unknown;
|
|
214
|
-
[size]: number;
|
|
215
|
-
x: number;
|
|
216
|
-
y: number;
|
|
217
|
-
z: number | undefined;
|
|
218
|
-
w: number | undefined;
|
|
219
|
-
/**
|
|
220
|
-
* Constructs a new vector.
|
|
221
|
-
* @param x The x-component of the vector.
|
|
222
|
-
* @param y The y-component of the vector (optional, defaults to x).
|
|
223
|
-
* @param z The z-component of the vector (optional).
|
|
224
|
-
* @param w The w-component of the vector (optional).
|
|
225
|
-
*/
|
|
226
|
-
constructor(x: number, y?: number, z?: number, w?: number);
|
|
227
|
-
[Symbol.iterator](): Iterator<number>;
|
|
228
|
-
get size(): number;
|
|
229
|
-
toString(): string;
|
|
230
|
-
/**
|
|
231
|
-
* @see Vector.clone
|
|
232
|
-
*/
|
|
233
|
-
clone<T extends this>(): T;
|
|
234
|
-
/**
|
|
235
|
-
* The product of the Euclidean magnitudes of this and another Vector.
|
|
236
|
-
*
|
|
237
|
-
* @param v Vector to find Euclidean magnitude between.
|
|
238
|
-
* @returns Euclidean magnitude with another vector.
|
|
239
|
-
*/
|
|
240
|
-
distanceSquared(v: VectorLike): number;
|
|
241
|
-
/**
|
|
242
|
-
* The distance between two Vectors.
|
|
243
|
-
*
|
|
244
|
-
* @param v Vector to find distance between.
|
|
245
|
-
* @returns Distance between this and another vector.
|
|
246
|
-
*/
|
|
247
|
-
distance(v: VectorLike): number;
|
|
248
|
-
/**
|
|
249
|
-
* @see Vector.normalize
|
|
250
|
-
*/
|
|
251
|
-
normalize(): this;
|
|
252
|
-
/**
|
|
253
|
-
* @see Vector.dotProduct
|
|
254
|
-
*/
|
|
255
|
-
dotProduct(v: this): number;
|
|
256
|
-
/**
|
|
257
|
-
* @see Vector.add
|
|
258
|
-
*/
|
|
259
|
-
add(v: VectorLike | number): this;
|
|
260
|
-
/**
|
|
261
|
-
* @see Vector.addX
|
|
262
|
-
*/
|
|
263
|
-
addX(x: number): this;
|
|
264
|
-
/**
|
|
265
|
-
* @see Vector.addY
|
|
266
|
-
*/
|
|
267
|
-
addY(y: number): this;
|
|
268
|
-
/**
|
|
269
|
-
* @see Vector.subtract
|
|
270
|
-
*/
|
|
271
|
-
subtract(v: VectorLike): this;
|
|
272
|
-
/**
|
|
273
|
-
* @see Vector.multiply
|
|
274
|
-
*/
|
|
275
|
-
multiply(v: VectorLike | number): this;
|
|
276
|
-
/**
|
|
277
|
-
* @see Vector.divide
|
|
278
|
-
*/
|
|
279
|
-
divide(v: VectorLike | number): this;
|
|
280
|
-
/**
|
|
281
|
-
* @see Vector.addAbsolute
|
|
282
|
-
*/
|
|
283
|
-
addAbsolute(v: VectorLike): this;
|
|
284
|
-
/**
|
|
285
|
-
* @see Vector.subtractAbsolute
|
|
286
|
-
*/
|
|
287
|
-
subtractAbsolute(v: VectorLike): this;
|
|
288
|
-
/**
|
|
289
|
-
* @see Vector.multiply
|
|
290
|
-
*/
|
|
291
|
-
multiplyAbsolute(v: VectorLike | number): this;
|
|
292
|
-
/**
|
|
293
|
-
* @see Vector.divide
|
|
294
|
-
*/
|
|
295
|
-
divideAbsolute(v: VectorLike | number): this;
|
|
296
|
-
/**
|
|
297
|
-
* Converts the vector to an array of its components.
|
|
298
|
-
*/
|
|
299
|
-
toArray<T extends this>(): VectorArray<T>;
|
|
300
|
-
/**
|
|
301
|
-
* Replaces the components of the vector with the components of another vector object.
|
|
302
|
-
* @param v - The object whose components will replace the current vector's components.
|
|
303
|
-
*/
|
|
304
|
-
replace<T extends VectorLike>(v: T): void;
|
|
305
|
-
/**
|
|
306
|
-
* Calculates the length (magnitude) of a vector.
|
|
307
|
-
* @returns The magnitude of the vector.
|
|
308
|
-
*/
|
|
309
|
-
get Length(): number;
|
|
310
|
-
swizzle<T extends VectorSwizzle>(components: T): T extends Vec2Swizzle ? Vector2 : T extends Vec3Swizzle ? Vector3 : Vector4;
|
|
311
|
-
}
|
|
312
|
-
/**
|
|
313
|
-
* Represents a 2-dimensional vector.
|
|
314
|
-
*/
|
|
315
|
-
export declare class Vector2 extends Vector {
|
|
316
|
-
readonly type = ClassTypes.Vector2;
|
|
317
|
-
readonly [size]: number;
|
|
318
|
-
static readonly Zero: Vector2;
|
|
319
|
-
/**
|
|
320
|
-
* Constructs a new 2D vector.
|
|
321
|
-
* @param x The x-component of the vector.
|
|
322
|
-
* @param y The y-component of the vector (optional, defaults to x).
|
|
323
|
-
*/
|
|
324
|
-
constructor(x: number, y?: number);
|
|
325
|
-
/**
|
|
326
|
-
* Creates a new vector based on the provided parameters.
|
|
327
|
-
* @param x The x-component of the vector.
|
|
328
|
-
* @param y The y-component of the vector (optional, defaults to the value of x).
|
|
329
|
-
* @returns A new vector instance.
|
|
330
|
-
*/
|
|
331
|
-
protected static create(x: number | Vec, y?: number): Vector2;
|
|
332
|
-
}
|
|
333
|
-
/**
|
|
334
|
-
* Represents a 3-dimensional vector.
|
|
335
|
-
*/
|
|
336
|
-
export declare class Vector3 extends Vector implements Vec3 {
|
|
337
|
-
readonly type = ClassTypes.Vector3;
|
|
338
|
-
readonly [size]: number;
|
|
339
|
-
z: number;
|
|
340
|
-
static readonly Zero: Vector3;
|
|
341
|
-
static readonly UnitX: Vector3;
|
|
342
|
-
static readonly UnitY: Vector3;
|
|
343
|
-
static readonly UnitZ: Vector3;
|
|
344
|
-
static readonly One: Vector3;
|
|
345
|
-
static readonly Up: Vector3;
|
|
346
|
-
static readonly Down: Vector3;
|
|
347
|
-
static readonly Left: Vector3;
|
|
348
|
-
static readonly Right: Vector3;
|
|
349
|
-
static readonly ForwardRH: Vector3;
|
|
350
|
-
static readonly ForwardLH: Vector3;
|
|
351
|
-
static readonly BackwardRH: Vector3;
|
|
352
|
-
static readonly BackwardLH: Vector3;
|
|
353
|
-
static readonly Backward: Vector3;
|
|
354
|
-
/**
|
|
355
|
-
* Constructs a new 3D vector.
|
|
356
|
-
* @param x The x-component of the vector.
|
|
357
|
-
* @param y The y-component of the vector (optional, defaults to x).
|
|
358
|
-
* @param z The z-component of the vector (optional, defaults to y).
|
|
359
|
-
*/
|
|
360
|
-
constructor(x: number, y?: number, z?: number);
|
|
361
|
-
/**
|
|
362
|
-
* Creates a new vector based on the provided parameters.
|
|
363
|
-
* @param x The x-component of the vector.
|
|
364
|
-
* @param y The y-component of the vector (optional, defaults to the value of x).
|
|
365
|
-
* @param z The z-component of the vector (optional, defaults to the value of y).
|
|
366
|
-
* @returns A new vector instance.
|
|
367
|
-
*/
|
|
368
|
-
protected static create(x: number | Vec, y?: number, z?: number): Vector3;
|
|
369
|
-
/**
|
|
370
|
-
* @see Vector.addZ
|
|
371
|
-
*/
|
|
372
|
-
addZ(z: number): this;
|
|
373
|
-
/**
|
|
374
|
-
* @see Vector.crossProduct
|
|
375
|
-
*/
|
|
376
|
-
crossProduct(v: Vec3 | Vec4): Vec3 | Vec4;
|
|
377
|
-
/**
|
|
378
|
-
* @returns the x and y values as Vec2
|
|
379
|
-
*/
|
|
380
|
-
toVec2(): Vector2;
|
|
381
|
-
}
|
|
382
|
-
/**
|
|
383
|
-
* Represents a 4-dimensional vector.
|
|
384
|
-
*/
|
|
385
|
-
export declare class Vector4 extends Vector {
|
|
386
|
-
readonly type = ClassTypes.Vector4;
|
|
387
|
-
readonly [size]: number;
|
|
388
|
-
z: number;
|
|
389
|
-
w: number;
|
|
390
|
-
static readonly Zero: Vector4;
|
|
391
|
-
/**
|
|
392
|
-
* Constructs a new 4D vector.
|
|
393
|
-
* @param x The x-component of the vector.
|
|
394
|
-
* @param y The y-component of the vector (optional, defaults to x).
|
|
395
|
-
* @param z The z-component of the vector (optional, defaults to y).
|
|
396
|
-
* @param w The w-component of the vector (optional, defaults to z).
|
|
397
|
-
*/
|
|
398
|
-
constructor(x: number, y?: number, z?: number, w?: number);
|
|
399
|
-
/**
|
|
400
|
-
* Creates a new vector based on the provided parameters.
|
|
401
|
-
* @param x The x-component of the vector.
|
|
402
|
-
* @param y The y-component of the vector (optional, defaults to the value of x).
|
|
403
|
-
* @param z The z-component of the vector (optional, defaults to the value of y).
|
|
404
|
-
* @param w The w-component of the vector (optional, defaults to the value of z).
|
|
405
|
-
* @returns A new vector instance.
|
|
406
|
-
*/
|
|
407
|
-
protected static create(x: number | Vec, y?: number, z?: number, w?: number): Vector4;
|
|
408
|
-
/**
|
|
409
|
-
* @see Vector.addZ
|
|
410
|
-
*/
|
|
411
|
-
addZ(z: number): this;
|
|
412
|
-
/**
|
|
413
|
-
* @see Vector.addW
|
|
414
|
-
*/
|
|
415
|
-
addW(w: number): this;
|
|
416
|
-
/**
|
|
417
|
-
* @see Vector.crossProduct
|
|
418
|
-
*/
|
|
419
|
-
crossProduct(v: Vec3 | Vec4): Vec3 | Vec4;
|
|
420
|
-
/**
|
|
421
|
-
* @returns the x and y values as Vec2
|
|
422
|
-
*/
|
|
423
|
-
toVec2(): Vector2;
|
|
424
|
-
/**
|
|
425
|
-
* @returns the x and y values as Vec3
|
|
426
|
-
*/
|
|
427
|
-
toVec3(): Vector3;
|
|
428
|
-
}
|
|
429
|
-
export {};
|