@@ -26,6 +26,19 @@
*/
export class Matrix2 {
+ static {
+
+ /**
+ * This flag can be used for type testing.
+ *
+ * @type {boolean}
+ * @readonly
+ * @default true
+ */
+ Matrix2.prototype.isMatrix2 = true;
+ }
/**
* Constructs a new 2x2 matrix. The arguments are supposed to be
* in row-major order. If no arguments are provided, the constructor
@@ -38,15 +51,6 @@ export class Matrix2 {
constructor( n11, n12, n21, n22 ) {
- /**
- * This flag can be used for type testing.
- *
- * @type {boolean}
- * @readonly
- * @default true
- */
- Matrix2.prototype.isMatrix2 = true;
-
* A column-major list of matrix values.
*
@@ -28,6 +28,19 @@
class Matrix3 {
+ Matrix3.prototype.isMatrix3 = true;
* Constructs a new 3x3 matrix. The arguments are supposed to be
@@ -45,15 +58,6 @@ class Matrix3 {
constructor( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) {
- Matrix3.prototype.isMatrix3 = true;
@@ -41,6 +41,19 @@ import { Vector3 } from './Vector3.js';
class Matrix4 {
+ Matrix4.prototype.isMatrix4 = true;
* Constructs a new 4x4 matrix. The arguments are supposed to be
@@ -65,15 +78,6 @@ class Matrix4 {
constructor( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) {
- Matrix4.prototype.isMatrix4 = true;
@@ -27,13 +27,7 @@ import { clamp } from './MathUtils.js';
class Vector2 {
- * Constructs a new 2D vector.
- * @param {number} [x=0] - The x value of this vector.
- * @param {number} [y=0] - The y value of this vector.
- constructor( x = 0, y = 0 ) {
* This flag can be used for type testing.
@@ -44,6 +38,16 @@ class Vector2 {
Vector2.prototype.isVector2 = true;
+ * Constructs a new 2D vector.
+ * @param {number} [x=0] - The x value of this vector.
+ * @param {number} [y=0] - The y value of this vector.
+ constructor( x = 0, y = 0 ) {
* The x value of this vector.
@@ -28,14 +28,7 @@ import { Quaternion } from './Quaternion.js';
class Vector3 {
- * Constructs a new 3D vector.
- * @param {number} [z=0] - The z value of this vector.
- constructor( x = 0, y = 0, z = 0 ) {
@@ -46,6 +39,17 @@ class Vector3 {
Vector3.prototype.isVector3 = true;
+ * Constructs a new 3D vector.
+ * @param {number} [z=0] - The z value of this vector.
+ constructor( x = 0, y = 0, z = 0 ) {
@@ -26,15 +26,7 @@ import { clamp } from './MathUtils.js';
class Vector4 {
- * Constructs a new 4D vector.
- * @param {number} [w=1] - The w value of this vector.
- constructor( x = 0, y = 0, z = 0, w = 1 ) {
@@ -45,6 +37,18 @@ class Vector4 {
Vector4.prototype.isVector4 = true;
+ * Constructs a new 4D vector.
+ * @param {number} [w=1] - The w value of this vector.
+ constructor( x = 0, y = 0, z = 0, w = 1 ) {