-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #157 from musehq/dev
* Many Minor Fixes (#156) * remove workshop wings, free up wasd on textinput unmount * suppress pointer lock errors, general cleanup * add open in oculus menu button, enter vr on clicking continue in headset * change direction state from input space to player space, map left button to fly, fix xr movement * mute audio on page hide, pause menu dev mode * add .preload to useImage and useModel * comments and small refactors * v2.10.0
- Loading branch information
Showing
20 changed files
with
348 additions
and
273 deletions.
There are no files selected for viewing
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 file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { useState } from "react"; | ||
import { Image, useImage, useKeypress } from "spacesvr"; | ||
import { useThree } from "@react-three/fiber"; | ||
|
||
const IMAGE_URL = | ||
"https://d1htv66kutdwsl.cloudfront.net/e7edec86-52b6-4734-9c43-ffd70bc5bef6/9d1e5c18-3fb5-4844-8b31-1a08b800976e.ktx2"; | ||
|
||
export default function PreloadImage() { | ||
const gl = useThree((st) => st.gl); | ||
|
||
const [mounted, setMounted] = useState(false); | ||
useKeypress("m", () => setMounted(!mounted), [mounted]); | ||
|
||
useImage.preload(IMAGE_URL, gl); | ||
|
||
if (!mounted) return null; | ||
|
||
return ( | ||
<Image | ||
src={IMAGE_URL} | ||
framed | ||
frameWidth={0.75} | ||
size={12} | ||
rotation-y={0} | ||
position={[-1.4, 1.5, -12]} | ||
/> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
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
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
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
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 file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { useEffect } from "react"; | ||
import { AudioContext } from "three"; | ||
|
||
export default function MuteOnHide() { | ||
useEffect(() => { | ||
function handleChange() { | ||
const context = AudioContext.getContext(); | ||
if (document.hidden) context.suspend(); | ||
else context.resume(); | ||
} | ||
|
||
document.addEventListener("visibilitychange", handleChange); | ||
return () => document.removeEventListener("visibilitychange", handleChange); | ||
}, []); | ||
|
||
return null; | ||
} |
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
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
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
Oops, something went wrong.
2007317
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
spacesvr – ./
spacesvr-muse-hq.vercel.app
spacesvr.vercel.app
spacesvr.io
spacesvr-git-master-muse-hq.vercel.app
www.spacesvr.io