hytopia 0.1.30 → 0.1.32
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +3 -26
- package/bin/scripts.js +14 -8
- package/boilerplate/assets/map.json +2 -2
- package/docs/server.entity.md +2 -2
- package/docs/server.entity.onblockcollision.md +1 -1
- package/docs/server.entity.onblockcontactforce.md +1 -1
- package/docs/server.hytopia.entity.md +2 -2
- package/docs/server.hytopia.entity.onblockcollision.md +1 -1
- package/docs/server.hytopia.entity.onblockcontactforce.md +1 -1
- package/docs/server.hytopia.md +42 -0
- package/docs/server.hytopia.player.camera.md +13 -0
- package/docs/server.hytopia.player.md +21 -0
- package/docs/server.hytopia.playercamera.attachedtoentity.md +13 -0
- package/docs/server.hytopia.playercamera.attachedtoposition.md +13 -0
- package/docs/server.hytopia.playercamera.filmoffset.md +13 -0
- package/docs/server.hytopia.playercamera.forwardoffset.md +13 -0
- package/docs/server.hytopia.playercamera.fov.md +13 -0
- package/docs/server.hytopia.playercamera.hiddenmodelnodes.md +13 -0
- package/docs/server.hytopia.playercamera.lookatentity.md +53 -0
- package/docs/server.hytopia.playercamera.lookatposition.md +53 -0
- package/docs/server.hytopia.playercamera.md +506 -0
- package/docs/server.hytopia.playercamera.mode.md +13 -0
- package/docs/server.hytopia.playercamera.offset.md +13 -0
- package/docs/server.hytopia.playercamera.player.md +13 -0
- package/docs/server.hytopia.playercamera.setattachedtoentity.md +53 -0
- package/docs/server.hytopia.playercamera.setattachedtoposition.md +53 -0
- package/docs/server.hytopia.playercamera.setfilmoffset.md +53 -0
- package/docs/server.hytopia.playercamera.setforwardoffset.md +53 -0
- package/docs/server.hytopia.playercamera.setfov.md +53 -0
- package/docs/server.hytopia.playercamera.sethiddenmodelnodes.md +53 -0
- package/docs/server.hytopia.playercamera.setmode.md +53 -0
- package/docs/server.hytopia.playercamera.setoffset.md +53 -0
- package/docs/server.hytopia.playercamera.settrackedentity.md +53 -0
- package/docs/server.hytopia.playercamera.settrackedposition.md +53 -0
- package/docs/server.hytopia.playercamera.setzoom.md +53 -0
- package/docs/server.hytopia.playercamera.trackedentity.md +13 -0
- package/docs/server.hytopia.playercamera.trackedposition.md +13 -0
- package/docs/server.hytopia.playercamera.zoom.md +13 -0
- package/docs/server.hytopia.playercameraeventpayload.lookatentity.entity.md +11 -0
- package/docs/server.hytopia.playercameraeventpayload.lookatentity.md +70 -0
- package/docs/server.hytopia.playercameraeventpayload.lookatentity.playercamera.md +11 -0
- package/docs/server.hytopia.playercameraeventpayload.lookatposition.md +70 -0
- package/docs/server.hytopia.playercameraeventpayload.lookatposition.playercamera.md +11 -0
- package/docs/server.hytopia.playercameraeventpayload.lookatposition.position.md +11 -0
- package/docs/server.hytopia.playercameraeventpayload.md +145 -0
- package/docs/server.hytopia.playercameraeventpayload.setattachedtoentity.entity.md +11 -0
- package/docs/server.hytopia.playercameraeventpayload.setattachedtoentity.md +70 -0
- package/docs/server.hytopia.playercameraeventpayload.setattachedtoentity.playercamera.md +11 -0
- package/docs/server.hytopia.playercameraeventpayload.setattachedtoposition.md +70 -0
- package/docs/server.hytopia.playercameraeventpayload.setattachedtoposition.playercamera.md +11 -0
- package/docs/server.hytopia.playercameraeventpayload.setattachedtoposition.position.md +11 -0
- package/docs/server.hytopia.playercameraeventpayload.setfilmoffset.filmoffset.md +11 -0
- package/docs/server.hytopia.playercameraeventpayload.setfilmoffset.md +70 -0
- package/docs/server.hytopia.playercameraeventpayload.setfilmoffset.playercamera.md +11 -0
- package/docs/server.hytopia.playercameraeventpayload.setforwardoffset.forwardoffset.md +11 -0
- package/docs/server.hytopia.playercameraeventpayload.setforwardoffset.md +70 -0
- package/docs/server.hytopia.playercameraeventpayload.setforwardoffset.playercamera.md +11 -0
- package/docs/server.hytopia.playercameraeventpayload.setfov.fov.md +11 -0
- package/docs/server.hytopia.playercameraeventpayload.setfov.md +70 -0
- package/docs/server.hytopia.playercameraeventpayload.setfov.playercamera.md +11 -0
- package/docs/server.hytopia.playercameraeventpayload.sethiddenmodelnodes.hiddenmodelnodes.md +11 -0
- package/docs/server.hytopia.playercameraeventpayload.sethiddenmodelnodes.md +70 -0
- package/docs/server.hytopia.playercameraeventpayload.sethiddenmodelnodes.playercamera.md +11 -0
- package/docs/server.hytopia.playercameraeventpayload.setmode.md +70 -0
- package/docs/server.hytopia.playercameraeventpayload.setmode.mode.md +11 -0
- package/docs/server.hytopia.playercameraeventpayload.setmode.playercamera.md +11 -0
- package/docs/server.hytopia.playercameraeventpayload.setoffset.md +70 -0
- package/docs/server.hytopia.playercameraeventpayload.setoffset.offset.md +11 -0
- package/docs/server.hytopia.playercameraeventpayload.setoffset.playercamera.md +11 -0
- package/docs/server.hytopia.playercameraeventpayload.settrackedentity.entity.md +11 -0
- package/docs/server.hytopia.playercameraeventpayload.settrackedentity.md +70 -0
- package/docs/server.hytopia.playercameraeventpayload.settrackedentity.playercamera.md +11 -0
- package/docs/server.hytopia.playercameraeventpayload.settrackedposition.md +70 -0
- package/docs/server.hytopia.playercameraeventpayload.settrackedposition.playercamera.md +11 -0
- package/docs/server.hytopia.playercameraeventpayload.settrackedposition.position.md +11 -0
- package/docs/server.hytopia.playercameraeventpayload.setzoom.md +70 -0
- package/docs/server.hytopia.playercameraeventpayload.setzoom.playercamera.md +11 -0
- package/docs/server.hytopia.playercameraeventpayload.setzoom.zoom.md +11 -0
- package/docs/server.hytopia.playercameraeventtype.md +215 -0
- package/docs/server.hytopia.playercameramode.md +59 -0
- package/docs/server.md +42 -0
- package/docs/server.player.camera.md +13 -0
- package/docs/server.player.md +21 -0
- package/docs/server.playercamera.attachedtoentity.md +13 -0
- package/docs/server.playercamera.attachedtoposition.md +13 -0
- package/docs/server.playercamera.filmoffset.md +13 -0
- package/docs/server.playercamera.forwardoffset.md +13 -0
- package/docs/server.playercamera.fov.md +13 -0
- package/docs/server.playercamera.hiddenmodelnodes.md +13 -0
- package/docs/server.playercamera.lookatentity.md +53 -0
- package/docs/server.playercamera.lookatposition.md +53 -0
- package/docs/server.playercamera.md +506 -0
- package/docs/server.playercamera.mode.md +13 -0
- package/docs/server.playercamera.offset.md +13 -0
- package/docs/server.playercamera.player.md +13 -0
- package/docs/server.playercamera.setattachedtoentity.md +53 -0
- package/docs/server.playercamera.setattachedtoposition.md +53 -0
- package/docs/server.playercamera.setfilmoffset.md +53 -0
- package/docs/server.playercamera.setforwardoffset.md +53 -0
- package/docs/server.playercamera.setfov.md +53 -0
- package/docs/server.playercamera.sethiddenmodelnodes.md +53 -0
- package/docs/server.playercamera.setmode.md +53 -0
- package/docs/server.playercamera.setoffset.md +53 -0
- package/docs/server.playercamera.settrackedentity.md +53 -0
- package/docs/server.playercamera.settrackedposition.md +53 -0
- package/docs/server.playercamera.setzoom.md +53 -0
- package/docs/server.playercamera.trackedentity.md +13 -0
- package/docs/server.playercamera.trackedposition.md +13 -0
- package/docs/server.playercamera.zoom.md +13 -0
- package/docs/server.playercameraeventpayload.lookatentity.entity.md +11 -0
- package/docs/server.playercameraeventpayload.lookatentity.md +70 -0
- package/docs/server.playercameraeventpayload.lookatentity.playercamera.md +11 -0
- package/docs/server.playercameraeventpayload.lookatposition.md +70 -0
- package/docs/server.playercameraeventpayload.lookatposition.playercamera.md +11 -0
- package/docs/server.playercameraeventpayload.lookatposition.position.md +11 -0
- package/docs/server.playercameraeventpayload.md +145 -0
- package/docs/server.playercameraeventpayload.setattachedtoentity.entity.md +11 -0
- package/docs/server.playercameraeventpayload.setattachedtoentity.md +70 -0
- package/docs/server.playercameraeventpayload.setattachedtoentity.playercamera.md +11 -0
- package/docs/server.playercameraeventpayload.setattachedtoposition.md +70 -0
- package/docs/server.playercameraeventpayload.setattachedtoposition.playercamera.md +11 -0
- package/docs/server.playercameraeventpayload.setattachedtoposition.position.md +11 -0
- package/docs/server.playercameraeventpayload.setfilmoffset.filmoffset.md +11 -0
- package/docs/server.playercameraeventpayload.setfilmoffset.md +70 -0
- package/docs/server.playercameraeventpayload.setfilmoffset.playercamera.md +11 -0
- package/docs/server.playercameraeventpayload.setforwardoffset.forwardoffset.md +11 -0
- package/docs/server.playercameraeventpayload.setforwardoffset.md +70 -0
- package/docs/server.playercameraeventpayload.setforwardoffset.playercamera.md +11 -0
- package/docs/server.playercameraeventpayload.setfov.fov.md +11 -0
- package/docs/server.playercameraeventpayload.setfov.md +70 -0
- package/docs/server.playercameraeventpayload.setfov.playercamera.md +11 -0
- package/docs/server.playercameraeventpayload.sethiddenmodelnodes.hiddenmodelnodes.md +11 -0
- package/docs/server.playercameraeventpayload.sethiddenmodelnodes.md +70 -0
- package/docs/server.playercameraeventpayload.sethiddenmodelnodes.playercamera.md +11 -0
- package/docs/server.playercameraeventpayload.setmode.md +70 -0
- package/docs/server.playercameraeventpayload.setmode.mode.md +11 -0
- package/docs/server.playercameraeventpayload.setmode.playercamera.md +11 -0
- package/docs/server.playercameraeventpayload.setoffset.md +70 -0
- package/docs/server.playercameraeventpayload.setoffset.offset.md +11 -0
- package/docs/server.playercameraeventpayload.setoffset.playercamera.md +11 -0
- package/docs/server.playercameraeventpayload.settrackedentity.entity.md +11 -0
- package/docs/server.playercameraeventpayload.settrackedentity.md +70 -0
- package/docs/server.playercameraeventpayload.settrackedentity.playercamera.md +11 -0
- package/docs/server.playercameraeventpayload.settrackedposition.md +70 -0
- package/docs/server.playercameraeventpayload.settrackedposition.playercamera.md +11 -0
- package/docs/server.playercameraeventpayload.settrackedposition.position.md +11 -0
- package/docs/server.playercameraeventpayload.setzoom.md +70 -0
- package/docs/server.playercameraeventpayload.setzoom.playercamera.md +11 -0
- package/docs/server.playercameraeventpayload.setzoom.zoom.md +11 -0
- package/docs/server.playercameraeventtype.md +215 -0
- package/docs/server.playercameramode.md +59 -0
- package/examples/payload-game/index.ts +1 -1
- package/package.json +1 -1
- package/server.api.json +9023 -4203
- package/server.d.ts +222 -4
- package/server.js +118 -61
- package/examples/character-controller/package.json +0 -14
- package/examples/entity-spawn/package.json +0 -14
- package/examples/payload-game/package.json +0 -14
package/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# HYTOPIA SDK
|
2
2
|
|
3
3
|
## Quick Links
|
4
|
-
[Quickstart](#quickstart) • [Developer Docs](https://dev.hytopia.com/) • [API Reference](./docs/server.md) • [Examples](./examples) • [Join Our Developer Discord](https://discord.gg/hytopia-developers) • [Report Bugs or Request Features](https://github.com/hytopiagg/sdk/issues)
|
4
|
+
[Quickstart (Start Here)](#quickstart-start-here) • [Developer Docs](https://dev.hytopia.com/) • [API Reference](./docs/server.md) • [Examples](./examples) • [Join Our Developer Discord](https://discord.gg/hytopia-developers) • [Report Bugs or Request Features](https://github.com/hytopiagg/sdk/issues)
|
5
5
|
|
6
6
|
## What is HYTOPIA?
|
7
7
|
|
@@ -28,32 +28,9 @@ Available as a simple NPM package, this SDK provides everything you need to get
|
|
28
28
|
|
29
29
|
With these resources, you can quickly build and share immersive, voxel-style multiplayer games on HYTOPIA.
|
30
30
|
|
31
|
-
## Quickstart
|
31
|
+
## Quickstart (Start Here)
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
2. Create a new project directory somewhere on your machine and navigate into it.
|
36
|
-
```bash
|
37
|
-
mkdir my-project-directory && cd my-project-directory
|
38
|
-
```
|
39
|
-
|
40
|
-
3. Initialize a hytopia project from boilerplate or an existing example. Sets up package.json and all dependencies, copies assets and an index.ts game script into your project.
|
41
|
-
```bash
|
42
|
-
# Option 1: Initialize a boilerplate project
|
43
|
-
bunx hytopia init
|
44
|
-
|
45
|
-
# Option 2: Initialize a project from any of the examples in the examples directory like so:
|
46
|
-
bunx hytopia init --template payload-game
|
47
|
-
```
|
48
|
-
|
49
|
-
3. Start the server, use --watch for hot reloads as you make changes.
|
50
|
-
```bash
|
51
|
-
bun --watch index.ts
|
52
|
-
```
|
53
|
-
|
54
|
-
4. Visit https://play.hytopia.com - when prompted, enter `localhost:8080` - this is the hostname of the local server you started in the previous step.
|
55
|
-
|
56
|
-
**Note: If you'd prefer to use JavaScript instead of TypeScript, simply change the file extension of index.ts to index.js - Your editor will highlight the TypeScript syntax errors, simple delete the type annotations and everything should work the same without any TypeScript usage.**
|
33
|
+
**[Follow the Initial Setup guide, here](https://dev.hytopia.com/getting-started/initial-setup).**
|
57
34
|
|
58
35
|
Once you're up and running, here's some other resources to go further:
|
59
36
|
- [Developer Docs](https://dev.hytopia.com/)
|
package/bin/scripts.js
CHANGED
@@ -27,28 +27,34 @@ const path = require('path');
|
|
27
27
|
if (command === 'init') {
|
28
28
|
const destDir = process.cwd();
|
29
29
|
|
30
|
+
// Initialize project with latest HYTOPIA SDK
|
31
|
+
console.log('🔧 Initializing project with latest HYTOPIA SDK...');
|
32
|
+
execSync('bun init --yes');
|
33
|
+
execSync('bun add hytopia@latest');
|
34
|
+
|
30
35
|
if (flags.template) {
|
31
|
-
|
36
|
+
// Init from example template
|
37
|
+
console.log(`🖨️ Initializing project with examples template "${flags.template}"...`);
|
32
38
|
|
33
|
-
const templateDir = path.join(
|
39
|
+
const templateDir = path.join(destDir, 'node_modules', 'hytopia', 'examples', flags.template);
|
34
40
|
|
35
41
|
if (!fs.existsSync(templateDir)) {
|
36
|
-
console.error(`Examples template ${flags.template} does not exist in the examples directory, could not initialize project
|
42
|
+
console.error(`Examples template ${flags.template} does not exist in the examples directory, could not initialize project! Tried directory: ${templateDir}`);
|
37
43
|
return;
|
38
44
|
}
|
39
45
|
|
40
46
|
fs.cpSync(templateDir, destDir, { recursive: true });
|
41
|
-
execSync('bun install');
|
42
47
|
} else {
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
48
|
+
// Init from boilerplate
|
49
|
+
console.log('🧑💻 Initializing project with boilerplate...');
|
50
|
+
|
47
51
|
const srcDir = path.join(__dirname, '..', 'boilerplate');
|
52
|
+
|
48
53
|
fs.cpSync(srcDir, destDir, { recursive: true });
|
49
54
|
}
|
50
55
|
|
51
56
|
// Done, lfg!
|
57
|
+
console.log('--------------------------------');
|
52
58
|
console.log('🚀 Hytopia project initialized successfully!');
|
53
59
|
console.log('💡 Start your development server with `bun --watch index.ts`!');
|
54
60
|
console.log('🎮 After you start your development server, play by opening your browser and visiting: https://play.hytopia.com/?join=localhost:8080')
|
@@ -108,7 +108,7 @@
|
|
108
108
|
{
|
109
109
|
"id": 22,
|
110
110
|
"name": "water_still",
|
111
|
-
"textureUri": "textures/
|
111
|
+
"textureUri": "textures/water.png"
|
112
112
|
}
|
113
113
|
],
|
114
114
|
"blocks": {
|
@@ -2620,4 +2620,4 @@
|
|
2620
2620
|
"3,3,-11": 19,
|
2621
2621
|
"-1,1,12": 11
|
2622
2622
|
}
|
2623
|
-
}
|
2623
|
+
}
|
package/docs/server.entity.md
CHANGED
@@ -278,7 +278,7 @@ The name of the entity.
|
|
278
278
|
|
279
279
|
</td><td>
|
280
280
|
|
281
|
-
(entity: [Entity](./server.entity.md)<!-- -->,
|
281
|
+
(entity: [Entity](./server.entity.md)<!-- -->, blockType: [BlockType](./server.blocktype.md)<!-- -->, started: boolean) => void
|
282
282
|
|
283
283
|
|
284
284
|
</td><td>
|
@@ -297,7 +297,7 @@ _(Optional)_ A function that is called when the entity collides with a block.
|
|
297
297
|
|
298
298
|
</td><td>
|
299
299
|
|
300
|
-
(entity: [Entity](./server.entity.md)<!-- -->,
|
300
|
+
(entity: [Entity](./server.entity.md)<!-- -->, blockType: [BlockType](./server.blocktype.md)<!-- -->, contactForceData: ContactForceData) => void
|
301
301
|
|
302
302
|
|
303
303
|
</td><td>
|
@@ -9,5 +9,5 @@ A function that is called when the entity collides with a block.
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
onBlockCollision?: (entity: Entity,
|
12
|
+
onBlockCollision?: (entity: Entity, blockType: BlockType, started: boolean) => void;
|
13
13
|
```
|
@@ -9,5 +9,5 @@ A function that is called when the entity collides with a block.
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
onBlockContactForce?: (entity: Entity,
|
12
|
+
onBlockContactForce?: (entity: Entity, blockType: BlockType, contactForceData: ContactForceData) => void;
|
13
13
|
```
|
@@ -278,7 +278,7 @@ The name of the entity.
|
|
278
278
|
|
279
279
|
</td><td>
|
280
280
|
|
281
|
-
(entity: [Entity](./server.entity.md)<!-- -->,
|
281
|
+
(entity: [Entity](./server.entity.md)<!-- -->, blockType: [BlockType](./server.blocktype.md)<!-- -->, started: boolean) => void
|
282
282
|
|
283
283
|
|
284
284
|
</td><td>
|
@@ -297,7 +297,7 @@ _(Optional)_ A function that is called when the entity collides with a block.
|
|
297
297
|
|
298
298
|
</td><td>
|
299
299
|
|
300
|
-
(entity: [Entity](./server.entity.md)<!-- -->,
|
300
|
+
(entity: [Entity](./server.entity.md)<!-- -->, blockType: [BlockType](./server.blocktype.md)<!-- -->, contactForceData: ContactForceData) => void
|
301
301
|
|
302
302
|
|
303
303
|
</td><td>
|
@@ -9,5 +9,5 @@ A function that is called when the entity collides with a block.
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
onBlockCollision?: (entity: Entity,
|
12
|
+
onBlockCollision?: (entity: Entity, blockType: BlockType, started: boolean) => void;
|
13
13
|
```
|
@@ -9,5 +9,5 @@ A function that is called when the entity collides with a block.
|
|
9
9
|
**Signature:**
|
10
10
|
|
11
11
|
```typescript
|
12
|
-
onBlockContactForce?: (entity: Entity,
|
12
|
+
onBlockContactForce?: (entity: Entity, blockType: BlockType, contactForceData: ContactForceData) => void;
|
13
13
|
```
|
package/docs/server.hytopia.md
CHANGED
@@ -192,6 +192,17 @@ Manages the game and associated worlds and systems.
|
|
192
192
|
A player in the game.
|
193
193
|
|
194
194
|
|
195
|
+
</td></tr>
|
196
|
+
<tr><td>
|
197
|
+
|
198
|
+
[PlayerCamera](./server.hytopia.playercamera.md)
|
199
|
+
|
200
|
+
|
201
|
+
</td><td>
|
202
|
+
|
203
|
+
The camera for a Player.
|
204
|
+
|
205
|
+
|
195
206
|
</td></tr>
|
196
207
|
<tr><td>
|
197
208
|
|
@@ -409,6 +420,26 @@ Event types an Entity instance can emit.
|
|
409
420
|
Event types a GameServer instance can emit.
|
410
421
|
|
411
422
|
|
423
|
+
</td></tr>
|
424
|
+
<tr><td>
|
425
|
+
|
426
|
+
[PlayerCameraEventType](./server.hytopia.playercameraeventtype.md)
|
427
|
+
|
428
|
+
|
429
|
+
</td><td>
|
430
|
+
|
431
|
+
Event types a PlayerCamera can emit.
|
432
|
+
|
433
|
+
|
434
|
+
</td></tr>
|
435
|
+
<tr><td>
|
436
|
+
|
437
|
+
[PlayerCameraMode](./server.hytopia.playercameramode.md)
|
438
|
+
|
439
|
+
|
440
|
+
</td><td>
|
441
|
+
|
442
|
+
|
412
443
|
</td></tr>
|
413
444
|
<tr><td>
|
414
445
|
|
@@ -718,6 +749,17 @@ Payloads for events an Entity instance can emit.
|
|
718
749
|
Payloads for events emitted by a GameServer instance.
|
719
750
|
|
720
751
|
|
752
|
+
</td></tr>
|
753
|
+
<tr><td>
|
754
|
+
|
755
|
+
[PlayerCameraEventPayload](./server.hytopia.playercameraeventpayload.md)
|
756
|
+
|
757
|
+
|
758
|
+
</td><td>
|
759
|
+
|
760
|
+
Payloads for events a PlayerCamera can emit.
|
761
|
+
|
762
|
+
|
721
763
|
</td></tr>
|
722
764
|
<tr><td>
|
723
765
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [HYTOPIA](./server.hytopia.md) > [Player](./server.hytopia.player.md) > [camera](./server.hytopia.player.camera.md)
|
4
|
+
|
5
|
+
## HYTOPIA.Player.camera property
|
6
|
+
|
7
|
+
The camera for the player.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
readonly camera: PlayerCamera;
|
13
|
+
```
|
@@ -43,6 +43,27 @@ Description
|
|
43
43
|
</th></tr></thead>
|
44
44
|
<tbody><tr><td>
|
45
45
|
|
46
|
+
[camera](./server.hytopia.player.camera.md)
|
47
|
+
|
48
|
+
|
49
|
+
</td><td>
|
50
|
+
|
51
|
+
`readonly`
|
52
|
+
|
53
|
+
|
54
|
+
</td><td>
|
55
|
+
|
56
|
+
[PlayerCamera](./server.playercamera.md)
|
57
|
+
|
58
|
+
|
59
|
+
</td><td>
|
60
|
+
|
61
|
+
The camera for the player.
|
62
|
+
|
63
|
+
|
64
|
+
</td></tr>
|
65
|
+
<tr><td>
|
66
|
+
|
46
67
|
[id](./server.hytopia.player.id.md)
|
47
68
|
|
48
69
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [HYTOPIA](./server.hytopia.md) > [PlayerCamera](./server.hytopia.playercamera.md) > [attachedToEntity](./server.hytopia.playercamera.attachedtoentity.md)
|
4
|
+
|
5
|
+
## HYTOPIA.PlayerCamera.attachedToEntity property
|
6
|
+
|
7
|
+
The entity the camera is attached to.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
get attachedToEntity(): Entity | undefined;
|
13
|
+
```
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [HYTOPIA](./server.hytopia.md) > [PlayerCamera](./server.hytopia.playercamera.md) > [attachedToPosition](./server.hytopia.playercamera.attachedtoposition.md)
|
4
|
+
|
5
|
+
## HYTOPIA.PlayerCamera.attachedToPosition property
|
6
|
+
|
7
|
+
The position the camera is attached to.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
get attachedToPosition(): Vector3 | undefined;
|
13
|
+
```
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [HYTOPIA](./server.hytopia.md) > [PlayerCamera](./server.hytopia.playercamera.md) > [filmOffset](./server.hytopia.playercamera.filmoffset.md)
|
4
|
+
|
5
|
+
## HYTOPIA.PlayerCamera.filmOffset property
|
6
|
+
|
7
|
+
The film offset of the camera. A positive value shifts the camera right, a negative value shifts it left.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
get filmOffset(): number;
|
13
|
+
```
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [HYTOPIA](./server.hytopia.md) > [PlayerCamera](./server.hytopia.playercamera.md) > [forwardOffset](./server.hytopia.playercamera.forwardoffset.md)
|
4
|
+
|
5
|
+
## HYTOPIA.PlayerCamera.forwardOffset property
|
6
|
+
|
7
|
+
Only used in first-person mode. The forward offset of the camera. A positive number shifts the camera forward, a negative number shifts it backward.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
get forwardOffset(): number;
|
13
|
+
```
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [HYTOPIA](./server.hytopia.md) > [PlayerCamera](./server.hytopia.playercamera.md) > [fov](./server.hytopia.playercamera.fov.md)
|
4
|
+
|
5
|
+
## HYTOPIA.PlayerCamera.fov property
|
6
|
+
|
7
|
+
The field of view of the camera.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
get fov(): number;
|
13
|
+
```
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [HYTOPIA](./server.hytopia.md) > [PlayerCamera](./server.hytopia.playercamera.md) > [hiddenModelNodes](./server.hytopia.playercamera.hiddenmodelnodes.md)
|
4
|
+
|
5
|
+
## HYTOPIA.PlayerCamera.hiddenModelNodes property
|
6
|
+
|
7
|
+
The nodes of the model the camera is attached to that will not be rendered for the player. Uses case insensitive substring matching.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
get hiddenModelNodes(): Set<string>;
|
13
|
+
```
|
@@ -0,0 +1,53 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [HYTOPIA](./server.hytopia.md) > [PlayerCamera](./server.hytopia.playercamera.md) > [lookAtEntity](./server.hytopia.playercamera.lookatentity.md)
|
4
|
+
|
5
|
+
## HYTOPIA.PlayerCamera.lookAtEntity() method
|
6
|
+
|
7
|
+
Makes the camera look at an entity. If the camera was previously tracking an entity or position, it will stop tracking.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
lookAtEntity(entity: Entity): void;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
<table><thead><tr><th>
|
18
|
+
|
19
|
+
Parameter
|
20
|
+
|
21
|
+
|
22
|
+
</th><th>
|
23
|
+
|
24
|
+
Type
|
25
|
+
|
26
|
+
|
27
|
+
</th><th>
|
28
|
+
|
29
|
+
Description
|
30
|
+
|
31
|
+
|
32
|
+
</th></tr></thead>
|
33
|
+
<tbody><tr><td>
|
34
|
+
|
35
|
+
entity
|
36
|
+
|
37
|
+
|
38
|
+
</td><td>
|
39
|
+
|
40
|
+
[Entity](./server.entity.md)
|
41
|
+
|
42
|
+
|
43
|
+
</td><td>
|
44
|
+
|
45
|
+
The entity to look at.
|
46
|
+
|
47
|
+
|
48
|
+
</td></tr>
|
49
|
+
</tbody></table>
|
50
|
+
**Returns:**
|
51
|
+
|
52
|
+
void
|
53
|
+
|
@@ -0,0 +1,53 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [server](./server.md) > [HYTOPIA](./server.hytopia.md) > [PlayerCamera](./server.hytopia.playercamera.md) > [lookAtPosition](./server.hytopia.playercamera.lookatposition.md)
|
4
|
+
|
5
|
+
## HYTOPIA.PlayerCamera.lookAtPosition() method
|
6
|
+
|
7
|
+
Makes the camera look at a position. If the camera was previously tracking an entity or position, it will stop tracking.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
lookAtPosition(position: Vector3): void;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
<table><thead><tr><th>
|
18
|
+
|
19
|
+
Parameter
|
20
|
+
|
21
|
+
|
22
|
+
</th><th>
|
23
|
+
|
24
|
+
Type
|
25
|
+
|
26
|
+
|
27
|
+
</th><th>
|
28
|
+
|
29
|
+
Description
|
30
|
+
|
31
|
+
|
32
|
+
</th></tr></thead>
|
33
|
+
<tbody><tr><td>
|
34
|
+
|
35
|
+
position
|
36
|
+
|
37
|
+
|
38
|
+
</td><td>
|
39
|
+
|
40
|
+
[Vector3](./server.vector3.md)
|
41
|
+
|
42
|
+
|
43
|
+
</td><td>
|
44
|
+
|
45
|
+
The position to look at.
|
46
|
+
|
47
|
+
|
48
|
+
</td></tr>
|
49
|
+
</tbody></table>
|
50
|
+
**Returns:**
|
51
|
+
|
52
|
+
void
|
53
|
+
|