GaussianSplats3D icon indicating copy to clipboard operation
GaussianSplats3D copied to clipboard

Fix missing _axis variable

Open PeterZhizhin opened this issue 6 months ago • 0 comments

This piece of code uses uninitialized variable:

    setDirection( dir ) {
        if (dir.y > 0.99999) {
            this.quaternion.set(0, 0, 0, 1);
        } else if (dir.y < - 0.99999) {
            this.quaternion.set(1, 0, 0, 0);
        } else {
            _axis.set(dir.z, 0, -dir.x).normalize();
            const radians = Math.acos(dir.y);
            this.quaternion.setFromAxisAngle(_axis, radians);
        }
    }

I add a global constant to fix this, similar to this threejs example file: https://github.com/mrdoob/three.js/blob/dev/examples/jsm/utils/CameraUtils.js

PeterZhizhin avatar Aug 02 '24 11:08 PeterZhizhin