|
803 | 803 | const localMatrix = new THREE.Matrix4();
|
804 | 804 | const localColor = new THREE.Color();
|
805 | 805 | const localColor2 = new THREE.Color();
|
| 806 | +const localVectorArray = Array(3); |
| 807 | +const localVectorArray2 = Array(3); |
| 808 | +const localQuaternionArray = Array(4); |
806 | 809 |
|
807 | 810 | const scene = new THREE.Scene();
|
808 | 811 |
|
|
1811 | 1814 | mesh.frustumCulled = false;
|
1812 | 1815 | mesh.update = async () => {
|
1813 | 1816 | const vrCamera = _getVrCamera();
|
1814 |
| - xrRaycaster.updateView(vrCamera.position.toArray(), vrCamera.quaternion.toArray()); |
| 1817 | + xrRaycaster.updateView(vrCamera.position.toArray(localVectorArray), vrCamera.quaternion.toArray(localQuaternionArray)); |
1815 | 1818 | xrRaycaster.updateTexture();
|
1816 | 1819 | await XRRaycaster.nextFrame();
|
1817 | 1820 | xrRaycaster.updateDepthBuffer();
|
|
1928 | 1931 | mesh.frustumCulled = false;
|
1929 | 1932 | mesh.update = () => {
|
1930 | 1933 | const vrCamera = _getVrCamera();
|
1931 |
| - xrRaycaster.updateView(vrCamera.position.toArray(), vrCamera.quaternion.toArray()); |
| 1934 | + xrRaycaster.updateView(vrCamera.position.toArray(localVectorArray), vrCamera.quaternion.toArray(localQuaternionArray)); |
1932 | 1935 | xrRaycaster.updateTexture();
|
1933 | 1936 |
|
1934 | 1937 | gpuParticlesMeshMaterial.uniforms.uMatrixWorld.value.copy(xrRaycaster.camera.matrixWorld);
|
|
1974 | 1977 | xrChunker.updateTransform(
|
1975 | 1978 | localVector.copy(vrCamera.position)
|
1976 | 1979 | .add(localVector2.set(0, 0, -1).applyQuaternion(vrCamera.quaternion))
|
1977 |
| - .toArray(), |
1978 |
| - vrCamera.quaternion.toArray(), |
1979 |
| - [2, 2, 2] |
| 1980 | + .toArray(localVectorArray), |
| 1981 | + vrCamera.quaternion.toArray(localQuaternionArray), |
| 1982 | + localVector.set(2, 2, 2).toArray(localVectorArray2) |
1980 | 1983 | );
|
1981 | 1984 | xrChunker.updateMesh(async () => {
|
1982 | 1985 | const vrCamera = _getVrCamera();
|
1983 |
| - xrRaycaster.updateView(vrCamera.position.toArray(), vrCamera.quaternion.toArray()); |
| 1986 | + xrRaycaster.updateView(vrCamera.position.toArray(localVectorArray), vrCamera.quaternion.toArray(localQuaternionArray)); |
1984 | 1987 | xrRaycaster.updateTexture();
|
1985 | 1988 | await XRRaycaster.nextFrame();
|
1986 | 1989 | xrRaycaster.updateDepthBuffer();
|
|
0 commit comments