Skip to content

Commit d987638

Browse files
committed
fix lookatRH
1 parent 20ae4ce commit d987638

File tree

8 files changed

+16
-25
lines changed

8 files changed

+16
-25
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.0.1 (May 13th 2020)
2+
-----------------------------
3+
* fix lookAtRH() method in Matrix4x3 class
4+
15
Version 2.0.0 (May 09th 2020)
26
-----------------------------
37
* New Matrix3x3 class

dist/type6.d.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -176,19 +176,6 @@ export declare class Trigonometry {
176176
private static taylorSerie;
177177
}
178178

179-
180-
181-
182-
183-
184-
185-
186-
187-
188-
189-
190-
191-
192179
export declare type AxisNames2d = 'x' | 'y';
193180
export declare type AxisNames3d = AxisNames2d & 'z';
194181
export declare class Utils {

dist/type6.iife.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,9 +1004,9 @@ var Type6 = (function (exports) {
10041004
return this;
10051005
};
10061006
Matrix4x3.prototype.lookAtRH = function (eye, target, up) {
1007-
this.zAxis.subtractVectors(eye, target).normalize();
1008-
this.xAxis.crossVectors(up, this.zAxis).normalize();
1009-
this.yAxis.crossVectors(this.zAxis, this.xAxis);
1007+
this.zAxis.copy(eye).subtract(target).normalize();
1008+
this.xAxis.copy(up).cross(this.zAxis).normalize();
1009+
this.yAxis.copy(this.zAxis).cross(this.xAxis);
10101010
this.make(this.xAxis.x, this.yAxis.x, this.zAxis.x, this.xAxis.y, this.yAxis.y, this.zAxis.y, this.xAxis.z, this.yAxis.z, this.zAxis.z, -this.xAxis.dotProduct(eye), -this.yAxis.dotProduct(eye), -this.zAxis.dotProduct(eye));
10111011
return this;
10121012
};

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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,9 +1010,9 @@ class Matrix4x3 {
10101010
return this;
10111011
}
10121012
lookAtRH(eye, target, up) {
1013-
this.zAxis.subtractVectors(eye, target).normalize();
1014-
this.xAxis.crossVectors(up, this.zAxis).normalize();
1015-
this.yAxis.crossVectors(this.zAxis, this.xAxis);
1013+
this.zAxis.copy(eye).subtract(target).normalize();
1014+
this.xAxis.copy(up).cross(this.zAxis).normalize();
1015+
this.yAxis.copy(this.zAxis).cross(this.xAxis);
10161016
this.make(this.xAxis.x, this.yAxis.x, this.zAxis.x, this.xAxis.y, this.yAxis.y, this.zAxis.y, this.xAxis.z, this.yAxis.z, this.zAxis.z, -this.xAxis.dotProduct(eye), -this.yAxis.dotProduct(eye), -this.zAxis.dotProduct(eye));
10171017
return this;
10181018
}

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.0",
3+
"version": "2.0.1",
44
"description": "Mathematics library written in TypeScript",
55
"keywords": [
66
"maths",

src/ts/matrices/matrix4x3.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@ export class Matrix4x3 {
156156

157157
public lookAtRH(eye: Vector3, target: Vector3, up: Vector3): Matrix4x3 {
158158

159-
this.zAxis.subtractVectors(eye, target).normalize(); // The "forward" vector.
160-
this.xAxis.crossVectors(up,this.zAxis).normalize(); // The "right" vector.
161-
this.yAxis.crossVectors(this.zAxis,this.xAxis);// The "up" vector.
159+
this.zAxis.copy(eye).subtract(target).normalize(); // The "forward" vector.
160+
this.xAxis.copy(up).cross(this.zAxis).normalize(); // The "right" vector.
161+
this.yAxis.copy(this.zAxis).cross(this.xAxis);// The "up" vector.
162162

163163
// Create a view matrix from the right, up, forward and eye position vectors
164164
this.make( this.xAxis.x, this.yAxis.x, this.zAxis.x,

web/public/js/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.

0 commit comments

Comments
 (0)