@fimbul-works/vec 1.0.2 → 1.1.0
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/README.md +10 -0
- package/VEC2.md +147 -0
- package/VEC3.md +172 -0
- package/VEC4.md +161 -0
- package/dist/cjs/index.js +19 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/vec2.js +882 -0
- package/dist/{vec3.d.ts → cjs/vec3.d.ts} +46 -2
- package/dist/cjs/vec3.js +1047 -0
- package/dist/{vec4.d.ts → cjs/vec4.d.ts} +56 -1
- package/dist/cjs/vec4.js +1101 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/vec2.d.ts +531 -0
- package/dist/{vec2.js → esm/vec2.js} +1 -0
- package/dist/esm/vec3.d.ts +599 -0
- package/dist/{vec3.js → esm/vec3.js} +71 -2
- package/dist/esm/vec4.d.ts +584 -0
- package/dist/{vec4.js → esm/vec4.js} +87 -6
- package/package.json +74 -70
- /package/dist/{index.d.ts → cjs/index.d.ts} +0 -0
- /package/dist/{vec2.d.ts → cjs/vec2.d.ts} +0 -0
- /package/dist/{index.js → esm/index.d.ts} +0 -0
|
@@ -130,6 +130,10 @@ export declare class Vec3 {
|
|
|
130
130
|
readonly y: number;
|
|
131
131
|
readonly z: number;
|
|
132
132
|
readonly xyz: readonly number[];
|
|
133
|
+
readonly r: number;
|
|
134
|
+
readonly g: number;
|
|
135
|
+
readonly b: number;
|
|
136
|
+
readonly rgb: readonly number[];
|
|
133
137
|
readonly magnitude: number;
|
|
134
138
|
readonly magnitudeSq: number;
|
|
135
139
|
readonly angleX: number;
|
|
@@ -289,10 +293,50 @@ export declare class Vec3 {
|
|
|
289
293
|
*/
|
|
290
294
|
get xyz(): [number, number, number];
|
|
291
295
|
/**
|
|
292
|
-
* Sets
|
|
296
|
+
* Sets all components of the vector at once.
|
|
293
297
|
* @param xyz - An array containing the new x, y and z components.
|
|
294
298
|
*/
|
|
295
|
-
set xyz(xyz: [number, number, number]
|
|
299
|
+
set xyz(xyz: [number, number, number]);
|
|
300
|
+
/**
|
|
301
|
+
* Gets the Red-component of a Color.
|
|
302
|
+
* @returns The Red-component.
|
|
303
|
+
*/
|
|
304
|
+
get r(): number;
|
|
305
|
+
/**
|
|
306
|
+
* Sets the Red-component of a Color.
|
|
307
|
+
* @param r - The new Red-component.
|
|
308
|
+
*/
|
|
309
|
+
set r(r: number);
|
|
310
|
+
/**
|
|
311
|
+
* Gets the Green-component of a Color.
|
|
312
|
+
* @returns The Green-component.
|
|
313
|
+
*/
|
|
314
|
+
get g(): number;
|
|
315
|
+
/**
|
|
316
|
+
* Sets the Green-component of the Color.
|
|
317
|
+
* @param g - The new Green-component.
|
|
318
|
+
*/
|
|
319
|
+
set g(g: number);
|
|
320
|
+
/**
|
|
321
|
+
* Gets the Blue-component of the color.
|
|
322
|
+
* @returns The Blue-component.
|
|
323
|
+
*/
|
|
324
|
+
get b(): number;
|
|
325
|
+
/**
|
|
326
|
+
* Sets the Blue-component of the Color.
|
|
327
|
+
* @param b - The new Blue-component.
|
|
328
|
+
*/
|
|
329
|
+
set b(b: number);
|
|
330
|
+
/**
|
|
331
|
+
* Gets a copy of the vector's components as an array.
|
|
332
|
+
* @returns An array containing the x, y and z components of the vector.
|
|
333
|
+
*/
|
|
334
|
+
get rgb(): [number, number, number];
|
|
335
|
+
/**
|
|
336
|
+
* Sets all components of the Color at once.
|
|
337
|
+
* @param rgb - An array containing the new Red, Green and Blue components.
|
|
338
|
+
*/
|
|
339
|
+
set rgb(rgb: [number, number, number]);
|
|
296
340
|
/**
|
|
297
341
|
* Gets the angle between the vector and the positive x-axis in radians.
|
|
298
342
|
* @returns The angle in radians, always in the range [0, 2π).
|