hytopia 0.2.0 → 0.2.2
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/docs/server.quaternion.identity.md +19 -0
- package/docs/server.quaternion.length.md +13 -0
- package/docs/server.quaternion.logarithm.md +19 -0
- package/docs/server.quaternion.magnitude.md +1 -1
- package/docs/server.quaternion.md +114 -2
- package/docs/server.quaternion.power.md +55 -0
- package/docs/server.quaternion.randomize.md +19 -0
- package/docs/server.quaternion.setaxisangle.md +71 -0
- package/docs/server.quaternion.squaredlength.md +13 -0
- package/docs/server.quaternion.squaredmagnitude.md +1 -1
- package/docs/server.vector3.create.md +19 -0
- package/docs/server.vector3.length.md +13 -0
- package/docs/server.vector3.magnitude.md +1 -1
- package/docs/server.vector3.md +144 -2
- package/docs/server.vector3.randomize.md +55 -0
- package/docs/server.vector3.scaleandadd.md +71 -0
- package/docs/server.vector3.squaredlength.md +13 -0
- package/docs/server.vector3.squaredmagnitude.md +1 -1
- package/docs/server.vector3.transformmatrix3.md +55 -0
- package/docs/server.vector3.transformmatrix4.md +55 -0
- package/docs/server.vector3.transformquaternion.md +55 -0
- package/docs/server.vector3.zero.md +19 -0
- package/examples/hole-in-wall-game/index.ts +4 -4
- package/examples/wall-dodge-game/assets/audio/bgm.mp3 +0 -0
- package/examples/wall-dodge-game/index.ts +7 -0
- package/examples/zombies-fps/assets/ui/index.html +7 -1
- package/examples/zombies-fps/classes/EnemyEntity.ts +5 -3
- package/examples/zombies-fps/classes/GameManager.ts +112 -18
- package/examples/zombies-fps/classes/GamePlayerEntity.ts +11 -1
- package/examples/zombies-fps/classes/GunEntity.ts +13 -13
- package/examples/zombies-fps/classes/PurchaseBarrierEntity.ts +1 -0
- package/examples/zombies-fps/index.ts +2 -7
- package/package.json +1 -1
- package/server.api.json +678 -18
- package/server.d.ts +535 -4
- package/server.js +51 -51
- package/examples/ai-agents/bun.lockb +0 -0
- package/examples/big-world/bun.lockb +0 -0
- package/examples/block-entity/bun.lockb +0 -0
- package/examples/child-entity/bun.lockb +0 -0
- package/examples/child-entity/package-lock.json +0 -30
- package/examples/custom-ui/bun.lockb +0 -0
- package/examples/entity-controller/bun.lockb +0 -0
- package/examples/entity-spawn/bun.lockb +0 -0
- package/examples/hole-in-wall-game/bun.lockb +0 -0
- package/examples/lighting/bun.lockb +0 -0
- package/examples/pathfinding/bun.lockb +0 -0
- package/examples/payload-game/bun.lockb +0 -0
- package/examples/wall-dodge-game/bun.lockb +0 -0
- package/examples/zombies-fps/bun.lockb +0 -0
package/server.d.ts
CHANGED
@@ -2119,6 +2119,448 @@ export declare enum LightType {
|
|
2119
2119
|
SPOTLIGHT = 1
|
2120
2120
|
}
|
2121
2121
|
|
2122
|
+
/**
|
2123
|
+
* Represents a 3x3 matrix.
|
2124
|
+
*
|
2125
|
+
* @remarks
|
2126
|
+
* All matrix methods result in mutation of the matrix instance.
|
2127
|
+
* This class extends `Float32Array` to provide an efficient way to
|
2128
|
+
* create and manipulate a 3x3 matrix. Various convenience methods are
|
2129
|
+
* provided for common matrix operations.
|
2130
|
+
*
|
2131
|
+
* @public
|
2132
|
+
*/
|
2133
|
+
declare class Matrix3 extends Float32Array {
|
2134
|
+
constructor(m00: number, m01: number, m02: number, m10: number, m11: number, m12: number, m20: number, m21: number, m22: number);
|
2135
|
+
/** The determinant of the matrix. */
|
2136
|
+
get determinant(): number;
|
2137
|
+
/** The frobenius normal of the matrix. */
|
2138
|
+
get frobeniusNormal(): number;
|
2139
|
+
/**
|
2140
|
+
* Creates a new `Matrix3` instance.
|
2141
|
+
*
|
2142
|
+
* @returns A new `Matrix3` instance.
|
2143
|
+
*/
|
2144
|
+
static create(): Matrix3;
|
2145
|
+
/**
|
2146
|
+
* Creates a new `Matrix3` instance from a `Matrix4` instance.
|
2147
|
+
*
|
2148
|
+
* @param matrix4 - The `Matrix4` instance to create the `Matrix3` instance from.
|
2149
|
+
* @returns A new `Matrix3` instance.
|
2150
|
+
*/
|
2151
|
+
static fromMatrix4(matrix4: Matrix4): Matrix3;
|
2152
|
+
/**
|
2153
|
+
* Creates a new `Matrix3` instance from a `Quaternion` instance.
|
2154
|
+
*
|
2155
|
+
* @param quaternion - The `Quaternion` instance to create the `Matrix3` instance from.
|
2156
|
+
* @returns A new `Matrix3` instance.
|
2157
|
+
*/
|
2158
|
+
static fromQuaternion(quaternion: Quaternion): Matrix3;
|
2159
|
+
/**
|
2160
|
+
* Creates a new `Matrix3` instance from a rotation of identity matrix.
|
2161
|
+
*
|
2162
|
+
* @param angle - The angle in radians to rotate the matrix by.
|
2163
|
+
* @returns A new `Matrix3` instance.
|
2164
|
+
*/
|
2165
|
+
static fromRotation(angle: number): Matrix3;
|
2166
|
+
/**
|
2167
|
+
* Creates a new `Matrix3` instance from a scale of identity matrix.
|
2168
|
+
*
|
2169
|
+
* @param scale - The scale of the matrix.
|
2170
|
+
* @returns A new `Matrix3` instance.
|
2171
|
+
*/
|
2172
|
+
static fromScaling(scale: Vector3): Matrix3;
|
2173
|
+
/**
|
2174
|
+
* Creates a new `Matrix3` instance from a translation of identity matrix.
|
2175
|
+
*
|
2176
|
+
* @param translation - The translation of the matrix.
|
2177
|
+
* @returns A new `Matrix3` instance.
|
2178
|
+
*/
|
2179
|
+
static fromTranslation(translation: Vector3): Matrix3;
|
2180
|
+
/**
|
2181
|
+
* Adds a matrix to the current matrix.
|
2182
|
+
*
|
2183
|
+
* @param matrix3 - The matrix to add to the current matrix.
|
2184
|
+
* @returns The current matrix.
|
2185
|
+
*/
|
2186
|
+
add(matrix3: Matrix3): Matrix3;
|
2187
|
+
/**
|
2188
|
+
* Sets the adjugate of the current matrix.
|
2189
|
+
*
|
2190
|
+
* @returns The current matrix.
|
2191
|
+
*/
|
2192
|
+
adjoint(): Matrix3;
|
2193
|
+
/**
|
2194
|
+
* Clones the current matrix.
|
2195
|
+
*
|
2196
|
+
* @returns A clone of the current matrix.
|
2197
|
+
*/
|
2198
|
+
clone(): Matrix3;
|
2199
|
+
/**
|
2200
|
+
* Copies a matrix to the current matrix.
|
2201
|
+
*
|
2202
|
+
* @param matrix3 - The matrix to copy to the current matrix.
|
2203
|
+
* @returns The current matrix.
|
2204
|
+
*/
|
2205
|
+
copy(matrix3: Matrix3): Matrix3;
|
2206
|
+
/**
|
2207
|
+
* Checks if the current matrix is approximately equal to another matrix.
|
2208
|
+
*
|
2209
|
+
* @param matrix3 - The matrix to compare to the current matrix.
|
2210
|
+
* @returns `true` if the current matrix is equal to the provided matrix, `false` otherwise.
|
2211
|
+
*/
|
2212
|
+
equals(matrix3: Matrix3): boolean;
|
2213
|
+
/**
|
2214
|
+
* Checks if the current matrix is exactly equal to another matrix.
|
2215
|
+
*
|
2216
|
+
* @param matrix3 - The matrix to compare to the current matrix.
|
2217
|
+
* @returns `true` if the current matrix is equal to the provided matrix, `false` otherwise.
|
2218
|
+
*/
|
2219
|
+
exactEquals(matrix3: Matrix3): boolean;
|
2220
|
+
/**
|
2221
|
+
* Sets the current matrix to the identity matrix.
|
2222
|
+
*
|
2223
|
+
* @returns The current matrix.
|
2224
|
+
*/
|
2225
|
+
identity(): Matrix3;
|
2226
|
+
/**
|
2227
|
+
* Inverts the current matrix.
|
2228
|
+
*
|
2229
|
+
* @returns The current matrix.
|
2230
|
+
*/
|
2231
|
+
invert(): Matrix3;
|
2232
|
+
/**
|
2233
|
+
* Multiplies the current matrix by another matrix.
|
2234
|
+
*
|
2235
|
+
* @param matrix3 - The matrix to multiply the current matrix by.
|
2236
|
+
* @returns The current matrix.
|
2237
|
+
*/
|
2238
|
+
multiply(matrix3: Matrix3): Matrix3;
|
2239
|
+
/**
|
2240
|
+
* Multiplies each element of the current matrix by a scalar value.
|
2241
|
+
*
|
2242
|
+
* @param scalar - The scalar value to multiply the current matrix elements by.
|
2243
|
+
* @returns The current matrix.
|
2244
|
+
*/
|
2245
|
+
multiplyScalar(scalar: number): Matrix3;
|
2246
|
+
/**
|
2247
|
+
* Sets the current matrix to a projection matrix with the given bounds.
|
2248
|
+
*
|
2249
|
+
* @param width - The width of the projection.
|
2250
|
+
* @param height - The height of the projection.
|
2251
|
+
* @returns The current matrix.
|
2252
|
+
*/
|
2253
|
+
projection(width: number, height: number): Matrix3;
|
2254
|
+
/**
|
2255
|
+
* Rotates the current matrix by an angle in radians.
|
2256
|
+
*
|
2257
|
+
* @param angle - The angle in radians to rotate the current matrix by.
|
2258
|
+
* @returns The current matrix.
|
2259
|
+
*/
|
2260
|
+
rotate(angle: number): Matrix3;
|
2261
|
+
/**
|
2262
|
+
* Subtracts a matrix from the current matrix.
|
2263
|
+
*
|
2264
|
+
* @param matrix3 - The matrix to subtract from the current matrix.
|
2265
|
+
* @returns The current matrix.
|
2266
|
+
*/
|
2267
|
+
subtract(matrix3: Matrix3): Matrix3;
|
2268
|
+
/**
|
2269
|
+
* Returns a string representation of the current matrix.
|
2270
|
+
*
|
2271
|
+
* @returns A string representation of the current matrix.
|
2272
|
+
*/
|
2273
|
+
toString(): string;
|
2274
|
+
/**
|
2275
|
+
* Transposes the current matrix.
|
2276
|
+
*
|
2277
|
+
* @returns The current matrix.
|
2278
|
+
*/
|
2279
|
+
transpose(): Matrix3;
|
2280
|
+
}
|
2281
|
+
|
2282
|
+
/**
|
2283
|
+
* Represents a 4x4 matrix.
|
2284
|
+
*
|
2285
|
+
* @remarks
|
2286
|
+
* All matrix methods result in mutation of the matrix instance.
|
2287
|
+
* This class extends `Float32Array` to provide an efficient way to
|
2288
|
+
* create and manipulate a 4x4 matrix. Various convenience methods are
|
2289
|
+
* provided for common matrix operations.
|
2290
|
+
*
|
2291
|
+
* @public
|
2292
|
+
*/
|
2293
|
+
declare class Matrix4 extends Float32Array {
|
2294
|
+
constructor(m00: number, m01: number, m02: number, m03: number, m10: number, m11: number, m12: number, m13: number, m20: number, m21: number, m22: number, m23: number, m30: number, m31: number, m32: number, m33: number);
|
2295
|
+
/** The determinant of the matrix. */
|
2296
|
+
get determinant(): number;
|
2297
|
+
/** The frobenius normal of the matrix. */
|
2298
|
+
get frobeniusNormal(): number;
|
2299
|
+
/**
|
2300
|
+
* Creates a new `Matrix4` instance.
|
2301
|
+
*
|
2302
|
+
* @returns A new `Matrix4` instance.
|
2303
|
+
*/
|
2304
|
+
static create(): Matrix4;
|
2305
|
+
/**
|
2306
|
+
* Creates a new `Matrix4` instance from a `Quaternion` object.
|
2307
|
+
*
|
2308
|
+
* @param quaternion - The `Quaternion` object to create the `Matrix4` instance from.
|
2309
|
+
* @returns A new `Matrix4` instance.
|
2310
|
+
*/
|
2311
|
+
static fromQuaternion(quaternion: Quaternion): Matrix4;
|
2312
|
+
/**
|
2313
|
+
* Creates a new `Matrix4` instance from an angle and axis.
|
2314
|
+
*
|
2315
|
+
* @param angle - The angle in radians to rotate the matrix by.
|
2316
|
+
* @param axis - The axis to rotate the matrix around.
|
2317
|
+
* @returns A new `Matrix4` instance.
|
2318
|
+
*/
|
2319
|
+
static fromRotation(angle: number, axis: Vector3): Matrix4;
|
2320
|
+
/**
|
2321
|
+
* Creates a new `Matrix4` instance from a rotation and translation.
|
2322
|
+
*
|
2323
|
+
* @param rotation - The rotation of the matrix.
|
2324
|
+
* @param translation - The translation of the matrix.
|
2325
|
+
* @returns A new `Matrix4` instance.
|
2326
|
+
*/
|
2327
|
+
static fromRotationTranslation(rotation: Quaternion, translation: Vector3): Matrix4;
|
2328
|
+
/**
|
2329
|
+
* Creates a new `Matrix4` instance from a rotation, translation, and scale.
|
2330
|
+
*
|
2331
|
+
* @param rotation - The rotation of the matrix.
|
2332
|
+
* @param translation - The translation of the matrix.
|
2333
|
+
* @param scale - The scale of the matrix.
|
2334
|
+
* @returns A new `Matrix4` instance.
|
2335
|
+
*/
|
2336
|
+
static fromRotationTranslationScale(rotation: Quaternion, translation: Vector3, scale: Vector3): Matrix4;
|
2337
|
+
/**
|
2338
|
+
* Creates a new `Matrix4` instance from a rotation, translation, scale, and origin.
|
2339
|
+
*
|
2340
|
+
* @param rotation - The rotation of the matrix.
|
2341
|
+
* @param translation - The translation of the matrix.
|
2342
|
+
* @param scale - The scale of the matrix.
|
2343
|
+
* @param origin - The origin of the matrix.
|
2344
|
+
* @returns A new `Matrix4` instance.
|
2345
|
+
*/
|
2346
|
+
static fromRotationTranslationScaleOrigin(rotation: Quaternion, translation: Vector3, scale: Vector3, origin: Vector3): Matrix4;
|
2347
|
+
/**
|
2348
|
+
* Creates a new `Matrix4` instance from a scale of identity matrix.
|
2349
|
+
*
|
2350
|
+
* @param scale - The scale of the matrix.
|
2351
|
+
* @returns A new `Matrix4` instance.
|
2352
|
+
*/
|
2353
|
+
static fromScaling(scale: Vector3): Matrix4;
|
2354
|
+
/**
|
2355
|
+
* Creates a new `Matrix4` instance from a translation of identity matrix.
|
2356
|
+
*
|
2357
|
+
* @param translation - The translation of the matrix.
|
2358
|
+
* @returns A new `Matrix4` instance.
|
2359
|
+
*/
|
2360
|
+
static fromTranslation(translation: Vector3): Matrix4;
|
2361
|
+
/**
|
2362
|
+
* Creates a new `Matrix4` instance from an x-rotation of identity matrix.
|
2363
|
+
*
|
2364
|
+
* @param angle - The angle in radians to rotate the matrix by.
|
2365
|
+
* @returns A new `Matrix4` instance.
|
2366
|
+
*/
|
2367
|
+
static fromXRotation(angle: number): Matrix4;
|
2368
|
+
/**
|
2369
|
+
* Creates a new `Matrix4` instance from a y-rotation of identity matrix.
|
2370
|
+
*
|
2371
|
+
* @param angle - The angle in radians to rotate the matrix by.
|
2372
|
+
* @returns A new `Matrix4` instance.
|
2373
|
+
*/
|
2374
|
+
static fromYRotation(angle: number): Matrix4;
|
2375
|
+
/**
|
2376
|
+
* Creates a new `Matrix4` instance from a z-rotation of identity matrix.
|
2377
|
+
*
|
2378
|
+
* @param angle - The angle in radians to rotate the matrix by.
|
2379
|
+
* @returns A new `Matrix4` instance.
|
2380
|
+
*/
|
2381
|
+
static fromZRotation(angle: number): Matrix4;
|
2382
|
+
/**
|
2383
|
+
* Adds a matrix to the current matrix.
|
2384
|
+
*
|
2385
|
+
* @param matrix4 - The matrix to add to the current matrix.
|
2386
|
+
* @returns The current matrix.
|
2387
|
+
*/
|
2388
|
+
add(matrix4: Matrix4): Matrix4;
|
2389
|
+
/**
|
2390
|
+
* Sets the adjugate of the current matrix.
|
2391
|
+
*
|
2392
|
+
* @returns The current matrix.
|
2393
|
+
*/
|
2394
|
+
adjoint(): Matrix4;
|
2395
|
+
/**
|
2396
|
+
* Clones the current matrix.
|
2397
|
+
*
|
2398
|
+
* @returns A clone of the current matrix.
|
2399
|
+
*/
|
2400
|
+
clone(): Matrix4;
|
2401
|
+
/**
|
2402
|
+
* Copies a matrix to the current matrix.
|
2403
|
+
*
|
2404
|
+
* @param matrix4 - The matrix to copy to the current matrix.
|
2405
|
+
* @returns The current matrix.
|
2406
|
+
*/
|
2407
|
+
copy(matrix4: Matrix4): Matrix4;
|
2408
|
+
/**
|
2409
|
+
* Checks if the current matrix is approximately equal to another matrix.
|
2410
|
+
*
|
2411
|
+
* @param matrix4 - The matrix to compare to the current matrix.
|
2412
|
+
* @returns `true` if the current matrix is equal to the provided matrix, `false` otherwise.
|
2413
|
+
*/
|
2414
|
+
equals(matrix4: Matrix4): boolean;
|
2415
|
+
/**
|
2416
|
+
* Checks if the current matrix is exactly equal to another matrix.
|
2417
|
+
*
|
2418
|
+
* @param matrix4 - The matrix to compare to the current matrix.
|
2419
|
+
* @returns `true` if the current matrix is equal to the provided matrix, `false` otherwise.
|
2420
|
+
*/
|
2421
|
+
exactEquals(matrix4: Matrix4): boolean;
|
2422
|
+
/**
|
2423
|
+
* Sets the current matrix to a frustrum matrix with the given bounds.
|
2424
|
+
*
|
2425
|
+
* @param left - The left bound of the projection.
|
2426
|
+
* @param right - The right bound of the projection.
|
2427
|
+
* @param bottom - The bottom bound of the projection.
|
2428
|
+
* @param top - The top bound of the projection.
|
2429
|
+
* @param near - The near bound of the projection.
|
2430
|
+
* @param far - The far bound of the projection.
|
2431
|
+
* @returns The current matrix.
|
2432
|
+
*/
|
2433
|
+
frustrum(left: number, right: number, bottom: number, top: number, near: number, far: number): Matrix4;
|
2434
|
+
/**
|
2435
|
+
* Sets the current matrix to the identity matrix.
|
2436
|
+
*
|
2437
|
+
* @returns The current matrix.
|
2438
|
+
*/
|
2439
|
+
identity(): Matrix4;
|
2440
|
+
/**
|
2441
|
+
* Inverts the current matrix.
|
2442
|
+
*
|
2443
|
+
* @returns The current matrix.
|
2444
|
+
*/
|
2445
|
+
invert(): Matrix4;
|
2446
|
+
/**
|
2447
|
+
* Sets the current matrix to a look-at matrix with the given eye, center, and up vectors.
|
2448
|
+
*
|
2449
|
+
* @param eye - The eye vector of the camera.
|
2450
|
+
* @param center - The center vector of the camera.
|
2451
|
+
* @param up - The up vector of the camera.
|
2452
|
+
* @returns The current matrix.
|
2453
|
+
*/
|
2454
|
+
lookAt(eye: Vector3, center: Vector3, up: Vector3): Matrix4;
|
2455
|
+
/**
|
2456
|
+
* Multiplies the current matrix by another matrix.
|
2457
|
+
*
|
2458
|
+
* @param matrix4 - The matrix to multiply the current matrix by.
|
2459
|
+
* @returns The current matrix.
|
2460
|
+
*/
|
2461
|
+
multiply(matrix4: Matrix4): Matrix4;
|
2462
|
+
/**
|
2463
|
+
* Multiplies each element of the current matrix by a scalar value.
|
2464
|
+
*
|
2465
|
+
* @param scalar - The scalar value to multiply the current matrix elements by.
|
2466
|
+
* @returns The current matrix.
|
2467
|
+
*/
|
2468
|
+
multiplyScalar(scalar: number): Matrix4;
|
2469
|
+
/**
|
2470
|
+
* Sets the current matrix to an orthogonal matrix with the given bounds.
|
2471
|
+
*
|
2472
|
+
* @param left - The left bound of the projection.
|
2473
|
+
* @param right - The right bound of the projection.
|
2474
|
+
* @param bottom - The bottom bound of the projection.
|
2475
|
+
* @param top - The top bound of the projection.
|
2476
|
+
* @param near - The near bound of the projection.
|
2477
|
+
* @param far - The far bound of the projection.
|
2478
|
+
* @returns The current matrix.
|
2479
|
+
*/
|
2480
|
+
orthogonal(left: number, right: number, bottom: number, top: number, near: number, far: number): Matrix4;
|
2481
|
+
/**
|
2482
|
+
* Sets the current matrix to a perspective matrix with the given field of view, aspect ratio, and near and far bounds.
|
2483
|
+
*
|
2484
|
+
* @param fovy - The field of view of the projection.
|
2485
|
+
* @param aspect - The aspect ratio of the projection.
|
2486
|
+
* @param near - The near bound of the projection.
|
2487
|
+
* @param far - The far bound of the projection.
|
2488
|
+
* @returns The current matrix.
|
2489
|
+
*/
|
2490
|
+
perspective(fovy: number, aspect: number, near: number, far: number): Matrix4;
|
2491
|
+
/**
|
2492
|
+
* Rotates the current matrix by an angle in radians around an axis.
|
2493
|
+
*
|
2494
|
+
* @param angle - The angle in radians to rotate the current matrix by.
|
2495
|
+
* @param axis - The axis to rotate the current matrix around.
|
2496
|
+
* @returns The current matrix.
|
2497
|
+
*/
|
2498
|
+
rotate(angle: number, axis: Vector3): Matrix4;
|
2499
|
+
/**
|
2500
|
+
* Rotates the current matrix by an angle in radians around the x-axis.
|
2501
|
+
*
|
2502
|
+
* @param angle - The angle in radians to rotate the current matrix by.
|
2503
|
+
* @returns The current matrix.
|
2504
|
+
*/
|
2505
|
+
rotateX(angle: number): Matrix4;
|
2506
|
+
/**
|
2507
|
+
* Rotates the current matrix by an angle in radians around the y-axis.
|
2508
|
+
*
|
2509
|
+
* @param angle - The angle in radians to rotate the current matrix by.
|
2510
|
+
* @returns The current matrix.
|
2511
|
+
*/
|
2512
|
+
rotateY(angle: number): Matrix4;
|
2513
|
+
/**
|
2514
|
+
* Rotates the current matrix by an angle in radians around the z-axis.
|
2515
|
+
*
|
2516
|
+
* @param angle - The angle in radians to rotate the current matrix by.
|
2517
|
+
* @returns The current matrix.
|
2518
|
+
*/
|
2519
|
+
rotateZ(angle: number): Matrix4;
|
2520
|
+
/**
|
2521
|
+
* Scales the current matrix by a vector.
|
2522
|
+
*
|
2523
|
+
* @param vector3 - The vector to scale the current matrix by.
|
2524
|
+
* @returns The current matrix.
|
2525
|
+
*/
|
2526
|
+
scale(vector3: Vector3): Matrix4;
|
2527
|
+
/**
|
2528
|
+
* Subtracts a matrix from the current matrix.
|
2529
|
+
*
|
2530
|
+
* @param matrix4 - The matrix to subtract from the current matrix.
|
2531
|
+
* @returns The current matrix.
|
2532
|
+
*/
|
2533
|
+
subtract(matrix4: Matrix4): Matrix4;
|
2534
|
+
/**
|
2535
|
+
* Sets the current matrix to a matrix that looks at a target.
|
2536
|
+
*
|
2537
|
+
* @param eye - The eye vector of the camera.
|
2538
|
+
* @param center - The center vector of the camera.
|
2539
|
+
* @param up - The up vector of the camera.
|
2540
|
+
* @returns The current matrix.
|
2541
|
+
*/
|
2542
|
+
targetTo(eye: Vector3, center: Vector3, up: Vector3): Matrix4;
|
2543
|
+
/**
|
2544
|
+
* Returns a string representation of the current matrix.
|
2545
|
+
*
|
2546
|
+
* @returns A string representation of the current matrix.
|
2547
|
+
*/
|
2548
|
+
toString(): string;
|
2549
|
+
/**
|
2550
|
+
* Translates the current matrix by a vector.
|
2551
|
+
*
|
2552
|
+
* @param vector3 - The vector to translate the current matrix by.
|
2553
|
+
* @returns The current matrix.
|
2554
|
+
*/
|
2555
|
+
translate(vector3: Vector3): Matrix4;
|
2556
|
+
/**
|
2557
|
+
* Transposes the current matrix.
|
2558
|
+
*
|
2559
|
+
* @returns The current matrix.
|
2560
|
+
*/
|
2561
|
+
transpose(): Matrix4;
|
2562
|
+
}
|
2563
|
+
|
2122
2564
|
/** A bounding box for a model. @public */
|
2123
2565
|
declare type ModelBoundingBox = {
|
2124
2566
|
min: Vector3Like;
|
@@ -2953,9 +3395,13 @@ export declare const PORT: string | 8080;
|
|
2953
3395
|
*/
|
2954
3396
|
export declare class Quaternion extends Float32Array implements QuaternionLike {
|
2955
3397
|
constructor(x: number, y: number, z: number, w: number);
|
2956
|
-
/** The
|
3398
|
+
/** The length of the quaternion. */
|
3399
|
+
get length(): number;
|
3400
|
+
/** The squared length of the quaternion. */
|
3401
|
+
get squaredLength(): number;
|
3402
|
+
/** The magnitude of the quaternion. Alias for `.length`. */
|
2957
3403
|
get magnitude(): number;
|
2958
|
-
/** The squared magnitude of the quaternion.
|
3404
|
+
/** The squared magnitude of the quaternion. Alias for `.squaredLength`. */
|
2959
3405
|
get squaredMagnitude(): number;
|
2960
3406
|
/** The x-component of the quaternion. */
|
2961
3407
|
get x(): number;
|
@@ -3036,6 +3482,12 @@ export declare class Quaternion extends Float32Array implements QuaternionLike {
|
|
3036
3482
|
* @returns The angle in degrees.
|
3037
3483
|
*/
|
3038
3484
|
getAngle(quaternion: Quaternion): number;
|
3485
|
+
/**
|
3486
|
+
* Sets the current quaternion to the identity quaternion.
|
3487
|
+
*
|
3488
|
+
* @returns The current quaternion.
|
3489
|
+
*/
|
3490
|
+
identity(): Quaternion;
|
3039
3491
|
/**
|
3040
3492
|
* Inverts each component of the quaternion.
|
3041
3493
|
*
|
@@ -3050,6 +3502,12 @@ export declare class Quaternion extends Float32Array implements QuaternionLike {
|
|
3050
3502
|
* @returns The current quaternion.
|
3051
3503
|
*/
|
3052
3504
|
lerp(quaternion: Quaternion, t: number): Quaternion;
|
3505
|
+
/**
|
3506
|
+
* Sets the current quaternion to its natural logarithm.
|
3507
|
+
*
|
3508
|
+
* @returns The current quaternion.
|
3509
|
+
*/
|
3510
|
+
logarithm(): Quaternion;
|
3053
3511
|
/**
|
3054
3512
|
* Multiplies the quaternion by another quaternion.
|
3055
3513
|
*
|
@@ -3063,6 +3521,19 @@ export declare class Quaternion extends Float32Array implements QuaternionLike {
|
|
3063
3521
|
* @returns The current quaternion.
|
3064
3522
|
*/
|
3065
3523
|
normalize(): Quaternion;
|
3524
|
+
/**
|
3525
|
+
* Raises the current quaternion to a power.
|
3526
|
+
*
|
3527
|
+
* @param exponent - The exponent to raise the quaternion to.
|
3528
|
+
* @returns The current quaternion.
|
3529
|
+
*/
|
3530
|
+
power(exponent: number): Quaternion;
|
3531
|
+
/**
|
3532
|
+
* Randomizes the current quaternion.
|
3533
|
+
*
|
3534
|
+
* @returns The current quaternion.
|
3535
|
+
*/
|
3536
|
+
randomize(): Quaternion;
|
3066
3537
|
/**
|
3067
3538
|
* Rotates the quaternion around the x-axis.
|
3068
3539
|
*
|
@@ -3091,6 +3562,14 @@ export declare class Quaternion extends Float32Array implements QuaternionLike {
|
|
3091
3562
|
* @returns The current quaternion.
|
3092
3563
|
*/
|
3093
3564
|
scale(scale: number): Quaternion;
|
3565
|
+
/**
|
3566
|
+
* Sets the current quaternion to the angle and rotation axis.
|
3567
|
+
*
|
3568
|
+
* @param axis - The axis to rotate around.
|
3569
|
+
* @param angle - The angle to rotate in radians.
|
3570
|
+
* @returns The current quaternion.
|
3571
|
+
*/
|
3572
|
+
setAxisAngle(axis: Vector3, angle: number): Quaternion;
|
3094
3573
|
/**
|
3095
3574
|
* Spherically interpolates between the current quaternion and another quaternion.
|
3096
3575
|
*
|
@@ -3899,9 +4378,13 @@ export declare const SUPPORTED_INPUT_KEYS: readonly ["w", "a", "s", "d", "sp", "
|
|
3899
4378
|
*/
|
3900
4379
|
export declare class Vector3 extends Float32Array implements Vector3Like {
|
3901
4380
|
constructor(x: number, y: number, z: number);
|
3902
|
-
/** The
|
4381
|
+
/** The length of the vector. */
|
4382
|
+
get length(): number;
|
4383
|
+
/** The squared length of the vector. */
|
4384
|
+
get squaredLength(): number;
|
4385
|
+
/** The magnitude of the vector. Alias for `length`. */
|
3903
4386
|
get magnitude(): number;
|
3904
|
-
/** The squared magnitude of the vector.
|
4387
|
+
/** The squared magnitude of the vector. Alias for `squaredLength`. */
|
3905
4388
|
get squaredMagnitude(): number;
|
3906
4389
|
/** The x-component of the vector. */
|
3907
4390
|
get x(): number;
|
@@ -3912,6 +4395,12 @@ export declare class Vector3 extends Float32Array implements Vector3Like {
|
|
3912
4395
|
/** The z-component of the vector. */
|
3913
4396
|
get z(): number;
|
3914
4397
|
set z(value: number);
|
4398
|
+
/**
|
4399
|
+
* Creates a new `Vector3` instance.
|
4400
|
+
*
|
4401
|
+
* @returns A new `Vector3` instance.
|
4402
|
+
*/
|
4403
|
+
static create(): Vector3;
|
3915
4404
|
/**
|
3916
4405
|
* Creates a new `Vector3` instance from a `Vector3Like` object.
|
3917
4406
|
*
|
@@ -4033,6 +4522,13 @@ export declare class Vector3 extends Float32Array implements Vector3Like {
|
|
4033
4522
|
* @returns The current vector.
|
4034
4523
|
*/
|
4035
4524
|
normalize(): Vector3;
|
4525
|
+
/**
|
4526
|
+
* Randomizes the vector.
|
4527
|
+
*
|
4528
|
+
* @param scale - Length of the resulting vector, if omitted a unit vector is set.
|
4529
|
+
* @returns The current vector.
|
4530
|
+
*/
|
4531
|
+
randomize(scale?: number): Vector3;
|
4036
4532
|
/**
|
4037
4533
|
* Rotates the vector around the x-axis.
|
4038
4534
|
*
|
@@ -4070,6 +4566,14 @@ export declare class Vector3 extends Float32Array implements Vector3Like {
|
|
4070
4566
|
* @returns The current vector.
|
4071
4567
|
*/
|
4072
4568
|
scale(scale: number): Vector3;
|
4569
|
+
/**
|
4570
|
+
* Adds 2 vectors together after scaling the provided vector by a scalar value.
|
4571
|
+
*
|
4572
|
+
* @param vector3 - The vector to add the scaled vector to.
|
4573
|
+
* @param scale - The scalar value to scale the current vector by.
|
4574
|
+
* @returns The current vector.
|
4575
|
+
*/
|
4576
|
+
scaleAndAdd(vector3: Vector3, scale: number): Vector3;
|
4073
4577
|
/**
|
4074
4578
|
* Subtracts a vector from the current vector.
|
4075
4579
|
*
|
@@ -4083,6 +4587,33 @@ export declare class Vector3 extends Float32Array implements Vector3Like {
|
|
4083
4587
|
* @returns A string representation of the vector in the format x,y,z.
|
4084
4588
|
*/
|
4085
4589
|
toString(): string;
|
4590
|
+
/**
|
4591
|
+
* Transforms the vector by a matrix3.
|
4592
|
+
*
|
4593
|
+
* @param matrix3 - The matrix3 to transform the vector by.
|
4594
|
+
* @returns The current vector.
|
4595
|
+
*/
|
4596
|
+
transformMatrix3(matrix3: Matrix3): Vector3;
|
4597
|
+
/**
|
4598
|
+
* Transforms the vector by a matrix4.
|
4599
|
+
*
|
4600
|
+
* @param matrix4 - The matrix4 to transform the vector by.
|
4601
|
+
* @returns The current vector.
|
4602
|
+
*/
|
4603
|
+
transformMatrix4(matrix4: Matrix4): Vector3;
|
4604
|
+
/**
|
4605
|
+
* Transforms the vector by a quaternion.
|
4606
|
+
*
|
4607
|
+
* @param quaternion - The quaternion to transform the vector by.
|
4608
|
+
* @returns The current vector.
|
4609
|
+
*/
|
4610
|
+
transformQuaternion(quaternion: Quaternion): Vector3;
|
4611
|
+
/**
|
4612
|
+
* Sets each component of the vector to zero.
|
4613
|
+
*
|
4614
|
+
* @returns The current vector.
|
4615
|
+
*/
|
4616
|
+
zero(): Vector3;
|
4086
4617
|
}
|
4087
4618
|
|
4088
4619
|
/** A 3-dimensional vector of boolean values. @public */
|