فهرست منبع

Added width/height aliases

WestLangley 6 سال پیش
والد
کامیت
5d7e094f68
3فایلهای تغییر یافته به همراه44 افزوده شده و 0 حذف شده
  1. 6 0
      docs/api/en/math/Vector4.html
  2. 2 0
      src/math/Vector4.d.ts
  3. 36 0
      src/math/Vector4.js

+ 6 - 0
docs/api/en/math/Vector4.html

@@ -78,6 +78,12 @@ var d = a.dot( b );
 
 		<h3>[property:Float w]</h3>
 
+		<h3>[property:Float width]</h3>
+		<p>Alias for [page:.z z].</p>
+
+		<h3>[property:Float height]</h3>
+		<p>Alias for [page:.w w].</p>
+
 
 		<h2>Methods</h2>
 

+ 2 - 0
src/math/Vector4.d.ts

@@ -21,6 +21,8 @@ export class Vector4 implements Vector {
 	y: number;
 	z: number;
 	w: number;
+	width: number;
+	height: number;
 	isVector4: true;
 
 	/**

+ 36 - 0
src/math/Vector4.js

@@ -15,6 +15,42 @@ function Vector4( x, y, z, w ) {
 
 }
 
+Object.defineProperties( Vector4.prototype, {
+
+	"width": {
+
+		get: function () {
+
+			return this.z;
+
+		},
+
+		set: function ( value ) {
+
+			this.z = value;
+
+		}
+
+	},
+
+	"height": {
+
+		get: function () {
+
+			return this.w;
+
+		},
+
+		set: function ( value ) {
+
+			this.w = value;
+
+		}
+
+	}
+
+} );
+
 Object.assign( Vector4.prototype, {
 
 	isVector4: true,