Skip to content

Commit

Permalink
delete setFromArray method in vectors classes
Browse files Browse the repository at this point in the history
  • Loading branch information
LCluber committed Aug 29, 2020
1 parent 104873d commit c62e71c
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 63 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Version 2.1.0 (August 29th 2020)
-----------------------------
* delete setFromArray() method in Vector2 and Vector3 classes

Version 2.0.1 (May 13th 2020)
-----------------------------
* fix lookAtRH() method in Matrix4x3 class
Expand Down
5 changes: 0 additions & 5 deletions dist/type6.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ export declare class Vector2 {
constructor(x?: number, y?: number);
isOrigin(): boolean;
isPositive(): boolean;
setFromArray(array: number[], offset?: number): Vector2;
toArray(): number[];
toString(): string;
set(x: number, y: number): Vector2;
Expand Down Expand Up @@ -255,17 +254,13 @@ export declare class Vector2 {
lerp(min: Vector2, max: Vector2, amount: number): Vector2;
dotProduct(v: Vector2): number;
}
export interface Vector3 {
[key: string]: any;
}
export declare class Vector3 {
x: number;
y: number;
z: number;
constructor(x?: number, y?: number, z?: number);
isOrigin(): boolean;
isPositive(): boolean;
setFromArray(array: number[], offset?: number): Vector3;
toArray(): number[];
toString(): string;
set(x: number, y: number, z: number): Vector3;
Expand Down
17 changes: 0 additions & 17 deletions dist/type6.iife.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,14 +309,6 @@ var Type6 = (function (exports) {
Vector2.prototype.isPositive = function () {
return this.x >= 0 && this.y >= 0 ? true : false;
};
Vector2.prototype.setFromArray = function (array, offset) {
if (offset === undefined) {
offset = 0;
}
this.x = array[offset];
this.y = array[offset + 1];
return this;
};
Vector2.prototype.toArray = function () {
return [this.x, this.y];
};
Expand Down Expand Up @@ -692,15 +684,6 @@ var Type6 = (function (exports) {
Vector3.prototype.isPositive = function () {
return this.x >= 0 && this.y >= 0 && this.z >= 0 ? true : false;
};
Vector3.prototype.setFromArray = function (array, offset) {
if (offset === undefined) {
offset = 0;
}
this.x = array[offset];
this.y = array[offset + 1];
this.z = array[offset + 2];
return this;
};
Vector3.prototype.toArray = function () {
return [this.x, this.y, this.z];
};
Expand Down
2 changes: 1 addition & 1 deletion dist/type6.iife.min.js

Large diffs are not rendered by default.

17 changes: 0 additions & 17 deletions dist/type6.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,14 +334,6 @@ class Vector2 {
isPositive() {
return (this.x >= 0 && this.y >= 0) ? true : false;
}
setFromArray(array, offset) {
if (offset === undefined) {
offset = 0;
}
this.x = array[offset];
this.y = array[offset + 1];
return this;
}
toArray() {
return [this.x, this.y];
}
Expand Down Expand Up @@ -702,15 +694,6 @@ class Vector3 {
isPositive() {
return (this.x >= 0 && this.y >= 0 && this.z >= 0) ? true : false;
}
setFromArray(array, offset) {
if (offset === undefined) {
offset = 0;
}
this.x = array[offset];
this.y = array[offset + 1];
this.z = array[offset + 2];
return this;
}
toArray() {
return [this.x, this.y, this.z];
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lcluber/type6js",
"version": "2.0.1",
"version": "2.1.0",
"description": "Mathematics library for Javascript",
"keywords": [
"maths",
Expand Down
9 changes: 0 additions & 9 deletions src/vectors/vector2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,6 @@ export class Vector2 {
return ( this.x >= 0 && this.y >= 0 ) ? true : false;
}

public setFromArray( array: number[], offset?: number ): Vector2 {
if ( offset === undefined ){
offset = 0;
}
this.x = array[ offset ];
this.y = array[ offset + 1 ];
return this;
}

public toArray(): number[] {
return [ this.x, this.y ];
}
Expand Down
16 changes: 3 additions & 13 deletions src/vectors/vector3.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

export interface Vector3 {
[key: string]: any;
}
// export interface Vector3 {
// [key: string]: any;
// }

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

public setFromArray( array: number[], offset?: number ): Vector3 {
if ( offset === undefined ){
offset = 0;
}
this.x = array[ offset ];
this.y = array[ offset + 1 ];
this.z = array[ offset + 2 ];
return this;
}

public toArray(): number[] {
return [ this.x, this.y, this.z ];
}
Expand Down

0 comments on commit c62e71c

Please sign in to comment.