@hytopia.com/server-protocol 1.3.33 → 1.3.35

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.3.33",
3
+ "version": "1.3.35",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -7,10 +7,10 @@ export type SceneUISchema = {
7
7
  e?: number; // entity attachment, follows entity id
8
8
  o?: VectorSchema; // offset
9
9
  p?: VectorSchema; // spatial position of ui
10
- rd?: number; // reference distance
11
10
  rm?: boolean; // remove/removed
12
11
  s?: object; // state
13
12
  t?: string; // template id
13
+ v?: number; // view distance
14
14
  }
15
15
 
16
16
  export const sceneUISchema: JSONSchemaType<SceneUISchema> = {
@@ -20,10 +20,10 @@ export const sceneUISchema: JSONSchemaType<SceneUISchema> = {
20
20
  e: { type: 'number', nullable: true },
21
21
  o: { ...vectorSchema, nullable: true },
22
22
  p: { ...vectorSchema, nullable: true },
23
- rd: { type: 'number', nullable: true },
24
23
  rm: { type: 'boolean', nullable: true },
25
24
  s: { type: 'object', nullable: true },
26
25
  t: { type: 'string', nullable: true },
26
+ v: { type: 'number', nullable: true },
27
27
  },
28
28
  required: ['i'],
29
29
  additionalProperties: false,
package/schemas/World.ts CHANGED
@@ -1,17 +1,31 @@
1
+ import { rgbColorSchema } from './RgbColor';
2
+ import { vectorSchema } from './Vector';
1
3
  import type { JSONSchemaType } from 'ajv';
4
+ import type { RgbColorSchema } from './RgbColor';
5
+ import type { VectorSchema } from './Vector';
2
6
 
3
7
  export type WorldSchema = {
4
- i: number; // id
5
- f?: boolean; // focused
6
- n?: string; // name
7
- s?: string; // skyboxUri
8
- t?: number; // timestep (seconds)
8
+ i: number; // id
9
+ ac?: RgbColorSchema; // ambient light color
10
+ ai?: number; // ambient light intensity
11
+ dc?: RgbColorSchema; // directional light color
12
+ di?: number; // directional light intensity
13
+ dp?: VectorSchema; // directional light position
14
+ f?: boolean; // focused
15
+ n?: string; // name
16
+ s?: string; // skyboxUri
17
+ t?: number; // timestep (seconds)
9
18
  };
10
19
 
11
20
  export const worldSchema: JSONSchemaType<WorldSchema> = {
12
21
  type: 'object',
13
22
  properties: {
14
23
  i: { type: 'number' },
24
+ ac: { ...rgbColorSchema, nullable: true },
25
+ ai: { type: 'number', nullable: true },
26
+ dc: { ...rgbColorSchema, nullable: true },
27
+ di: { type: 'number', nullable: true },
28
+ dp: { ...vectorSchema, nullable: true },
15
29
  f: { type: 'boolean', nullable: true },
16
30
  n: { type: 'string', nullable: true },
17
31
  s: { type: 'string', nullable: true },