This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Retargets DOM events within a Shadow DOM to ensure they are correctly recognized | |
* by React 16's synthetic event system. This is necessary because React 16 does not | |
* natively handle events from within a Shadow DOM, leading to issues with event propagation | |
* and target recognition. | |
* | |
* @param {ShadowRoot} shadowRoot - The root of the Shadow DOM where event retargeting should be applied. | |
*/ | |
function retargetEvents(shadowRoot) { | |
// List of all event types to listen for within the Shadow DOM. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// original implementation is from https://github.com/pmndrs/drei | |
const { | |
DepthFormat, DepthTexture, LinearFilter, Matrix4, MeshStandardMaterial, | |
PerspectiveCamera, Plane, UnsignedShortType, Vector3, Vector4, WebGLRenderTarget | |
} = THREE | |
class MeshReflectorMaterial extends MeshStandardMaterial { | |
constructor(renderer, camera, scene, object, { | |
mixBlur = 0, |