@hytopia.com/server-protocol 1.0.25 → 1.0.27
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/schemas/RigidBody.ts +39 -6
- package/schemas/World.ts +3 -1
- package/schemas/index.ts +0 -1
- package/schemas/RigidBodyDesc.ts +0 -47
package/package.json
CHANGED
package/schemas/RigidBody.ts
CHANGED
|
@@ -1,18 +1,51 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { colliderSchema } from './Collider';
|
|
2
|
+
import { vectorSchema } from './Vector';
|
|
3
|
+
import { vectorBooleanSchema } from './VectorBoolean'
|
|
2
4
|
import type { JSONSchemaType } from 'ajv';
|
|
3
|
-
import {
|
|
5
|
+
import type { ColliderSchema } from './Collider';
|
|
6
|
+
import type { VectorSchema } from './Vector';
|
|
7
|
+
import type { VectorBooleanSchema } from './VectorBoolean';
|
|
4
8
|
|
|
5
9
|
export type RigidBodySchema = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
ad?: number; // angular dampening
|
|
11
|
+
av?: VectorSchema; // angular velocity
|
|
12
|
+
b?: number; // body type
|
|
13
|
+
c?: ColliderSchema[]; // collider desc
|
|
14
|
+
d?: number; // dominance group
|
|
15
|
+
ce?: boolean; // ccd enabled
|
|
16
|
+
en?: boolean; // enabled
|
|
17
|
+
er?: VectorBooleanSchema; // enabled rotations
|
|
18
|
+
et?: VectorBooleanSchema; // enabled translations
|
|
19
|
+
g?: number; // gravity scaling
|
|
20
|
+
h?: number; // rigid body handle for rapier
|
|
21
|
+
ld?: number; // linear damping
|
|
22
|
+
lv?: VectorSchema; // linear velocity
|
|
23
|
+
rm?: boolean; // removed
|
|
24
|
+
sl?: boolean; // sleeping
|
|
25
|
+
scp?: number; // soft ccd prediction
|
|
26
|
+
t?: VectorSchema; // translation
|
|
27
|
+
};
|
|
9
28
|
|
|
10
29
|
export const rigidBodySchema: JSONSchemaType<RigidBodySchema> = {
|
|
11
30
|
type: 'object',
|
|
12
31
|
properties: {
|
|
32
|
+
ad: { type: 'number', nullable: true },
|
|
33
|
+
av: { ...vectorSchema, nullable: true },
|
|
34
|
+
b: { type: 'number', nullable: true },
|
|
35
|
+
c: { type: 'array', items: colliderSchema, nullable: true },
|
|
36
|
+
d: { type: 'number', nullable: true },
|
|
37
|
+
ce: { type: 'boolean', nullable: true },
|
|
38
|
+
en: { type: 'boolean', nullable: true },
|
|
39
|
+
er: { ...vectorBooleanSchema, nullable: true },
|
|
40
|
+
et: { ...vectorBooleanSchema, nullable: true },
|
|
41
|
+
g: { type: 'number', nullable: true },
|
|
13
42
|
h: { type: 'number', nullable: true },
|
|
43
|
+
ld: { type: 'number', nullable: true },
|
|
44
|
+
lv: { ...vectorSchema, nullable: true },
|
|
14
45
|
rm: { type: 'boolean', nullable: true },
|
|
15
|
-
|
|
46
|
+
sl: { type: 'boolean', nullable: true },
|
|
47
|
+
scp: { type: 'number', nullable: true },
|
|
48
|
+
t: { ...vectorSchema, nullable: true },
|
|
16
49
|
},
|
|
17
50
|
additionalProperties: false,
|
|
18
51
|
}
|
package/schemas/World.ts
CHANGED
|
@@ -4,6 +4,7 @@ export type WorldSchema = {
|
|
|
4
4
|
i: number; // id
|
|
5
5
|
f?: boolean; // focused
|
|
6
6
|
n?: string; // name
|
|
7
|
+
s?: string; // skyboxUri
|
|
7
8
|
};
|
|
8
9
|
|
|
9
10
|
export const worldSchema: JSONSchemaType<WorldSchema> = {
|
|
@@ -11,7 +12,8 @@ export const worldSchema: JSONSchemaType<WorldSchema> = {
|
|
|
11
12
|
properties: {
|
|
12
13
|
i: { type: 'number' },
|
|
13
14
|
f: { type: 'boolean', nullable: true },
|
|
14
|
-
n: { type: 'string', nullable: true }
|
|
15
|
+
n: { type: 'string', nullable: true },
|
|
16
|
+
s: { type: 'string', nullable: true }
|
|
15
17
|
},
|
|
16
18
|
required: [ 'i' ],
|
|
17
19
|
additionalProperties: false,
|
package/schemas/index.ts
CHANGED
package/schemas/RigidBodyDesc.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { colliderSchema } from './Collider';
|
|
2
|
-
import { vectorSchema } from './Vector';
|
|
3
|
-
import { vectorBooleanSchema } from './VectorBoolean'
|
|
4
|
-
import type { JSONSchemaType } from 'ajv';
|
|
5
|
-
import type { ColliderSchema } from './Collider';
|
|
6
|
-
import type { VectorSchema } from './Vector';
|
|
7
|
-
import type { VectorBooleanSchema } from './VectorBoolean';
|
|
8
|
-
|
|
9
|
-
export type RigidBodyDescSchema = {
|
|
10
|
-
ad?: number; // angular dampening
|
|
11
|
-
av?: VectorSchema; // angular velocity
|
|
12
|
-
b?: number; // body type
|
|
13
|
-
c?: ColliderSchema[]; // colliders
|
|
14
|
-
d?: number; // dominance group
|
|
15
|
-
ce?: boolean; // ccd enabled
|
|
16
|
-
en?: boolean; // enabled
|
|
17
|
-
er?: VectorBooleanSchema; // enabled rotations
|
|
18
|
-
et?: VectorBooleanSchema; // enabled translations
|
|
19
|
-
g?: number; // gravity scaling
|
|
20
|
-
ld?: number; // linear damping
|
|
21
|
-
lv?: VectorSchema; // linear velocity
|
|
22
|
-
sl?: boolean; // sleeping
|
|
23
|
-
scp?: number; // soft ccd prediction
|
|
24
|
-
t?: VectorSchema; // translation
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const rigidBodyDescSchema: JSONSchemaType<RigidBodyDescSchema> = {
|
|
28
|
-
type: 'object',
|
|
29
|
-
properties: {
|
|
30
|
-
ad: { type: 'number', nullable: true },
|
|
31
|
-
av: { ...vectorSchema, nullable: true },
|
|
32
|
-
b: { type: 'number', nullable: true },
|
|
33
|
-
c: { type: 'array', items: colliderSchema, nullable: true },
|
|
34
|
-
d: { type: 'number', nullable: true },
|
|
35
|
-
ce: { type: 'boolean', nullable: true },
|
|
36
|
-
en: { type: 'boolean', nullable: true },
|
|
37
|
-
er: { ...vectorBooleanSchema, nullable: true },
|
|
38
|
-
et: { ...vectorBooleanSchema, nullable: true },
|
|
39
|
-
g: { type: 'number', nullable: true },
|
|
40
|
-
ld: { type: 'number', nullable: true },
|
|
41
|
-
lv: { ...vectorSchema, nullable: true },
|
|
42
|
-
sl: { type: 'boolean', nullable: true },
|
|
43
|
-
scp: { type: 'number', nullable: true },
|
|
44
|
-
t: { ...vectorSchema, nullable: true },
|
|
45
|
-
},
|
|
46
|
-
additionalProperties: false,
|
|
47
|
-
}
|