Skip to content

Commit 5d20037

Browse files
committed
Merge branch 'dev'
2 parents 97e3827 + 7c3fdbd commit 5d20037

62 files changed

Lines changed: 9131 additions & 2432 deletions

Some content is hidden

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

.env.example

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,34 @@ PUBLIC_WS_URL=ws://localhost:3000/ws
2727
# The public url used by clients to access api (eg upload assets)
2828
PUBLIC_API_URL=http://localhost:3000/api
2929

30-
# The public url used by clients to fetch assets
31-
PUBLIC_ASSETS_URL=http://localhost:3000/assets
30+
# How assets are stored, fetched and uploaded (local or s3)
31+
ASSETS=local
32+
ASSETS_BASE_URL=http://localhost:3000/assets
33+
ASSETS_S3_URI=
34+
35+
# By default world data is stored in a local sqlite database in the world folder
36+
# Optionally set this to a postgres uri to store remotely, eg `postgres://username:password@host:port/database`
37+
DB_URI=local
38+
DB_SCHEMA=
39+
40+
# Whether the server should do a cleanup of unused blueprints and assets before launching
41+
CLEAN=true
3242

3343
# LiveKit (voice chat)
3444
LIVEKIT_WS_URL=
3545
LIVEKIT_API_KEY=
36-
LIVEKIT_API_SECRET=
46+
LIVEKIT_API_SECRET=
47+
48+
49+
##
50+
# AI
51+
# --
52+
# AI_PROVIDER: openai, anthropic, xai, google
53+
# AI_MODEL: claude-opus-4-1-20250805, claude-sonnet-4-20250514, gpt-5, gpt-5-mini, gpt-5-nano, grok-4-0709, gemini-2.5-pro, gemini-2.5-flash
54+
# AI_EFFORT: minimal, low, medium, high (OpenAI only)
55+
# AI_API_KEY: The api key for the selected provider
56+
##
57+
AI_PROVIDER=anthropic
58+
AI_MODEL=claude-sonnet-4-20250514
59+
AI_EFFORT=medium
60+
AI_API_KEY=

.github/workflows/docker.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
- 'main'
99
- 'dev'
1010
- 'solana-v2'
11+
- 'ai'
1112
tags:
1213
- 'v*.*.*'
1314

CHANGELOG.md

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

1414
### Fixed
1515

16+
## [v0.16.0]
17+
18+
### Added
19+
- core: support for AI and AI generated apps via ChatGPT, Grok, Gemini etc (see .env)
20+
- core: env for cleaning up old blueprints and assets on launch (CLEAN=true)
21+
- core: support for remote databases
22+
- core: added safemode for rare case an app plays up
23+
- core: XR/VR improvements to physical movement, snap turn etc
24+
- core: XR/VR building basics
25+
- apps: support for `prim` shapes and optimizations to support thousands of unique primitive shapes at once
26+
- apps: support for applying physics force to push players (player.push(force))
27+
- apps: event.isLocalPlayer added to physics events onTriggerEnter and onTriggerLeave
28+
- apps: new `animate` event to help only animating apps nearby (distance based).
29+
30+
### Changed
31+
- core: more boot logs for brevity
32+
- core: fix not being able to see chat text selection
33+
- [BREAKING] core: apps now remain active while being moved in edit mode by default, disable with app.resetOnMove=true or check at runtime with app.isMoving. existing apps that use world space nodes will likely need to update their code.
34+
- core: improved AO to look slightly more natural
35+
- core: when creating nodes you can now also use Vector3 instances if needed, instead of requiring plain old arrays
36+
- core: support alt key in numeric inputs for small steps
37+
- core: support backquote (`) to toggle pointer lock
38+
39+
40+
### Fixed
41+
- core: safely capture errors during app update calls
42+
- core: ensure code editor syncs correctly over multiplayer if both editors have the code window open and one hits save
43+
- core: nested kinematic rigidbody physics not updating correctly outside fixedUpdate
44+
- core: fix false disconnects that keep happening on some worlds (ping-pong related)
45+
1646
## [v0.15.0]
1747

1848
### Added
@@ -464,7 +494,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
464494
- Basic project structure
465495
- Core functionality from original project
466496

467-
[Unreleased]: https://github.com/hyperfy-xyz/hyperfy/compare/v0.15.0...HEAD
497+
[Unreleased]: https://github.com/hyperfy-xyz/hyperfy/compare/v0.16.0...HEAD
498+
[0.16.0]: https://github.com/hyperfy-xyz/hyperfy/compare/v0.15.0...v0.16.0
468499
[0.15.0]: https://github.com/hyperfy-xyz/hyperfy/compare/v0.14.0...v0.15.0
469500
[0.14.0]: https://github.com/hyperfy-xyz/hyperfy/compare/v0.13.0...v0.14.0
470501
[0.13.0]: https://github.com/hyperfy-xyz/hyperfy/compare/v0.12.0...v0.13.0

DOCKER.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ docker build -t hyperfydemo . && docker run -d -p 3000:3000 \
1414
-e ASSETS_DIR=/world/assets \
1515
-e PUBLIC_WS_URL=https://demo.hyperfy.host/ws \
1616
-e PUBLIC_API_URL=https://demo.hyperfy.host/api \
17-
-e PUBLIC_ASSETS_URL=https://demo.hyperfy.host/assets \
17+
-e ASSETS_BASE_URL=https://demo.hyperfy.host/assets \
1818
hyperfydemo
1919
```
2020

MIGRATIONS.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Migration Guide
2+
3+
## 0.15.0 -> X.XX.X
4+
5+
### Self Hosting
6+
7+
- The `PUBLIC_ASSETS_URL` environment variable was renamed to `ASSETS_BASE_URL`.
8+
- A new `ASSETS=local` environment variable is now required. This can also be set to `s3` allowing assets to be stored in a remote S3-compatible bucket with `ASSETS_S3_URI` (such as Amazon S3 and Cloudflare R2)
9+
- A new `CLEAN` environment variable has been added which defaults to `CLEAN=true` for new installations. When enabled, all unused data (blueprints and assets) are purged during world startup.
10+
11+
### Apps
12+
13+
- The `app.keepActive` toggle has been removed as apps are now active and will run scripts by default, even while being moved. If you come across an app behaving weirdly while moving them, it's likely that adding `app.resetOnMove = true` at the top of the script will fix it.

docs/scripting/app/App.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,10 @@ NOTE: Blender GLTF exporter renames objects in some cases, eg by removing spaces
6363

6464
Creates and returns a node of the specified name.
6565

66-
#### `.control(options)`: Control
66+
### `.control(options)`
6767

68-
TODO: provides control to a client to respond to inputs and move the camera etc
68+
Gives you control to listen for inputs and modify things like camera position. See [Control(/docs/scripting/app/Control.md) for more info.
6969

7070
#### `.configure(fields)`
7171

7272
Configures custom UI for your app. See [Props](/docs/scripting/app/Props.md) for more info.
73-

docs/scripting/app/Control.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Input
2+
3+
## `app.control(options)`: Control
4+
5+
The `app.control()` method gives you access to user inputs like keyboard and mouse and gives you control over the camera etc. It's the primary way to create interactive experiences.
6+
7+
```javascript
8+
// Get a control object
9+
const control = app.control()
10+
11+
// The app will be cleaned up automatically, but if you need to manually release control:
12+
control.release()
13+
```
14+
15+
### Buttons
16+
17+
Listen to press and release events for keyboard keys and mouse buttons.
18+
19+
```javascript
20+
// Listen for 'W' key press and release
21+
control.keyW.onPress = () => { console.log('W pressed') }
22+
control.keyW.onRelease = () => { console.log('W released') }
23+
24+
// Listen for left mouse button
25+
control.mouseLeft.onPress = () => { console.log('Left mouse button pressed') }
26+
```
27+
28+
Each button object has the following properties:
29+
* `onPress` (Function): Callback for when the button is first pressed down.
30+
* `onRelease` (Function): Callback for when the button is released.
31+
* `down` (Boolean): `true` if the button is currently held down.
32+
* `pressed` (Boolean): `true` for the single frame when the button is first pressed.
33+
* `released` (Boolean): `true` for the single frame when the button is released.
34+
* `capture` (Boolean): If set to `true`, it will consume the event and prevent lower-priority controls from receiving it.
35+
36+
Here is a list of available button properties:
37+
38+
`keyA` to `keyZ`, `digit0` to `digit9`, `minus`, `equal`, `bracketLeft`, `bracketRight`, `backslash`, `semicolon`, `quote`, `backquote`, `comma`, `period`, `slash`, `arrowUp`, `arrowDown`, `arrowLeft`, `arrowRight`, `home`, `end`, `pageUp`, `pageDown`, `tab`, `capsLock`, `shiftLeft`, `shiftRight`, `controlLeft`, `controlRight`, `altLeft`, `altRight`, `enter`, `space`, `backspace`, `delete`, `escape`, `mouseLeft`, `mouseRight`, `metaLeft`.
39+
40+
### Pointer
41+
42+
Access pointer (mouse) information.
43+
44+
```javascript
45+
// Get pointer delta every frame
46+
app.on('update', () => {
47+
const pointerDelta = control.pointer.delta
48+
if (pointerDelta.x !== 0 || pointerDelta.y !== 0) {
49+
console.log('Pointer moved:', pointerDelta.x, pointerDelta.y)
50+
}
51+
})
52+
```
53+
54+
* `pointer.coords` (Vector3): Pointer coordinates in normalized screen space (`[0,0]` to `[1,1]`).
55+
* `pointer.position` (Vector3): Pointer coordinates in screen pixels.
56+
* `pointer.delta` (Vector3): Change in pointer position since the last frame.
57+
* `pointer.locked` (Boolean): `true` if the pointer is currently locked.
58+
* `pointer.lock()`: Requests to lock the pointer to the screen.
59+
* `pointer.unlock()`: Releases the pointer lock.
60+
61+
### Scroll
62+
63+
Get mouse scroll wheel changes.
64+
65+
```javascript
66+
// The value is the scroll delta for the current frame.
67+
const scrollDelta = control.scrollDelta.value
68+
```
69+
70+
* `scrollDelta.value` (Number): The scroll delta for the current frame.
71+
* `scrollDelta.capture` (Boolean): If `true`, consumes the scroll event.
72+
73+
### Camera
74+
75+
Lets you read and also modify the camera position if needed.
76+
77+
By default the camera information is read-only, set `write` to true when you want to take over control.
78+
79+
```jsx
80+
control.camera.write = true
81+
control.camera.position.y = 4
82+
```
83+
84+
* `camera.position` (Vector3): The position of the camera in world space.
85+
* `camera.quaternion` (Quaternion): The quaternion rotation of the camera in world space.
86+
* `camera.rotation` (Euler): The euler rotation (radians) of the camera in world space.
87+
* `camera.zoom` (Number): Third person zoom value, eg how far back the camera is from its position.
88+
* `camera.write` (Boolean): Set this to `true` if you want to modify the camera in any way.
89+
90+
91+
### Screen
92+
93+
Gives you the dimensions of the screen in pixels, useful when positioning UI.
94+
95+
* `screen.width` (Number): The width of the screen in px.
96+
* `screen.height` (Number): The height of the screen in px.

docs/scripting/app/Props.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,22 @@ const audio = app.create('audio', {
155155
audio.play()
156156
```
157157
158+
### Color
159+
160+
A visual color picker that displays a color swatch and opens a color wheel when clicked.
161+
162+
```jsx
163+
{
164+
type: 'color',
165+
key: String, // the key on `props` to set this value
166+
label: String, // the label for the color picker
167+
hint: String, // optional hint text displayed on hover
168+
initial: String, // the initial hex color value (default = '#ffffff')
169+
}
170+
```
171+
172+
The value set on props is a hex color string (e.g., '#ff0000' for red).
173+
158174
### Button
159175
160176
Displays a button that when clicked, executes something in the running app.

0 commit comments

Comments
 (0)