@3dverse/livelink.core 0.4.2 → 0.5.0
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/dist/_prebuild/messages/editor/ConnectConfirmation.d.ts +18 -2
- package/dist/_prebuild/types/components.d.ts +22 -0
- package/dist/_prebuild/types/settings.d.ts +188 -0
- package/dist/sources/LivelinkCore.d.ts +7 -3
- package/dist/sources/Serializer.d.ts +20 -0
- package/dist/sources/core.d.ts +3 -1
- package/package.json +1 -1
- package/dist/sources/ComponentSerializer.d.ts +0 -16
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { UUID } from "../../../sources/types";
|
|
2
|
+
import { SettingsBaseType, SettingType } from "../../types/settings";
|
|
2
3
|
/**
|
|
3
4
|
*
|
|
4
5
|
*/
|
|
@@ -28,6 +29,21 @@ export type ComponentDescriptor = {
|
|
|
28
29
|
readonly name: string;
|
|
29
30
|
readonly size: number;
|
|
30
31
|
};
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
*/
|
|
35
|
+
export type SettingAttributeDescriptor<T extends SettingType> = {
|
|
36
|
+
readonly default: T;
|
|
37
|
+
readonly name: string;
|
|
38
|
+
readonly type: string;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
*/
|
|
43
|
+
export type SettingDescriptor<T extends SettingType> = {
|
|
44
|
+
readonly attributes: Array<SettingAttributeDescriptor<T>>;
|
|
45
|
+
readonly name: string;
|
|
46
|
+
};
|
|
31
47
|
/**
|
|
32
48
|
*
|
|
33
49
|
*/
|
|
@@ -42,8 +58,8 @@ export type ConnectConfirmation = {
|
|
|
42
58
|
readonly sceneUUID: UUID;
|
|
43
59
|
readonly selectColor: string;
|
|
44
60
|
readonly sessionUUID: UUID;
|
|
45
|
-
readonly settingDescriptions:
|
|
46
|
-
readonly settings:
|
|
61
|
+
readonly settingDescriptions: Record<SettingType, SettingDescriptor<SettingType>>;
|
|
62
|
+
readonly settings: SettingsBaseType;
|
|
47
63
|
readonly stats: SceneStats;
|
|
48
64
|
readonly undoRedo: {
|
|
49
65
|
undo: {};
|
|
@@ -51,6 +51,27 @@ export type AnimationController = Partial<{
|
|
|
51
51
|
*/
|
|
52
52
|
rootMotionEnabled: boolean;
|
|
53
53
|
}>;
|
|
54
|
+
/**
|
|
55
|
+
* Animation sequence controller with reference to an animation sequence and assigned entities.
|
|
56
|
+
*/
|
|
57
|
+
export type AnimationSequenceController = Partial<{
|
|
58
|
+
/**
|
|
59
|
+
* A reference to an animation sequence.
|
|
60
|
+
*/
|
|
61
|
+
animationSequenceRef: AssetRef<Assets.AnimationSequence>;
|
|
62
|
+
/**
|
|
63
|
+
* Track to entity map. Key is track uuid, value is the entity to assign to it.
|
|
64
|
+
*/
|
|
65
|
+
entities: Record<UUID, EntityRef>;
|
|
66
|
+
/**
|
|
67
|
+
* The speed at which to play the animation sequence. The sequence will go in reverse if set to a value lower than 0.
|
|
68
|
+
*/
|
|
69
|
+
playbackSpeed: Float;
|
|
70
|
+
/**
|
|
71
|
+
* Whether or not the animation loops when it reaches the end of the sequence.
|
|
72
|
+
*/
|
|
73
|
+
loop: boolean;
|
|
74
|
+
}>;
|
|
54
75
|
/**
|
|
55
76
|
* Links entity to bone in skeleton.
|
|
56
77
|
*/
|
|
@@ -907,6 +928,7 @@ export type VolumeRef = Partial<{
|
|
|
907
928
|
*/
|
|
908
929
|
export declare enum ComponentHash {
|
|
909
930
|
animation_controller = 2978761622,
|
|
931
|
+
animation_sequence_controller = 1078130395,
|
|
910
932
|
bone = 1352454807,
|
|
911
933
|
box_geometry = 3718707752,
|
|
912
934
|
camera = 1515175333,
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DO NOT EDIT THIS FILE MANUALLY.
|
|
3
|
+
* This file has been generated automatically from ftl-schemas
|
|
4
|
+
*/
|
|
5
|
+
import type { Vec3, UInt32, Float } from "../../sources/types";
|
|
6
|
+
/**
|
|
7
|
+
* Settings for debug lines
|
|
8
|
+
*/
|
|
9
|
+
export type DebugLines = Partial<{
|
|
10
|
+
/**
|
|
11
|
+
* Whether to draw debug lines
|
|
12
|
+
*/
|
|
13
|
+
drawDebugLines: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Whether to draw geometry of physics bodies
|
|
16
|
+
*/
|
|
17
|
+
drawPhysicsBodies: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Whether to draw physics body axes
|
|
20
|
+
*/
|
|
21
|
+
drawPhysicsBodyAxes: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Whether to draw the center of mass of physics bodies
|
|
24
|
+
*/
|
|
25
|
+
drawCenterOfMass: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Whether to draw joint-related debug lines
|
|
28
|
+
*/
|
|
29
|
+
drawJoints: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Whether to draw the skeletons of rigged characters
|
|
32
|
+
*/
|
|
33
|
+
drawSkeletons: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Whether to draw the bouding boxes of entities
|
|
36
|
+
*/
|
|
37
|
+
drawBoundingBoxes: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Whether to draw camera frustums
|
|
40
|
+
*/
|
|
41
|
+
drawCameraFrustums: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Whether to draw light-related debug lines
|
|
44
|
+
*/
|
|
45
|
+
drawLights: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Whether to draw reflection probes
|
|
48
|
+
*/
|
|
49
|
+
drawReflectionProbes: boolean;
|
|
50
|
+
}>;
|
|
51
|
+
/**
|
|
52
|
+
* Settings for the display
|
|
53
|
+
*/
|
|
54
|
+
export type Display = Partial<{
|
|
55
|
+
/**
|
|
56
|
+
* Maximum number of Frames Per Second the renderer is allowed to produce
|
|
57
|
+
*/
|
|
58
|
+
maxFPS: UInt32;
|
|
59
|
+
/**
|
|
60
|
+
* Maximum resolution of loaded textures
|
|
61
|
+
*/
|
|
62
|
+
maxTextureSize: UInt32;
|
|
63
|
+
/**
|
|
64
|
+
* Draw frame without input events
|
|
65
|
+
*/
|
|
66
|
+
forceRedraw: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Toggle debug lines
|
|
69
|
+
*/
|
|
70
|
+
drawDebugLines: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Toggle camera frustum
|
|
73
|
+
*/
|
|
74
|
+
drawCameraFrustum: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Toggle bounding box
|
|
77
|
+
*/
|
|
78
|
+
drawBoundingBox: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Toggle frustum culling
|
|
81
|
+
*/
|
|
82
|
+
enableFrustumCulling: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Toggle texture streaming
|
|
85
|
+
*/
|
|
86
|
+
enableTextureStreaming: boolean;
|
|
87
|
+
}>;
|
|
88
|
+
/**
|
|
89
|
+
* Settings for the environment
|
|
90
|
+
*/
|
|
91
|
+
export type Environment = Partial<{
|
|
92
|
+
/**
|
|
93
|
+
* Solid color used to clear the screen before drawing.
|
|
94
|
+
*/
|
|
95
|
+
clearColor: Vec3;
|
|
96
|
+
/**
|
|
97
|
+
* Color of the spherical gradient at the top of the sphere.
|
|
98
|
+
*/
|
|
99
|
+
ambientColorTop: Vec3;
|
|
100
|
+
/**
|
|
101
|
+
* Color of the spherical gradient at the bottom of the sphere.
|
|
102
|
+
*/
|
|
103
|
+
ambientColorBottom: Vec3;
|
|
104
|
+
}>;
|
|
105
|
+
/**
|
|
106
|
+
* Miscellaneous settings
|
|
107
|
+
*/
|
|
108
|
+
export type Misc = Partial<{
|
|
109
|
+
/**
|
|
110
|
+
* The maximum number of time a linker can reference itself.
|
|
111
|
+
*/
|
|
112
|
+
maxLinkersRecursionCount: UInt32;
|
|
113
|
+
}>;
|
|
114
|
+
/**
|
|
115
|
+
* Settings for the physics engine.
|
|
116
|
+
*/
|
|
117
|
+
export type Physics = Partial<{
|
|
118
|
+
/**
|
|
119
|
+
* Global gravity applied throughout the scene.
|
|
120
|
+
*/
|
|
121
|
+
gravity: Vec3;
|
|
122
|
+
/**
|
|
123
|
+
* The approximate size of objects in the simulation. This is used to estimate certain length-related tolerances.
|
|
124
|
+
*/
|
|
125
|
+
toleranceLength: Float;
|
|
126
|
+
/**
|
|
127
|
+
* The typical magnitude of velocities of objects in simulation. This is used to estimate whether a contact should be treated as bouncing or resting based on its impact velocity, and a kinetic energy threshold below which the simulation may put objects to sleep. For normal physical environments, a good choice is the approximate speed of an object falling under gravity for one second.
|
|
128
|
+
*/
|
|
129
|
+
toleranceSpeed: Float;
|
|
130
|
+
}>;
|
|
131
|
+
/**
|
|
132
|
+
* Renderer settings
|
|
133
|
+
*/
|
|
134
|
+
export type Renderer = Partial<{
|
|
135
|
+
/**
|
|
136
|
+
* Enable occlusion culling.
|
|
137
|
+
*/
|
|
138
|
+
cpuOcclusionCulling: boolean;
|
|
139
|
+
}>;
|
|
140
|
+
/**
|
|
141
|
+
* Sound settings
|
|
142
|
+
*/
|
|
143
|
+
export type Sound = Partial<{
|
|
144
|
+
/**
|
|
145
|
+
* Enable 3dverse sound.
|
|
146
|
+
*/
|
|
147
|
+
enabled: boolean;
|
|
148
|
+
}>;
|
|
149
|
+
/**
|
|
150
|
+
* Settings for the scene streaming
|
|
151
|
+
*/
|
|
152
|
+
export type Streaming = Partial<{
|
|
153
|
+
/**
|
|
154
|
+
* Scenes that enter this radius around the camera get loaded.
|
|
155
|
+
*/
|
|
156
|
+
streamingLoadingRadius: Float;
|
|
157
|
+
/**
|
|
158
|
+
* Scenes that exit this radius around the camera get unloaded.
|
|
159
|
+
*/
|
|
160
|
+
streamingUnloadingRadius: Float;
|
|
161
|
+
}>;
|
|
162
|
+
/**
|
|
163
|
+
* Settings for voxel rendering
|
|
164
|
+
*/
|
|
165
|
+
export type Voxel = Partial<{
|
|
166
|
+
/**
|
|
167
|
+
* Maximum number of color samples used to compute the color LUT.
|
|
168
|
+
*/
|
|
169
|
+
maxNumberAlbedoValues: UInt32;
|
|
170
|
+
}>;
|
|
171
|
+
/**
|
|
172
|
+
*
|
|
173
|
+
*/
|
|
174
|
+
export type SettingsBaseType = Partial<{
|
|
175
|
+
debug_lines: DebugLines;
|
|
176
|
+
display: Display;
|
|
177
|
+
environment: Environment;
|
|
178
|
+
misc: Misc;
|
|
179
|
+
physics: Physics;
|
|
180
|
+
renderer: Renderer;
|
|
181
|
+
sound: Sound;
|
|
182
|
+
streaming: Streaming;
|
|
183
|
+
voxel: Voxel;
|
|
184
|
+
}>;
|
|
185
|
+
/**
|
|
186
|
+
*
|
|
187
|
+
*/
|
|
188
|
+
export type SettingType = keyof SettingsBaseType;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { AssignClientToScriptMessage, ClientConfig, ClientConfigResponse, FireEventMessage, HighlightEntitiesMessage, InputState, RemoveComponentsCommand, ScreenSpaceRayQuery, ScreenSpaceRayResult, SkeletonPoseMessage, UpdateAnimationSequenceStateMessage, UpdateEntitiesFromJsonMessage, ViewportConfigs } from "../_prebuild/messages/gateway";
|
|
2
|
-
import {
|
|
2
|
+
import { Serializer } from "./Serializer";
|
|
3
3
|
import { RTID, UUID, Vec2i } from "./types";
|
|
4
4
|
import { EntityInterface } from "./interfaces/EntityInterface";
|
|
5
5
|
import { SessionInterface } from "./interfaces/SessionInterface";
|
|
6
6
|
import { EditorEntity, EntityCreationOptions, UpdateComponentsCommand } from "../_prebuild/messages/editor";
|
|
7
|
+
import { SettingsBaseType } from "../_prebuild/types/settings";
|
|
7
8
|
/**
|
|
8
9
|
* The LivelinkCore interface.
|
|
9
10
|
*
|
|
@@ -20,10 +21,13 @@ export declare class LivelinkCore {
|
|
|
20
21
|
/**
|
|
21
22
|
* Connect to the session
|
|
22
23
|
*/
|
|
23
|
-
connect({ session, editor_url
|
|
24
|
+
connect({ session, editor_url }: {
|
|
24
25
|
session: SessionInterface;
|
|
25
26
|
editor_url: string;
|
|
26
|
-
}): Promise<
|
|
27
|
+
}): Promise<{
|
|
28
|
+
settings: SettingsBaseType;
|
|
29
|
+
serializer: Serializer;
|
|
30
|
+
}>;
|
|
27
31
|
/**
|
|
28
32
|
* Closes the connections to the gateway and the editor.
|
|
29
33
|
*/
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ComponentDescriptor, SettingDescriptor } from "../_prebuild/messages/editor";
|
|
2
|
+
import { ComponentType } from "../_prebuild/types/components";
|
|
3
|
+
import { SettingType } from "../_prebuild/types/settings";
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
export declare class Serializer {
|
|
8
|
+
#private;
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
readonly component_names: Array<ComponentType>;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
constructor({ component_descriptors, settings_descriptors, }: {
|
|
17
|
+
component_descriptors: Record<string, ComponentDescriptor>;
|
|
18
|
+
settings_descriptors: Record<string, SettingDescriptor<SettingType>>;
|
|
19
|
+
});
|
|
20
|
+
}
|
package/dist/sources/core.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export * from "./LivelinkCore";
|
|
2
|
-
export * from "./
|
|
2
|
+
export * from "./Serializer";
|
|
3
3
|
export * from "./types";
|
|
4
4
|
export * from "./interfaces";
|
|
5
5
|
export type { ComponentHash, ComponentType } from "../_prebuild/types/components";
|
|
6
6
|
export * as Components from "../_prebuild/types/components";
|
|
7
|
+
export type { SettingsBaseType, SettingType } from "../_prebuild/types/settings";
|
|
8
|
+
export * as Settings from "../_prebuild/types/settings";
|
|
7
9
|
export * as CoreEnums from "../_prebuild/enums";
|
|
8
10
|
export * from "../_prebuild/messages/editor";
|
|
9
11
|
export * from "../_prebuild/messages/gateway";
|
package/package.json
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ComponentDescriptor } from "../_prebuild/messages/editor";
|
|
2
|
-
import { ComponentType } from "../_prebuild/types/components";
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
export declare class ComponentSerializer {
|
|
7
|
-
#private;
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
*/
|
|
11
|
-
readonly component_names: Array<ComponentType>;
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
*/
|
|
15
|
-
constructor(descriptors: Record<string, ComponentDescriptor>);
|
|
16
|
-
}
|