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
import React, { useMemo, useRef } from 'react'; | |
import { extend, useFrame } from '@react-three/fiber'; | |
import * as THREE from 'three'; | |
import { shaderMaterial } from '@react-three/drei'; | |
const vertexShader = ` | |
#define PI 3.1415926535897932384626433832795 | |
uniform float uTime; | |
uniform float uBigWavesElevation; |
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
update() { | |
let transientPointerFoundThisFrame = false; | |
for (let input of this.engine.xr.session.inputSources) { | |
if (input.targetRayMode !== 'transient-pointer') continue; | |
// If we made it this far, we're dealing w/ a transient-pointer | |
transientPointerFoundThisFrame = true; | |
// Get the pose from the session from using the targetRaySpace and the currentRefSpace |
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
import nextTick from "../utils/next-tick"; | |
import { mapMaterials, convertStandardMaterial } from "../utils/material-utils"; | |
import SketchfabZipWorker from "../workers/sketchfab-zip.worker.js"; | |
import { getCustomGLTFParserURLResolver } from "../utils/media-url-utils"; | |
import { promisifyWorker } from "../utils/promisify-worker.js"; | |
import { MeshBVH, acceleratedRaycast } from "three-mesh-bvh"; | |
import { disposeNode, cloneObject3D } from "../utils/three-utils"; | |
import HubsTextureLoader from "../loaders/HubsTextureLoader"; | |
import HubsBasisTextureLoader from "../loaders/HubsBasisTextureLoader"; | |
import { createDefaultEnvironmentMap } from "./environment-map"; |