r3-legacy/bak/r3-matrix-3.js

37 lines
586 B
JavaScript
Raw Permalink Normal View History

2016-10-14 12:32:53 +02:00
/**
* Matrix 3 Maths
2018-04-09 10:05:13 +02:00
* @param row0 R3.API.Vector3
* @param row1 R3.API.Vector3
* @param row2 R3.API.Vector3
2016-10-14 12:32:53 +02:00
* @constructor
*/
2018-04-09 10:05:13 +02:00
R3.Matrix3 = function(
2016-10-14 12:32:53 +02:00
row0,
row1,
row2
) {
this.identity();
if (row0) {
this.rows[0] = row0;
}
if (row1) {
this.rows[1] = row1;
}
if (row2) {
this.rows[2] = row2;
}
};
/**
* Set matrix to identity
*/
2018-04-09 10:05:13 +02:00
R3.Matrix3.prototype.identity = function () {
2016-10-14 12:32:53 +02:00
this.rows = [
2018-04-09 10:05:13 +02:00
new R3.API.Vector3(1, 0, 0),
new R3.API.Vector3(0, 1, 0),
new R3.API.Vector3(0, 0, 1)
2016-10-14 12:32:53 +02:00
];
};