Skip to content

Commit 70b9d5b

Browse files
committed
Merge remote-tracking branch 'origin/dev'
2 parents 17161b1 + 0ab6c15 commit 70b9d5b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+2253
-1393
lines changed

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ ADMIN_CODE=
1515
# Can be set to 0 to disable saving
1616
SAVE_INTERVAL=60
1717

18+
# Whether players should collide with other players
19+
PUBLIC_PLAYER_COLLISION=false
20+
1821
# The maximum upload file size for models etc (mb)
1922
PUBLIC_MAX_UPLOAD_SIZE=12
2023

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
.notes/
66
node_modules/
77
build/
8-
world*
8+
/world*

CHANGELOG.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,47 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
### Fixed
1515

16+
## [v0.9.0]
17+
18+
### Added
19+
- core: standalone viewer/clients
20+
- apps: add world.getPlayers() to list all players in the world
21+
- apps: screen-space UI
22+
- core: add player health
23+
- apps: support world.overlapSphere queries
24+
- core: player to player collision (optional, disabled by default)
25+
- apps: player.push(force)
26+
- core: support ctrl+z to undo added, moved and removed apps
27+
- core: build mode right click with mouse to inspect
28+
- apps: new "buttons" prop
29+
- apps: app.sendTo(playerId, name, data) available on server
30+
- apps: node.children array of all child nodes
31+
- apps: uiimage.src support asset urls from props
32+
- apps: emit an app.on('destroy', cb) event that is run right before an app is destroyed/restarted
33+
- apps: add player.isAdmin for securely checking if a player is an admin
34+
35+
### Changed
36+
- apps: support webp image props
37+
- infra: pipe all client variables through initial server snapshot
38+
- core: preload local avatar and movement emotes before entering the world
39+
- apps: ui borderRadius use arcs instead of quadratic curves
40+
- apps: player effects moved to player.applyEffect (BREAKING CHANGE)
41+
- core: use more memory efficient app proxies
42+
- core: support custom app runtime method injection
43+
- core: show red reticle when in build mode for clarity
44+
- apps: unify player.id/userId/networkId etc as player.id
45+
46+
### Fixed
47+
- core: avatar feet too far above ground
48+
- core: fix esm module bundling
49+
- apps: anchors positions behind by one frame
50+
- apps: ui canvas using incorrect color space
51+
- apps: ensure control.camera initial values are accurate
52+
- apps: exporting app with emojis in props broken
53+
- apps: ui pointer events were not accurate
54+
- apps: ensure player enter event is emitted after they receive snapshot
55+
- apps: ui gap value not correctly multiplied by resolution
56+
1657
## [v0.8.1]
1758

1859
### Fixed
@@ -248,7 +289,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
248289
- Basic project structure
249290
- Core functionality from original project
250291

251-
[Unreleased]: https://github.com/hyperfy-xyz/hyperfy/compare/v0.8.1...HEAD
292+
[Unreleased]: https://github.com/hyperfy-xyz/hyperfy/compare/v0.9.0...HEAD
293+
[0.9.0]: https://github.com/hyperfy-xyz/hyperfy/compare/v0.8.1...v0.9.0
252294
[0.8.1]: https://github.com/hyperfy-xyz/hyperfy/compare/v0.8.0...v0.8.1
253295
[0.8.0]: https://github.com/hyperfy-xyz/hyperfy/compare/v0.7.1...v0.8.0
254296
[0.7.1]: https://github.com/hyperfy-xyz/hyperfy/compare/v0.7.0...v0.7.1

docs/commands.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,8 @@ Resets the spawn point back to origin. Requires admin role.
1919
### `/name <name>`
2020

2121
Sets your name.
22-
This is currently the only way to change your name, until the UI for it is built.
22+
This is currently the only way to change your name, until the UI for it is built.
23+
24+
### `/chat clear`
25+
26+
Clears all chat messages. Requires admin privledges to use.

docs/ref/Node.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ The world matrix of this node in global space.
3434

3535
The parent node, if any.
3636

37+
### `.children`: [Node]
38+
39+
The child nodes.
40+
3741
## Methods
3842

3943
### `.add(otherNode)`: Self

docs/ref/Player.md

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,12 @@
11
# Player
22

3-
Represents a player. An instance of Player can be retrived from events or via [World.getPlayer](/docs/ref/World.md)
4-
5-
NOTE: Setting/modifying the geometry are not currently supported, and only be configured within a GLTF (eg via blender).
3+
Represents a player. An instance of Player can be retrived via [World.getPlayer](/docs/ref/World.md)
64

75
## Properties
86

9-
### `.networkId`: String
10-
11-
A completely unique ID that is given to every player each time they connect.
12-
13-
### `.entityId`: String
14-
15-
The entity's ID.
16-
177
### `.id`: String
188

19-
The player ID. This ID is the same each time the player enters the world.
9+
The players unique ID. This is always the same for the same player, even when they leave and come back.
2010

2111
### `.name`: String
2212

@@ -46,3 +36,35 @@ Returns a matrix of the bone transform in world space.
4636

4737
See [Avatar](/docs/ref/Avatar.md) for full details.
4838

39+
### `.damage(amount)`
40+
41+
Removes health from the player. Health cannot go below zero.
42+
43+
### `.heal(amount)`
44+
45+
Adds health to the player. Health cannot go above 100.
46+
47+
### `.applyEffect({ anchor, emote, snare, freeze, turn, duration, cancellable, onEnd })`
48+
49+
Applies an effect to the player. If the player already has an effect, it is replaced. If this function is called with `null` it removes any active effect.
50+
51+
All options are optional.
52+
53+
**anchor**: an [Anchor](/docs/ref/Anchor.md) to attach the player to
54+
55+
**emote**: a url to an emote to play while this effect is active
56+
57+
**snare**: a multiplier from 0 to 1 that reduces movement speed, where zero means no snaring and one means entirely snared. when snared, players can still turn and attempt to move.
58+
59+
**freeze**: when true, the player is frozen in place and all movement keys are ignored.
60+
61+
**turn**: when true, the player will continually face the direction the camera is looking in.
62+
63+
**duration**: how long this effect should last in seconds.
64+
65+
**cancellable**: whether any movement keys will cancel the effect. if enabled, freeze is ignored.
66+
67+
**onEnd**: a function that should be called either at the end of the `duration` or when the player moves if `cancellable`.
68+
69+
70+

docs/ref/Props.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,19 @@ A simple section header to help group fields together
169169
key: String, // a unique `key` to represent this section
170170
label: String, // the label for the section header
171171
}
172+
```
173+
174+
### Buttons
175+
176+
Displays one or more buttons that when clicked, execute something in the running app.
177+
178+
```jsx
179+
{
180+
type: 'buttons',
181+
key: String, // a unique `key` for this button
182+
label: String, // the label for the button
183+
buttons: [
184+
...{ label: String, onClick: Function },
185+
]
186+
}
172187
```

docs/ref/UI.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,29 @@ ui.backgroundColor = 'rgba(0, 0, 0, 0.5)'
99

1010
## Properties
1111

12+
### `.space`: String
13+
14+
Whether this UI should be rendered in `world` space or `screen` space.
15+
When `world`, a plane geometry is physically placed in the world.
16+
When `screen`, the canvas is drawn directly on the screen.
17+
Defaults to `world`.
18+
19+
NOTE: when using `screen`, the `.position` value now represents a ratio from 0 to 1 on each axis. For example `position.x = 1` is the far right of the screen and `position.x = 0` is the far left. Use this in combination with the `pivot` and `offset` values.
20+
21+
```jsx
22+
/**
23+
* Example:
24+
* The following screen-space UI is rendered in the top left of the
25+
* screen, 20px away from both edges.
26+
*/
27+
const ui = app.create('ui', {
28+
space: 'screen',
29+
pivot: 'top-right',
30+
position: [1, 0, 0] // far right
31+
offset: [-20, 20, 0] // 20px left, 20px down
32+
})
33+
```
34+
1235
### `.width`: Number
1336

1437
The width of the UI canvas in pixels. Defaults to `100`.
@@ -42,6 +65,16 @@ Determines where the "center" of the UI is.
4265
Options are: `top-left`, `top-center`, `top-right`, `center-left`, `center`, `center-right`, `bottom-left`, `bottom-center`, `bottom-right`.
4366
Defaults to `center`.
4467

68+
### `.offset`: Vector3
69+
70+
Only applicable when using screen-space.
71+
The offset in pixels applied after the `position` value.
72+
73+
### `.pointerEvents`: Boolean
74+
75+
Whether the UI should receive or ignore pointer events. Defaults to `true`.
76+
If you are building informational screen-space UI that does not need to respond to pointer events, this should be set to `false` for an improved user experience.
77+
4578
### `.backgroundColor`: String
4679

4780
The background color of the UI.

docs/ref/World.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,7 @@ Currently the only groups available are `environment` and `player`.
5050

5151
Returns a player. If no `playerId` is provided it returns the local player.
5252

53+
### `.getPlayers()`: [...Player]
54+
55+
Returns an array of all players.
56+

package-lock.json

Lines changed: 10 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)