Commit 5ba7abc6 authored by Mr.doob's avatar Mr.doob

Deprecated THREE.Vertex.

parent 3c104d81
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -79,7 +79,7 @@ this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRo
Math.abs(this.x);this.y=a.elements[8]-a.elements[2]<0?-Math.abs(this.y):Math.abs(this.y);this.z=a.elements[1]-a.elements[4]<0?-Math.abs(this.z):Math.abs(this.z);this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x=this.x*-1;this.y=this.y*-1;this.z=this.z*-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=
Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);if(a===0)this.w=this.z=this.y=this.x=0;else{a=1/a;this.x=this.x*a;this.y=this.y*a;this.z=this.z*a;this.w=this.w*a}return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,f=a.x,g=a.y,h=a.z,a=a.w;this.x=b*a+e*f+c*h-d*g;this.y=
c*a+e*g+d*f-b*h;this.z=d*a+e*h+b*g-c*f;this.w=e*a-b*f-c*g-d*h;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,f=this.x,g=this.y,h=this.z,k=this.w,j=k*c+g*e-h*d,i=k*d+h*c-f*e,m=k*e+f*d-g*c,c=-f*c-g*d-h*e;b.x=j*k+c*-f+i*-h-m*-g;b.y=i*k+c*-g+m*-f-j*-h;b.z=m*k+c*-h+j*-g-i*-f;return b},clone:function(){return new THREE.Quaternion(this.x,this.y,this.z,this.w)}};
THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(e<0){c.w=-b.w;c.x=-b.x;c.y=-b.y;c.z=-b.z;e=-e}else c.copy(b);if(Math.abs(e)>=1){c.w=a.w;c.x=a.x;c.y=a.y;c.z=a.z;return c}var f=Math.acos(e),e=Math.sqrt(1-e*e);if(Math.abs(e)<0.001){c.w=0.5*(a.w+b.w);c.x=0.5*(a.x+b.x);c.y=0.5*(a.y+b.y);c.z=0.5*(a.z+b.z);return c}b=Math.sin((1-d)*f)/e;d=Math.sin(d*f)/e;c.w=a.w*b+c.w*d;c.x=a.x*b+c.x*d;c.y=a.y*b+c.y*d;c.z=a.z*b+c.z*d;return c};THREE.Vertex=THREE.Vector3;
THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(e<0){c.w=-b.w;c.x=-b.x;c.y=-b.y;c.z=-b.z;e=-e}else c.copy(b);if(Math.abs(e)>=1){c.w=a.w;c.x=a.x;c.y=a.y;c.z=a.z;return c}var f=Math.acos(e),e=Math.sqrt(1-e*e);if(Math.abs(e)<0.001){c.w=0.5*(a.w+b.w);c.x=0.5*(a.x+b.x);c.y=0.5*(a.y+b.y);c.z=0.5*(a.z+b.z);return c}b=Math.sin((1-d)*f)/e;d=Math.sin(d*f)/e;c.w=a.w*b+c.w*d;c.x=a.x*b+c.x*d;c.y=a.y*b+c.y*d;c.z=a.z*b+c.z*d;return c};THREE.Vertex=function(){console.warn("THREE.Vertex has been DEPRECATED. Use THREE.Vector3 instead.")};
THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=f;this.centroid=new THREE.Vector3};
THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;b=0;for(c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();
return a}};THREE.Face4=function(a,b,c,d,e,f,g){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=g;this.centroid=new THREE.Vector3};
......
......@@ -79,7 +79,7 @@ this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRo
Math.abs(this.x);this.y=a.elements[8]-a.elements[2]<0?-Math.abs(this.y):Math.abs(this.y);this.z=a.elements[1]-a.elements[4]<0?-Math.abs(this.z):Math.abs(this.z);this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x=this.x*-1;this.y=this.y*-1;this.z=this.z*-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=
Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);if(a===0)this.w=this.z=this.y=this.x=0;else{a=1/a;this.x=this.x*a;this.y=this.y*a;this.z=this.z*a;this.w=this.w*a}return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,f=a.x,g=a.y,i=a.z,a=a.w;this.x=b*a+e*f+c*i-d*g;this.y=
c*a+e*g+d*f-b*i;this.z=d*a+e*i+b*g-c*f;this.w=e*a-b*f-c*g-d*i;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,f=this.x,g=this.y,i=this.z,j=this.w,k=j*c+g*e-i*d,h=j*d+i*c-f*e,m=j*e+f*d-g*c,c=-f*c-g*d-i*e;b.x=k*j+c*-f+h*-i-m*-g;b.y=h*j+c*-g+m*-f-k*-i;b.z=m*j+c*-i+k*-g-h*-f;return b},clone:function(){return new THREE.Quaternion(this.x,this.y,this.z,this.w)}};
THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(e<0){c.w=-b.w;c.x=-b.x;c.y=-b.y;c.z=-b.z;e=-e}else c.copy(b);if(Math.abs(e)>=1){c.w=a.w;c.x=a.x;c.y=a.y;c.z=a.z;return c}var f=Math.acos(e),e=Math.sqrt(1-e*e);if(Math.abs(e)<0.001){c.w=0.5*(a.w+b.w);c.x=0.5*(a.x+b.x);c.y=0.5*(a.y+b.y);c.z=0.5*(a.z+b.z);return c}b=Math.sin((1-d)*f)/e;d=Math.sin(d*f)/e;c.w=a.w*b+c.w*d;c.x=a.x*b+c.x*d;c.y=a.y*b+c.y*d;c.z=a.z*b+c.z*d;return c};THREE.Vertex=THREE.Vector3;
THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(e<0){c.w=-b.w;c.x=-b.x;c.y=-b.y;c.z=-b.z;e=-e}else c.copy(b);if(Math.abs(e)>=1){c.w=a.w;c.x=a.x;c.y=a.y;c.z=a.z;return c}var f=Math.acos(e),e=Math.sqrt(1-e*e);if(Math.abs(e)<0.001){c.w=0.5*(a.w+b.w);c.x=0.5*(a.x+b.x);c.y=0.5*(a.y+b.y);c.z=0.5*(a.z+b.z);return c}b=Math.sin((1-d)*f)/e;d=Math.sin(d*f)/e;c.w=a.w*b+c.w*d;c.x=a.x*b+c.x*d;c.y=a.y*b+c.y*d;c.z=a.z*b+c.z*d;return c};THREE.Vertex=function(){console.warn("THREE.Vertex has been DEPRECATED. Use THREE.Vector3 instead.")};
THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=f;this.centroid=new THREE.Vector3};
THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;b=0;for(c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();
return a}};THREE.Face4=function(a,b,c,d,e,f,g){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=g;this.centroid=new THREE.Vector3};
......
This diff is collapsed.
......@@ -79,7 +79,7 @@ this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRo
Math.abs(this.x);this.y=a.elements[8]-a.elements[2]<0?-Math.abs(this.y):Math.abs(this.y);this.z=a.elements[1]-a.elements[4]<0?-Math.abs(this.z):Math.abs(this.z);this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x=this.x*-1;this.y=this.y*-1;this.z=this.z*-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=
Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);if(a===0)this.w=this.z=this.y=this.x=0;else{a=1/a;this.x=this.x*a;this.y=this.y*a;this.z=this.z*a;this.w=this.w*a}return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,f=a.x,g=a.y,i=a.z,a=a.w;this.x=b*a+e*f+c*i-d*g;this.y=
c*a+e*g+d*f-b*i;this.z=d*a+e*i+b*g-c*f;this.w=e*a-b*f-c*g-d*i;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,f=this.x,g=this.y,i=this.z,j=this.w,k=j*c+g*e-i*d,h=j*d+i*c-f*e,m=j*e+f*d-g*c,c=-f*c-g*d-i*e;b.x=k*j+c*-f+h*-i-m*-g;b.y=h*j+c*-g+m*-f-k*-i;b.z=m*j+c*-i+k*-g-h*-f;return b},clone:function(){return new THREE.Quaternion(this.x,this.y,this.z,this.w)}};
THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(e<0){c.w=-b.w;c.x=-b.x;c.y=-b.y;c.z=-b.z;e=-e}else c.copy(b);if(Math.abs(e)>=1){c.w=a.w;c.x=a.x;c.y=a.y;c.z=a.z;return c}var f=Math.acos(e),e=Math.sqrt(1-e*e);if(Math.abs(e)<0.001){c.w=0.5*(a.w+b.w);c.x=0.5*(a.x+b.x);c.y=0.5*(a.y+b.y);c.z=0.5*(a.z+b.z);return c}b=Math.sin((1-d)*f)/e;d=Math.sin(d*f)/e;c.w=a.w*b+c.w*d;c.x=a.x*b+c.x*d;c.y=a.y*b+c.y*d;c.z=a.z*b+c.z*d;return c};THREE.Vertex=THREE.Vector3;
THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(e<0){c.w=-b.w;c.x=-b.x;c.y=-b.y;c.z=-b.z;e=-e}else c.copy(b);if(Math.abs(e)>=1){c.w=a.w;c.x=a.x;c.y=a.y;c.z=a.z;return c}var f=Math.acos(e),e=Math.sqrt(1-e*e);if(Math.abs(e)<0.001){c.w=0.5*(a.w+b.w);c.x=0.5*(a.x+b.x);c.y=0.5*(a.y+b.y);c.z=0.5*(a.z+b.z);return c}b=Math.sin((1-d)*f)/e;d=Math.sin(d*f)/e;c.w=a.w*b+c.w*d;c.x=a.x*b+c.x*d;c.y=a.y*b+c.y*d;c.z=a.z*b+c.z*d;return c};THREE.Vertex=function(){console.warn("THREE.Vertex has been DEPRECATED. Use THREE.Vector3 instead.")};
THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=f;this.centroid=new THREE.Vector3};
THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;b=0;for(c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();
return a}};THREE.Face4=function(a,b,c,d,e,f,g){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=e instanceof THREE.Vector3?e:new THREE.Vector3;this.vertexNormals=e instanceof Array?e:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=g;this.centroid=new THREE.Vector3};
......
......@@ -79,7 +79,7 @@ this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRo
Math.abs(this.x);this.y=a.elements[8]-a.elements[2]<0?-Math.abs(this.y):Math.abs(this.y);this.z=a.elements[1]-a.elements[4]<0?-Math.abs(this.z):Math.abs(this.z);this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x=this.x*-1;this.y=this.y*-1;this.z=this.z*-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a=
Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);if(a===0)this.w=this.z=this.y=this.x=0;else{a=1/a;this.x=this.x*a;this.y=this.y*a;this.z=this.z*a;this.w=this.w*a}return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,f=this.w,g=a.x,i=a.y,h=a.z,a=a.w;this.x=b*a+f*g+c*h-d*i;this.y=
c*a+f*i+d*g-b*h;this.z=d*a+f*h+b*i-c*g;this.w=f*a-b*g-c*i-d*h;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,f=a.z,g=this.x,i=this.y,h=this.z,k=this.w,l=k*c+i*f-h*d,j=k*d+h*c-g*f,n=k*f+g*d-i*c,c=-g*c-i*d-h*f;b.x=l*k+c*-g+j*-h-n*-i;b.y=j*k+c*-i+n*-g-l*-h;b.z=n*k+c*-h+l*-i-j*-g;return b},clone:function(){return new THREE.Quaternion(this.x,this.y,this.z,this.w)}};
THREE.Quaternion.slerp=function(a,b,c,d){var f=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(f<0){c.w=-b.w;c.x=-b.x;c.y=-b.y;c.z=-b.z;f=-f}else c.copy(b);if(Math.abs(f)>=1){c.w=a.w;c.x=a.x;c.y=a.y;c.z=a.z;return c}var g=Math.acos(f),f=Math.sqrt(1-f*f);if(Math.abs(f)<0.001){c.w=0.5*(a.w+b.w);c.x=0.5*(a.x+b.x);c.y=0.5*(a.y+b.y);c.z=0.5*(a.z+b.z);return c}b=Math.sin((1-d)*g)/f;d=Math.sin(d*g)/f;c.w=a.w*b+c.w*d;c.x=a.x*b+c.x*d;c.y=a.y*b+c.y*d;c.z=a.z*b+c.z*d;return c};THREE.Vertex=THREE.Vector3;
THREE.Quaternion.slerp=function(a,b,c,d){var f=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(f<0){c.w=-b.w;c.x=-b.x;c.y=-b.y;c.z=-b.z;f=-f}else c.copy(b);if(Math.abs(f)>=1){c.w=a.w;c.x=a.x;c.y=a.y;c.z=a.z;return c}var g=Math.acos(f),f=Math.sqrt(1-f*f);if(Math.abs(f)<0.001){c.w=0.5*(a.w+b.w);c.x=0.5*(a.x+b.x);c.y=0.5*(a.y+b.y);c.z=0.5*(a.z+b.z);return c}b=Math.sin((1-d)*g)/f;d=Math.sin(d*g)/f;c.w=a.w*b+c.w*d;c.x=a.x*b+c.x*d;c.y=a.y*b+c.y*d;c.z=a.z*b+c.z*d;return c};THREE.Vertex=function(){console.warn("THREE.Vertex has been DEPRECATED. Use THREE.Vector3 instead.")};
THREE.Face3=function(a,b,c,d,f,g){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=f instanceof THREE.Color?f:new THREE.Color;this.vertexColors=f instanceof Array?f:[];this.vertexTangents=[];this.materialIndex=g;this.centroid=new THREE.Vector3};
THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;b=0;for(c=this.vertexNormals.length;b<c;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();b=0;for(c=this.vertexColors.length;b<c;b++)a.vertexColors[b]=this.vertexColors[b].clone();b=0;for(c=this.vertexTangents.length;b<c;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();
return a}};THREE.Face4=function(a,b,c,d,f,g,i){this.a=a;this.b=b;this.c=c;this.d=d;this.normal=f instanceof THREE.Vector3?f:new THREE.Vector3;this.vertexNormals=f instanceof Array?f:[];this.color=g instanceof THREE.Color?g:new THREE.Color;this.vertexColors=g instanceof Array?g:[];this.vertexTangents=[];this.materialIndex=i;this.centroid=new THREE.Vector3};
......@@ -333,7 +333,7 @@ THREE.BufferGeometry=function(){this.id=THREE.GeometryCount++;this.vertexColorAr
THREE.Gyroscope=function(){THREE.Object3D.call(this)};THREE.Gyroscope.prototype=new THREE.Object3D;THREE.Gyroscope.prototype.constructor=THREE.Gyroscope;
THREE.Gyroscope.prototype.updateMatrixWorld=function(a){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||a){if(this.parent){this.matrixWorld.multiply(this.parent.matrixWorld,this.matrix);this.matrixWorld.decompose(this.translationWorld,this.rotationWorld,this.scaleWorld);this.matrix.decompose(this.translationObject,this.rotationObject,this.scaleObject);this.matrixWorld.compose(this.translationWorld,this.rotationObject,this.scaleWorld)}else this.matrixWorld.copy(this.matrix);
this.matrixWorldNeedsUpdate=false;a=true}for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)};THREE.Gyroscope.prototype.translationWorld=new THREE.Vector3;THREE.Gyroscope.prototype.translationObject=new THREE.Vector3;THREE.Gyroscope.prototype.rotationWorld=new THREE.Quaternion;THREE.Gyroscope.prototype.rotationObject=new THREE.Quaternion;THREE.Gyroscope.prototype.scaleWorld=new THREE.Vector3;THREE.Gyroscope.prototype.scaleObject=new THREE.Vector3;
THREE.CameraHelper=function(a){function b(a,b,d){c(a,d);c(b,d)}function c(a,b){d.lineGeometry.vertices.push(new THREE.Vertex);d.lineGeometry.colors.push(new THREE.Color(b));d.pointMap[a]===void 0&&(d.pointMap[a]=[]);d.pointMap[a].push(d.lineGeometry.vertices.length-1)}THREE.Object3D.call(this);var d=this;this.lineGeometry=new THREE.Geometry;this.lineMaterial=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors});this.pointMap={};b("n1","n2",16755200);b("n2","n4",16755200);b("n4",
THREE.CameraHelper=function(a){function b(a,b,d){c(a,d);c(b,d)}function c(a,b){d.lineGeometry.vertices.push(new THREE.Vector3);d.lineGeometry.colors.push(new THREE.Color(b));d.pointMap[a]===void 0&&(d.pointMap[a]=[]);d.pointMap[a].push(d.lineGeometry.vertices.length-1)}THREE.Object3D.call(this);var d=this;this.lineGeometry=new THREE.Geometry;this.lineMaterial=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors});this.pointMap={};b("n1","n2",16755200);b("n2","n4",16755200);b("n4",
"n3",16755200);b("n3","n1",16755200);b("f1","f2",16755200);b("f2","f4",16755200);b("f4","f3",16755200);b("f3","f1",16755200);b("n1","f1",16755200);b("n2","f2",16755200);b("n3","f3",16755200);b("n4","f4",16755200);b("p","n1",16711680);b("p","n2",16711680);b("p","n3",16711680);b("p","n4",16711680);b("u1","u2",43775);b("u2","u3",43775);b("u3","u1",43775);b("c","t",16777215);b("p","c",3355443);b("cn1","cn2",3355443);b("cn3","cn4",3355443);b("cf1","cf2",3355443);b("cf3","cf4",3355443);this.camera=a;this.update(a);
this.lines=new THREE.Line(this.lineGeometry,this.lineMaterial,THREE.LinePieces);this.add(this.lines)};THREE.CameraHelper.prototype=new THREE.Object3D;THREE.CameraHelper.prototype.constructor=THREE.CameraHelper;
THREE.CameraHelper.prototype.update=function(){function a(a,d,f,g){THREE.CameraHelper.__v.set(d,f,g);THREE.CameraHelper.__projector.unprojectVector(THREE.CameraHelper.__v,THREE.CameraHelper.__c);a=b.pointMap[a];if(a!==void 0){d=0;for(f=a.length;d<f;d++)b.lineGeometry.vertices[a[d]].copy(THREE.CameraHelper.__v)}}var b=this;THREE.CameraHelper.__c.projectionMatrix.copy(this.camera.projectionMatrix);a("c",0,0,-1);a("t",0,0,1);a("n1",-1,-1,-1);a("n2",1,-1,-1);a("n3",-1,1,-1);a("n4",1,1,-1);a("f1",-1,-1,
......
......@@ -53,8 +53,8 @@
// Grid
var geometry = new THREE.Geometry();
geometry.vertices.push( new THREE.Vertex( - 500, 0, 0 ) );
geometry.vertices.push( new THREE.Vertex( 500, 0, 0 ) );
geometry.vertices.push( new THREE.Vector3( - 500, 0, 0 ) );
geometry.vertices.push( new THREE.Vector3( 500, 0, 0 ) );
for ( var i = 0; i <= 20; i ++ ) {
......
......@@ -119,8 +119,8 @@
// Grid
var geometry = new THREE.Geometry();
geometry.vertices.push( new THREE.Vertex( - 500, 0, 0 ) );
geometry.vertices.push( new THREE.Vertex( 500, 0, 0 ) );
geometry.vertices.push( new THREE.Vector3( - 500, 0, 0 ) );
geometry.vertices.push( new THREE.Vector3( 500, 0, 0 ) );
for ( var i = 0; i <= 20; i ++ ) {
......
......@@ -55,8 +55,8 @@
// Grid
var geometry = new THREE.Geometry();
geometry.vertices.push( new THREE.Vertex( - 500, 0, 0 ) );
geometry.vertices.push( new THREE.Vertex( 500, 0, 0 ) );
geometry.vertices.push( new THREE.Vector3( - 500, 0, 0 ) );
geometry.vertices.push( new THREE.Vector3( 500, 0, 0 ) );
var material = new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.2 } );
......
......@@ -85,7 +85,7 @@
particle.scale.x = particle.scale.y = 5;
scene.add( particle );
geometry.vertices.push( new THREE.Vertex().copy( particle.position ) );
geometry.vertices.push( particle.position );
}
......
......@@ -93,7 +93,7 @@
var geometry = new THREE.Geometry();
var vertex = new THREE.Vertex( Math.random() * 2 - 1, Math.random() * 2 - 1, Math.random() * 2 - 1 );
var vertex = new THREE.Vector3( Math.random() * 2 - 1, Math.random() * 2 - 1, Math.random() * 2 - 1 );
vertex.normalize();
vertex.multiplyScalar( 450 );
......
......@@ -44,8 +44,8 @@
// Grid
var geometry = new THREE.Geometry();
geometry.vertices.push( new THREE.Vertex( - 500, 0, 0 ) );
geometry.vertices.push( new THREE.Vertex( 500, 0, 0 ) );
geometry.vertices.push( new THREE.Vector3( - 500, 0, 0 ) );
geometry.vertices.push( new THREE.Vector3( 500, 0, 0 ) );
var material = new THREE.LineBasicMaterial( { color: 0xffffff, opacity: 0.2 } );
......
......@@ -54,8 +54,8 @@
// Grid
var geometry = new THREE.Geometry();
geometry.vertices.push( new THREE.Vertex( - 500, 0, 0 ) );
geometry.vertices.push( new THREE.Vertex( 500, 0, 0 ) );
geometry.vertices.push( new THREE.Vector3( - 500, 0, 0 ) );
geometry.vertices.push( new THREE.Vector3( 500, 0, 0 ) );
var material = new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.5 } );
......
......@@ -69,8 +69,8 @@
// Grid
var geometry = new THREE.Geometry();
geometry.vertices.push( new THREE.Vertex( - 500, 0, 0 ) );
geometry.vertices.push( new THREE.Vertex( 500, 0, 0 ) );
geometry.vertices.push( new THREE.Vector3( - 500, 0, 0 ) );
geometry.vertices.push( new THREE.Vector3( 500, 0, 0 ) );
var material = new THREE.LineBasicMaterial( { color: 0x000000, opacity: 0.5 } );
......
......@@ -602,7 +602,7 @@ THREE.MarchingCubes = function ( resolution, material ) {
var geo_callback = function( object ) {
var i, x, y, z, vertex, position, normal,
var i, x, y, z, vertex, normal,
face, a, b, c, na, nb, nc, nfaces;
......@@ -615,7 +615,7 @@ THREE.MarchingCubes = function ( resolution, material ) {
x = object.positionArray[ a ];
y = object.positionArray[ b ];
z = object.positionArray[ c ];
position = new THREE.Vector3( x, y, z );
vertex = new THREE.Vector3( x, y, z );
x = object.normalArray[ a ];
y = object.normalArray[ b ];
......@@ -623,8 +623,6 @@ THREE.MarchingCubes = function ( resolution, material ) {
normal = new THREE.Vector3( x, y, z );
normal.normalize();
vertex = new THREE.Vertex( position );
geo.vertices.push( vertex );
normals.push( normal );
......
......@@ -763,7 +763,7 @@ THREE.CTMLoader.prototype.createModelClassic = function ( file, callback ) {
function vertex ( scope, x, y, z ) {
scope.vertices.push( new THREE.Vertex( x, y, z ) );
scope.vertices.push( new THREE.Vector3( x, y, z ) );
};
......
......@@ -181,7 +181,10 @@
for ( i = 0; i < 250; i ++ ) {
var vertex = new THREE.Vertex( Math.random() * 2 - 1, Math.random() * 2 - 1, Math.random() * 2 - 1 );
var vertex = new THREE.Vector3();
vertex.x = Math.random() * 2 - 1;
vertex.y = Math.random() * 2 - 1;
vertex.z = Math.random() * 2 - 1;
vertex.multiplyScalar( r );
starsGeometry[ 0 ].vertices.push( vertex );
......@@ -190,7 +193,10 @@
for ( i = 0; i < 1500; i ++ ) {
var vertex = new THREE.Vertex( Math.random() * 2 - 1, Math.random() * 2 - 1, Math.random() * 2 - 1 );
var vertex = new THREE.Vector3();
vertex.x = Math.random() * 2 - 1;
vertex.y = Math.random() * 2 - 1;
vertex.z = Math.random() * 2 - 1;
vertex.multiplyScalar( r );
starsGeometry[ 1 ].vertices.push( vertex );
......
......@@ -103,9 +103,9 @@
var v = new THREE.Vector3( Math.random() * 1000 - 500, Math.random() * 1000 - 500, Math.random() * 1000 - 500 );
var v0 = new THREE.Vertex( Math.random() * 100 - 50, Math.random() * 100 - 50, Math.random() * 100 - 50 );
var v1 = new THREE.Vertex( Math.random() * 100 - 50, Math.random() * 100 - 50, Math.random() * 100 - 50 );
var v2 = new THREE.Vertex( Math.random() * 100 - 50, Math.random() * 100 - 50, Math.random() * 100 - 50 );
var v0 = new THREE.Vector3( Math.random() * 100 - 50, Math.random() * 100 - 50, Math.random() * 100 - 50 );
var v1 = new THREE.Vector3( Math.random() * 100 - 50, Math.random() * 100 - 50, Math.random() * 100 - 50 );
var v2 = new THREE.Vector3( Math.random() * 100 - 50, Math.random() * 100 - 50, Math.random() * 100 - 50 );
v0.addSelf( v );
v1.addSelf( v );
......
......@@ -25,7 +25,7 @@ var Bird = function () {
function v( x, y, z ) {
scope.vertices.push( new THREE.Vertex( x, y, z ) );
scope.vertices.push( new THREE.Vector3( x, y, z ) );
}
......
......@@ -1443,7 +1443,7 @@ var Qrcode = function () {
function v( x, y, z ) {
scope.vertices.push( new THREE.Vertex( x, y, z ) );
scope.vertices.push( new THREE.Vector3( x, y, z ) );
}
......
......@@ -115,19 +115,20 @@
//
var x, y, z, geo = new THREE.Geometry();
var geometry = new THREE.Geometry();
for ( var i = 0; i < 10000; i ++ ) {
x = THREE.Math.randFloatSpread( 2000 );
y = THREE.Math.randFloatSpread( 2000 );
z = THREE.Math.randFloatSpread( 2000 );
var vertex = new THREE.Vector3();
vertex.x = THREE.Math.randFloatSpread( 2000 );
vertex.y = THREE.Math.randFloatSpread( 2000 );
vertex.z = THREE.Math.randFloatSpread( 2000 );
geo.vertices.push( new THREE.Vertex( x, y, z ) );
geometry.vertices.push( vertex );
}
var particles = new THREE.ParticleSystem( geo, new THREE.ParticleBasicMaterial( { color: 0x888888 } ) );
var particles = new THREE.ParticleSystem( geometry, new THREE.ParticleBasicMaterial( { color: 0x888888 } ) );
scene.add( particles );
//
......
......@@ -138,7 +138,10 @@
for ( var i = 0; i < 100000; i++ ) {
var vertex = new THREE.Vertex( Math.random() * 2 - 1, Math.random() * 2 - 1, Math.random() * 2 - 1 );
var vertex = new THREE.Vector3();
vertex.x = Math.random() * 2 - 1;
vertex.y = Math.random() * 2 - 1;
vertex.z = Math.random() * 2 - 1;
vertex.multiplyScalar( radius );
geometry.vertices.push( vertex );
......
......@@ -140,8 +140,10 @@
for ( var i = 0; i < 100000; i ++ ) {
var vertex = new THREE.Vertex( Math.random() * 2 - 1, Math.random() * 2 - 1, Math.random() * 2 - 1 );
var vertex = new THREE.Vector3();
vertex.x = Math.random() * 2 - 1;
vertex.y = Math.random() * 2 - 1;
vertex.z = Math.random() * 2 - 1;
vertex.multiplyScalar( radius );
if ( ( vertex.x > inner || vertex.x < -inner ) ||
......
......@@ -155,7 +155,7 @@
for ( var i = 0, l = width * height; i < l; i ++ ) {
var vertex = new THREE.Vertex();
var vertex = new THREE.Vector3();
vertex.x = ( i % width );
vertex.y = Math.floor( i / width );
......
......@@ -98,7 +98,7 @@
for ( i = 0; i < points.length; i ++ ) {
geometry.vertices.push( new THREE.Vertex().copy( points[ i ] ) );
geometry.vertices.push( points[ i ] );
colors[ i ] = new THREE.Color( 0xffffff );
colors[ i ].setHSV( 0.6, ( 200 + points[ i ].x ) / 400, 1.0 );
......
......@@ -85,7 +85,7 @@
for ( i = 0; i < points.length; i ++ ) {
geometry.vertices.push( new THREE.Vertex().copy( points[i] ) );
geometry.vertices.push( points[i] );
}
......
......@@ -89,7 +89,10 @@
for ( i = 0; i < 1500; i ++ ) {
var vertex1 = new THREE.Vertex( Math.random() * 2 - 1, Math.random() * 2 - 1, Math.random() * 2 - 1 );
var vertex1 = new THREE.Vector3();
vertex1.x = Math.random() * 2 - 1;
vertex1.y = Math.random() * 2 - 1;
vertex1.z = Math.random() * 2 - 1;
vertex1.normalize();
vertex1.multiplyScalar( r );
......
......@@ -98,7 +98,7 @@
index = i / ( points.length * n_sub );
position = spline.getPoint( index );
geometry.vertices[ i ] = new THREE.Vertex( position.x, position.y, position.z );
geometry.vertices[ i ] = new THREE.Vector3( position.x, position.y, position.z );
colors[ i ] = new THREE.Color( 0xffffff );
colors[ i ].setHSV( 0.6, ( 200 + position.x ) / 400, 1.0 );
......
......@@ -81,11 +81,11 @@
for ( var i = 0; i <= size / step * 2; i ++ ) {
geometry.vertices.push( new THREE.Vertex( - size, floor, i * step - size ) );
geometry.vertices.push( new THREE.Vertex( size, floor, i * step - size ) );
geometry.vertices.push( new THREE.Vector3( - size, floor, i * step - size ) );
geometry.vertices.push( new THREE.Vector3( size, floor, i * step - size ) );
geometry.vertices.push( new THREE.Vertex( i * step - size, floor, -size ) );
geometry.vertices.push( new THREE.Vertex( i * step - size, floor, size ) );
geometry.vertices.push( new THREE.Vector3( i * step - size, floor, -size ) );
geometry.vertices.push( new THREE.Vector3( i * step - size, floor, size ) );
}
......
......@@ -109,10 +109,10 @@
for ( var i = 0; i <= size / step * 2; i ++ ) {
geometry.vertices.push( new THREE.Vertex( - size, floor, i * step - size ) );
geometry.vertices.push( new THREE.Vertex( size, floor, i * step - size ) );
geometry.vertices.push( new THREE.Vertex( i * step - size, floor, -size ) );
geometry.vertices.push( new THREE.Vertex( i * step - size, floor, size ) );
geometry.vertices.push( new THREE.Vector3( - size, floor, i * step - size ) );
geometry.vertices.push( new THREE.Vector3( size, floor, i * step - size ) );
geometry.vertices.push( new THREE.Vector3( i * step - size, floor, -size ) );
geometry.vertices.push( new THREE.Vector3( i * step - size, floor, size ) );
}
......
......@@ -54,11 +54,11 @@
for ( var i = 0; i <= 40; i ++ ) {
geometry.vertices.push( new THREE.Vertex( - 500, floor, i * step - 500 ) );
geometry.vertices.push( new THREE.Vertex( 500, floor, i * step - 500 ) );
geometry.vertices.push( new THREE.Vector3( - 500, floor, i * step - 500 ) );
geometry.vertices.push( new THREE.Vector3( 500, floor, i * step - 500 ) );
geometry.vertices.push( new THREE.Vertex( i * step - 500, floor, -500 ) );
geometry.vertices.push( new THREE.Vertex( i * step - 500, floor, 500 ) );
geometry.vertices.push( new THREE.Vector3( i * step - 500, floor, -500 ) );
geometry.vertices.push( new THREE.Vector3( i * step - 500, floor, 500 ) );
}
......
......@@ -119,7 +119,7 @@
for ( var v = 0; v < geometry.vertices.length; v ++ ) {
vertices.push( new THREE.Vertex().copy( geometry.vertices[ v ] ) );
vertices.push( geometry.vertices[ v ].clone() );
if ( v === i ) {
......
......@@ -73,7 +73,7 @@
for ( i = 0; i < 10000; i ++ ) {
var vertex = new THREE.Vertex();
var vertex = new THREE.Vector3();
vertex.x = 2000 * Math.random() - 1000;
vertex.y = 2000 * Math.random() - 1000;
vertex.z = 2000 * Math.random() - 1000;
......
......@@ -73,7 +73,7 @@
for ( i = 0; i < 5000; i ++ ) {
var vertex = new THREE.Vertex();
var vertex = new THREE.Vector3();
vertex.x = 2000 * Math.random() - 1000;
vertex.y = 2000 * Math.random() - 1000;
vertex.z = 2000 * Math.random() - 1000;
......
......@@ -214,7 +214,7 @@
p = vertices[ i ];
geometry.vertices[ i ] = new THREE.Vertex().copy( p );
geometry.vertices[ i ] = p.clone();
vertices_tmp[ i ] = [ p.x, p.y, p.z, 0, 0 ];
}
......
......@@ -71,7 +71,7 @@
for ( i = 0; i < 20000; i ++ ) {
var vertex = new THREE.Vertex();
var vertex = new THREE.Vector3();
vertex.x = Math.random() * 2000 - 1000;
vertex.y = Math.random() * 2000 - 1000;
vertex.z = Math.random() * 2000 - 1000;
......
......@@ -201,7 +201,7 @@
function newpos( x, y, z ) {
return new THREE.Vertex( x, y, z );
return new THREE.Vector3( x, y, z );
}
......
......@@ -78,7 +78,7 @@
for ( i = 0; i < 10000; i ++ ) {
var vertex = new THREE.Vertex();
var vertex = new THREE.Vector3();
vertex.x = Math.random() * 2000 - 1000;
vertex.y = Math.random() * 2000 - 1000;
vertex.z = Math.random() * 2000 - 1000;
......
......@@ -101,8 +101,8 @@
}
geometry.vertices.push( new THREE.Vertex( x, y, z ) );
geometry2.vertices.push( new THREE.Vertex( x, y, z ) );
geometry.vertices.push( new THREE.Vector3( x, y, z ) );
geometry2.vertices.push( new THREE.Vector3( x, y, z ) );
h = i2 % 2 ? 1 : 0.15;
if( i2 % 4 <= 2 ) h -= 0.15;
......
......@@ -198,7 +198,10 @@
for ( var i = 0; i < 1500; i ++ ) {
var vertex = new THREE.Vertex( Math.random() * 2 - 1, Math.random() * 2 - 1, Math.random() * 2 - 1 );
var vertex = new THREE.Vector3();
vertex.x = Math.random() * 2 - 1;
vertex.y = Math.random() * 2 - 1;
vertex.z = Math.random() * 2 - 1;
vertex.multiplyScalar( radius );
starsGeometry.vertices.push( vertex );
......
......@@ -55,7 +55,7 @@
for ( var i = 0; i < 2000; i ++ ) {
var vertex = new THREE.Vertex();
var vertex = new THREE.Vector3();
vertex.x = Math.random() * 4000 - 2000;
vertex.y = Math.random() * 4000 - 2000;
vertex.z = Math.random() * 4000 - 2000;
......
......@@ -2,4 +2,8 @@
* @author mr.doob / http://mrdoob.com/
*/
THREE.Vertex = THREE.Vector3;
THREE.Vertex = function () {
console.warn( 'THREE.Vertex has been DEPRECATED. Use THREE.Vector3 instead.')
};
......@@ -221,7 +221,7 @@ THREE.PathControls = function ( object, domElement ) {
index = i / ( spline.points.length * n_sub );
position = spline.getPoint( index );
geometry.vertices[ i ] = new THREE.Vertex( position.x, position.y, position.z );
geometry.vertices[ i ] = new THREE.Vector3( position.x, position.y, position.z );
}
......
......@@ -185,7 +185,7 @@ THREE.CurvePath.prototype.getBoundingBox = function () {
THREE.CurvePath.prototype.createPointsGeometry = function( divisions ) {
var pts = this.getPoints( divisions, true );
var pts = this.getPoints( divisions, true );
return this.createGeometry( pts );
};
......@@ -194,7 +194,7 @@ THREE.CurvePath.prototype.createPointsGeometry = function( divisions ) {
THREE.CurvePath.prototype.createSpacedPointsGeometry = function( divisions ) {
var pts = this.getSpacedPoints( divisions, true );
var pts = this.getSpacedPoints( divisions, true );
return this.createGeometry( pts );
};
......@@ -203,13 +203,13 @@ THREE.CurvePath.prototype.createGeometry = function( points ) {
var geometry = new THREE.Geometry();
for( var i = 0; i < points.length; i ++ ) {
for ( var i = 0; i < points.length; i ++ ) {
geometry.vertices.push( new THREE.Vertex( points[ i ].x, points[ i ].y, 0 ) );
geometry.vertices.push( new THREE.Vector3( points[ i ].x, points[ i ].y, 0 ) );
}
}
return geometry;
return geometry;
};
......
......@@ -100,7 +100,7 @@ THREE.CubeGeometry = function ( width, height, depth, segmentsWidth, segmentsHei
for ( ix = 0; ix < gridX1; ix ++ ) {
var vector = new THREE.Vertex();
var vector = new THREE.Vector3();
vector[ u ] = ( ix * segment_width - width_half ) * udir;
vector[ v ] = ( iy * segment_height - height_half ) * vdir;
vector[ w ] = depth;
......
......@@ -28,11 +28,12 @@ THREE.CylinderGeometry = function ( radiusTop, radiusBottom, height, segmentsRad
var u = x / segmentsX;
var xpos = radius * Math.sin( u * Math.PI * 2 );
var ypos = - v * height + heightHalf;
var zpos = radius * Math.cos( u * Math.PI * 2 );
var vertex = new THREE.Vector3();
vertex.x = radius * Math.sin( u * Math.PI * 2 );
vertex.y = - v * height + heightHalf;
vertex.z = radius * Math.cos( u * Math.PI * 2 );
this.vertices.push( new THREE.Vertex( xpos, ypos, zpos ) );
this.vertices.push( vertex );
verticesRow.push( this.vertices.length - 1 );
uvsRow.push( new THREE.UV( u, v ) );
......@@ -76,7 +77,7 @@ THREE.CylinderGeometry = function ( radiusTop, radiusBottom, height, segmentsRad
if ( !openEnded && radiusTop > 0 ) {
this.vertices.push( new THREE.Vertex( 0, heightHalf, 0 ) );
this.vertices.push( new THREE.Vector3( 0, heightHalf, 0 ) );
for ( x = 0; x < segmentsX; x ++ ) {
......@@ -103,7 +104,7 @@ THREE.CylinderGeometry = function ( radiusTop, radiusBottom, height, segmentsRad
if ( !openEnded && radiusBottom > 0 ) {
this.vertices.push( new THREE.Vertex( 0, - heightHalf, 0 ) );
this.vertices.push( new THREE.Vector3( 0, - heightHalf, 0 ) );
for ( x = 0; x < segmentsX; x ++ ) {
......
......@@ -625,7 +625,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function( shape, options ) {
function v( x, y, z ) {
scope.vertices.push( new THREE.Vertex( x, y, z ) );
scope.vertices.push( new THREE.Vector3( x, y, z ) );
}
function f3( a, b, c, isBottom ) {
......@@ -633,7 +633,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function( shape, options ) {
b += shapesOffset;
c += shapesOffset;
// normal, color, material
// normal, color, material
scope.faces.push( new THREE.Face3( a, b, c, null, null, material ) );
var uvs = isBottom ? uvgen.generateBottomUV( scope, shape, options, a, b, c)
......
......@@ -15,8 +15,7 @@ THREE.LatheGeometry = function ( points, steps, angle ) {
for ( var j = 0; j < points.length; j ++ ) {
_newV[ j ] = points[ j ].clone();
this.vertices.push( new THREE.Vertex().copy( _newV[ j ] ) );
this.vertices.push( points[ j ].clone() );
}
......@@ -27,8 +26,7 @@ THREE.LatheGeometry = function ( points, steps, angle ) {
for ( var j = 0; j < _newV.length; j ++ ) {
_newV[ j ] = _matrix.multiplyVector3( _newV[ j ].clone() );
this.vertices.push( new THREE.Vertex().copy( _newV[ j ] ) );
this.vertices.push( _matrix.multiplyVector3( _newV[ j ].clone() ) );
}
......
......@@ -25,7 +25,7 @@ THREE.PlaneGeometry = function ( width, depth, segmentsWidth, segmentsDepth ) {
var x = ix * segment_width - width_half;
var z = iz * segment_depth - depth_half;
this.vertices.push( new THREE.Vertex( x, 0, z ) );
this.vertices.push( new THREE.Vector3( x, 0, z ) );
}
......
......@@ -41,7 +41,7 @@ THREE.PolyhedronGeometry = function ( vertices, faces, radius, detail ) {
*/
function prepare( vector ) {
var vertex = new THREE.Vertex().copy( vector.normalize() );
var vertex = vector.normalize().clone();
vertex.index = that.vertices.push( vertex ) - 1;
// Texture coords are equivalent to map coords, calculate angle and convert to fraction of a circle.
......
......@@ -29,11 +29,12 @@ THREE.SphereGeometry = function ( radius, segmentsWidth, segmentsHeight, phiStar
var u = x / segmentsX;
var v = y / segmentsY;
var xpos = - radius * Math.cos( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength );
var ypos = radius * Math.cos( thetaStart + v * thetaLength );
var zpos = radius * Math.sin( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength );
var vertex = new THREE.Vector3();
vertex.x = - radius * Math.cos( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength );
vertex.y = radius * Math.cos( thetaStart + v * thetaLength );
vertex.z = radius * Math.sin( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength );
this.vertices.push( new THREE.Vertex( xpos, ypos, zpos ) );
this.vertices.push( vertex );
verticesRow.push( this.vertices.length - 1 );
uvsRow.push( new THREE.UV( u, v ) );
......
......@@ -28,7 +28,7 @@ THREE.TorusGeometry = function ( radius, tube, segmentsR, segmentsT, arc ) {
center.x = this.radius * Math.cos( u );
center.y = this.radius * Math.sin( u );
var vertex = new THREE.Vertex();
var vertex = new THREE.Vector3();
vertex.x = ( this.radius + this.tube * Math.cos( v ) ) * Math.cos( u );
vertex.y = ( this.radius + this.tube * Math.cos( v ) ) * Math.sin( u );
vertex.z = this.tube * Math.sin( v );
......
......@@ -84,7 +84,7 @@ THREE.TorusKnotGeometry = function ( radius, tube, segmentsR, segmentsT, p, q, h
function vert( x, y, z ) {
return scope.vertices.push( new THREE.Vertex( x, y, z ) ) - 1;
return scope.vertices.push( new THREE.Vector3( x, y, z ) ) - 1;
}
......
......@@ -56,7 +56,7 @@ THREE.TubeGeometry = function( path, segments, radius, segmentsRadius, closed, d
function vert( x, y, z ) {
return scope.vertices.push( new THREE.Vertex( x, y, z ) ) - 1;
return scope.vertices.push( new THREE.Vector3( x, y, z ) ) - 1;
}
......
......@@ -13,59 +13,55 @@
THREE.ArrowHelper = function ( dir, origin, length, hex ) {
THREE.Object3D.call( this );
THREE.Object3D.call( this );
if ( hex === undefined ) hex = 0xffff00;
if ( length === undefined ) length = 20;
if ( hex === undefined ) hex = 0xffff00;
if ( length === undefined ) length = 20;
var lineGeometry = new THREE.Geometry();
lineGeometry.vertices.push( new THREE.Vertex( 0, 0, 0 ) );
lineGeometry.vertices.push( new THREE.Vertex( 0, 1, 0 ) );
var lineGeometry = new THREE.Geometry();
lineGeometry.vertices.push( new THREE.Vector3( 0, 0, 0 ) );
lineGeometry.vertices.push( new THREE.Vector3( 0, 1, 0 ) );
this.line = new THREE.Line( lineGeometry, new THREE.LineBasicMaterial( { color : hex } ) );
this.add( this.line );
this.line = new THREE.Line( lineGeometry, new THREE.LineBasicMaterial( { color: hex } ) );
this.add( this.line );
var coneGeometry = new THREE.CylinderGeometry( 0, 0.05, 0.25, 5, 1 );
var coneGeometry = new THREE.CylinderGeometry( 0, 0.05, 0.25, 5, 1 );
this.cone = new THREE.Mesh( coneGeometry, new THREE.MeshBasicMaterial( { color : hex } ) );
this.cone.position.set( 0, 1, 0 );
this.add( this.cone );
this.cone = new THREE.Mesh( coneGeometry, new THREE.MeshBasicMaterial( { color: hex } ) );
this.cone.position.set( 0, 1, 0 );
this.add( this.cone );
if ( origin instanceof THREE.Vector3 ) {
if ( origin instanceof THREE.Vector3 ) this.position = origin;
this.position = origin;
}
this.setDirection( dir );
this.setLength( length );
this.setDirection( dir );
this.setLength( length );
};
THREE.ArrowHelper.prototype = new THREE.Object3D();
THREE.ArrowHelper.prototype.constructor = THREE.ArrowHelper;
THREE.ArrowHelper.prototype.setDirection = function( dir ) {
THREE.ArrowHelper.prototype.setDirection = function ( dir ) {
var axis = new THREE.Vector3( 0, 1, 0 ).crossSelf( dir );
var axis = new THREE.Vector3( 0, 1, 0 ).crossSelf( dir );
var radians = Math.acos( new THREE.Vector3( 0, 1, 0 ).dot( dir.clone().normalize() ) );
var radians = Math.acos( new THREE.Vector3( 0, 1, 0 ).dot( dir.clone().normalize() ) );
this.matrix = new THREE.Matrix4().makeRotationAxis( axis.normalize(), radians );
this.matrix = new THREE.Matrix4().makeRotationAxis( axis.normalize(), radians );
this.rotation.getRotationFromMatrix( this.matrix, this.scale );
this.rotation.getRotationFromMatrix( this.matrix, this.scale );
};
THREE.ArrowHelper.prototype.setLength = function( length ) {
THREE.ArrowHelper.prototype.setLength = function ( length ) {
this.scale.set( length, length, length );
this.scale.set( length, length, length );
};
THREE.ArrowHelper.prototype.setColor = function( hex ) {
THREE.ArrowHelper.prototype.setColor = function ( hex ) {
this.line.material.color.setHex( hex );
this.cone.material.color.setHex( hex );
this.line.material.color.setHex( hex );
this.cone.material.color.setHex( hex );
};
......@@ -8,8 +8,8 @@ THREE.AxisHelper = function () {
THREE.Object3D.call( this );
var lineGeometry = new THREE.Geometry();
lineGeometry.vertices.push( new THREE.Vertex() );
lineGeometry.vertices.push( new THREE.Vertex( 0, 100, 0 ) );
lineGeometry.vertices.push( new THREE.Vector3() );
lineGeometry.vertices.push( new THREE.Vector3( 0, 100, 0 ) );
var coneGeometry = new THREE.CylinderGeometry( 0, 5, 25, 5, 1 );
......
......@@ -84,7 +84,7 @@ THREE.CameraHelper = function ( camera ) {
function addPoint( id, hex ) {
_this.lineGeometry.vertices.push( new THREE.Vertex() );
_this.lineGeometry.vertices.push( new THREE.Vector3() );
_this.lineGeometry.colors.push( new THREE.Color( hex ) );
if ( _this.pointMap[ id ] === undefined ) _this.pointMap[ id ] = [];
......
......@@ -673,7 +673,7 @@ THREE.BinaryLoader.prototype.createBinModel = function ( data, callback, texture
function vertex ( scope, x, y, z ) {
scope.vertices.push( new THREE.Vertex( x, y, z ) );
scope.vertices.push( new THREE.Vector3( x, y, z ) );
};
......
......@@ -583,7 +583,7 @@ THREE.ColladaLoader = function () {
for ( i = 0; i < geometry.vertices.length; i++ ) {
skinned.push( new THREE.Vertex() );
skinned.push( new THREE.Vector3() );
}
......@@ -2306,8 +2306,7 @@ THREE.ColladaLoader = function () {
for ( i = 0; i < vertexData.length; i += 3 ) {
var v = new THREE.Vertex().copy( getConvertedVec3( vertexData, i ) );
this.geometry3js.vertices.push( v );
this.geometry3js.vertices.push( getConvertedVec3( vertexData, i ).clone() );
}
......
......@@ -159,7 +159,7 @@ THREE.JSONLoader.prototype.createModel = function ( json, callback, texturePath
while ( offset < zLength ) {
vertex = new THREE.Vertex();
vertex = new THREE.Vector3();
vertex.x = vertices[ offset ++ ] * scale;
vertex.y = vertices[ offset ++ ] * scale;
......@@ -369,7 +369,7 @@ THREE.JSONLoader.prototype.createModel = function ( json, callback, texturePath
if ( json.morphTargets !== undefined ) {
var i, l, v, vl, x, y, z, dstVertices, srcVertices;
var i, l, v, vl, dstVertices, srcVertices;
for ( i = 0, l = json.morphTargets.length; i < l; i ++ ) {
......@@ -382,11 +382,12 @@ THREE.JSONLoader.prototype.createModel = function ( json, callback, texturePath
for( v = 0, vl = srcVertices.length; v < vl; v += 3 ) {
x = srcVertices[ v ] * scale;
y = srcVertices[ v + 1 ] * scale;
z = srcVertices[ v + 2 ] * scale;
var vertex = new THREE.Vector3();
vertex.x = srcVertices[ v ] * scale;
vertex.y = srcVertices[ v + 1 ] * scale;
vertex.z = srcVertices[ v + 2 ] * scale;
dstVertices.push( new THREE.Vertex( x, y, z ) );
dstVertices.push( vertex );
}
......
......@@ -283,7 +283,7 @@ THREE.UTF8Loader.prototype.createModel = function ( data, callback, scale, offse
function vertex ( scope, x, y, z ) {
scope.vertices.push( new THREE.Vertex( x, y, z ) );
scope.vertices.push( new THREE.Vector3( x, y, z ) );
};
......
......@@ -57,7 +57,7 @@ THREE.SubdivisionModifier.prototype.smooth = function ( oldGeometry ) {
var newVertices = [], newFaces = [], newUVs = [];
function v( x, y, z ) {
newVertices.push( new THREE.Vertex( x, y, z ) );
newVertices.push( new THREE.Vector3( x, y, z ) );
}
var scope = this;
......@@ -294,7 +294,7 @@ THREE.SubdivisionModifier.prototype.smooth = function ( oldGeometry ) {
for (i=0, il = originalFaces.length; i<il ;i++) {
face = originalFaces[ i ];
facePoints.push( face.centroid );
newPoints.push( new THREE.Vertex().copy( face.centroid ) );
newPoints.push( face.centroid.clone() );
if (!scope.supportUVs) continue;
......@@ -430,7 +430,7 @@ THREE.SubdivisionModifier.prototype.smooth = function ( oldGeometry ) {
edgePoints[i] = originalVerticesLength + originalFaces.length + edgeCount;
newPoints.push( new THREE.Vertex().copy( avg ) );
newPoints.push( avg );
edgeCount ++;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment