Skip to content

Commit d00e3bd

Browse files
authored
Merge pull request #113 from musehq/dev
v2.3.1
2 parents 0c0853d + 8ffed00 commit d00e3bd

File tree

6 files changed

+39
-3
lines changed

6 files changed

+39
-3
lines changed

examples/worlds/Multiplayer/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { StandardReality, Background } from "spacesvr";
1+
import { StandardReality, Background, Model } from "spacesvr";
22
import LightSwitch from "./ideas/LightSwitch";
33

44
export default function Multiplayer() {
@@ -15,6 +15,7 @@ export default function Multiplayer() {
1515
<planeBufferGeometry args={[200, 200]} />
1616
<meshBasicMaterial color={"purple"} />
1717
</mesh>
18+
<Model src="https://d27rt3a60hh1lx.cloudfront.net/models/Camera-1652915410/camera_02_cleaned.glb.gz" />
1819
</StandardReality>
1920
);
2021
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "spacesvr",
3-
"version": "2.3.0",
3+
"version": "2.3.1",
44
"private": true,
55
"description": "A standardized reality for future of the 3D Web",
66
"keywords": [

src/ideas/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ export * from "./physical/Fog";
1414
export * from "./physical/Frame";
1515
export * from "./physical/HDRI";
1616
export * from "./physical/InfinitePlane";
17+
export * from "./physical/Model";
1718
export * from "./physical/Video";

src/ideas/physical/Model.tsx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { Fragment, Suspense } from "react";
2+
import { GroupProps } from "@react-three/fiber";
3+
import { Center } from "@react-three/drei";
4+
import { useModel } from "../../logic";
5+
6+
type ModelProps = {
7+
src: string;
8+
center?: boolean;
9+
} & GroupProps;
10+
11+
function UnsuspensedModel(props: ModelProps) {
12+
const { src, center, ...rest } = props;
13+
const gltf = useModel(src);
14+
15+
const Parent = center ? Center : Fragment;
16+
17+
return (
18+
<group name="spacesvr-model" {...rest}>
19+
<Parent>
20+
<primitive object={gltf.scene} />
21+
</Parent>
22+
</group>
23+
);
24+
}
25+
26+
export function Model(props: ModelProps) {
27+
return (
28+
<Suspense fallback={null}>
29+
<UnsuspensedModel {...props} />
30+
</Suspense>
31+
);
32+
}

src/layers/Environment/ui/PauseMenu/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export default function PauseMenu(props: PauseMenuProps) {
4848
const PAUSE_ITEMS: PauseItem[] = [
4949
...pauseMenuItems,
5050
{
51-
text: "v2.3.0",
51+
text: "v2.3.1",
5252
link: "https://www.npmjs.com/package/spacesvr",
5353
},
5454
...menuItems,

src/layers/Network/logic/connection.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export type ConnectionState = {
1515
connections: Map<string, DataConnection>;
1616
voiceStreams: Map<string, MediaStream>;
1717
disconnect: () => void;
18+
voice: boolean;
1819
setVoice: (v: boolean) => void;
1920
} & Pick<Channels, "useChannel">;
2021

@@ -133,6 +134,7 @@ export const useConnection = (
133134
connections,
134135
voiceStreams,
135136
useChannel: channels.useChannel,
137+
voice,
136138
setVoice,
137139
};
138140
};

0 commit comments

Comments
 (0)