Skip to content

Commit

Permalink
Merge pull request #113 from musehq/dev
Browse files Browse the repository at this point in the history
v2.3.1
  • Loading branch information
alex-shortt authored Sep 7, 2022
2 parents 0c0853d + 8ffed00 commit d00e3bd
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 3 deletions.
3 changes: 2 additions & 1 deletion examples/worlds/Multiplayer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { StandardReality, Background } from "spacesvr";
import { StandardReality, Background, Model } from "spacesvr";
import LightSwitch from "./ideas/LightSwitch";

export default function Multiplayer() {
Expand All @@ -15,6 +15,7 @@ export default function Multiplayer() {
<planeBufferGeometry args={[200, 200]} />
<meshBasicMaterial color={"purple"} />
</mesh>
<Model src="https://d27rt3a60hh1lx.cloudfront.net/models/Camera-1652915410/camera_02_cleaned.glb.gz" />
</StandardReality>
);
}
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": "2.3.0",
"version": "2.3.1",
"private": true,
"description": "A standardized reality for future of the 3D Web",
"keywords": [
Expand Down
1 change: 1 addition & 0 deletions src/ideas/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ export * from "./physical/Fog";
export * from "./physical/Frame";
export * from "./physical/HDRI";
export * from "./physical/InfinitePlane";
export * from "./physical/Model";
export * from "./physical/Video";
32 changes: 32 additions & 0 deletions src/ideas/physical/Model.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Fragment, Suspense } from "react";
import { GroupProps } from "@react-three/fiber";
import { Center } from "@react-three/drei";
import { useModel } from "../../logic";

type ModelProps = {
src: string;
center?: boolean;
} & GroupProps;

function UnsuspensedModel(props: ModelProps) {
const { src, center, ...rest } = props;
const gltf = useModel(src);

const Parent = center ? Center : Fragment;

return (
<group name="spacesvr-model" {...rest}>
<Parent>
<primitive object={gltf.scene} />
</Parent>
</group>
);
}

export function Model(props: ModelProps) {
return (
<Suspense fallback={null}>
<UnsuspensedModel {...props} />
</Suspense>
);
}
2 changes: 1 addition & 1 deletion src/layers/Environment/ui/PauseMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function PauseMenu(props: PauseMenuProps) {
const PAUSE_ITEMS: PauseItem[] = [
...pauseMenuItems,
{
text: "v2.3.0",
text: "v2.3.1",
link: "https://www.npmjs.com/package/spacesvr",
},
...menuItems,
Expand Down
2 changes: 2 additions & 0 deletions src/layers/Network/logic/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export type ConnectionState = {
connections: Map<string, DataConnection>;
voiceStreams: Map<string, MediaStream>;
disconnect: () => void;
voice: boolean;
setVoice: (v: boolean) => void;
} & Pick<Channels, "useChannel">;

Expand Down Expand Up @@ -133,6 +134,7 @@ export const useConnection = (
connections,
voiceStreams,
useChannel: channels.useChannel,
voice,
setVoice,
};
};

1 comment on commit d00e3bd

@vercel
Copy link

@vercel vercel bot commented on d00e3bd Sep 7, 2022

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-git-master-muse-hq.vercel.app
spacesvr.vercel.app
spacesvr-muse-hq.vercel.app

Please sign in to comment.