Skip to content

Commit

Permalink
Merge pull request #80 from spacesvr/dev
Browse files Browse the repository at this point in the history
v1.9.1
  • Loading branch information
spacesvr authored Mar 30, 2022
2 parents deeb550 + 8845a51 commit c60eb45
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
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

1 comment on commit c60eb45

@vercel
Copy link

@vercel vercel bot commented on c60eb45 Mar 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.