@hytopia.com/server-protocol 1.3.7 → 1.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packets/outbound/Camera.ts +12 -0
- package/schemas/Camera.ts +5 -5
package/package.json
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { definePacket, PacketId } from '../PacketCore';
|
|
2
|
+
import type { IPacket } from '../PacketCore';
|
|
3
|
+
import { cameraSchema } from '../../schemas';
|
|
4
|
+
import type { CameraSchema } from '../../schemas';
|
|
5
|
+
import type { WorldTick } from '../PacketCore';
|
|
6
|
+
|
|
7
|
+
export type CameraPacket = IPacket<typeof PacketId.CAMERA, CameraSchema> & [WorldTick];
|
|
8
|
+
|
|
9
|
+
export const cameraPacketDefinition = definePacket(
|
|
10
|
+
PacketId.CAMERA,
|
|
11
|
+
cameraSchema,
|
|
12
|
+
)
|
package/schemas/Camera.ts
CHANGED
|
@@ -6,13 +6,13 @@ export type CameraSchema = {
|
|
|
6
6
|
f?: boolean // first person mode
|
|
7
7
|
t?: boolean // third person mode
|
|
8
8
|
e?: number // entity id to fix camera to
|
|
9
|
-
|
|
9
|
+
et?: number // entity id to track
|
|
10
10
|
fo?: number // film offset, + value shifts right, - shifts left
|
|
11
11
|
ffo?: number // first person forward offset, moves camera in (+) or out (-) relative to camera position
|
|
12
12
|
fv?: number // field of view
|
|
13
13
|
p?: VectorSchema // position to fix camera at
|
|
14
|
-
|
|
15
|
-
h?: string[] // player model parts to hide by partial case insensitive match of gltf
|
|
14
|
+
pt?: VectorSchema // position to track
|
|
15
|
+
h?: string[] // player model parts to hide by partial case insensitive match of gltf node names
|
|
16
16
|
o?: VectorSchema // offset - positional relative to target
|
|
17
17
|
z?: number // zoom
|
|
18
18
|
}
|
|
@@ -23,12 +23,12 @@ export const cameraSchema: JSONSchemaType<CameraSchema> = {
|
|
|
23
23
|
f: { type: 'boolean', nullable: true },
|
|
24
24
|
t: { type: 'boolean', nullable: true },
|
|
25
25
|
e: { type: 'number', nullable: true },
|
|
26
|
-
|
|
26
|
+
et: { type: 'number', nullable: true },
|
|
27
27
|
fo: { type: 'number', nullable: true },
|
|
28
28
|
ffo: { type: 'number', nullable: true },
|
|
29
29
|
fv: { type: 'number', nullable: true },
|
|
30
30
|
p: { ...vectorSchema, nullable: true },
|
|
31
|
-
|
|
31
|
+
pt: { ...vectorSchema, nullable: true },
|
|
32
32
|
h: { type: 'array', items: { type: 'string' }, nullable: true },
|
|
33
33
|
o: { ...vectorSchema, nullable: true },
|
|
34
34
|
z: { type: 'number', nullable: true },
|