addForce(force) { // this.tmp2.copy(force).multiplyScalar(this.invMass); this.tmp2.copy(force); this.acceleration.add(this.tmp2); }
function rotateOnMove() { point.sub(worldPosition); point.multiply(parentScale); tempVector.copy(offset).sub(worldPosition); tempVector.multiply(parentScale); rotateEAxis(); }
function handleVertex(v) { n.fromArray(normals, v * 3); n2.copy(n); t = tan1[v]; // Gram-Schmidt orthogonalize tmp.copy(t); tmp.sub(n.multiplyScalar(n.dot(t))).normalize(); // Calculate handedness tmp2.crossVectors(n2, t); test = tmp2.dot(tan2[v]); w = test < 0.0 ? -1.0 : 1.0; tangents[v * 4] = tmp.x; tangents[v * 4 + 1] = tmp.y; tangents[v * 4 + 2] = tmp.z; tangents[v * 4 + 3] = w; }
applyAerodynamics(delta, geometry) { if (this.windEnabled) { geometry.faces.forEach((face) => { this.tmpForce .copy(face.normal) .normalize() .multiplyScalar(face.normal.dot(this.windForce)); this.particles[face.a].addForce(this.tmpForce); this.particles[face.b].addForce(this.tmpForce); this.particles[face.c].addForce(this.tmpForce); }); } this.particles.forEach((particle) => { particle.addForce(this.gravityForce); particle.integrate(delta); }); }
offset.copy(position).sub(scope.target); var targetDistance = offset.length();
this.position.copy(pos.multiplyScalar(DIMENSION)) this.position.y += EYE_2_TOE * DIMENSION this.skin.head.rotation.x = dir.x