Skip to content

Commit db6a79a

Browse files
committed
Fixed some more sub(a,b) to subVectors(a,b).
1 parent bff23c5 commit db6a79a

6 files changed

Lines changed: 10 additions & 10 deletions

File tree

examples/canvas_geometry_birds.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@
183183

184184
var steer = new THREE.Vector3();
185185

186-
steer.sub( this.position, target );
186+
steer.subVectors( this.position, target );
187187
steer.multiplyScalar( 0.5 / distance );
188188

189189
_acceleration.add( steer );
@@ -196,7 +196,7 @@
196196

197197
var steer = new THREE.Vector3();
198198

199-
steer.sub( target, this.position );
199+
steer.subVectors( target, this.position );
200200
steer.multiplyScalar( amount );
201201

202202
return steer;
@@ -272,7 +272,7 @@
272272

273273
}
274274

275-
steer.sub( posSum, this.position );
275+
steer.subVectors( posSum, this.position );
276276

277277
var l = steer.length();
278278

@@ -301,7 +301,7 @@
301301

302302
if ( distance > 0 && distance <= _neighborhoodRadius ) {
303303

304-
repulse.sub( this.position, boid.position );
304+
repulse.subVectors( this.position, boid.position );
305305
repulse.normalize();
306306
repulse.divideScalar( distance );
307307
posSum.add( repulse );

examples/js/AudioObject.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ THREE.AudioObject = function ( url, volume, playbackRate, loop ) {
113113
soundPosition.copy( this.matrixWorld.getPosition() );
114114
cameraPosition.copy( camera.matrixWorld.getPosition() );
115115

116-
soundDelta.sub( soundPosition, oldSoundPosition );
117-
cameraDelta.sub( cameraPosition, oldCameraPosition );
116+
soundDelta.subVectors( soundPosition, oldSoundPosition );
117+
cameraDelta.subVectors( cameraPosition, oldCameraPosition );
118118

119119
cameraUp.copy( camera.up );
120120

examples/js/Cloth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ function simulate(time) {
250250
;i<il;i++) {
251251
particle = particles[i];
252252
pos = particle.position;
253-
diff.sub(pos, ballPosition);
253+
diff.subVectors(pos, ballPosition);
254254
if (diff.length() < ballSize) {
255255
// collided
256256
diff.normalize().multiplyScalar(ballSize);

examples/js/renderers/SVGRenderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ THREE.SVGRenderer = function () {
249249

250250
lightPosition = light.matrixWorld.getPosition();
251251

252-
amount = normal.dot( _vector3.sub( lightPosition, position ).normalize() );
252+
amount = normal.dot( _vector3.subVectors( lightPosition, position ).normalize() );
253253

254254
if ( amount <= 0 ) continue;
255255

examples/misc_controls_fly.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@
298298

299299
dPlanet = camera.position.length();
300300

301-
dMoonVec.sub( camera.position, meshMoon.position );
301+
dMoonVec.subVectors( camera.position, meshMoon.position );
302302
dMoon = dMoonVec.length();
303303

304304
if ( dMoon < dPlanet ) {

src/extras/core/Curve.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ THREE.LineCurve3 = THREE.Curve.create(
562562
var r = new THREE.Vector3();
563563

564564

565-
r.sub( this.v2, this.v1 ); // diff
565+
r.subVectors( this.v2, this.v1 ); // diff
566566
r.multiplyScalar( t );
567567
r.add( this.v1 );
568568

0 commit comments

Comments
 (0)