@hytopia.com/server-protocol 1.4.49-dev1 → 1.4.51

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hytopia.com/server-protocol",
3
- "version": "1.4.49-dev1",
3
+ "version": "1.4.51",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/schemas/Entity.ts CHANGED
@@ -1,10 +1,8 @@
1
1
  import { rgbColorSchema } from './RgbColor';
2
- import { modelAnimationSchema } from './ModelAnimation';
3
2
  import { modelNodeOverrideSchema } from './ModelNodeOverride';
4
3
  import { quaternionSchema } from './Quaternion';
5
4
  import { vectorSchema } from './Vector';
6
5
  import type { JSONSchemaType } from 'ajv';
7
- import type { ModelAnimationSchema } from './ModelAnimation';
8
6
  import type { ModelNodeOverrideSchema } from './ModelNodeOverride';
9
7
  import type { QuaternionSchema } from './Quaternion';
10
8
  import type { RgbColorSchema } from './RgbColor';
@@ -12,6 +10,10 @@ import type { VectorSchema } from './Vector';
12
10
 
13
11
  export type EntitySchema = {
14
12
  i: number; // entity id
13
+ al?: string[]; // model animations looped
14
+ ao?: string[]; // model animations one shot
15
+ ap?: number; // model animations playback rate
16
+ as?: string[]; // model animations stop
15
17
  bh?: VectorSchema; // block half extents
16
18
  bt?: string; // block texture uri
17
19
  e?: boolean; // environmental
@@ -19,7 +21,6 @@ export type EntitySchema = {
19
21
  ei?: number; // emissive intensity
20
22
  h?: string[]; // model nodes to hide by partial case insensitive match of gltf node names - merge into node overrides?
21
23
  m?: string; // model uri
22
- ma?: ModelAnimationSchema[]; // model animations
23
24
  mo?: ModelNodeOverrideSchema[]; // model node overrides
24
25
  mt?: string; // model texture uri (custom override)
25
26
  n?: string; // name
@@ -50,7 +51,6 @@ export const entitySchema: JSONSchemaType<EntitySchema> = {
50
51
  ei: { type: 'number', nullable: true },
51
52
  h: { type: 'array', items: { type: 'string' }, nullable: true },
52
53
  m: { type: 'string', nullable: true },
53
- ma: { type: 'array', items: { ...modelAnimationSchema }, nullable: true },
54
54
  mo: { type: 'array', items: { ...modelNodeOverrideSchema }, nullable: true },
55
55
  mt: { type: 'string', nullable: true },
56
56
  n: { type: 'string', nullable: true },
@@ -20,11 +20,14 @@ export type ParticleEmitterSchema = {
20
20
  en?: string; // entity attachment node name, follows entity node name
21
21
  g?: VectorSchema; // gravity per axis as vector3
22
22
  l?: number; // lifetime, in seconds
23
+ le?: boolean; // lock to emitter, particles follow emitter position
23
24
  lv?: number; // lifetime variance, in seconds
24
25
  mp?: number; // max particles
25
26
  o?: VectorSchema; // offset
26
27
  oe?: number; // opacity end
27
28
  oev?: number; // opacity end variance
29
+ or?: number; // orientation mode: 0=billboard, 1=billboardY, 2=fixed
30
+ ofr?: VectorSchema; // orientation fixed rotation in degrees (x, y, z)
28
31
  os?: number; // opacity start
29
32
  osv?: number; // opacity start variance
30
33
  p?: VectorSchema; // spatial position
@@ -61,11 +64,14 @@ export const particleEmitterSchema: JSONSchemaType<ParticleEmitterSchema> = {
61
64
  en: { type: 'string', nullable: true },
62
65
  g: { ...vectorSchema, nullable: true },
63
66
  l: { type: 'number', nullable: true },
67
+ le: { type: 'boolean', nullable: true },
64
68
  lv: { type: 'number', nullable: true },
65
69
  mp: { type: 'number', nullable: true },
66
70
  o: { ...vectorSchema, nullable: true },
67
71
  oe: { type: 'number', nullable: true },
68
72
  oev: { type: 'number', nullable: true },
73
+ or: { type: 'number', nullable: true },
74
+ ofr: { ...vectorSchema, nullable: true },
69
75
  os: { type: 'number', nullable: true },
70
76
  osv: { type: 'number', nullable: true },
71
77
  p: { ...vectorSchema, nullable: true },
package/schemas/index.ts CHANGED
@@ -18,7 +18,6 @@ export * from './HexColor';
18
18
  export * from './Input';
19
19
  export * from './Light';
20
20
  export * from './Lights';
21
- export * from './ModelAnimation';
22
21
  export * from './ModelNodeOverride';
23
22
  export * from './NotificationPermissionRequest';
24
23
  export * from './ParticleEmitter';
@@ -1,28 +0,0 @@
1
- import { JSONSchemaType } from 'ajv';
2
-
3
- export type ModelAnimationSchema = {
4
- n: string; // animation name
5
- b?: 'normal' | 'additive'; // blend mode
6
- l?: boolean; // loop
7
- p?: boolean; // pause
8
- pr?: number; // playback rate
9
- r?: boolean; // restart
10
- s?: boolean; // stop
11
- w?: number; // weight
12
- }
13
-
14
- export const modelAnimationSchema: JSONSchemaType<ModelAnimationSchema> = {
15
- type: 'object',
16
- properties: {
17
- n: { type: 'string' },
18
- b: { type: 'string', enum: [ 'normal', 'additive' ], nullable: true },
19
- l: { type: 'boolean', nullable: true },
20
- p: { type: 'boolean', nullable: true },
21
- pr: { type: 'number', nullable: true },
22
- r: { type: 'boolean', nullable: true },
23
- s: { type: 'boolean', nullable: true },
24
- w: { type: 'number', nullable: true },
25
- },
26
- required: [ 'n' ],
27
- additionalProperties: false,
28
- }