|
@@ -4159,21 +4159,20 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
applyQuaternion( q ) {
|
|
|
|
|
|
- const x = this.x, y = this.y, z = this.z;
|
|
|
- const qx = q.x, qy = q.y, qz = q.z, qw = q.w;
|
|
|
-
|
|
|
- // calculate quat * vector
|
|
|
+ // Derived from https://raw.org/proof/vector-rotation-using-quaternions/
|
|
|
|
|
|
- const ix = qw * x + qy * z - qz * y;
|
|
|
- const iy = qw * y + qz * x - qx * z;
|
|
|
- const iz = qw * z + qx * y - qy * x;
|
|
|
- const iw = - qx * x - qy * y - qz * z;
|
|
|
+ const vx = this.x, vy = this.y, vz = this.z;
|
|
|
+ const qx = q.x, qy = q.y, qz = q.z, qw = q.w;
|
|
|
|
|
|
- // calculate result * inverse quat
|
|
|
+ // t = 2q x v
|
|
|
+ const tx = 2 * ( qy * vz - qz * vy );
|
|
|
+ const ty = 2 * ( qz * vx - qx * vz );
|
|
|
+ const tz = 2 * ( qx * vy - qy * vx );
|
|
|
|
|
|
- this.x = ix * qw + iw * - qx + iy * - qz - iz * - qy;
|
|
|
- this.y = iy * qw + iw * - qy + iz * - qx - ix * - qz;
|
|
|
- this.z = iz * qw + iw * - qz + ix * - qy - iy * - qx;
|
|
|
+ // v + w t + q x t
|
|
|
+ this.x = vx + qw * tx + qy * tz - qz * ty;
|
|
|
+ this.y = vy + qw * ty + qz * tx - qx * tz;
|
|
|
+ this.z = vz + qw * tz + qx * ty - qy * tx;
|
|
|
|
|
|
return this;
|
|
|
|
|
@@ -29418,6 +29417,14 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
function renderTransmissionPass( opaqueObjects, transmissiveObjects, scene, camera ) {
|
|
|
|
|
|
+ const overrideMaterial = scene.isScene === true ? scene.overrideMaterial : null;
|
|
|
+
|
|
|
+ if ( overrideMaterial !== null ) {
|
|
|
+
|
|
|
+ return;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
const isWebGL2 = capabilities.isWebGL2;
|
|
|
|
|
|
if ( _transmissionRenderTarget === null ) {
|