Skip to content

v1.9.1 #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spacesvr",
"version": "1.9.0",
"version": "1.9.1",
"private": true,
"description": "An Environment for WebXR Spaces",
"keywords": [
Expand Down
1 change: 0 additions & 1 deletion src/ideas/components/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ function UnsuspensedImage(props: ImageProps) {
thickness={frameWidth}
material={frameMaterial}
innerFrameMaterial={innerFrameMaterial}
transparent={transparent}
/>
)}
</group>
Expand Down
10 changes: 2 additions & 8 deletions src/ideas/misc/Frame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ type FrameProps = {
thickness?: number;
material?: Material;
innerFrameMaterial?: Material;
transparent?: boolean;
};

/**
Expand All @@ -33,7 +32,6 @@ export default function Frame(props: FrameProps) {
height,
thickness = 1,
material: passedMaterial,
transparent = false,
innerFrameMaterial,
} = props;

Expand Down Expand Up @@ -102,11 +100,7 @@ export default function Frame(props: FrameProps) {
0
);

const geos = [topFrame, bottomFrame, leftFrame, rightFrame];

if (!innerFrameMaterial && !transparent) {
geos.unshift(backPanel);
}
const geos = [backPanel, topFrame, bottomFrame, leftFrame, rightFrame];

const geo = BufferGeometryUtils.mergeBufferGeometries(geos);

Expand All @@ -117,7 +111,7 @@ export default function Frame(props: FrameProps) {
rightFrame.dispose();

return geo;
}, [innerFrameMaterial, transparent, borderThickness, width, height]);
}, [innerFrameMaterial, borderThickness, width, height]);

const backFrameGeometry = useMemo<BufferGeometry | undefined>(() => {
if (!innerFrameMaterial) return undefined;
Expand Down
2 changes: 1 addition & 1 deletion src/layers/reality/ui/PauseMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default function PauseMenu(props: PauseMenuProps) {
const PAUSE_ITEMS: PauseItem[] = [
...pauseMenuItems,
{
text: "v1.9.0",
text: "v1.9.1",
link: "https://www.npmjs.com/package/spacesvr",
},
...menuItems,
Expand Down
4 changes: 3 additions & 1 deletion src/layers/reality/utils/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function RegisterMenuItems() {

export const useVRMenuItem = (): MenuItem | undefined => {
const gl = useThree((state) => state.gl);
const { setDevice } = useEnvironment();
const { setDevice, setPaused } = useEnvironment();

// @ts-ignore
const xr = navigator.xr;
Expand Down Expand Up @@ -67,13 +67,15 @@ export const useVRMenuItem = (): MenuItem | undefined => {
await gl.xr.setSession(sesh);
setText("Exit VR");
setDevice("xr");
setPaused(false);
session.current = sesh;
}

function onSessionEnded() {
session.current?.removeEventListener("end", onSessionEnded);
setDevice(isMobile ? "mobile" : "desktop");
setText("Enter VR");
setPaused(true);
session.current = undefined;
}

Expand Down