Skip to content

Commit c62e71c

Browse files
committed
delete setFromArray method in vectors classes
1 parent 104873d commit c62e71c

File tree

8 files changed

+9
-63
lines changed

8 files changed

+9
-63
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Version 2.1.0 (August 29th 2020)
2+
-----------------------------
3+
* delete setFromArray() method in Vector2 and Vector3 classes
4+
15
Version 2.0.1 (May 13th 2020)
26
-----------------------------
37
* fix lookAtRH() method in Matrix4x3 class

dist/type6.d.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ export declare class Vector2 {
215215
constructor(x?: number, y?: number);
216216
isOrigin(): boolean;
217217
isPositive(): boolean;
218-
setFromArray(array: number[], offset?: number): Vector2;
219218
toArray(): number[];
220219
toString(): string;
221220
set(x: number, y: number): Vector2;
@@ -255,17 +254,13 @@ export declare class Vector2 {
255254
lerp(min: Vector2, max: Vector2, amount: number): Vector2;
256255
dotProduct(v: Vector2): number;
257256
}
258-
export interface Vector3 {
259-
[key: string]: any;
260-
}
261257
export declare class Vector3 {
262258
x: number;
263259
y: number;
264260
z: number;
265261
constructor(x?: number, y?: number, z?: number);
266262
isOrigin(): boolean;
267263
isPositive(): boolean;
268-
setFromArray(array: number[], offset?: number): Vector3;
269264
toArray(): number[];
270265
toString(): string;
271266
set(x: number, y: number, z: number): Vector3;

dist/type6.iife.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -309,14 +309,6 @@ var Type6 = (function (exports) {
309309
Vector2.prototype.isPositive = function () {
310310
return this.x >= 0 && this.y >= 0 ? true : false;
311311
};
312-
Vector2.prototype.setFromArray = function (array, offset) {
313-
if (offset === undefined) {
314-
offset = 0;
315-
}
316-
this.x = array[offset];
317-
this.y = array[offset + 1];
318-
return this;
319-
};
320312
Vector2.prototype.toArray = function () {
321313
return [this.x, this.y];
322314
};
@@ -692,15 +684,6 @@ var Type6 = (function (exports) {
692684
Vector3.prototype.isPositive = function () {
693685
return this.x >= 0 && this.y >= 0 && this.z >= 0 ? true : false;
694686
};
695-
Vector3.prototype.setFromArray = function (array, offset) {
696-
if (offset === undefined) {
697-
offset = 0;
698-
}
699-
this.x = array[offset];
700-
this.y = array[offset + 1];
701-
this.z = array[offset + 2];
702-
return this;
703-
};
704687
Vector3.prototype.toArray = function () {
705688
return [this.x, this.y, this.z];
706689
};

dist/type6.iife.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/type6.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -334,14 +334,6 @@ class Vector2 {
334334
isPositive() {
335335
return (this.x >= 0 && this.y >= 0) ? true : false;
336336
}
337-
setFromArray(array, offset) {
338-
if (offset === undefined) {
339-
offset = 0;
340-
}
341-
this.x = array[offset];
342-
this.y = array[offset + 1];
343-
return this;
344-
}
345337
toArray() {
346338
return [this.x, this.y];
347339
}
@@ -702,15 +694,6 @@ class Vector3 {
702694
isPositive() {
703695
return (this.x >= 0 && this.y >= 0 && this.z >= 0) ? true : false;
704696
}
705-
setFromArray(array, offset) {
706-
if (offset === undefined) {
707-
offset = 0;
708-
}
709-
this.x = array[offset];
710-
this.y = array[offset + 1];
711-
this.z = array[offset + 2];
712-
return this;
713-
}
714697
toArray() {
715698
return [this.x, this.y, this.z];
716699
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lcluber/type6js",
3-
"version": "2.0.1",
3+
"version": "2.1.0",
44
"description": "Mathematics library for Javascript",
55
"keywords": [
66
"maths",

src/vectors/vector2.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,6 @@ export class Vector2 {
2626
return ( this.x >= 0 && this.y >= 0 ) ? true : false;
2727
}
2828

29-
public setFromArray( array: number[], offset?: number ): Vector2 {
30-
if ( offset === undefined ){
31-
offset = 0;
32-
}
33-
this.x = array[ offset ];
34-
this.y = array[ offset + 1 ];
35-
return this;
36-
}
37-
3829
public toArray(): number[] {
3930
return [ this.x, this.y ];
4031
}

src/vectors/vector3.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

2-
export interface Vector3 {
3-
[key: string]: any;
4-
}
2+
// export interface Vector3 {
3+
// [key: string]: any;
4+
// }
55

66
export class Vector3 {
77
public x: number;
@@ -23,16 +23,6 @@ export class Vector3 {
2323
return ( this.x >= 0 && this.y >= 0 && this.z >= 0) ? true : false;
2424
}
2525

26-
public setFromArray( array: number[], offset?: number ): Vector3 {
27-
if ( offset === undefined ){
28-
offset = 0;
29-
}
30-
this.x = array[ offset ];
31-
this.y = array[ offset + 1 ];
32-
this.z = array[ offset + 2 ];
33-
return this;
34-
}
35-
3626
public toArray(): number[] {
3727
return [ this.x, this.y, this.z ];
3828
}

0 commit comments

Comments
 (0)