Pryme8 Posted February 2, 2018 Share Posted February 2, 2018 So I wrote up a quick script to compile a script that could effectively add swizzle functions to the Vec2, Vec3, and Quat Objects. It compiles really quick and the results of it are : BABYLON.Vector2.prototype.xx = BABYLON.Vector3.prototype.xx = BABYLON.Quaternion.prototype.xx = function(){return new BABYLON.Vector2(this.x,this.x);} BABYLON.Vector2.prototype.yx = BABYLON.Vector3.prototype.yx = BABYLON.Quaternion.prototype.yx = function(){return new BABYLON.Vector2(this.y,this.x);} BABYLON.Vector3.prototype.zx = BABYLON.Quaternion.prototype.zx = function(){return new BABYLON.Vector2(this.z,this.x);} BABYLON.Quaternion.prototype.wx = function(){return new BABYLON.Vector2(this.w,this.x);} BABYLON.Vector2.prototype.xy = BABYLON.Vector3.prototype.xy = BABYLON.Quaternion.prototype.xy = function(){return new BABYLON.Vector2(this.x,this.y);} BABYLON.Vector2.prototype.yy = BABYLON.Vector3.prototype.yy = BABYLON.Quaternion.prototype.yy = function(){return new BABYLON.Vector2(this.y,this.y);} BABYLON.Vector3.prototype.zy = BABYLON.Quaternion.prototype.zy = function(){return new BABYLON.Vector2(this.z,this.y);} BABYLON.Quaternion.prototype.wy = function(){return new BABYLON.Vector2(this.w,this.y);} BABYLON.Vector3.prototype.xz = BABYLON.Quaternion.prototype.xz = function(){return new BABYLON.Vector2(this.x,this.z);} BABYLON.Vector3.prototype.yz = BABYLON.Quaternion.prototype.yz = function(){return new BABYLON.Vector2(this.y,this.z);} BABYLON.Vector3.prototype.zz = BABYLON.Quaternion.prototype.zz = function(){return new BABYLON.Vector2(this.z,this.z);} BABYLON.Quaternion.prototype.wz = function(){return new BABYLON.Vector2(this.w,this.z);} BABYLON.Quaternion.prototype.xw = function(){return new BABYLON.Vector2(this.x,this.w);} BABYLON.Quaternion.prototype.yw = function(){return new BABYLON.Vector2(this.y,this.w);} BABYLON.Quaternion.prototype.zw = function(){return new BABYLON.Vector2(this.z,this.w);} BABYLON.Quaternion.prototype.ww = function(){return new BABYLON.Vector2(this.w,this.w);} BABYLON.Vector2.prototype.xxx = BABYLON.Vector3.prototype.xxx = BABYLON.Quaternion.prototype.xxx = function(){return new BABYLON.Vector3(this.x,this.x,this.x);} BABYLON.Vector2.prototype.yxx = BABYLON.Vector3.prototype.yxx = BABYLON.Quaternion.prototype.yxx = function(){return new BABYLON.Vector3(this.y,this.x,this.x);} BABYLON.Vector3.prototype.zxx = BABYLON.Quaternion.prototype.zxx = function(){return new BABYLON.Vector3(this.z,this.x,this.x);} BABYLON.Quaternion.prototype.wxx = function(){return new BABYLON.Vector3(this.w,this.x,this.x);} BABYLON.Vector2.prototype.xyx = BABYLON.Vector3.prototype.xyx = BABYLON.Quaternion.prototype.xyx = function(){return new BABYLON.Vector3(this.x,this.y,this.x);} BABYLON.Vector2.prototype.yyx = BABYLON.Vector3.prototype.yyx = BABYLON.Quaternion.prototype.yyx = function(){return new BABYLON.Vector3(this.y,this.y,this.x);} BABYLON.Vector3.prototype.zyx = BABYLON.Quaternion.prototype.zyx = function(){return new BABYLON.Vector3(this.z,this.y,this.x);} BABYLON.Quaternion.prototype.wyx = function(){return new BABYLON.Vector3(this.w,this.y,this.x);} BABYLON.Vector3.prototype.xzx = BABYLON.Quaternion.prototype.xzx = function(){return new BABYLON.Vector3(this.x,this.z,this.x);} BABYLON.Vector3.prototype.yzx = BABYLON.Quaternion.prototype.yzx = function(){return new BABYLON.Vector3(this.y,this.z,this.x);} BABYLON.Vector3.prototype.zzx = BABYLON.Quaternion.prototype.zzx = function(){return new BABYLON.Vector3(this.z,this.z,this.x);} BABYLON.Quaternion.prototype.wzx = function(){return new BABYLON.Vector3(this.w,this.z,this.x);} BABYLON.Quaternion.prototype.xwx = function(){return new BABYLON.Vector3(this.x,this.w,this.x);} BABYLON.Quaternion.prototype.ywx = function(){return new BABYLON.Vector3(this.y,this.w,this.x);} BABYLON.Quaternion.prototype.zwx = function(){return new BABYLON.Vector3(this.z,this.w,this.x);} BABYLON.Quaternion.prototype.wwx = function(){return new BABYLON.Vector3(this.w,this.w,this.x);} BABYLON.Vector2.prototype.xxy = BABYLON.Vector3.prototype.xxy = BABYLON.Quaternion.prototype.xxy = function(){return new BABYLON.Vector3(this.x,this.x,this.y);} BABYLON.Vector2.prototype.yxy = BABYLON.Vector3.prototype.yxy = BABYLON.Quaternion.prototype.yxy = function(){return new BABYLON.Vector3(this.y,this.x,this.y);} BABYLON.Vector3.prototype.zxy = BABYLON.Quaternion.prototype.zxy = function(){return new BABYLON.Vector3(this.z,this.x,this.y);} BABYLON.Quaternion.prototype.wxy = function(){return new BABYLON.Vector3(this.w,this.x,this.y);} BABYLON.Vector2.prototype.xyy = BABYLON.Vector3.prototype.xyy = BABYLON.Quaternion.prototype.xyy = function(){return new BABYLON.Vector3(this.x,this.y,this.y);} BABYLON.Vector2.prototype.yyy = BABYLON.Vector3.prototype.yyy = BABYLON.Quaternion.prototype.yyy = function(){return new BABYLON.Vector3(this.y,this.y,this.y);} BABYLON.Vector3.prototype.zyy = BABYLON.Quaternion.prototype.zyy = function(){return new BABYLON.Vector3(this.z,this.y,this.y);} BABYLON.Quaternion.prototype.wyy = function(){return new BABYLON.Vector3(this.w,this.y,this.y);} BABYLON.Vector3.prototype.xzy = BABYLON.Quaternion.prototype.xzy = function(){return new BABYLON.Vector3(this.x,this.z,this.y);} BABYLON.Vector3.prototype.yzy = BABYLON.Quaternion.prototype.yzy = function(){return new BABYLON.Vector3(this.y,this.z,this.y);} BABYLON.Vector3.prototype.zzy = BABYLON.Quaternion.prototype.zzy = function(){return new BABYLON.Vector3(this.z,this.z,this.y);} BABYLON.Quaternion.prototype.wzy = function(){return new BABYLON.Vector3(this.w,this.z,this.y);} BABYLON.Quaternion.prototype.xwy = function(){return new BABYLON.Vector3(this.x,this.w,this.y);} BABYLON.Quaternion.prototype.ywy = function(){return new BABYLON.Vector3(this.y,this.w,this.y);} BABYLON.Quaternion.prototype.zwy = function(){return new BABYLON.Vector3(this.z,this.w,this.y);} BABYLON.Quaternion.prototype.wwy = function(){return new BABYLON.Vector3(this.w,this.w,this.y);} BABYLON.Vector3.prototype.xxz = BABYLON.Quaternion.prototype.xxz = function(){return new BABYLON.Vector3(this.x,this.x,this.z);} BABYLON.Vector3.prototype.yxz = BABYLON.Quaternion.prototype.yxz = function(){return new BABYLON.Vector3(this.y,this.x,this.z);} BABYLON.Vector3.prototype.zxz = BABYLON.Quaternion.prototype.zxz = function(){return new BABYLON.Vector3(this.z,this.x,this.z);} BABYLON.Quaternion.prototype.wxz = function(){return new BABYLON.Vector3(this.w,this.x,this.z);} BABYLON.Vector3.prototype.xyz = BABYLON.Quaternion.prototype.xyz = function(){return new BABYLON.Vector3(this.x,this.y,this.z);} BABYLON.Vector3.prototype.yyz = BABYLON.Quaternion.prototype.yyz = function(){return new BABYLON.Vector3(this.y,this.y,this.z);} BABYLON.Vector3.prototype.zyz = BABYLON.Quaternion.prototype.zyz = function(){return new BABYLON.Vector3(this.z,this.y,this.z);} BABYLON.Quaternion.prototype.wyz = function(){return new BABYLON.Vector3(this.w,this.y,this.z);} BABYLON.Vector3.prototype.xzz = BABYLON.Quaternion.prototype.xzz = function(){return new BABYLON.Vector3(this.x,this.z,this.z);} BABYLON.Vector3.prototype.yzz = BABYLON.Quaternion.prototype.yzz = function(){return new BABYLON.Vector3(this.y,this.z,this.z);} BABYLON.Vector3.prototype.zzz = BABYLON.Quaternion.prototype.zzz = function(){return new BABYLON.Vector3(this.z,this.z,this.z);} BABYLON.Quaternion.prototype.wzz = function(){return new BABYLON.Vector3(this.w,this.z,this.z);} BABYLON.Quaternion.prototype.xwz = function(){return new BABYLON.Vector3(this.x,this.w,this.z);} BABYLON.Quaternion.prototype.ywz = function(){return new BABYLON.Vector3(this.y,this.w,this.z);} BABYLON.Quaternion.prototype.zwz = function(){return new BABYLON.Vector3(this.z,this.w,this.z);} BABYLON.Quaternion.prototype.wwz = function(){return new BABYLON.Vector3(this.w,this.w,this.z);} BABYLON.Quaternion.prototype.xxw = function(){return new BABYLON.Vector3(this.x,this.x,this.w);} BABYLON.Quaternion.prototype.yxw = function(){return new BABYLON.Vector3(this.y,this.x,this.w);} BABYLON.Quaternion.prototype.zxw = function(){return new BABYLON.Vector3(this.z,this.x,this.w);} BABYLON.Quaternion.prototype.wxw = function(){return new BABYLON.Vector3(this.w,this.x,this.w);} BABYLON.Quaternion.prototype.xyw = function(){return new BABYLON.Vector3(this.x,this.y,this.w);} BABYLON.Quaternion.prototype.yyw = function(){return new BABYLON.Vector3(this.y,this.y,this.w);} BABYLON.Quaternion.prototype.zyw = function(){return new BABYLON.Vector3(this.z,this.y,this.w);} BABYLON.Quaternion.prototype.wyw = function(){return new BABYLON.Vector3(this.w,this.y,this.w);} BABYLON.Quaternion.prototype.xzw = function(){return new BABYLON.Vector3(this.x,this.z,this.w);} BABYLON.Quaternion.prototype.yzw = function(){return new BABYLON.Vector3(this.y,this.z,this.w);} BABYLON.Quaternion.prototype.zzw = function(){return new BABYLON.Vector3(this.z,this.z,this.w);} BABYLON.Quaternion.prototype.wzw = function(){return new BABYLON.Vector3(this.w,this.z,this.w);} BABYLON.Quaternion.prototype.xww = function(){return new BABYLON.Vector3(this.x,this.w,this.w);} BABYLON.Quaternion.prototype.yww = function(){return new BABYLON.Vector3(this.y,this.w,this.w);} BABYLON.Quaternion.prototype.zww = function(){return new BABYLON.Vector3(this.z,this.w,this.w);} BABYLON.Quaternion.prototype.www = function(){return new BABYLON.Vector3(this.w,this.w,this.w);} BABYLON.Vector2.prototype.xxxx = BABYLON.Vector3.prototype.xxxx = BABYLON.Quaternion.prototype.xxxx = function(){return new BABYLON.Quaternion(this.x,this.x,this.x,this.x);} BABYLON.Vector2.prototype.yxxx = BABYLON.Vector3.prototype.yxxx = BABYLON.Quaternion.prototype.yxxx = function(){return new BABYLON.Quaternion(this.y,this.x,this.x,this.x);} BABYLON.Vector3.prototype.zxxx = BABYLON.Quaternion.prototype.zxxx = function(){return new BABYLON.Quaternion(this.z,this.x,this.x,this.x);} BABYLON.Quaternion.prototype.wxxx = function(){return new BABYLON.Quaternion(this.w,this.x,this.x,this.x);} BABYLON.Vector2.prototype.xyxx = BABYLON.Vector3.prototype.xyxx = BABYLON.Quaternion.prototype.xyxx = function(){return new BABYLON.Quaternion(this.x,this.y,this.x,this.x);} BABYLON.Vector2.prototype.yyxx = BABYLON.Vector3.prototype.yyxx = BABYLON.Quaternion.prototype.yyxx = function(){return new BABYLON.Quaternion(this.y,this.y,this.x,this.x);} BABYLON.Vector3.prototype.zyxx = BABYLON.Quaternion.prototype.zyxx = function(){return new BABYLON.Quaternion(this.z,this.y,this.x,this.x);} BABYLON.Quaternion.prototype.wyxx = function(){return new BABYLON.Quaternion(this.w,this.y,this.x,this.x);} BABYLON.Vector3.prototype.xzxx = BABYLON.Quaternion.prototype.xzxx = function(){return new BABYLON.Quaternion(this.x,this.z,this.x,this.x);} BABYLON.Vector3.prototype.yzxx = BABYLON.Quaternion.prototype.yzxx = function(){return new BABYLON.Quaternion(this.y,this.z,this.x,this.x);} BABYLON.Vector3.prototype.zzxx = BABYLON.Quaternion.prototype.zzxx = function(){return new BABYLON.Quaternion(this.z,this.z,this.x,this.x);} BABYLON.Quaternion.prototype.wzxx = function(){return new BABYLON.Quaternion(this.w,this.z,this.x,this.x);} BABYLON.Quaternion.prototype.xwxx = function(){return new BABYLON.Quaternion(this.x,this.w,this.x,this.x);} BABYLON.Quaternion.prototype.ywxx = function(){return new BABYLON.Quaternion(this.y,this.w,this.x,this.x);} BABYLON.Quaternion.prototype.zwxx = function(){return new BABYLON.Quaternion(this.z,this.w,this.x,this.x);} BABYLON.Quaternion.prototype.wwxx = function(){return new BABYLON.Quaternion(this.w,this.w,this.x,this.x);} BABYLON.Vector2.prototype.xxyx = BABYLON.Vector3.prototype.xxyx = BABYLON.Quaternion.prototype.xxyx = function(){return new BABYLON.Quaternion(this.x,this.x,this.y,this.x);} BABYLON.Vector2.prototype.yxyx = BABYLON.Vector3.prototype.yxyx = BABYLON.Quaternion.prototype.yxyx = function(){return new BABYLON.Quaternion(this.y,this.x,this.y,this.x);} BABYLON.Vector3.prototype.zxyx = BABYLON.Quaternion.prototype.zxyx = function(){return new BABYLON.Quaternion(this.z,this.x,this.y,this.x);} BABYLON.Quaternion.prototype.wxyx = function(){return new BABYLON.Quaternion(this.w,this.x,this.y,this.x);} BABYLON.Vector2.prototype.xyyx = BABYLON.Vector3.prototype.xyyx = BABYLON.Quaternion.prototype.xyyx = function(){return new BABYLON.Quaternion(this.x,this.y,this.y,this.x);} BABYLON.Vector2.prototype.yyyx = BABYLON.Vector3.prototype.yyyx = BABYLON.Quaternion.prototype.yyyx = function(){return new BABYLON.Quaternion(this.y,this.y,this.y,this.x);} BABYLON.Vector3.prototype.zyyx = BABYLON.Quaternion.prototype.zyyx = function(){return new BABYLON.Quaternion(this.z,this.y,this.y,this.x);} BABYLON.Quaternion.prototype.wyyx = function(){return new BABYLON.Quaternion(this.w,this.y,this.y,this.x);} BABYLON.Vector3.prototype.xzyx = BABYLON.Quaternion.prototype.xzyx = function(){return new BABYLON.Quaternion(this.x,this.z,this.y,this.x);} BABYLON.Vector3.prototype.yzyx = BABYLON.Quaternion.prototype.yzyx = function(){return new BABYLON.Quaternion(this.y,this.z,this.y,this.x);} BABYLON.Vector3.prototype.zzyx = BABYLON.Quaternion.prototype.zzyx = function(){return new BABYLON.Quaternion(this.z,this.z,this.y,this.x);} BABYLON.Quaternion.prototype.wzyx = function(){return new BABYLON.Quaternion(this.w,this.z,this.y,this.x);} BABYLON.Quaternion.prototype.xwyx = function(){return new BABYLON.Quaternion(this.x,this.w,this.y,this.x);} BABYLON.Quaternion.prototype.ywyx = function(){return new BABYLON.Quaternion(this.y,this.w,this.y,this.x);} BABYLON.Quaternion.prototype.zwyx = function(){return new BABYLON.Quaternion(this.z,this.w,this.y,this.x);} BABYLON.Quaternion.prototype.wwyx = function(){return new BABYLON.Quaternion(this.w,this.w,this.y,this.x);} BABYLON.Vector3.prototype.xxzx = BABYLON.Quaternion.prototype.xxzx = function(){return new BABYLON.Quaternion(this.x,this.x,this.z,this.x);} BABYLON.Vector3.prototype.yxzx = BABYLON.Quaternion.prototype.yxzx = function(){return new BABYLON.Quaternion(this.y,this.x,this.z,this.x);} BABYLON.Vector3.prototype.zxzx = BABYLON.Quaternion.prototype.zxzx = function(){return new BABYLON.Quaternion(this.z,this.x,this.z,this.x);} BABYLON.Quaternion.prototype.wxzx = function(){return new BABYLON.Quaternion(this.w,this.x,this.z,this.x);} BABYLON.Vector3.prototype.xyzx = BABYLON.Quaternion.prototype.xyzx = function(){return new BABYLON.Quaternion(this.x,this.y,this.z,this.x);} BABYLON.Vector3.prototype.yyzx = BABYLON.Quaternion.prototype.yyzx = function(){return new BABYLON.Quaternion(this.y,this.y,this.z,this.x);} BABYLON.Vector3.prototype.zyzx = BABYLON.Quaternion.prototype.zyzx = function(){return new BABYLON.Quaternion(this.z,this.y,this.z,this.x);} BABYLON.Quaternion.prototype.wyzx = function(){return new BABYLON.Quaternion(this.w,this.y,this.z,this.x);} BABYLON.Vector3.prototype.xzzx = BABYLON.Quaternion.prototype.xzzx = function(){return new BABYLON.Quaternion(this.x,this.z,this.z,this.x);} BABYLON.Vector3.prototype.yzzx = BABYLON.Quaternion.prototype.yzzx = function(){return new BABYLON.Quaternion(this.y,this.z,this.z,this.x);} BABYLON.Vector3.prototype.zzzx = BABYLON.Quaternion.prototype.zzzx = function(){return new BABYLON.Quaternion(this.z,this.z,this.z,this.x);} BABYLON.Quaternion.prototype.wzzx = function(){return new BABYLON.Quaternion(this.w,this.z,this.z,this.x);} BABYLON.Quaternion.prototype.xwzx = function(){return new BABYLON.Quaternion(this.x,this.w,this.z,this.x);} BABYLON.Quaternion.prototype.ywzx = function(){return new BABYLON.Quaternion(this.y,this.w,this.z,this.x);} BABYLON.Quaternion.prototype.zwzx = function(){return new BABYLON.Quaternion(this.z,this.w,this.z,this.x);} BABYLON.Quaternion.prototype.wwzx = function(){return new BABYLON.Quaternion(this.w,this.w,this.z,this.x);} BABYLON.Quaternion.prototype.xxwx = function(){return new BABYLON.Quaternion(this.x,this.x,this.w,this.x);} BABYLON.Quaternion.prototype.yxwx = function(){return new BABYLON.Quaternion(this.y,this.x,this.w,this.x);} BABYLON.Quaternion.prototype.zxwx = function(){return new BABYLON.Quaternion(this.z,this.x,this.w,this.x);} BABYLON.Quaternion.prototype.wxwx = function(){return new BABYLON.Quaternion(this.w,this.x,this.w,this.x);} BABYLON.Quaternion.prototype.xywx = function(){return new BABYLON.Quaternion(this.x,this.y,this.w,this.x);} BABYLON.Quaternion.prototype.yywx = function(){return new BABYLON.Quaternion(this.y,this.y,this.w,this.x);} BABYLON.Quaternion.prototype.zywx = function(){return new BABYLON.Quaternion(this.z,this.y,this.w,this.x);} BABYLON.Quaternion.prototype.wywx = function(){return new BABYLON.Quaternion(this.w,this.y,this.w,this.x);} BABYLON.Quaternion.prototype.xzwx = function(){return new BABYLON.Quaternion(this.x,this.z,this.w,this.x);} BABYLON.Quaternion.prototype.yzwx = function(){return new BABYLON.Quaternion(this.y,this.z,this.w,this.x);} BABYLON.Quaternion.prototype.zzwx = function(){return new BABYLON.Quaternion(this.z,this.z,this.w,this.x);} BABYLON.Quaternion.prototype.wzwx = function(){return new BABYLON.Quaternion(this.w,this.z,this.w,this.x);} BABYLON.Quaternion.prototype.xwwx = function(){return new BABYLON.Quaternion(this.x,this.w,this.w,this.x);} BABYLON.Quaternion.prototype.ywwx = function(){return new BABYLON.Quaternion(this.y,this.w,this.w,this.x);} BABYLON.Quaternion.prototype.zwwx = function(){return new BABYLON.Quaternion(this.z,this.w,this.w,this.x);} BABYLON.Quaternion.prototype.wwwx = function(){return new BABYLON.Quaternion(this.w,this.w,this.w,this.x);} BABYLON.Vector2.prototype.xxxy = BABYLON.Vector3.prototype.xxxy = BABYLON.Quaternion.prototype.xxxy = function(){return new BABYLON.Quaternion(this.x,this.x,this.x,this.y);} BABYLON.Vector2.prototype.yxxy = BABYLON.Vector3.prototype.yxxy = BABYLON.Quaternion.prototype.yxxy = function(){return new BABYLON.Quaternion(this.y,this.x,this.x,this.y);} BABYLON.Vector3.prototype.zxxy = BABYLON.Quaternion.prototype.zxxy = function(){return new BABYLON.Quaternion(this.z,this.x,this.x,this.y);} BABYLON.Quaternion.prototype.wxxy = function(){return new BABYLON.Quaternion(this.w,this.x,this.x,this.y);} BABYLON.Vector2.prototype.xyxy = BABYLON.Vector3.prototype.xyxy = BABYLON.Quaternion.prototype.xyxy = function(){return new BABYLON.Quaternion(this.x,this.y,this.x,this.y);} BABYLON.Vector2.prototype.yyxy = BABYLON.Vector3.prototype.yyxy = BABYLON.Quaternion.prototype.yyxy = function(){return new BABYLON.Quaternion(this.y,this.y,this.x,this.y);} BABYLON.Vector3.prototype.zyxy = BABYLON.Quaternion.prototype.zyxy = function(){return new BABYLON.Quaternion(this.z,this.y,this.x,this.y);} BABYLON.Quaternion.prototype.wyxy = function(){return new BABYLON.Quaternion(this.w,this.y,this.x,this.y);} BABYLON.Vector3.prototype.xzxy = BABYLON.Quaternion.prototype.xzxy = function(){return new BABYLON.Quaternion(this.x,this.z,this.x,this.y);} BABYLON.Vector3.prototype.yzxy = BABYLON.Quaternion.prototype.yzxy = function(){return new BABYLON.Quaternion(this.y,this.z,this.x,this.y);} BABYLON.Vector3.prototype.zzxy = BABYLON.Quaternion.prototype.zzxy = function(){return new BABYLON.Quaternion(this.z,this.z,this.x,this.y);} BABYLON.Quaternion.prototype.wzxy = function(){return new BABYLON.Quaternion(this.w,this.z,this.x,this.y);} BABYLON.Quaternion.prototype.xwxy = function(){return new BABYLON.Quaternion(this.x,this.w,this.x,this.y);} BABYLON.Quaternion.prototype.ywxy = function(){return new BABYLON.Quaternion(this.y,this.w,this.x,this.y);} BABYLON.Quaternion.prototype.zwxy = function(){return new BABYLON.Quaternion(this.z,this.w,this.x,this.y);} BABYLON.Quaternion.prototype.wwxy = function(){return new BABYLON.Quaternion(this.w,this.w,this.x,this.y);} BABYLON.Vector2.prototype.xxyy = BABYLON.Vector3.prototype.xxyy = BABYLON.Quaternion.prototype.xxyy = function(){return new BABYLON.Quaternion(this.x,this.x,this.y,this.y);} BABYLON.Vector2.prototype.yxyy = BABYLON.Vector3.prototype.yxyy = BABYLON.Quaternion.prototype.yxyy = function(){return new BABYLON.Quaternion(this.y,this.x,this.y,this.y);} BABYLON.Vector3.prototype.zxyy = BABYLON.Quaternion.prototype.zxyy = function(){return new BABYLON.Quaternion(this.z,this.x,this.y,this.y);} BABYLON.Quaternion.prototype.wxyy = function(){return new BABYLON.Quaternion(this.w,this.x,this.y,this.y);} BABYLON.Vector2.prototype.xyyy = BABYLON.Vector3.prototype.xyyy = BABYLON.Quaternion.prototype.xyyy = function(){return new BABYLON.Quaternion(this.x,this.y,this.y,this.y);} BABYLON.Vector2.prototype.yyyy = BABYLON.Vector3.prototype.yyyy = BABYLON.Quaternion.prototype.yyyy = function(){return new BABYLON.Quaternion(this.y,this.y,this.y,this.y);} BABYLON.Vector3.prototype.zyyy = BABYLON.Quaternion.prototype.zyyy = function(){return new BABYLON.Quaternion(this.z,this.y,this.y,this.y);} BABYLON.Quaternion.prototype.wyyy = function(){return new BABYLON.Quaternion(this.w,this.y,this.y,this.y);} BABYLON.Vector3.prototype.xzyy = BABYLON.Quaternion.prototype.xzyy = function(){return new BABYLON.Quaternion(this.x,this.z,this.y,this.y);} BABYLON.Vector3.prototype.yzyy = BABYLON.Quaternion.prototype.yzyy = function(){return new BABYLON.Quaternion(this.y,this.z,this.y,this.y);} BABYLON.Vector3.prototype.zzyy = BABYLON.Quaternion.prototype.zzyy = function(){return new BABYLON.Quaternion(this.z,this.z,this.y,this.y);} BABYLON.Quaternion.prototype.wzyy = function(){return new BABYLON.Quaternion(this.w,this.z,this.y,this.y);} BABYLON.Quaternion.prototype.xwyy = function(){return new BABYLON.Quaternion(this.x,this.w,this.y,this.y);} BABYLON.Quaternion.prototype.ywyy = function(){return new BABYLON.Quaternion(this.y,this.w,this.y,this.y);} BABYLON.Quaternion.prototype.zwyy = function(){return new BABYLON.Quaternion(this.z,this.w,this.y,this.y);} BABYLON.Quaternion.prototype.wwyy = function(){return new BABYLON.Quaternion(this.w,this.w,this.y,this.y);} BABYLON.Vector3.prototype.xxzy = BABYLON.Quaternion.prototype.xxzy = function(){return new BABYLON.Quaternion(this.x,this.x,this.z,this.y);} BABYLON.Vector3.prototype.yxzy = BABYLON.Quaternion.prototype.yxzy = function(){return new BABYLON.Quaternion(this.y,this.x,this.z,this.y);} BABYLON.Vector3.prototype.zxzy = BABYLON.Quaternion.prototype.zxzy = function(){return new BABYLON.Quaternion(this.z,this.x,this.z,this.y);} BABYLON.Quaternion.prototype.wxzy = function(){return new BABYLON.Quaternion(this.w,this.x,this.z,this.y);} BABYLON.Vector3.prototype.xyzy = BABYLON.Quaternion.prototype.xyzy = function(){return new BABYLON.Quaternion(this.x,this.y,this.z,this.y);} BABYLON.Vector3.prototype.yyzy = BABYLON.Quaternion.prototype.yyzy = function(){return new BABYLON.Quaternion(this.y,this.y,this.z,this.y);} BABYLON.Vector3.prototype.zyzy = BABYLON.Quaternion.prototype.zyzy = function(){return new BABYLON.Quaternion(this.z,this.y,this.z,this.y);} BABYLON.Quaternion.prototype.wyzy = function(){return new BABYLON.Quaternion(this.w,this.y,this.z,this.y);} BABYLON.Vector3.prototype.xzzy = BABYLON.Quaternion.prototype.xzzy = function(){return new BABYLON.Quaternion(this.x,this.z,this.z,this.y);} BABYLON.Vector3.prototype.yzzy = BABYLON.Quaternion.prototype.yzzy = function(){return new BABYLON.Quaternion(this.y,this.z,this.z,this.y);} BABYLON.Vector3.prototype.zzzy = BABYLON.Quaternion.prototype.zzzy = function(){return new BABYLON.Quaternion(this.z,this.z,this.z,this.y);} BABYLON.Quaternion.prototype.wzzy = function(){return new BABYLON.Quaternion(this.w,this.z,this.z,this.y);} BABYLON.Quaternion.prototype.xwzy = function(){return new BABYLON.Quaternion(this.x,this.w,this.z,this.y);} BABYLON.Quaternion.prototype.ywzy = function(){return new BABYLON.Quaternion(this.y,this.w,this.z,this.y);} BABYLON.Quaternion.prototype.zwzy = function(){return new BABYLON.Quaternion(this.z,this.w,this.z,this.y);} BABYLON.Quaternion.prototype.wwzy = function(){return new BABYLON.Quaternion(this.w,this.w,this.z,this.y);} BABYLON.Quaternion.prototype.xxwy = function(){return new BABYLON.Quaternion(this.x,this.x,this.w,this.y);} BABYLON.Quaternion.prototype.yxwy = function(){return new BABYLON.Quaternion(this.y,this.x,this.w,this.y);} BABYLON.Quaternion.prototype.zxwy = function(){return new BABYLON.Quaternion(this.z,this.x,this.w,this.y);} BABYLON.Quaternion.prototype.wxwy = function(){return new BABYLON.Quaternion(this.w,this.x,this.w,this.y);} BABYLON.Quaternion.prototype.xywy = function(){return new BABYLON.Quaternion(this.x,this.y,this.w,this.y);} BABYLON.Quaternion.prototype.yywy = function(){return new BABYLON.Quaternion(this.y,this.y,this.w,this.y);} BABYLON.Quaternion.prototype.zywy = function(){return new BABYLON.Quaternion(this.z,this.y,this.w,this.y);} BABYLON.Quaternion.prototype.wywy = function(){return new BABYLON.Quaternion(this.w,this.y,this.w,this.y);} BABYLON.Quaternion.prototype.xzwy = function(){return new BABYLON.Quaternion(this.x,this.z,this.w,this.y);} BABYLON.Quaternion.prototype.yzwy = function(){return new BABYLON.Quaternion(this.y,this.z,this.w,this.y);} BABYLON.Quaternion.prototype.zzwy = function(){return new BABYLON.Quaternion(this.z,this.z,this.w,this.y);} BABYLON.Quaternion.prototype.wzwy = function(){return new BABYLON.Quaternion(this.w,this.z,this.w,this.y);} BABYLON.Quaternion.prototype.xwwy = function(){return new BABYLON.Quaternion(this.x,this.w,this.w,this.y);} BABYLON.Quaternion.prototype.ywwy = function(){return new BABYLON.Quaternion(this.y,this.w,this.w,this.y);} BABYLON.Quaternion.prototype.zwwy = function(){return new BABYLON.Quaternion(this.z,this.w,this.w,this.y);} BABYLON.Quaternion.prototype.wwwy = function(){return new BABYLON.Quaternion(this.w,this.w,this.w,this.y);} BABYLON.Vector3.prototype.xxxz = BABYLON.Quaternion.prototype.xxxz = function(){return new BABYLON.Quaternion(this.x,this.x,this.x,this.z);} BABYLON.Vector3.prototype.yxxz = BABYLON.Quaternion.prototype.yxxz = function(){return new BABYLON.Quaternion(this.y,this.x,this.x,this.z);} BABYLON.Vector3.prototype.zxxz = BABYLON.Quaternion.prototype.zxxz = function(){return new BABYLON.Quaternion(this.z,this.x,this.x,this.z);} BABYLON.Quaternion.prototype.wxxz = function(){return new BABYLON.Quaternion(this.w,this.x,this.x,this.z);} BABYLON.Vector3.prototype.xyxz = BABYLON.Quaternion.prototype.xyxz = function(){return new BABYLON.Quaternion(this.x,this.y,this.x,this.z);} BABYLON.Vector3.prototype.yyxz = BABYLON.Quaternion.prototype.yyxz = function(){return new BABYLON.Quaternion(this.y,this.y,this.x,this.z);} BABYLON.Vector3.prototype.zyxz = BABYLON.Quaternion.prototype.zyxz = function(){return new BABYLON.Quaternion(this.z,this.y,this.x,this.z);} BABYLON.Quaternion.prototype.wyxz = function(){return new BABYLON.Quaternion(this.w,this.y,this.x,this.z);} BABYLON.Vector3.prototype.xzxz = BABYLON.Quaternion.prototype.xzxz = function(){return new BABYLON.Quaternion(this.x,this.z,this.x,this.z);} BABYLON.Vector3.prototype.yzxz = BABYLON.Quaternion.prototype.yzxz = function(){return new BABYLON.Quaternion(this.y,this.z,this.x,this.z);} BABYLON.Vector3.prototype.zzxz = BABYLON.Quaternion.prototype.zzxz = function(){return new BABYLON.Quaternion(this.z,this.z,this.x,this.z);} BABYLON.Quaternion.prototype.wzxz = function(){return new BABYLON.Quaternion(this.w,this.z,this.x,this.z);} BABYLON.Quaternion.prototype.xwxz = function(){return new BABYLON.Quaternion(this.x,this.w,this.x,this.z);} BABYLON.Quaternion.prototype.ywxz = function(){return new BABYLON.Quaternion(this.y,this.w,this.x,this.z);} BABYLON.Quaternion.prototype.zwxz = function(){return new BABYLON.Quaternion(this.z,this.w,this.x,this.z);} BABYLON.Quaternion.prototype.wwxz = function(){return new BABYLON.Quaternion(this.w,this.w,this.x,this.z);} BABYLON.Vector3.prototype.xxyz = BABYLON.Quaternion.prototype.xxyz = function(){return new BABYLON.Quaternion(this.x,this.x,this.y,this.z);} BABYLON.Vector3.prototype.yxyz = BABYLON.Quaternion.prototype.yxyz = function(){return new BABYLON.Quaternion(this.y,this.x,this.y,this.z);} BABYLON.Vector3.prototype.zxyz = BABYLON.Quaternion.prototype.zxyz = function(){return new BABYLON.Quaternion(this.z,this.x,this.y,this.z);} BABYLON.Quaternion.prototype.wxyz = function(){return new BABYLON.Quaternion(this.w,this.x,this.y,this.z);} BABYLON.Vector3.prototype.xyyz = BABYLON.Quaternion.prototype.xyyz = function(){return new BABYLON.Quaternion(this.x,this.y,this.y,this.z);} BABYLON.Vector3.prototype.yyyz = BABYLON.Quaternion.prototype.yyyz = function(){return new BABYLON.Quaternion(this.y,this.y,this.y,this.z);} BABYLON.Vector3.prototype.zyyz = BABYLON.Quaternion.prototype.zyyz = function(){return new BABYLON.Quaternion(this.z,this.y,this.y,this.z);} BABYLON.Quaternion.prototype.wyyz = function(){return new BABYLON.Quaternion(this.w,this.y,this.y,this.z);} BABYLON.Vector3.prototype.xzyz = BABYLON.Quaternion.prototype.xzyz = function(){return new BABYLON.Quaternion(this.x,this.z,this.y,this.z);} BABYLON.Vector3.prototype.yzyz = BABYLON.Quaternion.prototype.yzyz = function(){return new BABYLON.Quaternion(this.y,this.z,this.y,this.z);} BABYLON.Vector3.prototype.zzyz = BABYLON.Quaternion.prototype.zzyz = function(){return new BABYLON.Quaternion(this.z,this.z,this.y,this.z);} BABYLON.Quaternion.prototype.wzyz = function(){return new BABYLON.Quaternion(this.w,this.z,this.y,this.z);} BABYLON.Quaternion.prototype.xwyz = function(){return new BABYLON.Quaternion(this.x,this.w,this.y,this.z);} BABYLON.Quaternion.prototype.ywyz = function(){return new BABYLON.Quaternion(this.y,this.w,this.y,this.z);} BABYLON.Quaternion.prototype.zwyz = function(){return new BABYLON.Quaternion(this.z,this.w,this.y,this.z);} BABYLON.Quaternion.prototype.wwyz = function(){return new BABYLON.Quaternion(this.w,this.w,this.y,this.z);} BABYLON.Vector3.prototype.xxzz = BABYLON.Quaternion.prototype.xxzz = function(){return new BABYLON.Quaternion(this.x,this.x,this.z,this.z);} BABYLON.Vector3.prototype.yxzz = BABYLON.Quaternion.prototype.yxzz = function(){return new BABYLON.Quaternion(this.y,this.x,this.z,this.z);} BABYLON.Vector3.prototype.zxzz = BABYLON.Quaternion.prototype.zxzz = function(){return new BABYLON.Quaternion(this.z,this.x,this.z,this.z);} BABYLON.Quaternion.prototype.wxzz = function(){return new BABYLON.Quaternion(this.w,this.x,this.z,this.z);} BABYLON.Vector3.prototype.xyzz = BABYLON.Quaternion.prototype.xyzz = function(){return new BABYLON.Quaternion(this.x,this.y,this.z,this.z);} BABYLON.Vector3.prototype.yyzz = BABYLON.Quaternion.prototype.yyzz = function(){return new BABYLON.Quaternion(this.y,this.y,this.z,this.z);} BABYLON.Vector3.prototype.zyzz = BABYLON.Quaternion.prototype.zyzz = function(){return new BABYLON.Quaternion(this.z,this.y,this.z,this.z);} BABYLON.Quaternion.prototype.wyzz = function(){return new BABYLON.Quaternion(this.w,this.y,this.z,this.z);} BABYLON.Vector3.prototype.xzzz = BABYLON.Quaternion.prototype.xzzz = function(){return new BABYLON.Quaternion(this.x,this.z,this.z,this.z);} BABYLON.Vector3.prototype.yzzz = BABYLON.Quaternion.prototype.yzzz = function(){return new BABYLON.Quaternion(this.y,this.z,this.z,this.z);} BABYLON.Vector3.prototype.zzzz = BABYLON.Quaternion.prototype.zzzz = function(){return new BABYLON.Quaternion(this.z,this.z,this.z,this.z);} BABYLON.Quaternion.prototype.wzzz = function(){return new BABYLON.Quaternion(this.w,this.z,this.z,this.z);} BABYLON.Quaternion.prototype.xwzz = function(){return new BABYLON.Quaternion(this.x,this.w,this.z,this.z);} BABYLON.Quaternion.prototype.ywzz = function(){return new BABYLON.Quaternion(this.y,this.w,this.z,this.z);} BABYLON.Quaternion.prototype.zwzz = function(){return new BABYLON.Quaternion(this.z,this.w,this.z,this.z);} BABYLON.Quaternion.prototype.wwzz = function(){return new BABYLON.Quaternion(this.w,this.w,this.z,this.z);} BABYLON.Quaternion.prototype.xxwz = function(){return new BABYLON.Quaternion(this.x,this.x,this.w,this.z);} BABYLON.Quaternion.prototype.yxwz = function(){return new BABYLON.Quaternion(this.y,this.x,this.w,this.z);} BABYLON.Quaternion.prototype.zxwz = function(){return new BABYLON.Quaternion(this.z,this.x,this.w,this.z);} BABYLON.Quaternion.prototype.wxwz = function(){return new BABYLON.Quaternion(this.w,this.x,this.w,this.z);} BABYLON.Quaternion.prototype.xywz = function(){return new BABYLON.Quaternion(this.x,this.y,this.w,this.z);} BABYLON.Quaternion.prototype.yywz = function(){return new BABYLON.Quaternion(this.y,this.y,this.w,this.z);} BABYLON.Quaternion.prototype.zywz = function(){return new BABYLON.Quaternion(this.z,this.y,this.w,this.z);} BABYLON.Quaternion.prototype.wywz = function(){return new BABYLON.Quaternion(this.w,this.y,this.w,this.z);} BABYLON.Quaternion.prototype.xzwz = function(){return new BABYLON.Quaternion(this.x,this.z,this.w,this.z);} BABYLON.Quaternion.prototype.yzwz = function(){return new BABYLON.Quaternion(this.y,this.z,this.w,this.z);} BABYLON.Quaternion.prototype.zzwz = function(){return new BABYLON.Quaternion(this.z,this.z,this.w,this.z);} BABYLON.Quaternion.prototype.wzwz = function(){return new BABYLON.Quaternion(this.w,this.z,this.w,this.z);} BABYLON.Quaternion.prototype.xwwz = function(){return new BABYLON.Quaternion(this.x,this.w,this.w,this.z);} BABYLON.Quaternion.prototype.ywwz = function(){return new BABYLON.Quaternion(this.y,this.w,this.w,this.z);} BABYLON.Quaternion.prototype.zwwz = function(){return new BABYLON.Quaternion(this.z,this.w,this.w,this.z);} BABYLON.Quaternion.prototype.wwwz = function(){return new BABYLON.Quaternion(this.w,this.w,this.w,this.z);} BABYLON.Quaternion.prototype.xxxw = function(){return new BABYLON.Quaternion(this.x,this.x,this.x,this.w);} BABYLON.Quaternion.prototype.yxxw = function(){return new BABYLON.Quaternion(this.y,this.x,this.x,this.w);} BABYLON.Quaternion.prototype.zxxw = function(){return new BABYLON.Quaternion(this.z,this.x,this.x,this.w);} BABYLON.Quaternion.prototype.wxxw = function(){return new BABYLON.Quaternion(this.w,this.x,this.x,this.w);} BABYLON.Quaternion.prototype.xyxw = function(){return new BABYLON.Quaternion(this.x,this.y,this.x,this.w);} BABYLON.Quaternion.prototype.yyxw = function(){return new BABYLON.Quaternion(this.y,this.y,this.x,this.w);} BABYLON.Quaternion.prototype.zyxw = function(){return new BABYLON.Quaternion(this.z,this.y,this.x,this.w);} BABYLON.Quaternion.prototype.wyxw = function(){return new BABYLON.Quaternion(this.w,this.y,this.x,this.w);} BABYLON.Quaternion.prototype.xzxw = function(){return new BABYLON.Quaternion(this.x,this.z,this.x,this.w);} BABYLON.Quaternion.prototype.yzxw = function(){return new BABYLON.Quaternion(this.y,this.z,this.x,this.w);} BABYLON.Quaternion.prototype.zzxw = function(){return new BABYLON.Quaternion(this.z,this.z,this.x,this.w);} BABYLON.Quaternion.prototype.wzxw = function(){return new BABYLON.Quaternion(this.w,this.z,this.x,this.w);} BABYLON.Quaternion.prototype.xwxw = function(){return new BABYLON.Quaternion(this.x,this.w,this.x,this.w);} BABYLON.Quaternion.prototype.ywxw = function(){return new BABYLON.Quaternion(this.y,this.w,this.x,this.w);} BABYLON.Quaternion.prototype.zwxw = function(){return new BABYLON.Quaternion(this.z,this.w,this.x,this.w);} BABYLON.Quaternion.prototype.wwxw = function(){return new BABYLON.Quaternion(this.w,this.w,this.x,this.w);} BABYLON.Quaternion.prototype.xxyw = function(){return new BABYLON.Quaternion(this.x,this.x,this.y,this.w);} BABYLON.Quaternion.prototype.yxyw = function(){return new BABYLON.Quaternion(this.y,this.x,this.y,this.w);} BABYLON.Quaternion.prototype.zxyw = function(){return new BABYLON.Quaternion(this.z,this.x,this.y,this.w);} BABYLON.Quaternion.prototype.wxyw = function(){return new BABYLON.Quaternion(this.w,this.x,this.y,this.w);} BABYLON.Quaternion.prototype.xyyw = function(){return new BABYLON.Quaternion(this.x,this.y,this.y,this.w);} BABYLON.Quaternion.prototype.yyyw = function(){return new BABYLON.Quaternion(this.y,this.y,this.y,this.w);} BABYLON.Quaternion.prototype.zyyw = function(){return new BABYLON.Quaternion(this.z,this.y,this.y,this.w);} BABYLON.Quaternion.prototype.wyyw = function(){return new BABYLON.Quaternion(this.w,this.y,this.y,this.w);} BABYLON.Quaternion.prototype.xzyw = function(){return new BABYLON.Quaternion(this.x,this.z,this.y,this.w);} BABYLON.Quaternion.prototype.yzyw = function(){return new BABYLON.Quaternion(this.y,this.z,this.y,this.w);} BABYLON.Quaternion.prototype.zzyw = function(){return new BABYLON.Quaternion(this.z,this.z,this.y,this.w);} BABYLON.Quaternion.prototype.wzyw = function(){return new BABYLON.Quaternion(this.w,this.z,this.y,this.w);} BABYLON.Quaternion.prototype.xwyw = function(){return new BABYLON.Quaternion(this.x,this.w,this.y,this.w);} BABYLON.Quaternion.prototype.ywyw = function(){return new BABYLON.Quaternion(this.y,this.w,this.y,this.w);} BABYLON.Quaternion.prototype.zwyw = function(){return new BABYLON.Quaternion(this.z,this.w,this.y,this.w);} BABYLON.Quaternion.prototype.wwyw = function(){return new BABYLON.Quaternion(this.w,this.w,this.y,this.w);} BABYLON.Quaternion.prototype.xxzw = function(){return new BABYLON.Quaternion(this.x,this.x,this.z,this.w);} BABYLON.Quaternion.prototype.yxzw = function(){return new BABYLON.Quaternion(this.y,this.x,this.z,this.w);} BABYLON.Quaternion.prototype.zxzw = function(){return new BABYLON.Quaternion(this.z,this.x,this.z,this.w);} BABYLON.Quaternion.prototype.wxzw = function(){return new BABYLON.Quaternion(this.w,this.x,this.z,this.w);} BABYLON.Quaternion.prototype.xyzw = function(){return new BABYLON.Quaternion(this.x,this.y,this.z,this.w);} BABYLON.Quaternion.prototype.yyzw = function(){return new BABYLON.Quaternion(this.y,this.y,this.z,this.w);} BABYLON.Quaternion.prototype.zyzw = function(){return new BABYLON.Quaternion(this.z,this.y,this.z,this.w);} BABYLON.Quaternion.prototype.wyzw = function(){return new BABYLON.Quaternion(this.w,this.y,this.z,this.w);} BABYLON.Quaternion.prototype.xzzw = function(){return new BABYLON.Quaternion(this.x,this.z,this.z,this.w);} BABYLON.Quaternion.prototype.yzzw = function(){return new BABYLON.Quaternion(this.y,this.z,this.z,this.w);} BABYLON.Quaternion.prototype.zzzw = function(){return new BABYLON.Quaternion(this.z,this.z,this.z,this.w);} BABYLON.Quaternion.prototype.wzzw = function(){return new BABYLON.Quaternion(this.w,this.z,this.z,this.w);} BABYLON.Quaternion.prototype.xwzw = function(){return new BABYLON.Quaternion(this.x,this.w,this.z,this.w);} BABYLON.Quaternion.prototype.ywzw = function(){return new BABYLON.Quaternion(this.y,this.w,this.z,this.w);} BABYLON.Quaternion.prototype.zwzw = function(){return new BABYLON.Quaternion(this.z,this.w,this.z,this.w);} BABYLON.Quaternion.prototype.wwzw = function(){return new BABYLON.Quaternion(this.w,this.w,this.z,this.w);} BABYLON.Quaternion.prototype.xxww = function(){return new BABYLON.Quaternion(this.x,this.x,this.w,this.w);} BABYLON.Quaternion.prototype.yxww = function(){return new BABYLON.Quaternion(this.y,this.x,this.w,this.w);} BABYLON.Quaternion.prototype.zxww = function(){return new BABYLON.Quaternion(this.z,this.x,this.w,this.w);} BABYLON.Quaternion.prototype.wxww = function(){return new BABYLON.Quaternion(this.w,this.x,this.w,this.w);} BABYLON.Quaternion.prototype.xyww = function(){return new BABYLON.Quaternion(this.x,this.y,this.w,this.w);} BABYLON.Quaternion.prototype.yyww = function(){return new BABYLON.Quaternion(this.y,this.y,this.w,this.w);} BABYLON.Quaternion.prototype.zyww = function(){return new BABYLON.Quaternion(this.z,this.y,this.w,this.w);} BABYLON.Quaternion.prototype.wyww = function(){return new BABYLON.Quaternion(this.w,this.y,this.w,this.w);} BABYLON.Quaternion.prototype.xzww = function(){return new BABYLON.Quaternion(this.x,this.z,this.w,this.w);} BABYLON.Quaternion.prototype.yzww = function(){return new BABYLON.Quaternion(this.y,this.z,this.w,this.w);} BABYLON.Quaternion.prototype.zzww = function(){return new BABYLON.Quaternion(this.z,this.z,this.w,this.w);} BABYLON.Quaternion.prototype.wzww = function(){return new BABYLON.Quaternion(this.w,this.z,this.w,this.w);} BABYLON.Quaternion.prototype.xwww = function(){return new BABYLON.Quaternion(this.x,this.w,this.w,this.w);} BABYLON.Quaternion.prototype.ywww = function(){return new BABYLON.Quaternion(this.y,this.w,this.w,this.w);} BABYLON.Quaternion.prototype.zwww = function(){return new BABYLON.Quaternion(this.z,this.w,this.w,this.w);} BABYLON.Quaternion.prototype.wwww = function(){return new BABYLON.Quaternion(this.w,this.w,this.w,this.w);} Now I know that is quite a bit of extra bloat when trying to deliver the script, for a feature that most users might not use (I would)... but that aside figured it was kinda a cool concept. I bet it would be fairly effective to include something like this :https://github.com/dankogai/js-combinatorics into bjs as a feature that people would use and then include this section of script to generate these functions: var r = ''; function setSting(_set){ var _r = ''; for(var i=0; i<_set.length; i++){ _r+=(_set[i]+''); } return _r; } var sets = (Combinatorics.baseN(['x','y','z','w'], 2).toArray()).concat( (Combinatorics.baseN(['x','y','z','w'], 3)).toArray()).concat( (Combinatorics.baseN(['x','y','z','w'], 4)).toArray()); for(var i=0; i<sets.length; i++){ var _set = sets[i]; var vec3Flag = false; var quatFlag = false; for(var j=0; j<_set.length; j++){ if(_set[j]=='z'){vec3Flag=true;} if(_set[j]=='w'){quatFlag=true;} } var _ss = setSting(_set); //Prototypes if(!vec3Flag && !quatFlag){ //Vector2 Possible //Vector3 Possible //Quat Possible r+='BABYLON.Vector2.prototype.'+_ss+' = '; r+='BABYLON.Vector3.prototype.'+_ss+' = '; r+='BABYLON.Quaternion.prototype.'+_ss+' = '; }else if(vec3Flag && !quatFlag){ //Vector3 //Quat Possible r+='BABYLON.Vector3.prototype.'+_ss+' = '; r+='BABYLON.Quaternion.prototype.'+_ss+' = '; }else{ //Quat Possible r+='BABYLON.Quaternion.prototype.'+_ss+' = '; } //Functions r+='function(){'; if(_set.length ==2){ r+='return new BABYLON.Vector2(this.'+_set[0]+',this.'+_set[1]+');'; }else if(_set.length == 3){ r+='return new BABYLON.Vector3(this.'+_set[0]+',this.'+_set[1]+',this.'+_set[2]+');'; }else if(_set.length == 4){ r+='return new BABYLON.Quaternion(this.'+_set[0]+',this.'+_set[1]+',this.'+_set[2]+',this.'+_set[3]+');'; } r+='}\r\n'; } eval(r); Just a random thought.... JCPalmer 1 Quote Link to comment Share on other sites More sharing options...
brianzinn Posted February 2, 2018 Share Posted February 2, 2018 cool concept. i've only swizzled in shaders. i have the algorithms on combinations, so wouldn't need a 3rd party lib (16.8 KB) unminified. edit: nevermind - you are *generating* the code! Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted February 2, 2018 Author Share Posted February 2, 2018 we should see about making this an option then how cool would it be to be able to quick return new vectors like that? v1 = new BABYLON.Vector3(1,2,3); so instead of being like: v2 = new BABYLON.Vector2(v1.x, v1.z); You would just do v2 = v1.xz(); could even add a constructor optional string or array to modify the values like: v2 = v1.xz(['*2', '-1']); where each member of that array would be applied to the like value; which would then return: (2, 2); or if just a string it applys to all: v2 = v1.xz('*5'); which would return: (5,15); Ehhh, this was all just a quick half baked idea. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.