This is Pick Helper. It does one thing, picks objects in a 3d environment created with three js for you.
How to use:
First, import Pick Helper.
import PickHelper from pickhelper;
Next, create your pick helper.
pickHelper = new PickHelper(this.scene, this.camera);
or
pickHelper = new PickHelper(scene, camera)
Now, use the .pick command to get the mesh your cursor is over.
pickHelper.pick(event, this.scene, this.camera, this.mount);
or
pickHelper.pick(event, scene, camera, mount);
I have no interest on financial gain for this code and all are permitted to use it as they see fit.
special thanks to the creator of this tutorial: https://threejsfundamentals.org/threejs/lessons/threejs-picking.html
This code is based off their PickHelper class but converted into an object-oriented form for use in React, etc. and all contained within said class.