You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+82-11Lines changed: 82 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,7 @@ _the following are each a fundamental unit and their own folder at the top level
98
98
99
99
**realities** define how the player experiences your world. They are comparable in function to a browser. They are implemented as a React container component and composed of an ordering of layers.
100
100
101
-
**tools** offer the player affordances in your world. They are implemented as ideas using the Tool modifier, accessed by single keystrokes.
101
+
**tools** offer the player affordances in your world. They are the 3D equivalent of a browser toolbar. They are implemented using a Layer for fundamental state a modifier for registry.
102
102
103
103
**worlds** are sets of ideas. They are the actual content of your site. They are implemented as compositions of ideas.
104
104
@@ -113,7 +113,7 @@ _the following are each a fundamental unit and their own folder at the top level
113
113
114
114
#### Standard Reality
115
115
116
-
The Standard Reality defines the standard experiencing the 3D web. The layers provided are the Environment Layer, Physics Layer, Player Layer, and Network Layer. Additionally, it provides an infinite ground to walk on that can be disabled.
116
+
The Standard Reality defines the standard experiencing the 3D web. The layers provided are, in order: Environment, Physics, Player, Toolbelt, Network, Visual. Additionally, it provides an infinite ground to walk on that can be disabled.
117
117
118
118
```tsx
119
119
<StandardReality
@@ -188,6 +188,32 @@ type PlayerState = {
188
188
};
189
189
```
190
190
191
+
#### Toolbelt Layer
192
+
193
+
_Provides a layer of UX to offer user interaction with the world._
194
+
195
+
```tsx
196
+
typeToolbeltProps= {
197
+
showOnSpawn?:boolean; // whether to show the toolbelt on spawn, default true
198
+
};
199
+
```
200
+
201
+
```tsx
202
+
const toolbelt =useToolbelt();
203
+
204
+
typeToolbeltState= {
205
+
tools:Tool[];
206
+
activeTool?:Tool;
207
+
hide: () =>void;
208
+
next: () =>void;
209
+
prev: () =>void;
210
+
show: () =>void;
211
+
activeIndex:number|undefined;
212
+
setActiveIndex: (i:number) =>void;
213
+
direction:Direction;
214
+
};
215
+
```
216
+
191
217
#### Network Layer
192
218
193
219
_Provides multiplayer out-of-the-box. Muse provides signalling servers and [STUN/TURN](https://www.twilio.com/docs/stun-turn/faq#faq-what-is-nat) servers for everyone :)._
@@ -223,6 +249,22 @@ type NetworkState = {
223
249
};
224
250
```
225
251
252
+
## Tools
253
+
254
+
#### Camera Tool
255
+
256
+
A tool that gives the user a camera to take pictures with. To add to your toolbelt simply add it into the World.
257
+
258
+
```tsx
259
+
<StandardReality>
260
+
<Camera />
261
+
</StandardReality>
262
+
```
263
+
264
+
#### Walkie Talkie Tool
265
+
266
+
A tool to configure your microphone settings. Automatically added if voice chat is enabled in the network layer.
267
+
226
268
## Ideas
227
269
228
270
### _types of ideas_
@@ -425,6 +467,24 @@ Makes its children react to onclick and on hover methods
425
467
</Interactable>
426
468
```
427
469
470
+
#### Tool
471
+
472
+
Turns its children into a tool, automatically registers it with the Tool Layer.
473
+
474
+
```tsx
475
+
<Tool
476
+
name="My Tool"// name used for identification
477
+
pos={[0, 0]}// where the tool should be positioned in screen space, x:[-1, 1], y:[-1, 1]
478
+
face={true}// whether the tool should face the user, default true
479
+
pinY={false}// whether the tool should be pinned on the screen space y so user can look up and down
480
+
range={0}// how far from the cursor the tool will stay without moving left or ight, along the x screen space axis, measured in degrees
481
+
orderIndex={0}// the order in which the tool should be rendered relative to other orders, default 0, sorts low to high
482
+
onSwitch={(enabled:boolean) => {}}// callback for when active tool switches, passes whether the given tool is enabled
483
+
>
484
+
<Stuff />
485
+
</Tool>
486
+
```
487
+
428
488
#### Anchor
429
489
430
490
Makes its children link out to when clicked. handles leaving vr session.
@@ -443,7 +503,7 @@ Makes its children link out to when clicked. handles leaving vr session.
443
503
Turns its children into a billboard, always facing the camera.
0 commit comments