Quellcode durchsuchen

Removed Vector* add() to addVectors() and addSelf() to add(). Same with sub, cross, min, max, lerp... Renamed Matrix* and Quaternion multiply() to multiplyMatrices(), multiplyQuaternions() and multiplySelf() to multiply(). See #2860.
Good thing we have a ton of examples to make sure nothing is broken. The unit tests also helped. However, I suspect I've left something unchanged.

Mr.doob vor 12 Jahren
Ursprung
Commit
b062fee866
72 geänderte Dateien mit 652 neuen und 635 gelöschten Zeilen
  1. 5 5
      editor/js/ui/Viewport.js
  2. 17 17
      examples/canvas_geometry_birds.html
  3. 1 1
      examples/canvas_interactive_cubes.html
  4. 1 1
      examples/canvas_interactive_cubes_tween.html
  5. 1 1
      examples/canvas_interactive_particles.html
  6. 1 1
      examples/canvas_interactive_voxelpainter.html
  7. 4 4
      examples/css3d_molecules.html
  8. 9 9
      examples/js/Car.js
  9. 10 10
      examples/js/Cloth.js
  10. 5 5
      examples/js/Sparks.js
  11. 1 1
      examples/js/UVsUtils.js
  12. 1 1
      examples/js/controls/FlyControls.js
  13. 4 4
      examples/js/controls/OrbitControls.js
  14. 5 5
      examples/js/controls/RollControls.js
  15. 13 13
      examples/js/controls/TrackballControls.js
  16. 2 2
      examples/js/effects/AnaglyphEffect.js
  17. 2 2
      examples/js/effects/ParallaxBarrierEffect.js
  18. 9 5
      examples/js/loaders/ColladaLoader.js
  19. 17 17
      examples/js/modifiers/SubdivisionModifier.js
  20. 3 3
      examples/js/renderers/WebGLDeferredRenderer.js
  21. 3 3
      examples/misc_ubiquity_test.html
  22. 3 3
      examples/webgl_buffergeometry.html
  23. 24 24
      examples/webgl_geometry_extrude_splines.html
  24. 1 2
      examples/webgl_geometry_normals.html
  25. 1 1
      examples/webgl_interactive_cubes.html
  26. 1 1
      examples/webgl_interactive_cubes_gpu.html
  27. 4 4
      examples/webgl_interactive_draggablecubes.html
  28. 1 1
      examples/webgl_interactive_voxelpainter.html
  29. 1 1
      examples/webgl_materials_cubemap_dynamic.html
  30. 1 1
      examples/webgl_ribbons.html
  31. 14 14
      src/core/BufferGeometry.js
  32. 52 52
      src/core/Geometry.js
  33. 3 3
      src/core/Object3D.js
  34. 7 7
      src/core/Projector.js
  35. 34 34
      src/extras/GeometryUtils.js
  36. 1 1
      src/extras/animation/Animation.js
  37. 5 5
      src/extras/core/Curve.js
  38. 5 5
      src/extras/core/CurvePath.js
  39. 1 1
      src/extras/core/Gyroscope.js
  40. 3 3
      src/extras/geometries/ConvexGeometry.js
  41. 10 10
      src/extras/geometries/ExtrudeGeometry.js
  42. 2 2
      src/extras/geometries/PolyhedronGeometry.js
  43. 5 5
      src/extras/geometries/TorusGeometry.js
  44. 4 4
      src/extras/geometries/TorusKnotGeometry.js
  45. 13 13
      src/extras/geometries/TubeGeometry.js
  46. 2 2
      src/extras/helpers/DirectionalLightHelper.js
  47. 2 2
      src/extras/helpers/SpotLightHelper.js
  48. 5 5
      src/extras/renderers/plugins/ShadowMapPlugin.js
  49. 1 1
      src/extras/renderers/plugins/SpritePlugin.js
  50. 17 17
      src/math/Box2.js
  51. 17 17
      src/math/Box3.js
  52. 1 1
      src/math/Color.js
  53. 15 13
      src/math/Matrix4.js
  54. 4 5
      src/math/Plane.js
  55. 42 41
      src/math/Quaternion.js
  56. 8 8
      src/math/Ray.js
  57. 3 3
      src/math/Sphere.js
  58. 10 10
      src/math/Triangle.js
  59. 19 17
      src/math/Vector2.js
  60. 43 35
      src/math/Vector3.js
  61. 24 22
      src/math/Vector4.js
  62. 2 2
      src/objects/Bone.js
  63. 3 3
      src/objects/SkinnedMesh.js
  64. 1 1
      src/renderers/CanvasRenderer.js
  65. 5 5
      src/renderers/WebGLRenderer.js
  66. 6 6
      test/unit/math/Matrix3.js
  67. 4 4
      test/unit/math/Matrix4.js
  68. 6 6
      test/unit/math/Quaternion.js
  69. 9 9
      test/unit/math/Ray.js
  70. 27 27
      test/unit/math/Vector2.js
  71. 33 33
      test/unit/math/Vector3.js
  72. 33 33
      test/unit/math/Vector4.js

+ 5 - 5
editor/js/ui/Viewport.js

@@ -96,7 +96,7 @@ var Viewport = function ( signals ) {
 
 			projector.unprojectVector( vector, camera );
 
-			ray.set( camera.position, vector.subSelf( camera.position ).normalize() );
+			ray.set( camera.position, vector.sub( camera.position ).normalize() );
 
 			var intersects = ray.intersectObjects( objects, true );
 
@@ -126,7 +126,7 @@ var Viewport = function ( signals ) {
 				signals.objectSelected.dispatch( selected );
 
 				var intersects = ray.intersectObject( intersectionPlane );
-				offset.copy( intersects[ 0 ].point ).subSelf( intersectionPlane.position );
+				offset.copy( intersects[ 0 ].point ).sub( intersectionPlane.position );
 
 				document.addEventListener( 'mousemove', onMouseMove, false );
 				document.addEventListener( 'mouseup', onMouseUp, false );
@@ -153,13 +153,13 @@ var Viewport = function ( signals ) {
 
 		projector.unprojectVector( vector, camera );
 
-		ray.set( camera.position, vector.subSelf( camera.position ).normalize() );
+		ray.set( camera.position, vector.sub( camera.position ).normalize() );
 
 		var intersects = ray.intersectObject( intersectionPlane );
 
 		if ( intersects.length > 0 ) {
 
-			intersects[ 0 ].point.subSelf( offset );
+			intersects[ 0 ].point.sub( offset );
 
 			if ( picked.properties.isGizmo ) {
 
@@ -199,7 +199,7 @@ var Viewport = function ( signals ) {
 
 			projector.unprojectVector( vector, camera );
 
-			ray.set( camera.position, vector.subSelf( camera.position ).normalize() );
+			ray.set( camera.position, vector.sub( camera.position ).normalize() );
 			var intersects = ray.intersectObjects( objects, true );
 
 			if ( intersects.length > 0 && ! controls.enabled ) {

+ 17 - 17
examples/canvas_geometry_birds.html

@@ -74,32 +74,32 @@
 						vector.set( - _width, this.position.y, this.position.z );
 						vector = this.avoid( vector );
 						vector.multiplyScalar( 5 );
-						_acceleration.addSelf( vector );
+						_acceleration.add( vector );
 
 						vector.set( _width, this.position.y, this.position.z );
 						vector = this.avoid( vector );
 						vector.multiplyScalar( 5 );
-						_acceleration.addSelf( vector );
+						_acceleration.add( vector );
 
 						vector.set( this.position.x, - _height, this.position.z );
 						vector = this.avoid( vector );
 						vector.multiplyScalar( 5 );
-						_acceleration.addSelf( vector );
+						_acceleration.add( vector );
 
 						vector.set( this.position.x, _height, this.position.z );
 						vector = this.avoid( vector );
 						vector.multiplyScalar( 5 );
-						_acceleration.addSelf( vector );
+						_acceleration.add( vector );
 
 						vector.set( this.position.x, this.position.y, - _depth );
 						vector = this.avoid( vector );
 						vector.multiplyScalar( 5 );
-						_acceleration.addSelf( vector );
+						_acceleration.add( vector );
 
 						vector.set( this.position.x, this.position.y, _depth );
 						vector = this.avoid( vector );
 						vector.multiplyScalar( 5 );
-						_acceleration.addSelf( vector );
+						_acceleration.add( vector );
 
 					}/* else {
 
@@ -122,19 +122,19 @@
 
 					if ( _goal ) {
 
-						_acceleration.addSelf( this.reach( _goal, 0.005 ) );
+						_acceleration.add( this.reach( _goal, 0.005 ) );
 
 					}
 
-					_acceleration.addSelf( this.alignment( boids ) );
-					_acceleration.addSelf( this.cohesion( boids ) );
-					_acceleration.addSelf( this.separation( boids ) );
+					_acceleration.add( this.alignment( boids ) );
+					_acceleration.add( this.cohesion( boids ) );
+					_acceleration.add( this.separation( boids ) );
 
 				}
 
 				this.move = function () {
 
-					this.velocity.addSelf( _acceleration );
+					this.velocity.add( _acceleration );
 
 					var l = this.velocity.length();
 
@@ -144,7 +144,7 @@
 
 					}
 
-					this.position.addSelf( this.velocity );
+					this.position.add( this.velocity );
 					_acceleration.set( 0, 0, 0 );
 
 				}
@@ -167,7 +167,7 @@
 					var steer = new THREE.Vector3();
 
 					steer.copy( this.position );
-					steer.subSelf( target );
+					steer.sub( target );
 
 					steer.multiplyScalar( 1 / this.position.distanceToSquared( target ) );
 
@@ -186,7 +186,7 @@
 						steer.sub( this.position, target );
 						steer.multiplyScalar( 0.5 / distance );
 
-						_acceleration.addSelf( steer );
+						_acceleration.add( steer );
 
 					}
 
@@ -218,7 +218,7 @@
 
 						if ( distance > 0 && distance <= _neighborhoodRadius ) {
 
-							velSum.addSelf( boid.velocity );
+							velSum.add( boid.velocity );
 							count++;
 
 						}
@@ -259,7 +259,7 @@
 
 						if ( distance > 0 && distance <= _neighborhoodRadius ) {
 
-							posSum.addSelf( boid.position );
+							posSum.add( boid.position );
 							count++;
 
 						}
@@ -304,7 +304,7 @@
 							repulse.sub( this.position, boid.position );
 							repulse.normalize();
 							repulse.divideScalar( distance );
-							posSum.addSelf( repulse );
+							posSum.add( repulse );
 
 						}
 

+ 1 - 1
examples/canvas_interactive_cubes.html

@@ -122,7 +122,7 @@
 				var vector = new THREE.Vector3( ( event.clientX / window.innerWidth ) * 2 - 1, - ( event.clientY / window.innerHeight ) * 2 + 1, 0.5 );
 				projector.unprojectVector( vector, camera );
 
-				var raycaster = new THREE.Raycaster( camera.position, vector.subSelf( camera.position ).normalize() );
+				var raycaster = new THREE.Raycaster( camera.position, vector.sub( camera.position ).normalize() );
 
 				var intersects = raycaster.intersectObjects( objects );
 

+ 1 - 1
examples/canvas_interactive_cubes_tween.html

@@ -101,7 +101,7 @@
 				var vector = new THREE.Vector3( ( event.clientX / window.innerWidth ) * 2 - 1, - ( event.clientY / window.innerHeight ) * 2 + 1, 0.5 );
 				projector.unprojectVector( vector, camera );
 
-				var raycaster = new THREE.Raycaster( camera.position, vector.subSelf( camera.position ).normalize() );
+				var raycaster = new THREE.Raycaster( camera.position, vector.sub( camera.position ).normalize() );
 
 				var intersects = raycaster.intersectObjects( scene.children );
 

+ 1 - 1
examples/canvas_interactive_particles.html

@@ -149,7 +149,7 @@
 				var vector = new THREE.Vector3( mouse.x, mouse.y, 0.5 );
 				projector.unprojectVector( vector, camera );
 
-				var raycaster = new THREE.Raycaster( camera.position, vector.subSelf( camera.position ).normalize() );
+				var raycaster = new THREE.Raycaster( camera.position, vector.sub( camera.position ).normalize() );
 
 				var intersects = raycaster.intersectObjects( scene.children );
 

+ 1 - 1
examples/canvas_interactive_voxelpainter.html

@@ -175,7 +175,7 @@
 						var normal = interect.face.normal.clone();
 						normal.applyMatrix4( interect.object.matrixRotationWorld );
 
-						var position = new THREE.Vector3().add( interect.point, normal );
+						var position = new THREE.Vector3().addVectors( interect.point, normal );
 
 						var geometry = new THREE.CubeGeometry( 50, 50, 50 );
 

+ 4 - 4
examples/css3d_molecules.html

@@ -409,7 +409,7 @@
 						start.multiplyScalar( 75 );
 						end.multiplyScalar( 75 );
 
-						tmpVec1.sub( end, start );
+						tmpVec1.subVectors( end, start );
 						var bondLength = tmpVec1.length() - 50;
 
 
@@ -421,14 +421,14 @@
 
 						var object = new THREE.CSS3DObject( bond );
 						object.position.copy( start );
-						object.position.lerpSelf( end, 0.5 );
+						object.position.lerp( end, 0.5 );
 
 						object.properties.bondLengthShort = bondLength + "px";
 						object.properties.bondLengthFull = ( bondLength + 55 ) + "px";
 
 						//
 
-						var axis = tmpVec2.set( 0, 1, 0 ).crossSelf( tmpVec1 );
+						var axis = tmpVec2.set( 0, 1, 0 ).cross( tmpVec1 );
 						var radians = Math.acos( tmpVec3.set( 0, 1, 0 ).dot( tmpVec4.copy( tmpVec1 ).normalize() ) );
 
 						var objMatrix = new THREE.Matrix4().makeRotationAxis( axis.normalize(), radians );
@@ -450,7 +450,7 @@
 
 						var joint = new THREE.Object3D( bond );
 						joint.position.copy( start );
-						joint.position.lerpSelf( end, 0.5 );
+						joint.position.lerp( end, 0.5 );
 
 						joint.matrix.copy( objMatrix );
 						joint.rotation.setEulerFromRotationMatrix( joint.matrix, joint.eulerOrder );

+ 9 - 9
examples/js/Car.js

@@ -269,7 +269,7 @@ THREE.Car = function () {
 
 				var bb = scope.wheelGeometry.boundingBox;
 
-				scope.wheelOffset.add( bb.min, bb.max );
+				scope.wheelOffset.addVectors( bb.min, bb.max );
 				scope.wheelOffset.multiplyScalar( 0.5 );
 
 				scope.wheelDiameter = bb.max.y - bb.min.y;
@@ -295,9 +295,9 @@ THREE.Car = function () {
 
 			// front left wheel
 
-			delta.multiply( scope.wheelOffset, new THREE.Vector3( s, s, s ) );
+			delta.multiplyVectors( scope.wheelOffset, new THREE.Vector3( s, s, s ) );
 
-			scope.frontLeftWheelRoot.position.addSelf( delta );
+			scope.frontLeftWheelRoot.position.add( delta );
 
 			scope.frontLeftWheelMesh = new THREE.Mesh( scope.wheelGeometry, wheelFaceMaterial );
 			scope.frontLeftWheelMesh.scale.set( s, s, s );
@@ -307,9 +307,9 @@ THREE.Car = function () {
 
 			// front right wheel
 
-			delta.multiply( scope.wheelOffset, new THREE.Vector3( -s, s, s ) );
+			delta.multiplyVectors( scope.wheelOffset, new THREE.Vector3( -s, s, s ) );
 
-			scope.frontRightWheelRoot.position.addSelf( delta );
+			scope.frontRightWheelRoot.position.add( delta );
 
 			scope.frontRightWheelMesh = new THREE.Mesh( scope.wheelGeometry, wheelFaceMaterial );
 
@@ -321,24 +321,24 @@ THREE.Car = function () {
 
 			// back left wheel
 
-			delta.multiply( scope.wheelOffset, new THREE.Vector3( s, s, -s ) );
+			delta.multiplyVectors( scope.wheelOffset, new THREE.Vector3( s, s, -s ) );
 			delta.z -= scope.backWheelOffset;
 
 			scope.backLeftWheelMesh = new THREE.Mesh( scope.wheelGeometry, wheelFaceMaterial );
 
-			scope.backLeftWheelMesh.position.addSelf( delta );
+			scope.backLeftWheelMesh.position.add( delta );
 			scope.backLeftWheelMesh.scale.set( s, s, s );
 
 			scope.root.add( scope.backLeftWheelMesh );
 
 			// back right wheel
 
-			delta.multiply( scope.wheelOffset, new THREE.Vector3( -s, s, -s ) );
+			delta.multiplyVectors( scope.wheelOffset, new THREE.Vector3( -s, s, -s ) );
 			delta.z -= scope.backWheelOffset;
 
 			scope.backRightWheelMesh = new THREE.Mesh( scope.wheelGeometry, wheelFaceMaterial );
 
-			scope.backRightWheelMesh.position.addSelf( delta );
+			scope.backRightWheelMesh.position.add( delta );
 			scope.backRightWheelMesh.scale.set( s, s, s );
 			scope.backRightWheelMesh.rotation.z = Math.PI;
 

+ 10 - 10
examples/js/Cloth.js

@@ -69,7 +69,7 @@ function Particle(x, y, z, mass) {
 
 // Force -> Acceleration
 Particle.prototype.addForce = function(force) {
-	this.a.addSelf(
+	this.a.add(
 		this.tmp2.copy(force).multiplyScalar(this.invMass)
 	);
 };
@@ -77,10 +77,10 @@ Particle.prototype.addForce = function(force) {
 
 // Performs verlet integration
 Particle.prototype.integrate = function(timesq) {
-	var newPos = this.tmp.sub(this.position, this.previous);
-	newPos.multiplyScalar(DRAG).addSelf(this.position);
-	newPos.addSelf(this.a.multiplyScalar(timesq));
-	
+	var newPos = this.tmp.subVectors(this.position, this.previous);
+	newPos.multiplyScalar(DRAG).add(this.position);
+	newPos.add(this.a.multiplyScalar(timesq));
+
 	this.tmp = this.previous;
 	this.previous = this.position;
 	this.position = newPos;
@@ -92,13 +92,13 @@ Particle.prototype.integrate = function(timesq) {
 var diff = new THREE.Vector3();
 
 function satisifyConstrains(p1, p2, distance) {
-	diff.sub(p2.position, p1.position);
+	diff.subVectors(p2.position, p1.position);
 	var currentDist = diff.length();
 	if (currentDist==0) return; // prevents division by 0
 	var correction = diff.multiplyScalar(1 - distance/currentDist);
 	var correctionHalf = correction.multiplyScalar(0.5);
-	p1.position.addSelf(correctionHalf);
-	p2.position.subSelf(correctionHalf);
+	p1.position.add(correctionHalf);
+	p2.position.sub(correctionHalf);
 }
 
 
@@ -254,7 +254,7 @@ function simulate(time) {
 		if (diff.length() < ballSize) {
 			// collided
 			diff.normalize().multiplyScalar(ballSize);
-			pos.copy(ballPosition).addSelf(diff);
+			pos.copy(ballPosition).add(diff);
 		}
 	}
 
@@ -277,4 +277,4 @@ function simulate(time) {
 	}
 
 
-}
+}

+ 5 - 5
examples/js/Sparks.js

@@ -539,14 +539,14 @@ SPARKS.PointZone.prototype.getLocation = function() {
 SPARKS.LineZone = function(start, end) {
     this.start = start;
 	this.end = end;
-	this._length = end.clone().subSelf( start );
+	this._length = end.clone().sub( start );
 };
 
 SPARKS.LineZone.prototype.getLocation = function() {
     var len = this._length.clone();
 
 	len.multiplyScalar( Math.random() );
-	return len.addSelf( this.start );
+	return len.add( this.start );
 
 };
 
@@ -561,8 +561,8 @@ SPARKS.ParallelogramZone.prototype.getLocation = function() {
 
 	var d1 = this.side1.clone().multiplyScalar( Math.random() );
 	var d2 = this.side2.clone().multiplyScalar( Math.random() );
-	d1.addSelf(d2);
-	return d1.addSelf( this.corner );
+	d1.add(d2);
+	return d1.add( this.corner );
 
 };
 
@@ -667,7 +667,7 @@ SPARKS.DiscZone.prototype.getLocation = function() {
 	p.multiplyScalar( radius * Math.cos( angle ) );
 	var p2 = _planeAxis2.clone();
 	p2.multiplyScalar( radius * Math.sin( angle ) );
-	p.addSelf( p2 );
+	p.add( p2 );
 	return _center.add( p );
 
 };

+ 1 - 1
examples/js/UVsUtils.js

@@ -160,7 +160,7 @@ THREE.UVsDebug = function(geometry) {
         // label uv edge orders
         for (j = 0, jl = uv.length; j < jl; j++) {
             u = uv[j];
-            b.set(u.x, u.y).subSelf(a).divideScalar(4);
+            b.set(u.x, u.y).sub(a).divideScalar(4);
             
             b.x = u.x - b.x;
             b.y = u.y - b.y;

+ 1 - 1
examples/js/controls/FlyControls.js

@@ -192,7 +192,7 @@ THREE.FlyControls = function ( object, domElement ) {
 		this.object.translateZ( this.moveVector.z * moveMult );
 
 		this.tmpQuaternion.set( this.rotationVector.x * rotMult, this.rotationVector.y * rotMult, this.rotationVector.z * rotMult, 1 ).normalize();
-		this.object.quaternion.multiplySelf( this.tmpQuaternion );
+		this.object.quaternion.multiply( this.tmpQuaternion );
 
 		this.object.matrix.setPosition( this.object.position );
 		this.object.matrix.setRotationFromQuaternion( this.object.quaternion );

+ 4 - 4
examples/js/controls/OrbitControls.js

@@ -135,7 +135,7 @@ THREE.OrbitControls = function ( object, domElement ) {
 	this.update = function () {
 
 		var position = this.object.position;
-		var offset = position.clone().subSelf( this.center )
+		var offset = position.clone().sub( this.center )
 
 		// angle from z-axis around y-axis
 
@@ -169,7 +169,7 @@ THREE.OrbitControls = function ( object, domElement ) {
 		offset.y = radius * Math.cos( phi );
 		offset.z = radius * Math.sin( phi ) * Math.cos( theta );
 
-		position.copy( this.center ).addSelf( offset );
+		position.copy( this.center ).add( offset );
 
 		this.object.lookAt( this.center );
 
@@ -232,7 +232,7 @@ THREE.OrbitControls = function ( object, domElement ) {
 		if ( state === STATE.ROTATE ) {
 
 			rotateEnd.set( event.clientX, event.clientY );
-			rotateDelta.sub( rotateEnd, rotateStart );
+			rotateDelta.subVectors( rotateEnd, rotateStart );
 
 			scope.rotateLeft( 2 * Math.PI * rotateDelta.x / PIXELS_PER_ROUND * scope.userRotateSpeed );
 			scope.rotateUp( 2 * Math.PI * rotateDelta.y / PIXELS_PER_ROUND * scope.userRotateSpeed );
@@ -242,7 +242,7 @@ THREE.OrbitControls = function ( object, domElement ) {
 		} else if ( state === STATE.ZOOM ) {
 
 			zoomEnd.set( event.clientX, event.clientY );
-			zoomDelta.sub( zoomEnd, zoomStart );
+			zoomDelta.subVectors( zoomEnd, zoomStart );
 
 			if ( zoomDelta.y > 0 ) {
 

+ 5 - 5
examples/js/controls/RollControls.js

@@ -95,8 +95,8 @@ THREE.RollControls = function ( object, domElement ) {
 		zTemp.copy( this.forward );
 		yTemp.set( 0, 1, 0 );
 
-		xTemp.cross( yTemp, zTemp ).normalize();
-		yTemp.cross( zTemp, xTemp ).normalize();
+		xTemp.crossVectors( yTemp, zTemp ).normalize();
+		yTemp.crossVectors( zTemp, xTemp ).normalize();
 
 		this.object.matrix.elements[0] = xTemp.x; this.object.matrix.elements[4] = yTemp.x; this.object.matrix.elements[8] = zTemp.x;
 		this.object.matrix.elements[1] = xTemp.y; this.object.matrix.elements[5] = yTemp.y; this.object.matrix.elements[9] = zTemp.y;
@@ -110,7 +110,7 @@ THREE.RollControls = function ( object, domElement ) {
 
 		// multiply camera with roll
 
-		this.object.matrix.multiplySelf( rollMatrix );
+		this.object.matrix.multiply( rollMatrix );
 		this.object.matrixWorldNeedsUpdate = true;
 
 		// set position
@@ -154,7 +154,7 @@ THREE.RollControls = function ( object, domElement ) {
 		xTemp.set( this.object.matrix.elements[0], this.object.matrix.elements[1], this.object.matrix.elements[2] );
 		xTemp.multiplyScalar( amount );
 
-		this.forward.subSelf( xTemp );
+		this.forward.sub( xTemp );
 		this.forward.normalize();
 
 	};
@@ -166,7 +166,7 @@ THREE.RollControls = function ( object, domElement ) {
 		yTemp.set( this.object.matrix.elements[4], this.object.matrix.elements[5], this.object.matrix.elements[6] );
 		yTemp.multiplyScalar( amount );
 
-		this.forward.addSelf( yTemp );
+		this.forward.add( yTemp );
 		this.forward.normalize();
 
 	};

+ 13 - 13
examples/js/controls/TrackballControls.js

@@ -112,11 +112,11 @@ THREE.TrackballControls = function ( object, domElement ) {
 
 		}
 
-		_eye.copy( _this.object.position ).subSelf( _this.target );
+		_eye.copy( _this.object.position ).sub( _this.target );
 
 		var projection = _this.object.up.clone().setLength( mouseOnBall.y );
-		projection.addSelf( _this.object.up.clone().crossSelf( _eye ).setLength( mouseOnBall.x ) );
-		projection.addSelf( _eye.setLength( mouseOnBall.z ) );
+		projection.add( _this.object.up.clone().cross( _eye ).setLength( mouseOnBall.x ) );
+		projection.add( _eye.setLength( mouseOnBall.z ) );
 
 		return projection;
 
@@ -128,7 +128,7 @@ THREE.TrackballControls = function ( object, domElement ) {
 
 		if ( angle ) {
 
-			var axis = ( new THREE.Vector3() ).cross( _rotateStart, _rotateEnd ).normalize(),
+			var axis = ( new THREE.Vector3() ).crossVectors( _rotateStart, _rotateEnd ).normalize(),
 				quaternion = new THREE.Quaternion();
 
 			angle *= _this.rotateSpeed;
@@ -179,17 +179,17 @@ THREE.TrackballControls = function ( object, domElement ) {
 
 	this.panCamera = function () {
 
-		var mouseChange = _panEnd.clone().subSelf( _panStart );
+		var mouseChange = _panEnd.clone().sub( _panStart );
 
 		if ( mouseChange.lengthSq() ) {
 
 			mouseChange.multiplyScalar( _eye.length() * _this.panSpeed );
 
-			var pan = _eye.clone().crossSelf( _this.object.up ).setLength( mouseChange.x );
-			pan.addSelf( _this.object.up.clone().setLength( mouseChange.y ) );
+			var pan = _eye.clone().cross( _this.object.up ).setLength( mouseChange.x );
+			pan.add( _this.object.up.clone().setLength( mouseChange.y ) );
 
-			_this.object.position.addSelf( pan );
-			_this.target.addSelf( pan );
+			_this.object.position.add( pan );
+			_this.target.add( pan );
 
 			if ( _this.staticMoving ) {
 
@@ -197,7 +197,7 @@ THREE.TrackballControls = function ( object, domElement ) {
 
 			} else {
 
-				_panStart.addSelf( mouseChange.sub( _panEnd, _panStart ).multiplyScalar( _this.dynamicDampingFactor ) );
+				_panStart.add( mouseChange.subVectors( _panEnd, _panStart ).multiplyScalar( _this.dynamicDampingFactor ) );
 
 			}
 
@@ -217,7 +217,7 @@ THREE.TrackballControls = function ( object, domElement ) {
 
 			if ( _eye.lengthSq() < _this.minDistance * _this.minDistance ) {
 
-				_this.object.position.add( _this.target, _eye.setLength( _this.minDistance ) );
+				_this.object.position.addVectors( _this.target, _eye.setLength( _this.minDistance ) );
 
 			}
 
@@ -227,7 +227,7 @@ THREE.TrackballControls = function ( object, domElement ) {
 
 	this.update = function () {
 
-		_eye.copy( _this.object.position ).subSelf( _this.target );
+		_eye.copy( _this.object.position ).sub( _this.target );
 
 		if ( !_this.noRotate ) {
 
@@ -247,7 +247,7 @@ THREE.TrackballControls = function ( object, domElement ) {
 
 		}
 
-		_this.object.position.add( _this.target, _eye );
+		_this.object.position.addVectors( _this.target, _eye );
 
 		_this.checkDistances();
 

+ 2 - 2
examples/js/effects/AnaglyphEffect.js

@@ -147,14 +147,14 @@ THREE.AnaglyphEffect = function ( renderer, width, height ) {
 
 		}
 
-		_cameraL.matrixWorld.copy( camera.matrixWorld ).multiplySelf( eyeLeft );
+		_cameraL.matrixWorld.copy( camera.matrixWorld ).multiply( eyeLeft );
 		_cameraL.position.copy( camera.position );
 		_cameraL.near = camera.near;
 		_cameraL.far = camera.far;
 
 		renderer.render( scene, _cameraL, _renderTargetL, true );
 
-		_cameraR.matrixWorld.copy( camera.matrixWorld ).multiplySelf( eyeRight );
+		_cameraR.matrixWorld.copy( camera.matrixWorld ).multiply( eyeRight );
 		_cameraR.position.copy( camera.position );
 		_cameraR.near = camera.near;
 		_cameraR.far = camera.far;

+ 2 - 2
examples/js/effects/ParallaxBarrierEffect.js

@@ -148,14 +148,14 @@ THREE.ParallaxBarrierEffect = function ( renderer ) {
 
 		}
 
-		_cameraL.matrixWorld.copy( camera.matrixWorld ).multiplySelf( eyeLeft );
+		_cameraL.matrixWorld.copy( camera.matrixWorld ).multiply( eyeLeft );
 		_cameraL.position.copy( camera.position );
 		_cameraL.near = camera.near;
 		_cameraL.far = camera.far;
 
 		renderer.render( scene, _cameraL, _renderTargetL, true );
 
-		_cameraR.matrixWorld.copy( camera.matrixWorld ).multiplySelf( eyeRight );
+		_cameraR.matrixWorld.copy( camera.matrixWorld ).multiply( eyeRight );
 		_cameraR.position.copy( camera.position );
 		_cameraR.near = camera.near;
 		_cameraR.far = camera.far;

+ 9 - 5
examples/js/loaders/ColladaLoader.js

@@ -472,7 +472,7 @@ THREE.ColladaLoader = function () {
 
 		if ( parent ) {
 
-			node.world.multiply( parent, node.world );
+			node.world.multiplyMatrices( parent, node.world );
 
 		}
 
@@ -514,7 +514,7 @@ THREE.ColladaLoader = function () {
 
 				bone.invBindMatrix = inv;
 				bone.skinningMatrix = new THREE.Matrix4();
-				bone.skinningMatrix.multiply(bone.world, inv); // (IBMi * JMi)
+				bone.skinningMatrix.multiplyMatrices(bone.world, inv); // (IBMi * JMi)
 
 				bone.weights = [];
 
@@ -849,10 +849,10 @@ THREE.ColladaLoader = function () {
 		if ( options.centerGeometry && obj.geometry ) {
 
 			var delta = THREE.GeometryUtils.center( obj.geometry );
-			delta.multiplySelf( obj.scale );
+			delta.multiply( obj.scale );
 			delta.applyQuaternion( obj.quaternion );
 
-			obj.position.subSelf( delta );
+			obj.position.sub( delta );
 
 		}
 
@@ -1948,22 +1948,26 @@ THREE.ColladaLoader = function () {
 
 			case 'matrix':
 
-				matrix.multiplySelf( this.obj );
+				matrix.multiply( this.obj );
+
 				break;
 
 			case 'translate':
 
 				matrix.translate( this.obj );
+
 				break;
 
 			case 'rotate':
 
 				matrix.rotateByAxis( this.obj, this.angle );
+
 				break;
 
 			case 'scale':
 
 				matrix.scale( this.obj );
+
 				break;
 
 		}

+ 17 - 17
examples/js/modifiers/SubdivisionModifier.js

@@ -452,21 +452,21 @@ THREE.SubdivisionModifier.prototype.smooth = function ( oldGeometry ) {
 
 		if (edge.length==1) {
 
-			avg.addSelf(originalPoints[edgeVertexA]);
-			avg.addSelf(originalPoints[edgeVertexB]);
-			avg.multiplyScalar(0.5);
+			avg.add( originalPoints[ edgeVertexA ] );
+			avg.add( originalPoints[ edgeVertexB ] );
+			avg.multiplyScalar( 0.5 );
 
 			sharpVertices[newPoints.length] = true;
 
 		} else {
 
-			avg.addSelf(facePoints[faceIndexA]);
-			avg.addSelf(facePoints[faceIndexB]);
+			avg.add( facePoints[ faceIndexA ] );
+			avg.add( facePoints[ faceIndexB ] );
 
-			avg.addSelf(originalPoints[edgeVertexA]);
-			avg.addSelf(originalPoints[edgeVertexB]);
+			avg.add( originalPoints[ edgeVertexA ] );
+			avg.add( originalPoints[ edgeVertexB ] );
 
-			avg.multiplyScalar(0.25);
+			avg.multiplyScalar( 0.25 );
 
 		}
 
@@ -589,7 +589,7 @@ THREE.SubdivisionModifier.prototype.smooth = function ( oldGeometry ) {
 
 		var f = 0; // this counts number of faces, original vertex is connected to (also known as valance?)
 		for (j in vertexFaceMap[i]) {
-			F.addSelf(facePoints[j]);
+			F.add(facePoints[j]);
 			f++;
 		}
 
@@ -636,8 +636,8 @@ THREE.SubdivisionModifier.prototype.smooth = function ( oldGeometry ) {
 				edge = vertexEdgeMap[i][j];
 				bb_edge = edgeFaceMap[orderedKey(edge[0], edge[1])].length == 1
 				if (bb_edge) {
-					var midPt = originalPoints[edge[0]].clone().addSelf(originalPoints[edge[1]]).divideScalar(2);
-					R.addSelf(midPt);
+					var midPt = originalPoints[edge[0]].clone().add(originalPoints[edge[1]]).divideScalar(2);
+					R.add(midPt);
 					boundary_edges++;
 				}
 			}
@@ -649,28 +649,28 @@ THREE.SubdivisionModifier.prototype.smooth = function ( oldGeometry ) {
 		} else {
 			for (j=0; j<n;j++) {
 				edge = vertexEdgeMap[i][j];
-				var midPt = originalPoints[edge[0]].clone().addSelf(originalPoints[edge[1]]).divideScalar(2);
-				R.addSelf(midPt);
+				var midPt = originalPoints[edge[0]].clone().add(originalPoints[edge[1]]).divideScalar(2);
+				R.add(midPt);
 			}
 
 			R.divideScalar(n);
 		}
 
 		// Sum the formula
-		newPos.addSelf(originalPoints[i]);
+		newPos.add(originalPoints[i]);
 
 
 		if (boundary_case) {
 
 			newPos.divideScalar(2);
-			newPos.addSelf(R);
+			newPos.add(R);
 
 		} else {
 
 			newPos.multiplyScalar(n - 3);
 
-			newPos.addSelf(F);
-			newPos.addSelf(R.multiplyScalar(2));
+			newPos.add(F);
+			newPos.add(R.multiplyScalar(2));
 			newPos.divideScalar(n);
 
 		}

+ 3 - 3
examples/js/renderers/WebGLDeferredRenderer.js

@@ -425,7 +425,7 @@ THREE.WebGLDeferredRenderer = function ( parameters ) {
 		positionVS.applyMatrix4( viewMatrix );
 
 		directionVS.copy( modelMatrix.getPosition() );
-		directionVS.subSelf( light.target.matrixWorld.getPosition() );
+		directionVS.sub( light.target.matrixWorld.getPosition() );
 		directionVS.normalize();
 		viewMatrix.rotateAxis( directionVS );
 
@@ -495,7 +495,7 @@ THREE.WebGLDeferredRenderer = function ( parameters ) {
 		var uniforms = lightProxy.material.uniforms;
 
 		directionVS.copy( light.matrixWorld.getPosition() );
-		directionVS.subSelf( light.target.matrixWorld.getPosition() );
+		directionVS.sub( light.target.matrixWorld.getPosition() );
 		directionVS.normalize();
 		camera.matrixWorldInverse.rotateAxis( directionVS );
 
@@ -642,7 +642,7 @@ THREE.WebGLDeferredRenderer = function ( parameters ) {
 		viewMatrix.rotateAxis( rightVS );
 		viewMatrix.rotateAxis( normalVS );
 
-		upVS.cross( rightVS, normalVS );
+		upVS.crossVectors( rightVS, normalVS );
 		upVS.normalize();
 
 		uniforms[ "lightRightVS" ].value.copy( rightVS );

+ 3 - 3
examples/misc_ubiquity_test.html

@@ -106,9 +106,9 @@
 					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 );
-					v2.addSelf( v );
+					v0.add( v );
+					v1.add( v );
+					v2.add( v );
 
 					var face = new THREE.Face3( geometry.vertices.push( v0 ) - 1, geometry.vertices.push( v1 ) - 1, geometry.vertices.push( v2 ) - 1, null, null, i );
 

+ 3 - 3
examples/webgl_buffergeometry.html

@@ -173,9 +173,9 @@
 					pB.set( bx, by, bz );
 					pC.set( cx, cy, cz );
 
-					cb.sub( pC, pB );
-					ab.sub( pA, pB );
-					cb.crossSelf( ab );
+					cb.subVectors( pC, pB );
+					ab.subVectors( pA, pB );
+					cb.cross( ab );
 
 					cb.normalize();
 

+ 24 - 24
examples/webgl_geometry_extrude_splines.html

@@ -203,26 +203,26 @@
 
 			scene = new THREE.Scene();
 
-			var light = new THREE.DirectionalLight(0xffffff);
-			light.position.set(0, 0, 1);
-			scene.add(light);
+			var light = new THREE.DirectionalLight( 0xffffff );
+			light.position.set( 0, 0, 1 );
+			scene.add( light );
 
 			parent = new THREE.Object3D();
 			parent.position.y = 100;
 			scene.add( parent );
 
-			splineCamera = new THREE.PerspectiveCamera(84, window.innerWidth / window.innerHeight, 0.01, 1000);
-			parent.add(splineCamera);
+			splineCamera = new THREE.PerspectiveCamera( 84, window.innerWidth / window.innerHeight, 0.01, 1000 );
+			parent.add( splineCamera );
 
-			cameraHelper = new THREE.CameraHelper(splineCamera);
-			scene.add(cameraHelper);
+			cameraHelper = new THREE.CameraHelper( splineCamera );
+			scene.add( cameraHelper );
 
 			addTube();
 
 			// Debug point
 
 			cameraEye = new THREE.Mesh( new THREE.SphereGeometry( 5 ), new THREE.MeshBasicMaterial( { color: 0xdddddd } ) );
-			parent.add(cameraEye);
+			parent.add( cameraEye );
 
 			cameraHelper.visible = showCameraHelper;
 			cameraEye.visible = showCameraHelper;
@@ -320,7 +320,7 @@
 				event.preventDefault();
 
 				mouseX = event.touches[ 0 ].pageX - windowHalfX;
-				targetRotation = targetRotationOnMouseDown + (mouseX - mouseXOnMouseDown) * 0.05;
+				targetRotation = targetRotationOnMouseDown + ( mouseX - mouseXOnMouseDown ) * 0.05;
 
 			}
 
@@ -330,7 +330,7 @@
 
 		function animate() {
 
-			requestAnimationFrame(animate);
+			requestAnimationFrame( animate );
 
 			render();
 			stats.update();
@@ -342,45 +342,45 @@
 			// Try Animate Camera Along Spline
 			var time = Date.now();
 			var looptime = 20 * 1000;
-			var t = (time % looptime) / looptime;
+			var t = ( time % looptime ) / looptime;
 
-			var pos = tube.path.getPointAt(t);
-			pos.multiplyScalar(scale);
+			var pos = tube.path.getPointAt( t );
+			pos.multiplyScalar( scale );
 
 			// interpolation
 			var segments = tube.tangents.length;
 			var pickt = t * segments;
-			var pick = Math.floor(pickt);
-			var pickNext = (pick + 1) % segments;
+			var pick = Math.floor( pickt );
+			var pickNext = ( pick + 1 ) % segments;
 
-			binormal.sub(tube.binormals[pickNext], tube.binormals[pick]);
-			binormal.multiplyScalar(pickt - pick).addSelf(tube.binormals[pick]);
+			binormal.subVectors( tube.binormals[ pickNext ], tube.binormals[ pick ] );
+			binormal.multiplyScalar( pickt - pick ).add( tube.binormals[ pick ] );
 
 
-			var dir = tube.path.getTangentAt(t);
+			var dir = tube.path.getTangentAt( t );
 
 			var offset = 15;
 
-			normal.copy(binormal).crossSelf(dir);
+			normal.copy( binormal ).cross( dir );
 
 			// We move on a offset on its binormal
-			pos.addSelf(normal.clone().multiplyScalar(offset));
+			pos.add( normal.clone().multiplyScalar( offset ) );
 
 			splineCamera.position = pos;
 			cameraEye.position = pos;
 
 
 			// Camera Orientation 1 - default look at
-			// splineCamera.lookAt(lookAt);
+			// splineCamera.lookAt( lookAt );
 
 			// Using arclength for stablization in look ahead.
-			var lookAt = tube.path.getPointAt((t + 30/tube.path.getLength()) % 1).multiplyScalar(scale);
+			var lookAt = tube.path.getPointAt( ( t + 30 / tube.path.getLength() ) % 1 ).multiplyScalar( scale );
 
 			// Camera Orientation 2 - up orientation via normal
 			if (!lookAhead)
-			lookAt.copy(pos).addSelf(dir);
+			lookAt.copy( pos ).add( dir );
 			splineCamera.matrix.lookAt(splineCamera.position, lookAt, normal);
-			splineCamera.rotation.setEulerFromRotationMatrix(splineCamera.matrix, splineCamera.eulerOrder);
+			splineCamera.rotation.setEulerFromRotationMatrix( splineCamera.matrix, splineCamera.eulerOrder );
 
 			cameraHelper.update();
 

+ 1 - 2
examples/webgl_geometry_normals.html

@@ -219,8 +219,7 @@
 				var fvNames = [ 'a', 'b', 'c', 'd' ];
 
 				var normalLength = 15;
-				
-			
+
 				for( var f = 0, fl = geometry.faces.length; f < fl; f ++ ) {
 					var face = geometry.faces[ f ];
 					var arrow = new THREE.ArrowHelper( 

+ 1 - 1
examples/webgl_interactive_cubes.html

@@ -145,7 +145,7 @@
 				var vector = new THREE.Vector3( mouse.x, mouse.y, 1 );
 				projector.unprojectVector( vector, camera );
 
-				var raycaster = new THREE.Raycaster( camera.position, vector.subSelf( camera.position ).normalize() );
+				var raycaster = new THREE.Raycaster( camera.position, vector.sub( camera.position ).normalize() );
 
 				var intersects = raycaster.intersectObjects( scene.children );
 

+ 1 - 1
examples/webgl_interactive_cubes_gpu.html

@@ -229,7 +229,7 @@
 
 						highlightBox.position.copy( data.position );
 						highlightBox.rotation.copy( data.rotation );
-						highlightBox.scale.copy( data.scale ).addSelf( offset );
+						highlightBox.scale.copy( data.scale ).add( offset );
 						highlightBox.visible = true;
 
 					}

+ 4 - 4
examples/webgl_interactive_draggablecubes.html

@@ -159,13 +159,13 @@
 				var vector = new THREE.Vector3( mouse.x, mouse.y, 0.5 );
 				projector.unprojectVector( vector, camera );
 
-				var raycaster = new THREE.Raycaster( camera.position, vector.subSelf( camera.position ).normalize() );
+				var raycaster = new THREE.Raycaster( camera.position, vector.sub( camera.position ).normalize() );
 
 
 				if ( SELECTED ) {
 
 					var intersects = raycaster.intersectObject( plane );
-					SELECTED.position.copy( intersects[ 0 ].point.subSelf( offset ) );
+					SELECTED.position.copy( intersects[ 0 ].point.sub( offset ) );
 					return;
 
 				}
@@ -208,7 +208,7 @@
 				var vector = new THREE.Vector3( mouse.x, mouse.y, 0.5 );
 				projector.unprojectVector( vector, camera );
 
-				var raycaster = new THREE.Raycaster( camera.position, vector.subSelf( camera.position ).normalize() );
+				var raycaster = new THREE.Raycaster( camera.position, vector.sub( camera.position ).normalize() );
 
 				var intersects = raycaster.intersectObjects( objects );
 
@@ -219,7 +219,7 @@
 					SELECTED = intersects[ 0 ].object;
 
 					var intersects = raycaster.intersectObject( plane );
-					offset.copy( intersects[ 0 ].point ).subSelf( plane.position );
+					offset.copy( intersects[ 0 ].point ).sub( plane.position );
 
 					container.style.cursor = 'move';
 

+ 1 - 1
examples/webgl_interactive_voxelpainter.html

@@ -176,7 +176,7 @@
 				tmpVec.copy( intersector.face.normal );
 				tmpVec.applyMatrix4( intersector.object.matrixRotationWorld );
 
-				voxelPosition.add( intersector.point, tmpVec );
+				voxelPosition.addVectors( intersector.point, tmpVec );
 
 				voxelPosition.x = Math.floor( voxelPosition.x / 50 ) * 50 + 25;
 				voxelPosition.y = Math.floor( voxelPosition.y / 50 ) * 50 + 25;

+ 1 - 1
examples/webgl_materials_cubemap_dynamic.html

@@ -616,7 +616,7 @@
 				var bb = shadowObject.geometry.boundingBox;
 
 				var dimensions = new THREE.Vector3();
-				dimensions.sub( bb.max, bb.min );
+				dimensions.subVectors( bb.max, bb.min );
 
 				var margin = 0.15,
 

+ 1 - 1
examples/webgl_ribbons.html

@@ -158,7 +158,7 @@
 					ribbon.matrix.elements[ 6 ] = ribbon.matrixRotationWorld.elements[ 6 ];
 					ribbon.matrix.elements[ 10 ] = ribbon.matrixRotationWorld.elements[ 10 ];
 
-					ribbon.matrix.multiplySelf( tmpRot );
+					ribbon.matrix.multiply( tmpRot );
 
 					ribbon.matrix.scale( ribbon.scale );
 

+ 14 - 14
src/core/BufferGeometry.js

@@ -249,9 +249,9 @@ THREE.BufferGeometry.prototype = {
 						z = positions[ vC * 3 + 2 ];
 						pC.set( x, y, z );
 
-						cb.sub( pC, pB );
-						ab.sub( pA, pB );
-						cb.crossSelf( ab );
+						cb.subVectors( pC, pB );
+						ab.subVectors( pA, pB );
+						cb.cross( ab );
 
 						normals[ vA * 3 ]     += cb.x;
 						normals[ vA * 3 + 1 ] += cb.y;
@@ -290,9 +290,9 @@ THREE.BufferGeometry.prototype = {
 					z = positions[ i + 8 ];
 					pC.set( x, y, z );
 
-					cb.sub( pC, pB );
-					ab.sub( pA, pB );
-					cb.crossSelf( ab );
+					cb.subVectors( pC, pB );
+					ab.subVectors( pA, pB );
+					cb.cross( ab );
 
 					normals[ i ] 	 = cb.x;
 					normals[ i + 1 ] = cb.y;
@@ -452,13 +452,13 @@ THREE.BufferGeometry.prototype = {
 				( s1 * z2 - s2 * z1 ) * r
 			);
 
-			tan1[ a ].addSelf( sdir );
-			tan1[ b ].addSelf( sdir );
-			tan1[ c ].addSelf( sdir );
+			tan1[ a ].add( sdir );
+			tan1[ b ].add( sdir );
+			tan1[ c ].add( sdir );
 
-			tan2[ a ].addSelf( tdir );
-			tan2[ b ].addSelf( tdir );
-			tan2[ c ].addSelf( tdir );
+			tan2[ a ].add( tdir );
+			tan2[ b ].add( tdir );
+			tan2[ c ].add( tdir );
 
 		}
 
@@ -504,11 +504,11 @@ THREE.BufferGeometry.prototype = {
 			// Gram-Schmidt orthogonalize
 
 			tmp.copy( t );
-			tmp.subSelf( n.multiplyScalar( n.dot( t ) ) ).normalize();
+			tmp.sub( n.multiplyScalar( n.dot( t ) ) ).normalize();
 
 			// Calculate handedness
 
-			tmp2.cross( n2, t );
+			tmp2.crossVectors( n2, t );
 			test = tmp2.dot( tan2[ v ] );
 			w = ( test < 0.0 ) ? -1.0 : 1.0;
 

+ 52 - 52
src/core/Geometry.js

@@ -97,17 +97,17 @@ THREE.Geometry.prototype = {
 
 			if ( face instanceof THREE.Face3 ) {
 
-				face.centroid.addSelf( this.vertices[ face.a ] );
-				face.centroid.addSelf( this.vertices[ face.b ] );
-				face.centroid.addSelf( this.vertices[ face.c ] );
+				face.centroid.add( this.vertices[ face.a ] );
+				face.centroid.add( this.vertices[ face.b ] );
+				face.centroid.add( this.vertices[ face.c ] );
 				face.centroid.divideScalar( 3 );
 
 			} else if ( face instanceof THREE.Face4 ) {
 
-				face.centroid.addSelf( this.vertices[ face.a ] );
-				face.centroid.addSelf( this.vertices[ face.b ] );
-				face.centroid.addSelf( this.vertices[ face.c ] );
-				face.centroid.addSelf( this.vertices[ face.d ] );
+				face.centroid.add( this.vertices[ face.a ] );
+				face.centroid.add( this.vertices[ face.b ] );
+				face.centroid.add( this.vertices[ face.c ] );
+				face.centroid.add( this.vertices[ face.d ] );
 				face.centroid.divideScalar( 4 );
 
 			}
@@ -129,9 +129,9 @@ THREE.Geometry.prototype = {
 			vB = this.vertices[ face.b ];
 			vC = this.vertices[ face.c ];
 
-			cb.sub( vC, vB );
-			ab.sub( vA, vB );
-			cb.crossSelf( ab );
+			cb.subVectors( vC, vB );
+			ab.subVectors( vA, vB );
+			cb.cross( ab );
 
 			cb.normalize();
 
@@ -206,13 +206,13 @@ THREE.Geometry.prototype = {
 					vB = this.vertices[ face.b ];
 					vC = this.vertices[ face.c ];
 
-					cb.sub( vC, vB );
-					ab.sub( vA, vB );
-					cb.crossSelf( ab );
+					cb.subVectors( vC, vB );
+					ab.subVectors( vA, vB );
+					cb.cross( ab );
 
-					vertices[ face.a ].addSelf( cb );
-					vertices[ face.b ].addSelf( cb );
-					vertices[ face.c ].addSelf( cb );
+					vertices[ face.a ].add( cb );
+					vertices[ face.b ].add( cb );
+					vertices[ face.c ].add( cb );
 
 				} else if ( face instanceof THREE.Face4 ) {
 
@@ -223,23 +223,23 @@ THREE.Geometry.prototype = {
 
 					// abd
 
-					db.sub( vD, vB );
-					ab.sub( vA, vB );
-					db.crossSelf( ab );
+					db.subVectors( vD, vB );
+					ab.subVectors( vA, vB );
+					db.cross( ab );
 
-					vertices[ face.a ].addSelf( db );
-					vertices[ face.b ].addSelf( db );
-					vertices[ face.d ].addSelf( db );
+					vertices[ face.a ].add( db );
+					vertices[ face.b ].add( db );
+					vertices[ face.d ].add( db );
 
 					// bcd
 
-					dc.sub( vD, vC );
-					bc.sub( vB, vC );
-					dc.crossSelf( bc );
+					dc.subVectors( vD, vC );
+					bc.subVectors( vB, vC );
+					dc.cross( bc );
 
-					vertices[ face.b ].addSelf( dc );
-					vertices[ face.c ].addSelf( dc );
-					vertices[ face.d ].addSelf( dc );
+					vertices[ face.b ].add( dc );
+					vertices[ face.c ].add( dc );
+					vertices[ face.d ].add( dc );
 
 				}
 
@@ -253,16 +253,16 @@ THREE.Geometry.prototype = {
 
 				if ( face instanceof THREE.Face3 ) {
 
-					vertices[ face.a ].addSelf( face.normal );
-					vertices[ face.b ].addSelf( face.normal );
-					vertices[ face.c ].addSelf( face.normal );
+					vertices[ face.a ].add( face.normal );
+					vertices[ face.b ].add( face.normal );
+					vertices[ face.c ].add( face.normal );
 
 				} else if ( face instanceof THREE.Face4 ) {
 
-					vertices[ face.a ].addSelf( face.normal );
-					vertices[ face.b ].addSelf( face.normal );
-					vertices[ face.c ].addSelf( face.normal );
-					vertices[ face.d ].addSelf( face.normal );
+					vertices[ face.a ].add( face.normal );
+					vertices[ face.b ].add( face.normal );
+					vertices[ face.c ].add( face.normal );
+					vertices[ face.d ].add( face.normal );
 
 				}
 
@@ -489,13 +489,13 @@ THREE.Geometry.prototype = {
 					  ( s1 * y2 - s2 * y1 ) * r,
 					  ( s1 * z2 - s2 * z1 ) * r );
 
-			tan1[ a ].addSelf( sdir );
-			tan1[ b ].addSelf( sdir );
-			tan1[ c ].addSelf( sdir );
+			tan1[ a ].add( sdir );
+			tan1[ b ].add( sdir );
+			tan1[ c ].add( sdir );
 
-			tan2[ a ].addSelf( tdir );
-			tan2[ b ].addSelf( tdir );
-			tan2[ c ].addSelf( tdir );
+			tan2[ a ].add( tdir );
+			tan2[ b ].add( tdir );
+			tan2[ c ].add( tdir );
 
 		}
 
@@ -534,11 +534,11 @@ THREE.Geometry.prototype = {
 				// Gram-Schmidt orthogonalize
 
 				tmp.copy( t );
-				tmp.subSelf( n.multiplyScalar( n.dot( t ) ) ).normalize();
+				tmp.sub( n.multiplyScalar( n.dot( t ) ) ).normalize();
 
 				// Calculate handedness
 
-				tmp2.cross( face.vertexNormals[ i ], t );
+				tmp2.crossVectors( face.vertexNormals[ i ], t );
 				test = tmp2.dot( tan2[ vertexIndex ] );
 				w = (test < 0.0) ? -1.0 : 1.0;
 
@@ -653,11 +653,11 @@ THREE.Geometry.prototype = {
 				indices = [ face.a, face.b, face.c ];
 
 				var dupIndex = -1;
-				
+
 				// if any duplicate vertices are found in a Face3
 				// we have to remove the face as nothing can be saved
-				for( var n = 0; n < 3; n ++ ) {
-					if( indices[ n ] == indices[ ( n + 1 ) % 3 ] ) {
+				for ( var n = 0; n < 3; n ++ ) {
+					if ( indices[ n ] == indices[ ( n + 1 ) % 3 ] ) {
 
 						dupIndex = n;
 						faceIndicesToRemove.push( i );
@@ -679,14 +679,14 @@ THREE.Geometry.prototype = {
 
 				var dupIndex = -1;
 
-				for( var n = 0; n < 4; n ++ ) {
-					if( indices[ n ] == indices[ ( n + 1 ) % 4 ] ) {
+				for ( var n = 0; n < 4; n ++ ) {
 
+					if ( indices[ n ] == indices[ ( n + 1 ) % 4 ] ) {
 
 						// if more than one duplicated vertex is found
 						// we can't generate any valid Face3's, thus
 						// we need to remove this face complete.
-						if( dupIndex >= 0 ) {
+						if ( dupIndex >= 0 ) {
 
 							faceIndicesToRemove.push( i );
 
@@ -697,7 +697,7 @@ THREE.Geometry.prototype = {
 					}
 				}
 
-				if( dupIndex >= 0 ) {
+				if ( dupIndex >= 0 ) {
 
 					indices.splice( dupIndex, 1 );
 
@@ -733,10 +733,10 @@ THREE.Geometry.prototype = {
 
 		}
 
-		for( i = faceIndicesToRemove.length - 1; i >= 0; i -- ) {
+		for ( i = faceIndicesToRemove.length - 1; i >= 0; i -- ) {
 
 			this.faces.splice( i, 1 );
-			
+
 			for ( j = 0, jl = this.faceVertexUvs.length; j < jl; j ++ ) {
 
 				this.faceVertexUvs[ j ].splice( i, 1 );

+ 3 - 3
src/core/Object3D.js

@@ -53,7 +53,7 @@ THREE.Object3D.prototype = {
 
 	applyMatrix: function ( matrix ) {
 
-		this.matrix.multiply( matrix, this.matrix );
+		this.matrix.multiplyMatrices( matrix, this.matrix );
 
 		this.scale.getScaleFromMatrix( this.matrix );
 
@@ -67,7 +67,7 @@ THREE.Object3D.prototype = {
 	translate: function ( distance, axis ) {
 
 		this.matrix.rotateAxis( axis );
-		this.position.addSelf( axis.multiplyScalar( distance ) );
+		this.position.add( axis.multiplyScalar( distance ) );
 
 	},
 
@@ -286,7 +286,7 @@ THREE.Object3D.prototype = {
 
 			} else {
 
-				this.matrixWorld.multiply( this.parent.matrixWorld, this.matrix );
+				this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );
 
 			}
 

+ 7 - 7
src/core/Projector.js

@@ -40,7 +40,7 @@ THREE.Projector = function() {
 
 		camera.matrixWorldInverse.getInverse( camera.matrixWorld );
 
-		_viewProjectionMatrix.multiply( camera.projectionMatrix, camera.matrixWorldInverse );
+		_viewProjectionMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );
 
 		return vector.applyMatrix4( _viewProjectionMatrix );
 
@@ -50,7 +50,7 @@ THREE.Projector = function() {
 
 		camera.projectionMatrixInverse.getInverse( camera.projectionMatrix );
 
-		_viewProjectionMatrix.multiply( camera.matrixWorld, camera.projectionMatrixInverse );
+		_viewProjectionMatrix.multiplyMatrices( camera.matrixWorld, camera.projectionMatrixInverse );
 
 		return vector.applyMatrix4( _viewProjectionMatrix );
 
@@ -66,7 +66,7 @@ THREE.Projector = function() {
 		this.unprojectVector( end, camera );
 
 		// find direction from vector to end
-		end.subSelf( vector ).normalize();
+		end.sub( vector ).normalize();
 
 		return new THREE.Raycaster( vector, end );
 
@@ -191,7 +191,7 @@ THREE.Projector = function() {
 		if ( camera.parent === undefined ) camera.updateMatrixWorld();
 
 		_viewMatrix.copy( camera.matrixWorldInverse.getInverse( camera.matrixWorld ) );
-		_viewProjectionMatrix.multiply( camera.projectionMatrix, _viewMatrix );
+		_viewProjectionMatrix.multiplyMatrices( camera.projectionMatrix, _viewMatrix );
 
 		_normalViewMatrix.getInverse( _viewMatrix );
 		_normalViewMatrix.transpose();
@@ -389,7 +389,7 @@ THREE.Projector = function() {
 
 			} else if ( object instanceof THREE.Line ) {
 
-				_modelViewProjectionMatrix.multiply( _viewProjectionMatrix, _modelMatrix );
+				_modelViewProjectionMatrix.multiplyMatrices( _viewProjectionMatrix, _modelMatrix );
 
 				vertices = object.geometry.vertices;
 
@@ -645,8 +645,8 @@ THREE.Projector = function() {
 			} else {
 
 				// Update the s1 and s2 vertices to match the clipped line segment.
-				s1.lerpSelf( s2, alpha1 );
-				s2.lerpSelf( s1, 1 - alpha2 );
+				s1.lerp( s2, alpha1 );
+				s2.lerp( s1, 1 - alpha2 );
 
 				return true;
 

+ 34 - 34
src/extras/GeometryUtils.js

@@ -178,12 +178,12 @@ THREE.GeometryUtils = {
 		tmp.copy( vectorB );
 		tmp.multiplyScalar( b );
 
-		point.addSelf( tmp );
+		point.add( tmp );
 
 		tmp.copy( vectorC );
 		tmp.multiplyScalar( c );
 
-		point.addSelf( tmp );
+		point.add( tmp );
 
 		return point;
 
@@ -377,9 +377,9 @@ THREE.GeometryUtils = {
 		var tmp1 = THREE.GeometryUtils.__v1,
 			tmp2 = THREE.GeometryUtils.__v2;
 
-		tmp1.sub( vectorB, vectorA );
-		tmp2.sub( vectorC, vectorA );
-		tmp1.crossSelf( tmp2 );
+		tmp1.subVectors( vectorB, vectorA );
+		tmp2.subVectors( vectorC, vectorA );
+		tmp1.cross( tmp2 );
 
 		return 0.5 * tmp1.length();
 
@@ -395,7 +395,7 @@ THREE.GeometryUtils = {
 
 		var offset = new THREE.Vector3();
 
-		offset.add( bb.min, bb.max );
+		offset.addVectors( bb.min, bb.max );
 		offset.multiplyScalar( -0.5 );
 
 		geometry.applyMatrix( new THREE.Matrix4().makeTranslation( offset ) );
@@ -671,7 +671,7 @@ THREE.GeometryUtils = {
 					if ( dab >= dbc && dab >= dac ) {
 
 						vm = va.clone();
-						vm.lerpSelf( vb, 0.5 );
+						vm.lerp( vb, 0.5 );
 
 						triA.a = a;
 						triA.b = m;
@@ -684,7 +684,7 @@ THREE.GeometryUtils = {
 						if ( face.vertexNormals.length === 3 ) {
 
 							vnm = face.vertexNormals[ 0 ].clone();
-							vnm.lerpSelf( face.vertexNormals[ 1 ], 0.5 );
+							vnm.lerp( face.vertexNormals[ 1 ], 0.5 );
 
 							triA.vertexNormals[ 1 ].copy( vnm );
 							triB.vertexNormals[ 0 ].copy( vnm );
@@ -694,7 +694,7 @@ THREE.GeometryUtils = {
 						if ( face.vertexColors.length === 3 ) {
 
 							vcm = face.vertexColors[ 0 ].clone();
-							vcm.lerpSelf( face.vertexColors[ 1 ], 0.5 );
+							vcm.lerp( face.vertexColors[ 1 ], 0.5 );
 
 							triA.vertexColors[ 1 ].copy( vcm );
 							triB.vertexColors[ 0 ].copy( vcm );
@@ -706,7 +706,7 @@ THREE.GeometryUtils = {
 					} else if ( dbc >= dab && dbc >= dac ) {
 
 						vm = vb.clone();
-						vm.lerpSelf( vc, 0.5 );
+						vm.lerp( vc, 0.5 );
 
 						triA.a = a;
 						triA.b = b;
@@ -719,7 +719,7 @@ THREE.GeometryUtils = {
 						if ( face.vertexNormals.length === 3 ) {
 
 							vnm = face.vertexNormals[ 1 ].clone();
-							vnm.lerpSelf( face.vertexNormals[ 2 ], 0.5 );
+							vnm.lerp( face.vertexNormals[ 2 ], 0.5 );
 
 							triA.vertexNormals[ 2 ].copy( vnm );
 
@@ -732,7 +732,7 @@ THREE.GeometryUtils = {
 						if ( face.vertexColors.length === 3 ) {
 
 							vcm = face.vertexColors[ 1 ].clone();
-							vcm.lerpSelf( face.vertexColors[ 2 ], 0.5 );
+							vcm.lerp( face.vertexColors[ 2 ], 0.5 );
 
 							triA.vertexColors[ 2 ].copy( vcm );
 
@@ -747,7 +747,7 @@ THREE.GeometryUtils = {
 					} else {
 
 						vm = va.clone();
-						vm.lerpSelf( vc, 0.5 );
+						vm.lerp( vc, 0.5 );
 
 						triA.a = a;
 						triA.b = b;
@@ -760,7 +760,7 @@ THREE.GeometryUtils = {
 						if ( face.vertexNormals.length === 3 ) {
 
 							vnm = face.vertexNormals[ 0 ].clone();
-							vnm.lerpSelf( face.vertexNormals[ 2 ], 0.5 );
+							vnm.lerp( face.vertexNormals[ 2 ], 0.5 );
 
 							triA.vertexNormals[ 2 ].copy( vnm );
 							triB.vertexNormals[ 0 ].copy( vnm );
@@ -770,7 +770,7 @@ THREE.GeometryUtils = {
 						if ( face.vertexColors.length === 3 ) {
 
 							vcm = face.vertexColors[ 0 ].clone();
-							vcm.lerpSelf( face.vertexColors[ 2 ], 0.5 );
+							vcm.lerp( face.vertexColors[ 2 ], 0.5 );
 
 							triA.vertexColors[ 2 ].copy( vcm );
 							triB.vertexColors[ 0 ].copy( vcm );
@@ -801,7 +801,7 @@ THREE.GeometryUtils = {
 							if ( edge === 0 ) {
 
 								uvM = uvA.clone();
-								uvM.lerpSelf( uvB, 0.5 );
+								uvM.lerp( uvB, 0.5 );
 
 								uvsTriA = [ uvA.clone(), uvM.clone(), uvC.clone() ];
 								uvsTriB = [ uvM.clone(), uvB.clone(), uvC.clone() ];
@@ -811,7 +811,7 @@ THREE.GeometryUtils = {
 							} else if ( edge === 1 ) {
 
 								uvM = uvB.clone();
-								uvM.lerpSelf( uvC, 0.5 );
+								uvM.lerp( uvC, 0.5 );
 
 								uvsTriA = [ uvA.clone(), uvB.clone(), uvM.clone() ];
 								uvsTriB = [ uvM.clone(), uvC.clone(), uvA.clone() ];
@@ -821,7 +821,7 @@ THREE.GeometryUtils = {
 							} else {
 
 								uvM = uvA.clone();
-								uvM.lerpSelf( uvC, 0.5 );
+								uvM.lerp( uvC, 0.5 );
 
 								uvsTriA = [ uvA.clone(), uvB.clone(), uvM.clone() ];
 								uvsTriB = [ uvM.clone(), uvB.clone(), uvC.clone() ];
@@ -874,10 +874,10 @@ THREE.GeometryUtils = {
 					if ( ( dab >= dbc && dab >= dcd && dab >= dad ) || ( dcd >= dbc && dcd >= dab && dcd >= dad ) ) {
 
 						vm1 = va.clone();
-						vm1.lerpSelf( vb, 0.5 );
+						vm1.lerp( vb, 0.5 );
 
 						vm2 = vc.clone();
-						vm2.lerpSelf( vd, 0.5 );
+						vm2.lerp( vd, 0.5 );
 
 						quadA.a = a;
 						quadA.b = m1;
@@ -892,10 +892,10 @@ THREE.GeometryUtils = {
 						if ( face.vertexNormals.length === 4 ) {
 
 							vnm1 = face.vertexNormals[ 0 ].clone();
-							vnm1.lerpSelf( face.vertexNormals[ 1 ], 0.5 );
+							vnm1.lerp( face.vertexNormals[ 1 ], 0.5 );
 
 							vnm2 = face.vertexNormals[ 2 ].clone();
-							vnm2.lerpSelf( face.vertexNormals[ 3 ], 0.5 );
+							vnm2.lerp( face.vertexNormals[ 3 ], 0.5 );
 
 							quadA.vertexNormals[ 1 ].copy( vnm1 );
 							quadA.vertexNormals[ 2 ].copy( vnm2 );
@@ -908,10 +908,10 @@ THREE.GeometryUtils = {
 						if ( face.vertexColors.length === 4 ) {
 
 							vcm1 = face.vertexColors[ 0 ].clone();
-							vcm1.lerpSelf( face.vertexColors[ 1 ], 0.5 );
+							vcm1.lerp( face.vertexColors[ 1 ], 0.5 );
 
 							vcm2 = face.vertexColors[ 2 ].clone();
-							vcm2.lerpSelf( face.vertexColors[ 3 ], 0.5 );
+							vcm2.lerp( face.vertexColors[ 3 ], 0.5 );
 
 							quadA.vertexColors[ 1 ].copy( vcm1 );
 							quadA.vertexColors[ 2 ].copy( vcm2 );
@@ -926,10 +926,10 @@ THREE.GeometryUtils = {
 					} else {
 
 						vm1 = vb.clone();
-						vm1.lerpSelf( vc, 0.5 );
+						vm1.lerp( vc, 0.5 );
 
 						vm2 = vd.clone();
-						vm2.lerpSelf( va, 0.5 );
+						vm2.lerp( va, 0.5 );
 
 						quadA.a = a;
 						quadA.b = b;
@@ -944,10 +944,10 @@ THREE.GeometryUtils = {
 						if ( face.vertexNormals.length === 4 ) {
 
 							vnm1 = face.vertexNormals[ 1 ].clone();
-							vnm1.lerpSelf( face.vertexNormals[ 2 ], 0.5 );
+							vnm1.lerp( face.vertexNormals[ 2 ], 0.5 );
 
 							vnm2 = face.vertexNormals[ 3 ].clone();
-							vnm2.lerpSelf( face.vertexNormals[ 0 ], 0.5 );
+							vnm2.lerp( face.vertexNormals[ 0 ], 0.5 );
 
 							quadA.vertexNormals[ 2 ].copy( vnm1 );
 							quadA.vertexNormals[ 3 ].copy( vnm2 );
@@ -960,10 +960,10 @@ THREE.GeometryUtils = {
 						if ( face.vertexColors.length === 4 ) {
 
 							vcm1 = face.vertexColors[ 1 ].clone();
-							vcm1.lerpSelf( face.vertexColors[ 2 ], 0.5 );
+							vcm1.lerp( face.vertexColors[ 2 ], 0.5 );
 
 							vcm2 = face.vertexColors[ 3 ].clone();
-							vcm2.lerpSelf( face.vertexColors[ 0 ], 0.5 );
+							vcm2.lerp( face.vertexColors[ 0 ], 0.5 );
 
 							quadA.vertexColors[ 2 ].copy( vcm1 );
 							quadA.vertexColors[ 3 ].copy( vcm2 );
@@ -998,10 +998,10 @@ THREE.GeometryUtils = {
 							if ( edge === 0 ) {
 
 								uvM1 = uvA.clone();
-								uvM1.lerpSelf( uvB, 0.5 );
+								uvM1.lerp( uvB, 0.5 );
 
 								uvM2 = uvC.clone();
-								uvM2.lerpSelf( uvD, 0.5 );
+								uvM2.lerp( uvD, 0.5 );
 
 								uvsQuadA = [ uvA.clone(), uvM1.clone(), uvM2.clone(), uvD.clone() ];
 								uvsQuadB = [ uvM1.clone(), uvB.clone(), uvC.clone(), uvM2.clone() ];
@@ -1011,10 +1011,10 @@ THREE.GeometryUtils = {
 							} else {
 
 								uvM1 = uvB.clone();
-								uvM1.lerpSelf( uvC, 0.5 );
+								uvM1.lerp( uvC, 0.5 );
 
 								uvM2 = uvD.clone();
-								uvM2.lerpSelf( uvA, 0.5 );
+								uvM2.lerp( uvA, 0.5 );
 
 								uvsQuadA = [ uvA.clone(), uvB.clone(), uvM1.clone(), uvM2.clone() ];
 								uvsQuadB = [ uvM2.clone(), uvM1.clone(), uvC.clone(), uvD.clone() ];

+ 1 - 1
src/extras/animation/Animation.js

@@ -247,7 +247,7 @@ THREE.Animation.prototype.update = function ( deltaTimeMS ) {
 						forwardPoint = this.interpolateCatmullRom( this.points, scale * 1.01 );
 
 						this.target.set( forwardPoint[ 0 ], forwardPoint[ 1 ], forwardPoint[ 2 ] );
-						this.target.subSelf( vector );
+						this.target.sub( vector );
 						this.target.y = 0;
 						this.target.normalize();
 

+ 5 - 5
src/extras/core/Curve.js

@@ -250,7 +250,7 @@ THREE.Curve.prototype.getTangent = function( t ) {
 	var pt1 = this.getPoint( t1 );
 	var pt2 = this.getPoint( t2 );
 
-	var vec = pt2.clone().subSelf(pt1);
+	var vec = pt2.clone().sub(pt1);
 	return vec.normalize();
 
 };
@@ -278,8 +278,8 @@ THREE.LineCurve.prototype = Object.create( THREE.Curve.prototype );
 
 THREE.LineCurve.prototype.getPoint = function ( t ) {
 
-	var point = this.v2.clone().subSelf(this.v1);
-	point.multiplyScalar( t ).addSelf( this.v1 );
+	var point = this.v2.clone().sub(this.v1);
+	point.multiplyScalar( t ).add( this.v1 );
 
 	return point;
 
@@ -295,7 +295,7 @@ THREE.LineCurve.prototype.getPointAt = function ( u ) {
 
 THREE.LineCurve.prototype.getTangent = function( t ) {
 
-	var tangent = this.v2.clone().subSelf(this.v1);
+	var tangent = this.v2.clone().sub(this.v1);
 
 	return tangent.normalize();
 
@@ -564,7 +564,7 @@ THREE.LineCurve3 = THREE.Curve.create(
 
 		r.sub( this.v2, this.v1 ); // diff
 		r.multiplyScalar( t );
-		r.addSelf( this.v1 );
+		r.add( this.v1 );
 
 		return r;
 

+ 5 - 5
src/extras/core/CurvePath.js

@@ -162,14 +162,14 @@ THREE.CurvePath.prototype.getBoundingBox = function () {
 		if ( p.y > maxY ) maxY = p.y;
 		else if ( p.y < minY ) minY = p.y;
 
-		if (v3) {
+		if ( v3 ) {
 
 			if ( p.z > maxZ ) maxZ = p.z;
 			else if ( p.z < minZ ) minZ = p.z;
 
 		}
 
-		sum.addSelf( p );
+		sum.add( p );
 
 	}
 
@@ -180,14 +180,14 @@ THREE.CurvePath.prototype.getBoundingBox = function () {
 		maxX: maxX,
 		maxY: maxY,
 		centroid: sum.divideScalar( il )
-	
+
 	};
 
-	if (v3) {
+	if ( v3 ) {
 
 		ret.maxZ = maxZ;
 		ret.minZ = minZ;
-	
+
 	}
 
 	return ret;

+ 1 - 1
src/extras/core/Gyroscope.js

@@ -20,7 +20,7 @@ THREE.Gyroscope.prototype.updateMatrixWorld = function ( force ) {
 
 		if ( this.parent ) {
 
-			this.matrixWorld.multiply( this.parent.matrixWorld, this.matrix );
+			this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );
 
 			this.matrixWorld.decompose( this.translationWorld, this.rotationWorld, this.scaleWorld );
 			this.matrix.decompose( this.translationObject, this.rotationObject, this.scaleObject );

+ 3 - 3
src/extras/geometries/ConvexGeometry.js

@@ -125,9 +125,9 @@ THREE.ConvexGeometry = function( vertices ) {
 		var cb = new THREE.Vector3();
 		var ab = new THREE.Vector3();
 
-		cb.sub( vc, vb );
-		ab.sub( va, vb );
-		cb.crossSelf( ab );
+		cb.subVectors( vc, vb );
+		ab.subVectors( va, vb );
+		cb.cross( ab );
 
 		cb.normalize();
 

+ 10 - 10
src/extras/geometries/ExtrudeGeometry.js

@@ -183,7 +183,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
 
 		if ( !vec ) console.log( "die" );
 
-		return vec.clone().multiplyScalar( size ).addSelf( pt );
+		return vec.clone().multiplyScalar( size ).add( pt );
 
 	}
 
@@ -264,8 +264,8 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
 
 		// pts from i
 
-		p.copy( pt_i ).addSelf( v_hat );
-		q.copy( pt_i ).addSelf( w_hat );
+		p.copy( pt_i ).add( v_hat );
+		q.copy( pt_i ).add( w_hat );
 
 		if ( p.equals( q ) ) {
 
@@ -276,11 +276,11 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
 
 		// Points from j, k. helps prevents points cross overover most of the time
 
-		p.copy( pt_j ).addSelf( v_hat );
-		q.copy( pt_k ).addSelf( w_hat );
+		p.copy( pt_j ).add( v_hat );
+		q.copy( pt_k ).add( w_hat );
 
 		v_dot_w_hat = v.dot( w_hat );
-		q_sub_p_dot_w_hat = q.subSelf( p ).dot( w_hat );
+		q_sub_p_dot_w_hat = q.sub( p ).dot( w_hat );
 
 		// We should not reach these conditions
 
@@ -310,9 +310,9 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
 
 		}
 
-		intersection = v.multiplyScalar( s ).addSelf( p );
+		intersection = v.multiplyScalar( s ).add( p );
 
-		return intersection.subSelf( pt_i ).clone(); // Don't normalize!, otherwise sharp corners become ugly
+		return intersection.sub( pt_i ).clone(); // Don't normalize!, otherwise sharp corners become ugly
 
 	}
 
@@ -419,7 +419,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
 			normal.copy( splineTube.normals[0] ).multiplyScalar(vert.x);
 			binormal.copy( splineTube.binormals[0] ).multiplyScalar(vert.y);
 
-			position2.copy( extrudePts[0] ).addSelf(normal).addSelf(binormal);
+			position2.copy( extrudePts[0] ).add(normal).add(binormal);
 
 			v( position2.x, position2.y, position2.z );
 
@@ -449,7 +449,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) {
 				normal.copy( splineTube.normals[s] ).multiplyScalar( vert.x );
 				binormal.copy( splineTube.binormals[s] ).multiplyScalar( vert.y );
 
-				position2.copy( extrudePts[s] ).addSelf( normal ).addSelf( binormal );
+				position2.copy( extrudePts[s] ).add( normal ).add( binormal );
 
 				v( position2.x, position2.y, position2.z );
 

+ 2 - 2
src/extras/geometries/PolyhedronGeometry.js

@@ -62,7 +62,7 @@ THREE.PolyhedronGeometry = function ( vertices, faces, radius, detail ) {
 		if ( detail < 1 ) {
 
 			var face = new THREE.Face3( v1.index, v2.index, v3.index, [ v1.clone(), v2.clone(), v3.clone() ] );
-			face.centroid.addSelf( v1 ).addSelf( v2 ).addSelf( v3 ).divideScalar( 3 );
+			face.centroid.add( v1 ).add( v2 ).add( v3 ).divideScalar( 3 );
 			face.normal = face.centroid.clone().normalize();
 			that.faces.push( face );
 
@@ -100,7 +100,7 @@ THREE.PolyhedronGeometry = function ( vertices, faces, radius, detail ) {
 			// generate mean point and project to surface with prepare()
 
 			midpoints[ v1.index ][ v2.index ] = midpoints[ v2.index ][ v1.index ] = mid = prepare(
-				new THREE.Vector3().add( v1, v2 ).divideScalar( 2 )
+				new THREE.Vector3().addVectors( v1, v2 ).divideScalar( 2 )
 			);
 		}
 

+ 5 - 5
src/extras/geometries/TorusGeometry.js

@@ -36,7 +36,7 @@ THREE.TorusGeometry = function ( radius, tube, radialSegments, tubularSegments,
 			this.vertices.push( vertex );
 
 			uvs.push( new THREE.Vector2( i / this.tubularSegments, j / this.radialSegments ) );
-			normals.push( vertex.clone().subSelf( center ).normalize() );
+			normals.push( vertex.clone().sub( center ).normalize() );
 
 		}
 	}
@@ -52,10 +52,10 @@ THREE.TorusGeometry = function ( radius, tube, radialSegments, tubularSegments,
 			var d = ( this.tubularSegments + 1 ) * j + i;
 
 			var face = new THREE.Face4( a, b, c, d, [ normals[ a ], normals[ b ], normals[ c ], normals[ d ] ] );
-			face.normal.addSelf( normals[ a ] );
-			face.normal.addSelf( normals[ b ] );
-			face.normal.addSelf( normals[ c ] );
-			face.normal.addSelf( normals[ d ] );
+			face.normal.add( normals[ a ] );
+			face.normal.add( normals[ b ] );
+			face.normal.add( normals[ c ] );
+			face.normal.add( normals[ d ] );
 			face.normal.normalize();
 
 			this.faces.push( face );

+ 4 - 4
src/extras/geometries/TorusKnotGeometry.js

@@ -34,11 +34,11 @@ THREE.TorusKnotGeometry = function ( radius, tube, radialSegments, tubularSegmen
 			var p2 = getPos( u + 0.01, v, this.q, this.p, this.radius, this.heightScale );
 			var cx, cy;
 
-			tang.sub( p2, p1 );
-			n.add( p2, p1 );
+			tang.subVectors( p2, p1 );
+			n.addVectors( p2, p1 );
 
-			bitan.cross( tang, n );
-			n.cross( bitan, tang );
+			bitan.crossVectors( tang, n );
+			n.crossVectors( bitan, tang );
 			bitan.normalize();
 			n.normalize();
 

+ 13 - 13
src/extras/geometries/TubeGeometry.js

@@ -181,8 +181,8 @@ THREE.TubeGeometry.FrenetFrames = function(path, segments, closed) {
 		normals[ 0 ] = new THREE.Vector3();
 		binormals[ 0 ] = new THREE.Vector3();
 		if (lastBinormal===undefined) lastBinormal = new THREE.Vector3( 0, 0, 1 );
-		normals[ 0 ].cross( lastBinormal, tangents[ 0 ] ).normalize();
-		binormals[ 0 ].cross( tangents[ 0 ], normals[ 0 ] ).normalize();
+		normals[ 0 ].crossVectors( lastBinormal, tangents[ 0 ] ).normalize();
+		binormals[ 0 ].crossVectors( tangents[ 0 ], normals[ 0 ] ).normalize();
 	}
 
 	function initialNormal2() {
@@ -190,11 +190,11 @@ THREE.TubeGeometry.FrenetFrames = function(path, segments, closed) {
 		// This uses the Frenet-Serret formula for deriving binormal
 		var t2 = path.getTangentAt( epsilon );
 
-		normals[ 0 ] = new THREE.Vector3().sub( t2, tangents[ 0 ] ).normalize();
-		binormals[ 0 ] = new THREE.Vector3().cross( tangents[ 0 ], normals[ 0 ] );
+		normals[ 0 ] = new THREE.Vector3().subVectors( t2, tangents[ 0 ] ).normalize();
+		binormals[ 0 ] = new THREE.Vector3().crossVectors( tangents[ 0 ], normals[ 0 ] );
 
-		normals[ 0 ].cross( binormals[ 0 ], tangents[ 0 ] ).normalize(); // last binormal x tangent
-		binormals[ 0 ].cross( tangents[ 0 ], normals[ 0 ] ).normalize();
+		normals[ 0 ].crossVectors( binormals[ 0 ], tangents[ 0 ] ).normalize(); // last binormal x tangent
+		binormals[ 0 ].crossVectors( tangents[ 0 ], normals[ 0 ] ).normalize();
 
 	}
 
@@ -223,10 +223,10 @@ THREE.TubeGeometry.FrenetFrames = function(path, segments, closed) {
 			normal.set( 0, 0, 1 );
 		}
 
-		vec.cross( tangents[ 0 ], normal ).normalize();
+		vec.crossVectors( tangents[ 0 ], normal ).normalize();
 
-		normals[ 0 ].cross( tangents[ 0 ], vec );
-		binormals[ 0 ].cross( tangents[ 0 ], normals[ 0 ] );
+		normals[ 0 ].crossVectors( tangents[ 0 ], vec );
+		binormals[ 0 ].crossVectors( tangents[ 0 ], normals[ 0 ] );
 	}
 
 
@@ -238,7 +238,7 @@ THREE.TubeGeometry.FrenetFrames = function(path, segments, closed) {
 
 		binormals[ i ] = binormals[ i-1 ].clone();
 
-		vec.cross( tangents[ i-1 ], tangents[ i ] );
+		vec.crossVectors( tangents[ i-1 ], tangents[ i ] );
 
 		if ( vec.length() > epsilon ) {
 
@@ -250,7 +250,7 @@ THREE.TubeGeometry.FrenetFrames = function(path, segments, closed) {
 
 		}
 
-		binormals[ i ].cross( tangents[ i ], normals[ i ] );
+		binormals[ i ].crossVectors( tangents[ i ], normals[ i ] );
 
 	}
 
@@ -262,7 +262,7 @@ THREE.TubeGeometry.FrenetFrames = function(path, segments, closed) {
 		theta = Math.acos( normals[ 0 ].dot( normals[ numpoints-1 ] ) );
 		theta /= ( numpoints - 1 );
 
-		if ( tangents[ 0 ].dot( vec.cross( normals[ 0 ], normals[ numpoints-1 ] ) ) > 0 ) {
+		if ( tangents[ 0 ].dot( vec.crossVectors( normals[ 0 ], normals[ numpoints-1 ] ) ) > 0 ) {
 
 			theta = -theta;
 
@@ -272,7 +272,7 @@ THREE.TubeGeometry.FrenetFrames = function(path, segments, closed) {
 
 			// twist a little...
 			normals[ i ].applyMatrix4( mat.makeRotationAxis( tangents[ i ], theta * i ) );
-			binormals[ i ].cross( tangents[ i ], normals[ i ] );
+			binormals[ i ].crossVectors( tangents[ i ], normals[ i ] );
 
 		}
 

+ 2 - 2
src/extras/helpers/DirectionalLightHelper.js

@@ -17,7 +17,7 @@ THREE.DirectionalLightHelper = function ( light, sphereSize ) {
 	// direction
 
 	this.direction = new THREE.Vector3();
-	this.direction.sub( light.target.position, light.position );
+	this.direction.subVectors( light.target.position, light.position );
 
 	// color
 
@@ -87,7 +87,7 @@ THREE.DirectionalLightHelper.prototype.update = function () {
 	// update arrow orientation
 	// pointing from light to target
 
-	this.direction.sub( this.light.target.position, this.light.position );
+	this.direction.subVectors( this.light.target.position, this.light.position );
 
 	// update arrow, spheres, rays and line colors to light color * light intensity
 

+ 2 - 2
src/extras/helpers/SpotLightHelper.js

@@ -17,7 +17,7 @@ THREE.SpotLightHelper = function ( light, sphereSize ) {
 	// direction
 
 	this.direction = new THREE.Vector3();
-	this.direction.sub( light.target.position, light.position );
+	this.direction.subVectors( light.target.position, light.position );
 
 	// color
 
@@ -106,7 +106,7 @@ THREE.SpotLightHelper.prototype.update = function () {
 	// update arrow orientation
 	// pointing from light to target
 
-	this.direction.sub( this.light.target.position, this.light.position );
+	this.direction.subVectors( this.light.target.position, this.light.position );
 
 	// update light cone orientation and size
 

+ 5 - 5
src/extras/renderers/plugins/ShadowMapPlugin.js

@@ -212,12 +212,12 @@ THREE.ShadowMapPlugin = function ( ) {
 							  0.0, 0.0, 0.5, 0.5,
 							  0.0, 0.0, 0.0, 1.0 );
 
-			shadowMatrix.multiplySelf( shadowCamera.projectionMatrix );
-			shadowMatrix.multiplySelf( shadowCamera.matrixWorldInverse );
+			shadowMatrix.multiply( shadowCamera.projectionMatrix );
+			shadowMatrix.multiply( shadowCamera.matrixWorldInverse );
 
 			// update camera matrices and frustum
 
-			_projScreenMatrix.multiply( shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse );
+			_projScreenMatrix.multiplyMatrices( shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse );
 			_frustum.setFromMatrix( _projScreenMatrix );
 
 			// render shadow map
@@ -240,7 +240,7 @@ THREE.ShadowMapPlugin = function ( ) {
 
 					if ( ! ( object instanceof THREE.Mesh || object instanceof THREE.ParticleSystem ) || ! ( object.frustumCulled ) || _frustum.intersectsObject( object ) ) {
 
-						object._modelViewMatrix.multiply( shadowCamera.matrixWorldInverse, object.matrixWorld );
+						object._modelViewMatrix.multiplyMatrices( shadowCamera.matrixWorldInverse, object.matrixWorld );
 
 						webglObject.render = true;
 
@@ -320,7 +320,7 @@ THREE.ShadowMapPlugin = function ( ) {
 
 				if ( object.visible && object.castShadow ) {
 
-					object._modelViewMatrix.multiply( shadowCamera.matrixWorldInverse, object.matrixWorld );
+					object._modelViewMatrix.multiplyMatrices( shadowCamera.matrixWorldInverse, object.matrixWorld );
 
 					_renderer.renderImmediateObject( shadowCamera, scene.__lights, fog, _depthMaterial, object );
 

+ 1 - 1
src/extras/renderers/plugins/SpritePlugin.js

@@ -165,7 +165,7 @@ THREE.SpritePlugin = function ( ) {
 
 			if ( ! material.useScreenCoordinates ) {
 
-				sprite._modelViewMatrix.multiply( camera.matrixWorldInverse, sprite.matrixWorld );
+				sprite._modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, sprite.matrixWorld );
 				sprite.z = - sprite._modelViewMatrix.elements[ 14 ];
 
 			} else {

+ 17 - 17
src/math/Box2.js

@@ -70,8 +70,8 @@ THREE.Box2.prototype = {
 	setFromCenterAndSize: function ( center, size ) {
 
 		var halfSize = THREE.Box2.__v1.copy( size ).multiplyScalar( 0.5 );
-		this.min.copy( center ).subSelf( halfSize );
-		this.max.copy( center ).addSelf( halfSize );
+		this.min.copy( center ).sub( halfSize );
+		this.max.copy( center ).add( halfSize );
 
 		return this;
 
@@ -106,29 +106,29 @@ THREE.Box2.prototype = {
 	center: function ( optionalTarget ) {
 
 		var result = optionalTarget || new THREE.Vector2();
-		return result.add( this.min, this.max ).multiplyScalar( 0.5 );
+		return result.addVectors( this.min, this.max ).multiplyScalar( 0.5 );
 
 	},
 
 	size: function ( optionalTarget ) {
 
 		var result = optionalTarget || new THREE.Vector2();
-		return result.sub( this.max, this.min );
+		return result.subVectors( this.max, this.min );
 
 	},
 
 	expandByPoint: function ( point ) {
 
-		this.min.minSelf( point );
-		this.max.maxSelf( point );
+		this.min.min( point );
+		this.max.max( point );
 
 		return this;
 	},
 
 	expandByVector: function ( vector ) {
 
-		this.min.subSelf( vector );
-		this.max.addSelf( vector );
+		this.min.sub( vector );
+		this.max.add( vector );
 
 		return this;
 	},
@@ -199,21 +199,21 @@ THREE.Box2.prototype = {
 	clampPoint: function ( point, optionalTarget ) {
 
 		var result = optionalTarget || new THREE.Vector2();
-		return result.copy( point ).clampSelf( this.min, this.max );
+		return result.copy( point ).clamp( this.min, this.max );
 
 	},
 
 	distanceToPoint: function ( point ) {
 
-		var clampedPoint = THREE.Box2.__v1.copy( point ).clampSelf( this.min, this.max );
-		return clampedPoint.subSelf( point ).length();
+		var clampedPoint = THREE.Box2.__v1.copy( point ).clamp( this.min, this.max );
+		return clampedPoint.sub( point ).length();
 
 	},
 
 	intersect: function ( box ) {
 
-		this.min.maxSelf( box.min );
-		this.max.minSelf( box.max );
+		this.min.max( box.min );
+		this.max.min( box.max );
 
 		return this;
 
@@ -221,8 +221,8 @@ THREE.Box2.prototype = {
 
 	union: function ( box ) {
 
-		this.min.minSelf( box.min );
-		this.max.maxSelf( box.max );
+		this.min.min( box.min );
+		this.max.max( box.max );
 
 		return this;
 
@@ -230,8 +230,8 @@ THREE.Box2.prototype = {
 
 	translate: function ( offset ) {
 
-		this.min.addSelf( offset );
-		this.max.addSelf( offset );
+		this.min.add( offset );
+		this.max.add( offset );
 
 		return this;
 

+ 17 - 17
src/math/Box3.js

@@ -81,8 +81,8 @@ THREE.Box3.prototype = {
 
 		var halfSize = THREE.Box3.__v1.copy( size ).multiplyScalar( 0.5 );
 
-		this.min.copy( center ).subSelf( halfSize );
-		this.max.copy( center ).addSelf( halfSize );
+		this.min.copy( center ).sub( halfSize );
+		this.max.copy( center ).add( halfSize );
 
 		return this;
 
@@ -117,21 +117,21 @@ THREE.Box3.prototype = {
 	center: function ( optionalTarget ) {
 
 		var result = optionalTarget || new THREE.Vector3();
-		return result.add( this.min, this.max ).multiplyScalar( 0.5 );
+		return result.addVectors( this.min, this.max ).multiplyScalar( 0.5 );
 
 	},
 
 	size: function ( optionalTarget ) {
 
 		var result = optionalTarget || new THREE.Vector3();
-		return result.sub( this.max, this.min );
+		return result.subVectors( this.max, this.min );
 
 	},
 
 	expandByPoint: function ( point ) {
 
-		this.min.minSelf( point );
-		this.max.maxSelf( point );
+		this.min.min( point );
+		this.max.max( point );
 
 		return this;
 
@@ -139,8 +139,8 @@ THREE.Box3.prototype = {
 
 	expandByVector: function ( vector ) {
 
-		this.min.subSelf( vector );
-		this.max.addSelf( vector );
+		this.min.sub( vector );
+		this.max.add( vector );
 
 		return this;
 
@@ -215,14 +215,14 @@ THREE.Box3.prototype = {
 	clampPoint: function ( point, optionalTarget ) {
 
 		var result = optionalTarget || new THREE.Vector3();
-		return new THREE.Vector3().copy( point ).clampSelf( this.min, this.max );
+		return new THREE.Vector3().copy( point ).clamp( this.min, this.max );
 
 	},
 
 	distanceToPoint: function ( point ) {
 
-		var clampedPoint = THREE.Box3.__v1.copy( point ).clampSelf( this.min, this.max );
-		return clampedPoint.subSelf( point ).length();
+		var clampedPoint = THREE.Box3.__v1.copy( point ).clamp( this.min, this.max );
+		return clampedPoint.sub( point ).length();
 
 	},
 
@@ -239,8 +239,8 @@ THREE.Box3.prototype = {
 
 	intersect: function ( box ) {
 
-		this.min.maxSelf( box.min );
-		this.max.minSelf( box.max );
+		this.min.max( box.min );
+		this.max.min( box.max );
 
 		return this;
 
@@ -248,8 +248,8 @@ THREE.Box3.prototype = {
 
 	union: function ( box ) {
 
-		this.min.minSelf( box.min );
-		this.max.maxSelf( box.max );
+		this.min.min( box.min );
+		this.max.max( box.max );
 
 		return this;
 
@@ -279,8 +279,8 @@ THREE.Box3.prototype = {
 
 	translate: function ( offset ) {
 
-		this.min.addSelf( offset );
-		this.max.addSelf( offset );
+		this.min.add( offset );
+		this.max.add( offset );
 
 		return this;
 

+ 1 - 1
src/math/Color.js

@@ -374,7 +374,7 @@ THREE.Color.prototype = {
 
 	},
 
-	lerpSelf: function ( color, alpha ) {
+	lerp: function ( color, alpha ) {
 
 		this.r += ( color.r - this.r ) * alpha;
 		this.g += ( color.g - this.g ) * alpha;

+ 15 - 13
src/math/Matrix4.js

@@ -220,7 +220,7 @@ THREE.Matrix4.prototype = {
 		var y = THREE.Matrix4.__v2;
 		var z = THREE.Matrix4.__v3;
 
-		z.sub( eye, target ).normalize();
+		z.subVectors( eye, target ).normalize();
 
 		if ( z.length() === 0 ) {
 
@@ -228,16 +228,16 @@ THREE.Matrix4.prototype = {
 
 		}
 
-		x.cross( up, z ).normalize();
+		x.crossVectors( up, z ).normalize();
 
 		if ( x.length() === 0 ) {
 
 			z.x += 0.0001;
-			x.cross( up, z ).normalize();
+			x.crossVectors( up, z ).normalize();
 
 		}
 
-		y.cross( z, x );
+		y.crossVectors( z, x );
 
 
 		te[0] = x.x; te[4] = y.x; te[8] = z.x;
@@ -248,7 +248,15 @@ THREE.Matrix4.prototype = {
 
 	},
 
-	multiply: function ( a, b ) {
+	multiply: function ( m ) {
+
+		if ( arguments.length > 1 ) debugger;
+
+		return this.multiplyMatrices( this, m );
+
+	},
+
+	multiplyMatrices: function ( a, b ) {
 
 		var ae = a.elements;
 		var be = b.elements;
@@ -288,17 +296,11 @@ THREE.Matrix4.prototype = {
 
 	},
 
-	multiplySelf: function ( m ) {
-
-		return this.multiply( this, m );
-
-	},
-
 	multiplyToArray: function ( a, b, r ) {
 
 		var te = this.elements;
 
-		this.multiply( a, b );
+		this.multiplyMatrices( a, b );
 
 		r[ 0 ] = te[0]; r[ 1 ] = te[1]; r[ 2 ] = te[2]; r[ 3 ] = te[3];
 		r[ 4 ] = te[4]; r[ 5 ] = te[5]; r[ 6 ] = te[6]; r[ 7 ] = te[7];
@@ -586,7 +588,7 @@ THREE.Matrix4.prototype = {
 
 		mScale.makeScale( scale );
 
-		this.multiply( mRotation, mScale );
+		this.multiplyMatrices( mRotation, mScale );
 
 		te[12] = translation.x;
 		te[13] = translation.y;

+ 4 - 5
src/math/Plane.js

@@ -42,8 +42,7 @@ THREE.Plane.prototype = {
 
 	setFromCoplanarPoints: function ( a, b, c ) {
 
-		var normal = THREE.Plane.__v1.sub( c, b ).crossSelf(
-					 THREE.Plane.__v2.sub( a, b ) ).normalize();
+		var normal = THREE.Plane.__v1.subVectors( c, b ).cross( THREE.Plane.__v2.subVectors( a, b ) ).normalize();
 
 		// Q: should an error be thrown if normal is zero (e.g. degenerate plane)?
 
@@ -97,7 +96,7 @@ THREE.Plane.prototype = {
 
 	projectPoint: function ( point, optionalTarget ) {
 
-		return this.orthoPoint( point, optionalTarget ).subSelf( point ).negate();
+		return this.orthoPoint( point, optionalTarget ).sub( point ).negate();
 
 	},
 
@@ -125,7 +124,7 @@ THREE.Plane.prototype = {
 
 		var result = optionalTarget || new THREE.Vector3();
 
-		var direction = THREE.Plane.__v1.sub( endPoint, startPoint );
+		var direction = THREE.Plane.__v1.subVectors( endPoint, startPoint );
 
 		var denominator = this.normal.dot( direction );
 
@@ -151,7 +150,7 @@ THREE.Plane.prototype = {
 
 		}
 
-		return result.copy( direction ).multiplyScalar( t ).addSelf( startPoint );
+		return result.copy( direction ).multiplyScalar( t ).add( startPoint );
 
 	},
 

+ 42 - 41
src/math/Quaternion.js

@@ -45,7 +45,7 @@ THREE.Quaternion.prototype = {
 		// http://www.mathworks.com/matlabcentral/fileexchange/
 		// 	20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/
 		//	content/SpinCalc.m
-	
+
 		var c1 = Math.cos( v.x / 2 );
 		var c2 = Math.cos( v.y / 2 );
 		var c3 = Math.cos( v.z / 2 );
@@ -61,42 +61,42 @@ THREE.Quaternion.prototype = {
 			this.w = c1 * c2 * c3 - s1 * s2 * s3;
 
 		} else if ( order === 'YXZ' ) {
-	
+
 			this.x = s1 * c2 * c3 + c1 * s2 * s3;
 			this.y = c1 * s2 * c3 - s1 * c2 * s3;
 			this.z = c1 * c2 * s3 - s1 * s2 * c3;
 			this.w = c1 * c2 * c3 + s1 * s2 * s3;
-				
+
 		} else if ( order === 'ZXY' ) {
-	
+
 			this.x = s1 * c2 * c3 - c1 * s2 * s3;
 			this.y = c1 * s2 * c3 + s1 * c2 * s3;
 			this.z = c1 * c2 * s3 + s1 * s2 * c3;
 			this.w = c1 * c2 * c3 - s1 * s2 * s3;
-				
+
 		} else if ( order === 'ZYX' ) {
-	
+
 			this.x = s1 * c2 * c3 - c1 * s2 * s3;
 			this.y = c1 * s2 * c3 + s1 * c2 * s3;
 			this.z = c1 * c2 * s3 - s1 * s2 * c3;
 			this.w = c1 * c2 * c3 + s1 * s2 * s3;
-				
+
 		} else if ( order === 'YZX' ) {
-			
+
 			this.x = s1 * c2 * c3 + c1 * s2 * s3;
 			this.y = c1 * s2 * c3 + s1 * c2 * s3;
 			this.z = c1 * c2 * s3 - s1 * s2 * c3;
 			this.w = c1 * c2 * c3 - s1 * s2 * s3;
-				
+
 		} else if ( order === 'XZY' ) {
-			
+
 			this.x = s1 * c2 * c3 - c1 * s2 * s3;
 			this.y = c1 * s2 * c3 - s1 * c2 * s3;
 			this.z = c1 * c2 * s3 + s1 * s2 * c3;
 			this.w = c1 * c2 * c3 + s1 * s2 * s3;
-				
+
 		}
-		
+
 		return this;
 
 	},
@@ -121,56 +121,56 @@ THREE.Quaternion.prototype = {
 	setFromRotationMatrix: function ( m ) {
 
 		// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm
-		
+
 		// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)
-		
+
 		var te = m.elements,
-			
+
 			m11 = te[0], m12 = te[4], m13 = te[8],
 			m21 = te[1], m22 = te[5], m23 = te[9],
 			m31 = te[2], m32 = te[6], m33 = te[10],
-			
+
 			trace = m11 + m22 + m33,
 			s;
-		
-		if( trace > 0 ) {
-		
+
+		if ( trace > 0 ) {
+
 			s = 0.5 / Math.sqrt( trace + 1.0 );
-			
+
 			this.w = 0.25 / s;
 			this.x = ( m32 - m23 ) * s;
 			this.y = ( m13 - m31 ) * s;
 			this.z = ( m21 - m12 ) * s;
-		
+
 		} else if ( m11 > m22 && m11 > m33 ) {
-		
+
 			s = 2.0 * Math.sqrt( 1.0 + m11 - m22 - m33 );
-			
+
 			this.w = (m32 - m23 ) / s;
 			this.x = 0.25 * s;
 			this.y = (m12 + m21 ) / s;
 			this.z = (m13 + m31 ) / s;
-		
-		} else if (m22 > m33) {
-		
+
+		} else if ( m22 > m33 ) {
+
 			s = 2.0 * Math.sqrt( 1.0 + m22 - m11 - m33 );
-			
+
 			this.w = (m13 - m31 ) / s;
 			this.x = (m12 + m21 ) / s;
 			this.y = 0.25 * s;
 			this.z = (m23 + m32 ) / s;
-		
+
 		} else {
-		
+
 			s = 2.0 * Math.sqrt( 1.0 + m33 - m11 - m22 );
-			
+
 			this.w = ( m21 - m12 ) / s;
 			this.x = ( m13 + m31 ) / s;
 			this.y = ( m23 + m32 ) / s;
 			this.z = 0.25 * s;
-		
+
 		}
-	
+
 		return this;
 
 	},
@@ -231,14 +231,9 @@ THREE.Quaternion.prototype = {
 
 	},
 
-	multiply: function ( a, b ) {
-
-		this.copy( a );
-		return this.multiplySelf( b );
-
-	},
+	multiply: function ( b ) {
 
-	multiplySelf: function ( b ) {
+		if ( arguments.length > 1 ) debugger;
 
 		// from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm
 		var qax = this.x, qay = this.y, qaz = this.z, qaw = this.w,
@@ -253,7 +248,13 @@ THREE.Quaternion.prototype = {
 
 	},
 
-	slerpSelf: function ( qb, t ) {
+	multiplyQuaternions: function ( a, b ) {
+
+		return this.copy( a ).multiply( b );
+
+	},
+
+	slerp: function ( qb, t ) {
 
 		var x = this.x, y = this.y, z = this.z, w = this.w;
 
@@ -329,6 +330,6 @@ THREE.Quaternion.prototype = {
 
 THREE.Quaternion.slerp = function ( qa, qb, qm, t ) {
 
-	return qm.copy( qa ).slerpSelf( qb, t );
+	return qm.copy( qa ).slerp( qb, t );
 
 }

+ 8 - 8
src/math/Ray.js

@@ -36,11 +36,11 @@ THREE.Ray.prototype = {
 
 		var result = optionalTarget || new THREE.Vector3();
 
-		return result.copy( this.direction ).multiplyScalar( t ).addSelf( this.origin );
+		return result.copy( this.direction ).multiplyScalar( t ).add( this.origin );
 
 	},
 
-	recastSelf: function ( t ) {
+	recast: function ( t ) {
 
 		this.origin.copy( this.at( t, THREE.Ray.__v1 ) );
 
@@ -51,17 +51,17 @@ THREE.Ray.prototype = {
 	closestPointToPoint: function ( point, optionalTarget ) {
 
 		var result = optionalTarget || new THREE.Vector3();
-		result.sub( point, this.origin );
+		result.subVectors( point, this.origin );
 		var directionDistance = result.dot( this.direction );
 
-		return result.copy( this.direction ).multiplyScalar( directionDistance ).addSelf( this.origin );
+		return result.copy( this.direction ).multiplyScalar( directionDistance ).add( this.origin );
 
 	},
 
 	distanceToPoint: function ( point ) {
 
-		var directionDistance = THREE.Ray.__v1.sub( point, this.origin ).dot( this.direction );		
-		THREE.Ray.__v1.copy( this.direction ).multiplyScalar( directionDistance ).addSelf( this.origin );
+		var directionDistance = THREE.Ray.__v1.subVectors( point, this.origin ).dot( this.direction );
+		THREE.Ray.__v1.copy( this.direction ).multiplyScalar( directionDistance ).add( this.origin );
 
 		return THREE.Ray.__v1.distanceTo( point );
 
@@ -133,9 +133,9 @@ THREE.Ray.prototype = {
 
 	transform: function ( matrix4 ) {
 
-		this.direction.addSelf( this.origin ).applyMatrix4( matrix4 );
+		this.direction.add( this.origin ).applyMatrix4( matrix4 );
 		this.origin.applyMatrix4( matrix4 );
-		this.direction.subSelf( this.origin );
+		this.direction.sub( this.origin );
 
 		return this;
 	},

+ 3 - 3
src/math/Sphere.js

@@ -84,8 +84,8 @@ THREE.Sphere.prototype = {
 
 		if ( deltaLengthSq > ( this.radius * this.radius ) ) {
 
-			result.subSelf( this.center ).normalize();
-			result.multiplyScalar( this.radius ).addSelf( this.center );
+			result.sub( this.center ).normalize();
+			result.multiplyScalar( this.radius ).add( this.center );
 
 		}
 
@@ -115,7 +115,7 @@ THREE.Sphere.prototype = {
 
 	translate: function ( offset ) {
 
-		this.center.addSelf( offset );
+		this.center.add( offset );
 
 		return this;
 

+ 10 - 10
src/math/Triangle.js

@@ -23,9 +23,9 @@ THREE.Triangle.normal = function( a, b, c, optionalTarget ) {
 
 	var result = optionalTarget || new THREE.Vector3();
 
-	result.sub( c, b );
-	THREE.Triangle.__v0.sub( a, b );
-	result.crossSelf( THREE.Triangle.__v0 );
+	result.subVectors( c, b );
+	THREE.Triangle.__v0.subVectors( a, b );
+	result.cross( THREE.Triangle.__v0 );
 
 	var resultLengthSq = result.lengthSq();
 	if( resultLengthSq > 0 ) {
@@ -42,9 +42,9 @@ THREE.Triangle.normal = function( a, b, c, optionalTarget ) {
 // based on: http://www.blackpawn.com/texts/pointinpoly/default.html
 THREE.Triangle.barycoordFromPoint = function ( point, a, b, c, optionalTarget ) {
 
-	THREE.Triangle.__v0.sub( c, a );
-	THREE.Triangle.__v1.sub( b, a );
-	THREE.Triangle.__v2.sub( point, a );
+	THREE.Triangle.__v0.subVectors( c, a );
+	THREE.Triangle.__v1.subVectors( b, a );
+	THREE.Triangle.__v2.subVectors( point, a );
 
 	var dot00 = THREE.Triangle.__v0.dot( THREE.Triangle.__v0 );
 	var dot01 = THREE.Triangle.__v0.dot( THREE.Triangle.__v1 );
@@ -117,17 +117,17 @@ THREE.Triangle.prototype = {
 
 	area: function () {
 
-		THREE.Triangle.__v0.sub( this.c, this.b );
-		THREE.Triangle.__v1.sub( this.a, this.b );
+		THREE.Triangle.__v0.subVectors( this.c, this.b );
+		THREE.Triangle.__v1.subVectors( this.a, this.b );
 
-		return THREE.Triangle.__v0.crossSelf( THREE.Triangle.__v1 ).length() * 0.5;
+		return THREE.Triangle.__v0.cross( THREE.Triangle.__v1 ).length() * 0.5;
 
 	},
 
 	midpoint: function ( optionalTarget ) {
 
 		var result = optionalTarget || new THREE.Vector3();
-		return result.add( this.a, this.b ).addSelf( this.c ).multiplyScalar( 1 / 3 );
+		return result.addVectors( this.a, this.b ).add( this.c ).multiplyScalar( 1 / 3 );
 
 	},
 

+ 19 - 17
src/math/Vector2.js

@@ -75,16 +75,18 @@ THREE.Vector2.prototype = {
 
 	},
 
-	addScalar: function ( s ) {
+	add: function ( v ) {
 
-		this.x += s;
-		this.y += s;
+		if ( arguments.length > 1 ) debugger;
+
+		this.x += v.x;
+		this.y += v.y;
 
 		return this;
 
 	},
 
-	add: function ( a, b ) {
+	addVectors: function ( a, b ) {
 
 		this.x = a.x + b.x;
 		this.y = a.y + b.y;
@@ -93,28 +95,28 @@ THREE.Vector2.prototype = {
 
 	},
 
-	addSelf: function ( v ) {
+	addScalar: function ( s ) {
 
-		this.x += v.x;
-		this.y += v.y;
+		this.x += s;
+		this.y += s;
 
 		return this;
 
 	},
 
-	sub: function ( a, b ) {
+	sub: function ( v ) {
 
-		this.x = a.x - b.x;
-		this.y = a.y - b.y;
+		this.x -= v.x;
+		this.y -= v.y;
 
 		return this;
 
 	},
 
-	subSelf: function ( v ) {
+	subVectors: function ( a, b ) {
 
-		this.x -= v.x;
-		this.y -= v.y;
+		this.x = a.x - b.x;
+		this.y = a.y - b.y;
 
 		return this;
 
@@ -146,7 +148,7 @@ THREE.Vector2.prototype = {
 
 	},
 
-	minSelf: function ( v ) {
+	min: function ( v ) {
 
 		if ( this.x > v.x ) {
 
@@ -164,7 +166,7 @@ THREE.Vector2.prototype = {
 
 	},
 
-	maxSelf: function ( v ) {
+	max: function ( v ) {
 
 		if ( this.x < v.x ) {
 
@@ -182,7 +184,7 @@ THREE.Vector2.prototype = {
 
 	},
 
-	clampSelf: function ( min, max ) {
+	clamp: function ( min, max ) {
 
 		// This function assumes min < max, if this assumption isn't true it will not operate correctly
 
@@ -266,7 +268,7 @@ THREE.Vector2.prototype = {
 
 	},
 
-	lerpSelf: function ( v, alpha ) {
+	lerp: function ( v, alpha ) {
 
 		this.x += ( v.x - this.x ) * alpha;
 		this.y += ( v.y - this.y ) * alpha;

+ 43 - 35
src/math/Vector3.js

@@ -90,17 +90,9 @@ THREE.Vector3.prototype = {
 
 	},
 
-	add: function ( a, b ) {
+	add: function ( v ) {
 
-		this.x = a.x + b.x;
-		this.y = a.y + b.y;
-		this.z = a.z + b.z;
-
-		return this;
-
-	},
-
-	addSelf: function ( v ) {
+		if ( arguments.length > 1 ) debugger;
 
 		this.x += v.x;
 		this.y += v.y;
@@ -120,17 +112,19 @@ THREE.Vector3.prototype = {
 
 	},
 
-	sub: function ( a, b ) {
+	addVectors: function ( a, b ) {
 
-		this.x = a.x - b.x;
-		this.y = a.y - b.y;
-		this.z = a.z - b.z;
+		this.x = a.x + b.x;
+		this.y = a.y + b.y;
+		this.z = a.z + b.z;
 
 		return this;
 
 	},
 
-	subSelf: function ( v ) {
+	sub: function ( v ) {
+
+		if ( arguments.length > 1 ) debugger;
 
 		this.x -= v.x;
 		this.y -= v.y;
@@ -140,17 +134,19 @@ THREE.Vector3.prototype = {
 
 	},
 
-	multiply: function ( a, b ) {
+	subVectors: function ( a, b ) {
 
-		this.x = a.x * b.x;
-		this.y = a.y * b.y;
-		this.z = a.z * b.z;
+		this.x = a.x - b.x;
+		this.y = a.y - b.y;
+		this.z = a.z - b.z;
 
 		return this;
 
 	},
 
-	multiplySelf: function ( v ) {
+	multiply: function ( v ) {
+
+		if ( arguments.length > 1 ) debugger;
 
 		this.x *= v.x;
 		this.y *= v.y;
@@ -170,6 +166,16 @@ THREE.Vector3.prototype = {
 
 	},
 
+	multiplyVectors: function ( a, b ) {
+
+		this.x = a.x * b.x;
+		this.y = a.y * b.y;
+		this.z = a.z * b.z;
+
+		return this;
+
+	},
+
 	applyMatrix3: function ( m ) {
 
 		var x = this.x;
@@ -231,7 +237,7 @@ THREE.Vector3.prototype = {
 
 	},
 
-	divideSelf: function ( v ) {
+	divide: function ( v ) {
 
 		this.x /= v.x;
 		this.y /= v.y;
@@ -261,7 +267,7 @@ THREE.Vector3.prototype = {
 
 	},
 
-	minSelf: function ( v ) {
+	min: function ( v ) {
 
 		if ( this.x > v.x ) {
 
@@ -285,7 +291,7 @@ THREE.Vector3.prototype = {
 
 	},
 
-	maxSelf: function ( v ) {
+	max: function ( v ) {
 
 		if ( this.x < v.x ) {
 
@@ -309,7 +315,7 @@ THREE.Vector3.prototype = {
 
 	},
 
-	clampSelf: function ( min, max ) {
+	clamp: function ( min, max ) {
 
 		// This function assumes min < max, if this assumption isn't true it will not operate correctly
 
@@ -396,7 +402,7 @@ THREE.Vector3.prototype = {
 
 	},
 
-	lerpSelf: function ( v, alpha ) {
+	lerp: function ( v, alpha ) {
 
 		this.x += ( v.x - this.x ) * alpha;
 		this.y += ( v.y - this.y ) * alpha;
@@ -406,17 +412,9 @@ THREE.Vector3.prototype = {
 
 	},
 
-	cross: function ( a, b ) {
-
-		this.x = a.y * b.z - a.z * b.y;
-		this.y = a.z * b.x - a.x * b.z;
-		this.z = a.x * b.y - a.y * b.x;
-
-		return this;
-
-	},
+	cross: function ( v ) {
 
-	crossSelf: function ( v ) {
+		if ( arguments.length > 1 ) debugger;
 
 		var x = this.x, y = this.y, z = this.z;
 
@@ -428,6 +426,16 @@ THREE.Vector3.prototype = {
 
 	},
 
+	crossVectors: function ( a, b ) {
+
+		this.x = a.y * b.z - a.z * b.y;
+		this.y = a.z * b.x - a.x * b.z;
+		this.z = a.x * b.y - a.y * b.x;
+
+		return this;
+
+	},
+
 	angleTo: function ( v ) {
 
 		return Math.acos( this.dot( v ) / this.length() / v.length() );

+ 24 - 22
src/math/Vector4.js

@@ -101,6 +101,19 @@ THREE.Vector4.prototype = {
 
 	},
 
+	add: function ( v ) {
+
+		if ( arguments.length > 1 ) debugger;
+
+		this.x += v.x;
+		this.y += v.y;
+		this.z += v.z;
+		this.w += v.w;
+
+		return this;
+
+	},
+
 	addScalar: function ( s ) {
 
 		this.x += s;
@@ -112,7 +125,7 @@ THREE.Vector4.prototype = {
 
 	},
 
-	add: function ( a, b ) {
+	addVectors: function ( a, b ) {
 
 		this.x = a.x + b.x;
 		this.y = a.y + b.y;
@@ -123,18 +136,18 @@ THREE.Vector4.prototype = {
 
 	},
 
-	addSelf: function ( v ) {
+	sub: function ( v ) {
 
-		this.x += v.x;
-		this.y += v.y;
-		this.z += v.z;
-		this.w += v.w;
+		this.x -= v.x;
+		this.y -= v.y;
+		this.z -= v.z;
+		this.w -= v.w;
 
 		return this;
 
 	},
 
-	sub: function ( a, b ) {
+	subVectors: function ( a, b ) {
 
 		this.x = a.x - b.x;
 		this.y = a.y - b.y;
@@ -145,17 +158,6 @@ THREE.Vector4.prototype = {
 
 	},
 
-	subSelf: function ( v ) {
-
-		this.x -= v.x;
-		this.y -= v.y;
-		this.z -= v.z;
-		this.w -= v.w;
-
-		return this;
-
-	},
-
 	multiplyScalar: function ( s ) {
 
 		this.x *= s;
@@ -207,7 +209,7 @@ THREE.Vector4.prototype = {
 
 	},
 
-	minSelf: function ( v ) {
+	min: function ( v ) {
 
 		if ( this.x > v.x ) {
 
@@ -237,7 +239,7 @@ THREE.Vector4.prototype = {
 
 	},
 
-	maxSelf: function ( v ) {
+	max: function ( v ) {
 
 		if ( this.x < v.x ) {
 
@@ -267,7 +269,7 @@ THREE.Vector4.prototype = {
 
 	},
 
-	clampSelf: function ( min, max ) {
+	clamp: function ( min, max ) {
 
 		// This function assumes min < max, if this assumption isn't true it will not operate correctly
 
@@ -364,7 +366,7 @@ THREE.Vector4.prototype = {
 
 	},
 
-	lerpSelf: function ( v, alpha ) {
+	lerp: function ( v, alpha ) {
 
 		this.x += ( v.x - this.x ) * alpha;
 		this.y += ( v.y - this.y ) * alpha;

+ 2 - 2
src/objects/Bone.js

@@ -14,7 +14,7 @@ THREE.Bone = function( belongsToSkin ) {
 
 THREE.Bone.prototype = Object.create( THREE.Object3D.prototype );
 
-THREE.Bone.prototype.update = function( parentSkinMatrix, forceUpdate ) {
+THREE.Bone.prototype.update = function ( parentSkinMatrix, forceUpdate ) {
 
 	// update local
 
@@ -30,7 +30,7 @@ THREE.Bone.prototype.update = function( parentSkinMatrix, forceUpdate ) {
 
 		if( parentSkinMatrix ) {
 
-			this.skinMatrix.multiply( parentSkinMatrix, this.matrix );
+			this.skinMatrix.multiplyMatrices( parentSkinMatrix, this.matrix );
 
 		} else {
 

+ 3 - 3
src/objects/SkinnedMesh.js

@@ -138,7 +138,7 @@ THREE.SkinnedMesh.prototype.updateMatrixWorld = function ( force ) {
 
 		if ( this.parent ) {
 
-			this.matrixWorld.multiply( this.parent.matrixWorld, this.matrix );
+			this.matrixWorld.multiplyMatrices( this.parent.matrixWorld, this.matrix );
 
 		} else {
 
@@ -198,7 +198,7 @@ THREE.SkinnedMesh.prototype.updateMatrixWorld = function ( force ) {
 		// was already representing the offset; however, this requires some
 		// major changes to the animation system
 
-		THREE.SkinnedMesh.offsetMatrix.multiply( this.bones[ b ].skinMatrix, this.boneInverses[ b ] );
+		THREE.SkinnedMesh.offsetMatrix.multiplyMatrices( this.bones[ b ].skinMatrix, this.boneInverses[ b ] );
 
 		THREE.SkinnedMesh.offsetMatrix.flattenToArrayOffset( this.boneMatrices, b * 16 );
 
@@ -212,7 +212,7 @@ THREE.SkinnedMesh.prototype.updateMatrixWorld = function ( force ) {
 
 };
 
-THREE.SkinnedMesh.prototype.pose = function() {
+THREE.SkinnedMesh.prototype.pose = function () {
 
 	this.updateMatrixWorld( true );
 

+ 1 - 1
src/renderers/CanvasRenderer.js

@@ -405,7 +405,7 @@ THREE.CanvasRenderer = function ( parameters ) {
 
 					var lightPosition = light.matrixWorld.getPosition();
 
-					var amount = normal.dot( _vector3.sub( lightPosition, position ).normalize() );
+					var amount = normal.dot( _vector3.subVectors( lightPosition, position ).normalize() );
 
 					if ( amount <= 0 ) continue;
 

+ 5 - 5
src/renderers/WebGLRenderer.js

@@ -1151,7 +1151,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 		if ( object.sortParticles ) {
 
 			_projScreenMatrixPS.copy( _projScreenMatrix );
-			_projScreenMatrixPS.multiplySelf( object.matrixWorld );
+			_projScreenMatrixPS.multiply( object.matrixWorld );
 
 			for ( v = 0; v < vl; v ++ ) {
 
@@ -4068,7 +4068,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 		camera.matrixWorldInverse.getInverse( camera.matrixWorld );
 
-		_projScreenMatrix.multiply( camera.projectionMatrix, camera.matrixWorldInverse );
+		_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );
 		_frustum.setFromMatrix( _projScreenMatrix );
 
 		// update WebGL objects
@@ -5809,7 +5809,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 	function setupMatrices ( object, camera ) {
 
-		object._modelViewMatrix.multiply( camera.matrixWorldInverse, object.matrixWorld );
+		object._modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );
 
 		object._normalMatrix.getInverse( object._modelViewMatrix );
 		object._normalMatrix.transpose();
@@ -5913,7 +5913,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 				if ( ! light.visible ) continue;
 
 				_direction.copy( light.matrixWorld.getPosition() );
-				_direction.subSelf( light.target.matrixWorld.getPosition() );
+				_direction.sub( light.target.matrixWorld.getPosition() );
 				_direction.normalize();
 
 				// skip lights with undefined direction
@@ -5994,7 +5994,7 @@ THREE.WebGLRenderer = function ( parameters ) {
 				spotDistances[ spotLength ] = distance;
 
 				_direction.copy( position );
-				_direction.subSelf( light.target.matrixWorld.getPosition() );
+				_direction.sub( light.target.matrixWorld.getPosition() );
 				_direction.normalize();
 
 				spotDirections[ spotOffset ]     = _direction.x;

+ 6 - 6
test/unit/math/Matrix3.js

@@ -8,7 +8,7 @@ var matrixEquals3 = function( a, b, tolerance ) {
 	tolerance = tolerance || 0.0001;
 	if( a.elements.length != b.elements.length ) {
 		return false;
-	}	
+	}
 	for( var i = 0, il = a.elements.length; i < il; i ++ ) {
 		var delta = a.elements[i] - b.elements[i];
 		if( delta > tolerance ) {
@@ -145,7 +145,7 @@ test( "getInverse", function() {
 	var a = new THREE.Matrix4();
 	var b = new THREE.Matrix3( 0, 0, 0, 0, 0, 0, 0, 0, 0 );
 	var c = new THREE.Matrix4( 0, 0, 0, 0, 0, 0, 0, 0, 0 );
-	
+
 	ok( ! matrixEquals3( a, b ), "Passed!" );
 	b.getInverse( a, false );
 	ok( matrixEquals3( b, new THREE.Matrix3() ), "Passed!" );
@@ -172,14 +172,14 @@ test( "getInverse", function() {
 	for( var i = 0, il = testMatrices.length; i < il; i ++ ) {
 		var m = testMatrices[i];
 		var mInverse3 = new THREE.Matrix3().getInverse( m );
-	
+
 		var mInverse = toMatrix4( mInverse3 );
-		
+
 		// the determinant of the inverse should be the reciprocal
 		ok( Math.abs( m.determinant() * mInverse3.determinant() - 1 ) < 0.0001, "Passed!" );
 		ok( Math.abs( m.determinant() * mInverse.determinant() - 1 ) < 0.0001, "Passed!" );
 
-		var mProduct = new THREE.Matrix4().multiply( m, mInverse );
+		var mProduct = new THREE.Matrix4().multiplyMatrices( m, mInverse );
 		ok( Math.abs( mProduct.determinant() - 1 ) < 0.0001, "Passed!" );
 		ok( matrixEquals3( mProduct, identity ), "Passed!" );
 	}
@@ -206,4 +206,4 @@ test( "clone", function() {
 	// ensure that it is a true copy
 	a.elements[0] = 2;
 	ok( ! matrixEquals3( a, b ), "Passed!" );
-});
+});

+ 4 - 4
test/unit/math/Matrix4.js

@@ -8,7 +8,7 @@ var matrixEquals4 = function( a, b, tolerance ) {
 	tolerance = tolerance || 0.0001;
 	if( a.elements.length != b.elements.length ) {
 		return false;
-	}	
+	}
 	for( var i = 0, il = a.elements.length; i < il; i ++ ) {
 		var delta = a.elements[i] - b.elements[i];
 		if( delta > tolerance ) {
@@ -162,7 +162,7 @@ test( "getInverse", function() {
 	var a = new THREE.Matrix4();
 	var b = new THREE.Matrix4( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 );
 	var c = new THREE.Matrix4( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 );
-	
+
 	ok( ! matrixEquals4( a, b ), "Passed!" );
 	b.getInverse( a, false );
 	ok( matrixEquals4( b, new THREE.Matrix4() ), "Passed!" );
@@ -197,7 +197,7 @@ test( "getInverse", function() {
 		// the determinant of the inverse should be the reciprocal
 		ok( Math.abs( m.determinant() * mInverse.determinant() - 1  ) < 0.0001, "Passed!" );
 
-		var mProduct = new THREE.Matrix4().multiply( m, mInverse );
+		var mProduct = new THREE.Matrix4().multiplyMatrices( m, mInverse );
 
 		// the determinant of the identity matrix is 1
 		ok( Math.abs( mProduct.determinant() - 1 ) < 0.0001, "Passed!" );
@@ -226,4 +226,4 @@ test( "clone", function() {
 	// ensure that it is a true copy
 	a.elements[0] = 2;
 	ok( ! matrixEquals4( a, b ), "Passed!" );
-});
+});

+ 6 - 6
test/unit/math/Quaternion.js

@@ -86,7 +86,7 @@ test( "setFromAxisAngle", function() {
 	var b2 = new THREE.Quaternion().setFromAxisAngle( new THREE.Vector3( 1, 0, 0 ), -Math.PI );
 	ok( ! a.equals( b2 ), "Passed!" );
 
-	b1.multiplySelf( b2 );
+	b1.multiply( b2 );
 	ok( a.equals( b1 ), "Passed!" );
 });
 
@@ -99,7 +99,7 @@ test( "setFromEuler/setEulerFromQuaternion", function() {
 	for( var i = 0; i < orders.length; i ++ ) {
 		for( var j = 0; j < angles.length; j ++ ) {
 			var eulers2 = new THREE.Vector3().setEulerFromQuaternion( new THREE.Quaternion().setFromEuler( angles[j], orders[i] ), orders[i] );
-		
+
 			ok( eulers2.distanceTo( angles[j] ) < 0.001, "Passed!" );
 		}
 	}
@@ -151,21 +151,21 @@ test( "inverse/conjugate", function() {
 });
 
 
-test( "multiply/multiplySelf", function() {
-	
+test( "multiplyQuaternions/multiply", function() {
+
 	var angles = [ new THREE.Vector3( 1, 0, 0 ), new THREE.Vector3( 0, 1, 0 ), new THREE.Vector3( 0, 0, 1 ) ];
 
 	var q1 = new THREE.Quaternion().setFromEuler( angles[0], "XYZ" );
 	var q2 = new THREE.Quaternion().setFromEuler( angles[1], "XYZ" );
 	var q3 = new THREE.Quaternion().setFromEuler( angles[2], "XYZ" );
 
-	var q = new THREE.Quaternion().multiply( q1, q2 ).multiplySelf( q3 );
+	var q = new THREE.Quaternion().multiplyQuaternions( q1, q2 ).multiply( q3 );
 
 	var m1 = new THREE.Matrix4().setRotationFromEuler( angles[0], "XYZ" );
 	var m2 = new THREE.Matrix4().setRotationFromEuler( angles[1], "XYZ" );
 	var m3 = new THREE.Matrix4().setRotationFromEuler( angles[2], "XYZ" );
 
-	var m = new THREE.Matrix4().multiply( m1, m2 ).multiplySelf( m3 );
+	var m = new THREE.Matrix4().multiplyMatrices( m1, m2 ).multiply( m3 );
 
 	var qFromM = new THREE.Quaternion().setFromRotationMatrix( m );
 

+ 9 - 9
test/unit/math/Ray.js

@@ -43,19 +43,19 @@ test( "at", function() {
 	ok( a.at( 1 ).equals( new THREE.Vector3( 1, 1, 2 ) ), "Passed!" );
 });
 
-test( "recastSelf/clone", function() {
+test( "recast/clone", function() {
 	var a = new THREE.Ray( one3, new THREE.Vector3( 0, 0, 1 ) );
 
-	ok( a.recastSelf( 0 ).equals( a ), "Passed!" );
+	ok( a.recast( 0 ).equals( a ), "Passed!" );
 
 	var b = a.clone();
-	ok( b.recastSelf( -1 ).equals( new THREE.Ray( new THREE.Vector3( 1, 1, 0 ), new THREE.Vector3( 0, 0, 1 ) ) ), "Passed!" );
+	ok( b.recast( -1 ).equals( new THREE.Ray( new THREE.Vector3( 1, 1, 0 ), new THREE.Vector3( 0, 0, 1 ) ) ), "Passed!" );
 
 	var c = a.clone();
-	ok( c.recastSelf( 1 ).equals( new THREE.Ray( new THREE.Vector3( 1, 1, 2 ), new THREE.Vector3( 0, 0, 1 ) ) ), "Passed!" );
+	ok( c.recast( 1 ).equals( new THREE.Ray( new THREE.Vector3( 1, 1, 2 ), new THREE.Vector3( 0, 0, 1 ) ) ), "Passed!" );
 
 	var d = a.clone();
-	var e = d.clone().recastSelf( 1 );
+	var e = d.clone().recast( 1 );
 	ok( d.equals( a ), "Passed!" );
 	ok( ! e.equals( d ), "Passed!" );
 	ok( e.equals( c ), "Passed!" );
@@ -102,17 +102,17 @@ test( "isIntersectionSphere", function() {
 
 test( "isIntersectionPlane", function() {
 	var a = new THREE.Ray( one3, new THREE.Vector3( 0, 0, 1 ) );
-	
+
 	// parallel plane behind
-	var b = new THREE.Plane().setFromNormalAndCoplanarPoint( new THREE.Vector3( 0, 0, 1 ), one3.clone().subSelf( new THREE.Vector3( 0, 0, -1 ) ) );
+	var b = new THREE.Plane().setFromNormalAndCoplanarPoint( new THREE.Vector3( 0, 0, 1 ), one3.clone().sub( new THREE.Vector3( 0, 0, -1 ) ) );
 	ok( a.isIntersectionPlane( b ), "Passed!" );
 
 	// parallel plane coincident with origin
-	var c = new THREE.Plane().setFromNormalAndCoplanarPoint( new THREE.Vector3( 0, 0, 1 ), one3.clone().subSelf( new THREE.Vector3( 0, 0, 0 ) ) );
+	var c = new THREE.Plane().setFromNormalAndCoplanarPoint( new THREE.Vector3( 0, 0, 1 ), one3.clone().sub( new THREE.Vector3( 0, 0, 0 ) ) );
 	ok( a.isIntersectionPlane( c ), "Passed!" );
 
 	// parallel plane infront
-	var d = new THREE.Plane().setFromNormalAndCoplanarPoint( new THREE.Vector3( 0, 0, 1 ), one3.clone().subSelf( new THREE.Vector3( 0, 0, 1 ) ) );
+	var d = new THREE.Plane().setFromNormalAndCoplanarPoint( new THREE.Vector3( 0, 0, 1 ), one3.clone().sub( new THREE.Vector3( 0, 0, 1 ) ) );
 	ok( a.isIntersectionPlane( d ), "Passed!" );
 
 	// perpendical ray that overlaps exactly

+ 27 - 27
test/unit/math/Vector2.js

@@ -63,26 +63,26 @@ test( "add", function() {
 	var a = new THREE.Vector2( x, y );
 	var b = new THREE.Vector2( -x, -y );
 
-	a.addSelf( b );
+	a.add( b );
 	ok( a.x == 0, "Passed!" );
 	ok( a.y == 0, "Passed!" );
 
-	var c = new THREE.Vector2().add( b, b );
+	var c = new THREE.Vector2().addVectors( b, b );
 	ok( c.x == -2*x, "Passed!" );
-	ok( c.y == -2*y, "Passed!" );	
+	ok( c.y == -2*y, "Passed!" );
 });
 
 test( "sub", function() {
 	var a = new THREE.Vector2( x, y );
 	var b = new THREE.Vector2( -x, -y );
 
-	a.subSelf( b );
+	a.sub( b );
 	ok( a.x == 2*x, "Passed!" );
 	ok( a.y == 2*y, "Passed!" );
 
-	var c = new THREE.Vector2().sub( a, a );
+	var c = new THREE.Vector2().subVectors( a, a );
 	ok( c.x == 0, "Passed!" );
-	ok( c.y == 0, "Passed!" );	
+	ok( c.y == 0, "Passed!" );
 });
 
 test( "multiply/divide", function() {
@@ -95,7 +95,7 @@ test( "multiply/divide", function() {
 
 	b.multiplyScalar( -2 );
 	ok( b.x == 2*x, "Passed!" );
-	ok( b.y == 2*y, "Passed!" );	
+	ok( b.y == 2*y, "Passed!" );
 
 	a.divideScalar( -2 );
 	ok( a.x == x, "Passed!" );
@@ -103,7 +103,7 @@ test( "multiply/divide", function() {
 
 	b.divideScalar( -2 );
 	ok( b.x == -x, "Passed!" );
-	ok( b.y == -y, "Passed!" );	
+	ok( b.y == -y, "Passed!" );
 });
 
 
@@ -112,23 +112,23 @@ test( "min/max/clamp", function() {
 	var b = new THREE.Vector2( -x, -y );
 	var c = new THREE.Vector2();
 
-	c.copy( a ).minSelf( b );
+	c.copy( a ).min( b );
 	ok( c.x == -x, "Passed!" );
 	ok( c.y == -y, "Passed!" );
 
-	c.copy( a ).maxSelf( b );
+	c.copy( a ).max( b );
 	ok( c.x == x, "Passed!" );
 	ok( c.y == y, "Passed!" );
 
 	c.set( -2*x, 2*y );
-	c.clampSelf( b, a );
+	c.clamp( b, a );
 	ok( c.x == -x, "Passed!" );
-	ok( c.y == y, "Passed!" );	
+	ok( c.y == y, "Passed!" );
 });
 
 test( "negate", function() {
 	var a = new THREE.Vector2( x, y );
-	
+
 	a.negate();
 	ok( a.x == -x, "Passed!" );
 	ok( a.y == -y, "Passed!" );
@@ -138,7 +138,7 @@ test( "dot", function() {
 	var a = new THREE.Vector2( x, y );
 	var b = new THREE.Vector2( -x, -y );
 	var c = new THREE.Vector2();
-	
+
 	var result = a.dot( b );
 	ok( result == (-x*x-y*y), "Passed!" );
 
@@ -150,7 +150,7 @@ test( "length/lengthSq", function() {
 	var a = new THREE.Vector2( x, 0 );
 	var b = new THREE.Vector2( 0, -y );
 	var c = new THREE.Vector2();
-	
+
 	ok( a.length() == x, "Passed!" );
 	ok( a.lengthSq() == x*x, "Passed!" );
 	ok( b.length() == y, "Passed!" );
@@ -167,7 +167,7 @@ test( "normalize", function() {
 	var a = new THREE.Vector2( x, 0 );
 	var b = new THREE.Vector2( 0, -y );
 	var c = new THREE.Vector2();
-	
+
 	a.normalize();
 	ok( a.length() == 1, "Passed!" );
 	ok( a.x == 1, "Passed!" );
@@ -181,7 +181,7 @@ test( "distanceTo/distanceToSquared", function() {
 	var a = new THREE.Vector2( x, 0 );
 	var b = new THREE.Vector2( 0, -y );
 	var c = new THREE.Vector2();
-	
+
 	ok( a.distanceTo( c ) == x, "Passed!" );
 	ok( a.distanceToSquared( c ) == x*x, "Passed!" );
 
@@ -191,7 +191,7 @@ test( "distanceTo/distanceToSquared", function() {
 
 test( "setLength", function() {
 	var a = new THREE.Vector2( x, 0 );
-	
+
 	ok( a.length() == x, "Passed!" );
 	a.setLength( y );
 	ok( a.length() == y, "Passed!" );
@@ -202,25 +202,25 @@ test( "setLength", function() {
 	ok( a.length() == 0, "Passed!" );
 });
 
-test( "lerpSelf/clone", function() {
+test( "lerp/clone", function() {
 	var a = new THREE.Vector2( x, 0 );
 	var b = new THREE.Vector2( 0, -y );
-	
-	ok( a.lerpSelf( a, 0 ).equals( a.lerpSelf( a, 0.5 ) ), "Passed!" );
-	ok( a.lerpSelf( a, 0 ).equals( a.lerpSelf( a, 1 ) ), "Passed!" );
 
-	ok( a.clone().lerpSelf( b, 0 ).equals( a ), "Passed!" );
+	ok( a.lerp( a, 0 ).equals( a.lerp( a, 0.5 ) ), "Passed!" );
+	ok( a.lerp( a, 0 ).equals( a.lerp( a, 1 ) ), "Passed!" );
 
-	ok( a.clone().lerpSelf( b, 0.5 ).x == x*0.5, "Passed!" );
-	ok( a.clone().lerpSelf( b, 0.5 ).y == -y*0.5, "Passed!" );
+	ok( a.clone().lerp( b, 0 ).equals( a ), "Passed!" );
 
-	ok( a.clone().lerpSelf( b, 1 ).equals( b ), "Passed!" );
+	ok( a.clone().lerp( b, 0.5 ).x == x*0.5, "Passed!" );
+	ok( a.clone().lerp( b, 0.5 ).y == -y*0.5, "Passed!" );
+
+	ok( a.clone().lerp( b, 1 ).equals( b ), "Passed!" );
 });
 
 test( "equals", function() {
 	var a = new THREE.Vector2( x, 0 );
 	var b = new THREE.Vector2( 0, -y );
-	
+
 	ok( a.x != b.x, "Passed!" );
 	ok( a.y != b.y, "Passed!" );
 

+ 33 - 33
test/unit/math/Vector3.js

@@ -77,30 +77,30 @@ test( "add", function() {
 	var a = new THREE.Vector3( x, y, z );
 	var b = new THREE.Vector3( -x, -y, -z );
 
-	a.addSelf( b );
+	a.add( b );
 	ok( a.x == 0, "Passed!" );
 	ok( a.y == 0, "Passed!" );
 	ok( a.z == 0, "Passed!" );
 
-	var c = new THREE.Vector3().add( b, b );
+	var c = new THREE.Vector3().addVectors( b, b );
 	ok( c.x == -2*x, "Passed!" );
-	ok( c.y == -2*y, "Passed!" );	
-	ok( c.z == -2*z, "Passed!" );	
+	ok( c.y == -2*y, "Passed!" );
+	ok( c.z == -2*z, "Passed!" );
 });
 
 test( "sub", function() {
 	var a = new THREE.Vector3( x, y, z );
 	var b = new THREE.Vector3( -x, -y, -z );
 
-	a.subSelf( b );
+	a.sub( b );
 	ok( a.x == 2*x, "Passed!" );
 	ok( a.y == 2*y, "Passed!" );
 	ok( a.z == 2*z, "Passed!" );
 
-	var c = new THREE.Vector3().sub( a, a );
+	var c = new THREE.Vector3().subVectors( a, a );
 	ok( c.x == 0, "Passed!" );
-	ok( c.y == 0, "Passed!" );	
-	ok( c.z == 0, "Passed!" );	
+	ok( c.y == 0, "Passed!" );
+	ok( c.z == 0, "Passed!" );
 });
 
 test( "multiply/divide", function() {
@@ -114,8 +114,8 @@ test( "multiply/divide", function() {
 
 	b.multiplyScalar( -2 );
 	ok( b.x == 2*x, "Passed!" );
-	ok( b.y == 2*y, "Passed!" );	
-	ok( b.z == 2*z, "Passed!" );	
+	ok( b.y == 2*y, "Passed!" );
+	ok( b.z == 2*z, "Passed!" );
 
 	a.divideScalar( -2 );
 	ok( a.x == x, "Passed!" );
@@ -124,8 +124,8 @@ test( "multiply/divide", function() {
 
 	b.divideScalar( -2 );
 	ok( b.x == -x, "Passed!" );
-	ok( b.y == -y, "Passed!" );	
-	ok( b.z == -z, "Passed!" );	
+	ok( b.y == -y, "Passed!" );
+	ok( b.z == -z, "Passed!" );
 });
 
 test( "min/max/clamp", function() {
@@ -133,26 +133,26 @@ test( "min/max/clamp", function() {
 	var b = new THREE.Vector3( -x, -y, -z );
 	var c = new THREE.Vector3();
 
-	c.copy( a ).minSelf( b );
+	c.copy( a ).min( b );
 	ok( c.x == -x, "Passed!" );
 	ok( c.y == -y, "Passed!" );
 	ok( c.z == -z, "Passed!" );
 
-	c.copy( a ).maxSelf( b );
+	c.copy( a ).max( b );
 	ok( c.x == x, "Passed!" );
 	ok( c.y == y, "Passed!" );
 	ok( c.z == z, "Passed!" );
 
 	c.set( -2*x, 2*y, -2*z );
-	c.clampSelf( b, a );
+	c.clamp( b, a );
 	ok( c.x == -x, "Passed!" );
-	ok( c.y == y, "Passed!" );	
-	ok( c.z == -z, "Passed!" );	
+	ok( c.y == y, "Passed!" );
+	ok( c.z == -z, "Passed!" );
 });
 
 test( "negate", function() {
 	var a = new THREE.Vector3( x, y, z );
-	
+
 	a.negate();
 	ok( a.x == -x, "Passed!" );
 	ok( a.y == -y, "Passed!" );
@@ -163,7 +163,7 @@ test( "dot", function() {
 	var a = new THREE.Vector3( x, y, z );
 	var b = new THREE.Vector3( -x, -y, -z );
 	var c = new THREE.Vector3();
-	
+
 	var result = a.dot( b );
 	ok( result == (-x*x-y*y-z*z), "Passed!" );
 
@@ -176,7 +176,7 @@ test( "length/lengthSq", function() {
 	var b = new THREE.Vector3( 0, -y, 0 );
 	var c = new THREE.Vector3( 0, 0, z );
 	var d = new THREE.Vector3();
-	
+
 	ok( a.length() == x, "Passed!" );
 	ok( a.lengthSq() == x*x, "Passed!" );
 	ok( b.length() == y, "Passed!" );
@@ -195,7 +195,7 @@ test( "normalize", function() {
 	var a = new THREE.Vector3( x, 0, 0 );
 	var b = new THREE.Vector3( 0, -y, 0 );
 	var c = new THREE.Vector3( 0, 0, z );
-	
+
 	a.normalize();
 	ok( a.length() == 1, "Passed!" );
 	ok( a.x == 1, "Passed!" );
@@ -214,7 +214,7 @@ test( "distanceTo/distanceToSquared", function() {
 	var b = new THREE.Vector3( 0, -y, 0 );
 	var c = new THREE.Vector3( 0, 0, z );
 	var d = new THREE.Vector3();
-	
+
 	ok( a.distanceTo( d ) == x, "Passed!" );
 	ok( a.distanceToSquared( d ) == x*x, "Passed!" );
 
@@ -227,7 +227,7 @@ test( "distanceTo/distanceToSquared", function() {
 
 test( "setLength", function() {
 	var a = new THREE.Vector3( x, 0, 0 );
-	
+
 	ok( a.length() == x, "Passed!" );
 	a.setLength( y );
 	ok( a.length() == y, "Passed!" );
@@ -239,26 +239,26 @@ test( "setLength", function() {
 
 });
 
-test( "lerpSelf/clone", function() {
+test( "lerp/clone", function() {
 	var a = new THREE.Vector3( x, 0, z );
 	var b = new THREE.Vector3( 0, -y, 0 );
-	
-	ok( a.lerpSelf( a, 0 ).equals( a.lerpSelf( a, 0.5 ) ), "Passed!" );
-	ok( a.lerpSelf( a, 0 ).equals( a.lerpSelf( a, 1 ) ), "Passed!" );
 
-	ok( a.clone().lerpSelf( b, 0 ).equals( a ), "Passed!" );
+	ok( a.lerp( a, 0 ).equals( a.lerp( a, 0.5 ) ), "Passed!" );
+	ok( a.lerp( a, 0 ).equals( a.lerp( a, 1 ) ), "Passed!" );
 
-	ok( a.clone().lerpSelf( b, 0.5 ).x == x*0.5, "Passed!" );
-	ok( a.clone().lerpSelf( b, 0.5 ).y == -y*0.5, "Passed!" );
-	ok( a.clone().lerpSelf( b, 0.5 ).z == z*0.5, "Passed!" );
+	ok( a.clone().lerp( b, 0 ).equals( a ), "Passed!" );
 
-	ok( a.clone().lerpSelf( b, 1 ).equals( b ), "Passed!" );
+	ok( a.clone().lerp( b, 0.5 ).x == x*0.5, "Passed!" );
+	ok( a.clone().lerp( b, 0.5 ).y == -y*0.5, "Passed!" );
+	ok( a.clone().lerp( b, 0.5 ).z == z*0.5, "Passed!" );
+
+	ok( a.clone().lerp( b, 1 ).equals( b ), "Passed!" );
 });
 
 test( "equals", function() {
 	var a = new THREE.Vector3( x, 0, z );
 	var b = new THREE.Vector3( 0, -y, 0 );
-	
+
 	ok( a.x != b.x, "Passed!" );
 	ok( a.y != b.y, "Passed!" );
 	ok( a.z != b.z, "Passed!" );

+ 33 - 33
test/unit/math/Vector4.js

@@ -90,34 +90,34 @@ test( "add", function() {
 	var a = new THREE.Vector4( x, y, z, w );
 	var b = new THREE.Vector4( -x, -y, -z, -w );
 
-	a.addSelf( b );
+	a.add( b );
 	ok( a.x == 0, "Passed!" );
 	ok( a.y == 0, "Passed!" );
 	ok( a.z == 0, "Passed!" );
 	ok( a.w == 0, "Passed!" );
 
-	var c = new THREE.Vector4().add( b, b );
+	var c = new THREE.Vector4().addVectors( b, b );
 	ok( c.x == -2*x, "Passed!" );
-	ok( c.y == -2*y, "Passed!" );	
-	ok( c.z == -2*z, "Passed!" );	
-	ok( c.w == -2*w, "Passed!" );	
+	ok( c.y == -2*y, "Passed!" );
+	ok( c.z == -2*z, "Passed!" );
+	ok( c.w == -2*w, "Passed!" );
 });
 
 test( "sub", function() {
 	var a = new THREE.Vector4( x, y, z, w );
 	var b = new THREE.Vector4( -x, -y, -z, -w );
 
-	a.subSelf( b );
+	a.sub( b );
 	ok( a.x == 2*x, "Passed!" );
 	ok( a.y == 2*y, "Passed!" );
 	ok( a.z == 2*z, "Passed!" );
 	ok( a.w == 2*w, "Passed!" );
 
-	var c = new THREE.Vector4().sub( a, a );
+	var c = new THREE.Vector4().subVectors( a, a );
 	ok( c.x == 0, "Passed!" );
-	ok( c.y == 0, "Passed!" );	
-	ok( c.z == 0, "Passed!" );	
-	ok( c.w == 0, "Passed!" );	
+	ok( c.y == 0, "Passed!" );
+	ok( c.z == 0, "Passed!" );
+	ok( c.w == 0, "Passed!" );
 });
 
 test( "multiply/divide", function() {
@@ -144,9 +144,9 @@ test( "multiply/divide", function() {
 
 	b.divideScalar( -2 );
 	ok( b.x == -x, "Passed!" );
-	ok( b.y == -y, "Passed!" );	
-	ok( b.z == -z, "Passed!" );	
-	ok( b.w == -w, "Passed!" );	
+	ok( b.y == -y, "Passed!" );
+	ok( b.z == -z, "Passed!" );
+	ok( b.w == -w, "Passed!" );
 });
 
 test( "min/max/clamp", function() {
@@ -154,29 +154,29 @@ test( "min/max/clamp", function() {
 	var b = new THREE.Vector4( -x, -y, -z, -w );
 	var c = new THREE.Vector4();
 
-	c.copy( a ).minSelf( b );
+	c.copy( a ).min( b );
 	ok( c.x == -x, "Passed!" );
 	ok( c.y == -y, "Passed!" );
 	ok( c.z == -z, "Passed!" );
 	ok( c.w == -w, "Passed!" );
 
-	c.copy( a ).maxSelf( b );
+	c.copy( a ).max( b );
 	ok( c.x == x, "Passed!" );
 	ok( c.y == y, "Passed!" );
 	ok( c.z == z, "Passed!" );
 	ok( c.w == w, "Passed!" );
 
 	c.set( -2*x, 2*y, -2*z, 2*w );
-	c.clampSelf( b, a );
+	c.clamp( b, a );
 	ok( c.x == -x, "Passed!" );
-	ok( c.y == y, "Passed!" );	
-	ok( c.z == -z, "Passed!" );	
-	ok( c.w == w, "Passed!" );	
+	ok( c.y == y, "Passed!" );
+	ok( c.z == -z, "Passed!" );
+	ok( c.w == w, "Passed!" );
 });
 
 test( "negate", function() {
 	var a = new THREE.Vector4( x, y, z, w );
-	
+
 	a.negate();
 	ok( a.x == -x, "Passed!" );
 	ok( a.y == -y, "Passed!" );
@@ -188,7 +188,7 @@ test( "dot", function() {
 	var a = new THREE.Vector4( x, y, z, w );
 	var b = new THREE.Vector4( -x, -y, -z, -w );
 	var c = new THREE.Vector4( 0, 0, 0, 0 );
-	
+
 	var result = a.dot( b );
 	ok( result == (-x*x-y*y-z*z-w*w), "Passed!" );
 
@@ -267,7 +267,7 @@ test( "distanceTo/distanceToSquared", function() {
 
 test( "setLength", function() {
 	var a = new THREE.Vector4( x, 0, 0, 0 );
-	
+
 	ok( a.length() == x, "Passed!" );
 	a.setLength( y );
 	ok( a.length() == y, "Passed!" );
@@ -278,27 +278,27 @@ test( "setLength", function() {
 	ok( a.length() == 0, "Passed!" );
 });
 
-test( "lerpSelf/clone", function() {
+test( "lerp/clone", function() {
 	var a = new THREE.Vector4( x, 0, z, 0 );
 	var b = new THREE.Vector4( 0, -y, 0, -w );
-	
-	ok( a.lerpSelf( a, 0 ).equals( a.lerpSelf( a, 0.5 ) ), "Passed!" );
-	ok( a.lerpSelf( a, 0 ).equals( a.lerpSelf( a, 1 ) ), "Passed!" );
 
-	ok( a.clone().lerpSelf( b, 0 ).equals( a ), "Passed!" );
+	ok( a.lerp( a, 0 ).equals( a.lerp( a, 0.5 ) ), "Passed!" );
+	ok( a.lerp( a, 0 ).equals( a.lerp( a, 1 ) ), "Passed!" );
 
-	ok( a.clone().lerpSelf( b, 0.5 ).x == x*0.5, "Passed!" );
-	ok( a.clone().lerpSelf( b, 0.5 ).y == -y*0.5, "Passed!" );
-	ok( a.clone().lerpSelf( b, 0.5 ).z == z*0.5, "Passed!" );
-	ok( a.clone().lerpSelf( b, 0.5 ).w == -w*0.5, "Passed!" );
+	ok( a.clone().lerp( b, 0 ).equals( a ), "Passed!" );
 
-	ok( a.clone().lerpSelf( b, 1 ).equals( b ), "Passed!" );
+	ok( a.clone().lerp( b, 0.5 ).x == x*0.5, "Passed!" );
+	ok( a.clone().lerp( b, 0.5 ).y == -y*0.5, "Passed!" );
+	ok( a.clone().lerp( b, 0.5 ).z == z*0.5, "Passed!" );
+	ok( a.clone().lerp( b, 0.5 ).w == -w*0.5, "Passed!" );
+
+	ok( a.clone().lerp( b, 1 ).equals( b ), "Passed!" );
 });
 
 test( "equals", function() {
 	var a = new THREE.Vector4( x, 0, z, 0 );
 	var b = new THREE.Vector4( 0, -y, 0, -w );
-	
+
 	ok( a.x != b.x, "Passed!" );
 	ok( a.y != b.y, "Passed!" );
 	ok( a.z != b.z, "Passed!" );