diff --git a/examples/jsm/animation/CCDIKSolver.js b/examples/jsm/animation/CCDIKSolver.js index c29169a456eb13..ebde2b9e83b9ae 100644 --- a/examples/jsm/animation/CCDIKSolver.js +++ b/examples/jsm/animation/CCDIKSolver.js @@ -204,7 +204,11 @@ class CCDIKSolver { if ( c > 1.0 ) c = 1.0; - const c2 = math.sqrt( 1 - c * c ); + // preserve sign of the rotation along the limitation axis, + // otherwise negative rotations get mirrored to positive + const dot = link.quaternion.x * limitation.x + link.quaternion.y * limitation.y + link.quaternion.z * limitation.z; + const sign = dot < 0 ? - 1 : 1; + const c2 = sign * math.sqrt( 1 - c * c ); link.quaternion.set( limitation.x * c2, limitation.y * c2, limitation.z * c2, diff --git a/examples/jsm/loaders/EXRLoader.js b/examples/jsm/loaders/EXRLoader.js index eb12d79d93fbef..8fbb362a9a5009 100644 --- a/examples/jsm/loaders/EXRLoader.js +++ b/examples/jsm/loaders/EXRLoader.js @@ -2082,17 +2082,7 @@ class EXRLoader extends DataTextureLoader { const parseInt64 = function ( dataView, offset ) { - let int; - - if ( 'getBigInt64' in DataView.prototype ) { - - int = Number( dataView.getBigInt64( offset.value, true ) ); - - } else { - - int = dataView.getUint32( offset.value + 4, true ) + Number( dataView.getUint32( offset.value, true ) << 32 ); - - } + const int = Number( dataView.getBigInt64( offset.value, true ) ); offset.value += ULONG_SIZE; diff --git a/src/renderers/webgpu/WebGPUBackend.js b/src/renderers/webgpu/WebGPUBackend.js index 06ada1d039d8a6..0320d99d03572c 100644 --- a/src/renderers/webgpu/WebGPUBackend.js +++ b/src/renderers/webgpu/WebGPUBackend.js @@ -1613,20 +1613,17 @@ class WebGPUBackend extends Backend { for ( let i = 0; i < drawCount; i ++ ) { - const count = 1; - const firstInstance = count > 1 ? 0 : i; - if ( hasIndex === true ) { - passEncoderGPU.drawIndexed( counts[ i ], count, starts[ i ] / bytesPerElement, 0, firstInstance ); + passEncoderGPU.drawIndexed( counts[ i ], 1, starts[ i ] / bytesPerElement, 0, i ); } else { - passEncoderGPU.draw( counts[ i ], count, starts[ i ], firstInstance ); + passEncoderGPU.draw( counts[ i ], 1, starts[ i ], i ); } - info.update( object, counts[ i ], count ); + info.update( object, counts[ i ], 1 ); }