skezo / Reticulum

A simple gaze interaction manager for VR in the browser with Three.js.
http://skezo.github.io/Reticulum/
61 stars 15 forks source link

Add support for fixing reticle distance #19

Closed UXVirtual closed 8 years ago

UXVirtual commented 8 years ago

I've noticed that the reticle adjusts its scale and distance depending on how far away gazed objects are. Would it be possible to optionally disable this? In certain use-cases this causes the reticle to disappear inside the gazed object which is confusing for the user. I've found that adjusting this section of code in reticulum.js to disable the distance / scaling changes achieves the desired effect:

if( reticle.active ) {
            //reticle.worldPosition.setFromMatrixPosition( threeObject.matrixWorld );
            //distance = settings.camera.position.distanceTo( reticle.worldPosition );
            //distance -= threeObject.geometry.boundingSphere.radius;
            reticle.hit = true;
            ///reticle.setDepthAndScale( distance );
}
UXVirtual commented 8 years ago

I've added support for a lockDistance option in pull request #20 to allow this functionality and it seems to be working as expected.

skezo commented 8 years ago

@HAZARDU5

Thanks for this. lockDistance has been merged. I am currently looking at few different other ways to kill this issue such as placing the display reticle in its own scene etc. but have not been successful so far as it kills performance.