File tree Expand file tree Collapse file tree 6 files changed +39
-3
lines changed
examples/worlds/Multiplayer Expand file tree Collapse file tree 6 files changed +39
-3
lines changed Original file line number Diff line number Diff line change 1
- import { StandardReality , Background } from "spacesvr" ;
1
+ import { StandardReality , Background , Model } from "spacesvr" ;
2
2
import LightSwitch from "./ideas/LightSwitch" ;
3
3
4
4
export default function Multiplayer ( ) {
@@ -15,6 +15,7 @@ export default function Multiplayer() {
15
15
< planeBufferGeometry args = { [ 200 , 200 ] } />
16
16
< meshBasicMaterial color = { "purple" } />
17
17
</ mesh >
18
+ < Model src = "https://d27rt3a60hh1lx.cloudfront.net/models/Camera-1652915410/camera_02_cleaned.glb.gz" />
18
19
</ StandardReality >
19
20
) ;
20
21
}
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " spacesvr" ,
3
- "version" : " 2.3.0 " ,
3
+ "version" : " 2.3.1 " ,
4
4
"private" : true ,
5
5
"description" : " A standardized reality for future of the 3D Web" ,
6
6
"keywords" : [
Original file line number Diff line number Diff line change @@ -14,4 +14,5 @@ export * from "./physical/Fog";
14
14
export * from "./physical/Frame" ;
15
15
export * from "./physical/HDRI" ;
16
16
export * from "./physical/InfinitePlane" ;
17
+ export * from "./physical/Model" ;
17
18
export * from "./physical/Video" ;
Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ export default function PauseMenu(props: PauseMenuProps) {
48
48
const PAUSE_ITEMS : PauseItem [ ] = [
49
49
...pauseMenuItems ,
50
50
{
51
- text : "v2.3.0 " ,
51
+ text : "v2.3.1 " ,
52
52
link : "https://www.npmjs.com/package/spacesvr" ,
53
53
} ,
54
54
...menuItems ,
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ export type ConnectionState = {
15
15
connections : Map < string , DataConnection > ;
16
16
voiceStreams : Map < string , MediaStream > ;
17
17
disconnect : ( ) => void ;
18
+ voice : boolean ;
18
19
setVoice : ( v : boolean ) => void ;
19
20
} & Pick < Channels , "useChannel" > ;
20
21
@@ -133,6 +134,7 @@ export const useConnection = (
133
134
connections,
134
135
voiceStreams,
135
136
useChannel : channels . useChannel ,
137
+ voice,
136
138
setVoice,
137
139
} ;
138
140
} ;
You can’t perform that action at this time.
0 commit comments