threejs交流群511163089
function SubV(a, b, normalize = false) {
if (normalize) return a.clone().sub(b).normalize();
return a.clone().sub(b);
}
function AddV(a, b, normalize = false) {
if (normalize) return a.clone().add(b).normalize();
return a.clone().add(b);
}
function MultiplyScalar(v, s) {
return v.clone().multiplyScalar(s);
}
function Cross(v1, v2, normalize = false) {
if (normalize)
return new THREE.Vector3().crossVectors(v1, v2).normalize()
return new THREE.Vector3().crossVectors(v1, v2);
}
function Dot(v1, v2) {
return v1.clone().dot(v2);
}
。。每次连续的运算例如(a+b).normalized这样的运算写出来会是a.clone().add(b).normalize();封一下写起来少一些字
标签:normalize,function,return,clone,第四十九,js,v1,v2,three From: https://blog.51cto.com/u_11889343/6045865