@wonderlandengine/editor-api 1.2.0-dev.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/README.md +24 -0
- package/dist/data.d.ts +671 -0
- package/dist/data.js +669 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +14 -0
- package/dist/native.d.ts +24 -0
- package/dist/native.js +1 -0
- package/dist/tools.d.ts +24 -0
- package/dist/tools.js +42 -0
- package/dist/ui.d.ts +53 -0
- package/dist/ui.js +79 -0
- package/package.json +46 -0
package/dist/data.js
ADDED
@@ -0,0 +1,669 @@
|
|
1
|
+
/** Project settings */
|
2
|
+
export class ProjectSettings {
|
3
|
+
name = '';
|
4
|
+
customIndexHtml = false;
|
5
|
+
extraFilesFolder = 'static';
|
6
|
+
packageForStreaming = false;
|
7
|
+
}
|
8
|
+
/** Sky settings */
|
9
|
+
export class SkySettings {
|
10
|
+
enabled = false;
|
11
|
+
material = null;
|
12
|
+
}
|
13
|
+
/** Bloom settings */
|
14
|
+
export class BloomSettings {
|
15
|
+
enabled = false;
|
16
|
+
kernelSize = 6;
|
17
|
+
passes = 1;
|
18
|
+
threshold = 1.25;
|
19
|
+
intensity = 2.0;
|
20
|
+
}
|
21
|
+
/** HDR settings */
|
22
|
+
export class HdrSettings {
|
23
|
+
exposure = 1.5;
|
24
|
+
}
|
25
|
+
/** Texture streaming settings */
|
26
|
+
export class TextureStreamingSettings {
|
27
|
+
maxCacheSize = 1024;
|
28
|
+
maxUploadPerFrame = 10;
|
29
|
+
}
|
30
|
+
/** Rendering settings */
|
31
|
+
export class RenderingSettings {
|
32
|
+
textureAtlasSize = [8192, 4096];
|
33
|
+
compressedTextureAtlasSize = [16384, 8192];
|
34
|
+
clearColor = [0.168, 0.168, 0.168, 1.0];
|
35
|
+
maxShadows = 4;
|
36
|
+
usePreZ = false;
|
37
|
+
useMultiDraw = false;
|
38
|
+
useFrustumCulling = true;
|
39
|
+
sky = new SkySettings();
|
40
|
+
bloom = new BloomSettings();
|
41
|
+
hdr = new HdrSettings();
|
42
|
+
textureStreaming = new TextureStreamingSettings();
|
43
|
+
}
|
44
|
+
/** Camera settings */
|
45
|
+
export class CameraSettings {
|
46
|
+
near = 0.02;
|
47
|
+
far = 100.0;
|
48
|
+
}
|
49
|
+
/** Editor settings */
|
50
|
+
export class EditorSettings {
|
51
|
+
serverPort = 8080;
|
52
|
+
serverCOEP = 'require-corp';
|
53
|
+
camera = new CameraSettings();
|
54
|
+
ids = 'incremental-number';
|
55
|
+
}
|
56
|
+
/** Plugins settings */
|
57
|
+
export class PluginsSettings {
|
58
|
+
}
|
59
|
+
/** WebXR settings */
|
60
|
+
export class WebXRSettings {
|
61
|
+
optionalFeatures = {
|
62
|
+
'local': true,
|
63
|
+
'local-floor': false,
|
64
|
+
'bounded-floor': false,
|
65
|
+
'unbounded': false,
|
66
|
+
'hand-tracking': true,
|
67
|
+
'hit-test': true,
|
68
|
+
'plane-detection': false,
|
69
|
+
'light-estimation': false,
|
70
|
+
'anchors': false,
|
71
|
+
'occlusion': false,
|
72
|
+
'marker-tracking': false,
|
73
|
+
'extraFeatures': '',
|
74
|
+
};
|
75
|
+
requiredFeatures = {
|
76
|
+
'local': true,
|
77
|
+
'local-floor': false,
|
78
|
+
'bounded-floor': false,
|
79
|
+
'unbounded': false,
|
80
|
+
'hand-tracking': false,
|
81
|
+
'hit-test': false,
|
82
|
+
'plane-detection': false,
|
83
|
+
'light-estimation': false,
|
84
|
+
'anchors': false,
|
85
|
+
'occlusion': false,
|
86
|
+
'marker-tracking': false,
|
87
|
+
'extraFeatures': '',
|
88
|
+
};
|
89
|
+
}
|
90
|
+
/** PWA settings */
|
91
|
+
export class PWASettings {
|
92
|
+
enable = false;
|
93
|
+
customServiceWorker = false;
|
94
|
+
customManifest = false;
|
95
|
+
display = 'standalone';
|
96
|
+
ovrPackageName = '';
|
97
|
+
appIcon = null;
|
98
|
+
}
|
99
|
+
/** Runtime settings */
|
100
|
+
export class RuntimeSettings {
|
101
|
+
visualizeColliders = false;
|
102
|
+
visualizePhysX = false;
|
103
|
+
visualizeOverdraw = false;
|
104
|
+
googleAnalytics = '';
|
105
|
+
googleAnalyticsSecondary = '';
|
106
|
+
enableRuntimeGltf = false;
|
107
|
+
viewObject = null;
|
108
|
+
webxr = new WebXRSettings();
|
109
|
+
xrButtonColor = 'white';
|
110
|
+
pwa = new PWASettings();
|
111
|
+
}
|
112
|
+
/** Bundling type enum */
|
113
|
+
export var BundlingType;
|
114
|
+
(function (BundlingType) {
|
115
|
+
BundlingType["None"] = "none";
|
116
|
+
BundlingType["Esbuild"] = "esbuild";
|
117
|
+
BundlingType["Npm"] = "npm";
|
118
|
+
})(BundlingType || (BundlingType = {}));
|
119
|
+
/** Scripting settings */
|
120
|
+
export class ScriptingSettings {
|
121
|
+
sourcePaths = [];
|
122
|
+
libraryPaths = [];
|
123
|
+
bundlingType = BundlingType.Esbuild;
|
124
|
+
npmScript = 'build';
|
125
|
+
esbuildFlags = '--format=esm';
|
126
|
+
entryPoint = 'js/index.js';
|
127
|
+
}
|
128
|
+
/** VR settings */
|
129
|
+
export class VRSettings {
|
130
|
+
enable = true;
|
131
|
+
rightEyeObject = null;
|
132
|
+
leftEyeObject = null;
|
133
|
+
framebufferScaleFactor = 1.0;
|
134
|
+
}
|
135
|
+
/** Physics settings */
|
136
|
+
export class PhysXSettings {
|
137
|
+
enable = false;
|
138
|
+
maxTimestep = 0.05;
|
139
|
+
contactOffset = 0.02;
|
140
|
+
restOffset = 0.0;
|
141
|
+
groupNames = {
|
142
|
+
'0': 'static',
|
143
|
+
'1': 'dynamic',
|
144
|
+
'2': 'ui',
|
145
|
+
'3': 'nav',
|
146
|
+
'4': 'player',
|
147
|
+
'5': 'enemy',
|
148
|
+
'6': 'group6',
|
149
|
+
'7': 'group7',
|
150
|
+
};
|
151
|
+
gravity = [0.0, -9.81, 0.0];
|
152
|
+
lengthToleranceScale = 1.0;
|
153
|
+
speedToleranceScale = 10.0;
|
154
|
+
}
|
155
|
+
/** AR settings */
|
156
|
+
export class ARSettings {
|
157
|
+
enable = false;
|
158
|
+
}
|
159
|
+
/** Localization settings */
|
160
|
+
export class LocalizationSettings {
|
161
|
+
enableZipCompression = false;
|
162
|
+
format = 'i18next';
|
163
|
+
languagesFolder = 'languages';
|
164
|
+
defaultLanguage = 'en';
|
165
|
+
}
|
166
|
+
/** Settings for the currently open project */
|
167
|
+
export class Settings {
|
168
|
+
project = new ProjectSettings();
|
169
|
+
rendering = new RenderingSettings();
|
170
|
+
editor = new EditorSettings();
|
171
|
+
runtime = new RuntimeSettings();
|
172
|
+
scripting = new ScriptingSettings();
|
173
|
+
plugins = new PluginsSettings();
|
174
|
+
vr = new VRSettings();
|
175
|
+
ar = new ARSettings();
|
176
|
+
physx = new PhysXSettings();
|
177
|
+
localization = new LocalizationSettings();
|
178
|
+
}
|
179
|
+
/** Image compression type */
|
180
|
+
export var ImageCompressionType;
|
181
|
+
(function (ImageCompressionType) {
|
182
|
+
ImageCompressionType["None"] = "etc1s";
|
183
|
+
ImageCompressionType["ETC1s"] = "etc1s";
|
184
|
+
ImageCompressionType["UASTC"] = "uastc";
|
185
|
+
})(ImageCompressionType || (ImageCompressionType = {}));
|
186
|
+
/** Image resource */
|
187
|
+
export class ImageResource {
|
188
|
+
name = 'image';
|
189
|
+
maxSize = [8192, 8192];
|
190
|
+
compression = ImageCompressionType.ETC1s;
|
191
|
+
stream = true;
|
192
|
+
isProbe = false;
|
193
|
+
isSpecularProbe = false;
|
194
|
+
}
|
195
|
+
/** Texture resource */
|
196
|
+
export class TextureResource {
|
197
|
+
name = 'texture';
|
198
|
+
image = null;
|
199
|
+
type = 1;
|
200
|
+
minFilter = 0;
|
201
|
+
magFilter = 0;
|
202
|
+
mipFilter = 0;
|
203
|
+
wrapping = [0, 0, 0];
|
204
|
+
}
|
205
|
+
/** Shader stage enum */
|
206
|
+
export var ShaderStage;
|
207
|
+
(function (ShaderStage) {
|
208
|
+
ShaderStage["Fragment"] = "fragment";
|
209
|
+
ShaderStage["Vertex"] = "vertex";
|
210
|
+
})(ShaderStage || (ShaderStage = {}));
|
211
|
+
/** Shader type enum */
|
212
|
+
export var ShaderType;
|
213
|
+
(function (ShaderType) {
|
214
|
+
ShaderType["Forward"] = "forward";
|
215
|
+
ShaderType["Fullscreen"] = "fullscreen";
|
216
|
+
})(ShaderType || (ShaderType = {}));
|
217
|
+
/** Shader resource */
|
218
|
+
export class ShaderResource {
|
219
|
+
name = 'shader';
|
220
|
+
stage = ShaderStage.Fragment;
|
221
|
+
type = ShaderType.Forward;
|
222
|
+
packageUnused = false;
|
223
|
+
}
|
224
|
+
/** Mesh resource */
|
225
|
+
export class MeshResource {
|
226
|
+
name = 'mesh';
|
227
|
+
simplify = false;
|
228
|
+
simplifyTarget = 0.5;
|
229
|
+
simplifyTargetError = 0.02;
|
230
|
+
importScaling = 1.0;
|
231
|
+
}
|
232
|
+
/** Material properties for the default Phong pipeline */
|
233
|
+
export class PhongMaterial {
|
234
|
+
ambientColor = [0.05, 0.05, 0.05, 1.0];
|
235
|
+
diffuseTexture = null;
|
236
|
+
diffuseColor = [1, 1, 1, 1.0];
|
237
|
+
specularColor = [1.0, 1.0, 1.0, 0.0];
|
238
|
+
emissiveTexture = null;
|
239
|
+
emissiveColor = [0.0, 0.0, 0.0, 1.0];
|
240
|
+
fogColor = [1.0, 1.0, 1.0, 0.0];
|
241
|
+
normalTexture = null;
|
242
|
+
lightmapTexture = null;
|
243
|
+
lightmapFactor = 1.0;
|
244
|
+
shininess = 2;
|
245
|
+
alphaMaskThreshold = 0.5;
|
246
|
+
alphaMaskTexture = null;
|
247
|
+
}
|
248
|
+
/** Material properties for the default Phong pipeline */
|
249
|
+
export class PhysicalMaterial {
|
250
|
+
albedoColor = [1.0, 1.0, 1.0, 1.0];
|
251
|
+
emissiveTexture = null;
|
252
|
+
emissiveColor = [0.0, 0.0, 0.0, 1.0];
|
253
|
+
albedoTexture = null;
|
254
|
+
metallicFactor = 1.0;
|
255
|
+
roughnessFactor = 1.0;
|
256
|
+
roughnessMetallicTexture = null;
|
257
|
+
specularProbeTexture = null;
|
258
|
+
irradianceProbeTexture = null;
|
259
|
+
normalTexture = null;
|
260
|
+
occlusionTexture = null;
|
261
|
+
occlusionFactor = 1.0;
|
262
|
+
alphaMaskThreshold = 0.5;
|
263
|
+
alphaMaskTexture = null;
|
264
|
+
}
|
265
|
+
/** Material properties for the default MeshVisualizer pipeline */
|
266
|
+
export class MeshVisualizerMaterial {
|
267
|
+
color = [0.5, 0.5, 0.5, 1];
|
268
|
+
wireframeColor = [1, 1, 1, 1];
|
269
|
+
}
|
270
|
+
/** Material properties for the default Flat pipeline */
|
271
|
+
export class FlatMaterial {
|
272
|
+
color = [1, 1, 1, 1];
|
273
|
+
flatTexture = null;
|
274
|
+
alphaMaskThreshold = 0.5;
|
275
|
+
alphaMaskTexture = null;
|
276
|
+
}
|
277
|
+
/** Material properties for the default Particle pipeline */
|
278
|
+
export class ParticleMaterial {
|
279
|
+
color = [1, 1, 1, 1];
|
280
|
+
mainTexture = null;
|
281
|
+
noiseTexture = null;
|
282
|
+
offsetX = 0.0;
|
283
|
+
offsetY = 0.0;
|
284
|
+
}
|
285
|
+
/** Material properties for the default DistanceFieldVector pipeline */
|
286
|
+
export class DistanceFieldVectorMaterial {
|
287
|
+
color = [1, 1, 1, 1];
|
288
|
+
outlineColor = [0, 0, 0, 1];
|
289
|
+
outlineRange = [0.4, 0.3];
|
290
|
+
vectorTexture = null;
|
291
|
+
smoothness = 0.02;
|
292
|
+
}
|
293
|
+
/** Material properties for the default Text pipeline */
|
294
|
+
export class TextMaterial {
|
295
|
+
color = [1, 1, 1, 1];
|
296
|
+
effectColor = [0, 0, 0, 1];
|
297
|
+
font = null;
|
298
|
+
}
|
299
|
+
/** Material properties for the default Sky pipeline */
|
300
|
+
export class SkyMaterial {
|
301
|
+
colorStop0 = [1, 1, 1, 1];
|
302
|
+
colorStop1 = [0.55, 0.95, 1, 1];
|
303
|
+
colorStop2 = [0.55, 0.95, 1, 1];
|
304
|
+
colorStop3 = [0.55, 0.95, 1, 1];
|
305
|
+
texture = null;
|
306
|
+
}
|
307
|
+
/** Material properties for the default Background pipeline */
|
308
|
+
export class BackgroundMaterial {
|
309
|
+
colorStop0 = [1, 1, 1, 1];
|
310
|
+
colorStop1 = [0.55, 0.95, 1, 1];
|
311
|
+
colorStop2 = [0.55, 0.95, 1, 1];
|
312
|
+
colorStop3 = [0.55, 0.95, 1, 1];
|
313
|
+
texture = null;
|
314
|
+
}
|
315
|
+
/** Material properties for the default Particle pipeline */
|
316
|
+
export class MaterialResource {
|
317
|
+
pipeline = null;
|
318
|
+
name = 'material';
|
319
|
+
Phong;
|
320
|
+
Physical;
|
321
|
+
MeshVisualizer;
|
322
|
+
Flat;
|
323
|
+
Particle;
|
324
|
+
DistanceFieldVector;
|
325
|
+
Text;
|
326
|
+
Sky;
|
327
|
+
Background;
|
328
|
+
}
|
329
|
+
/** 'animation' component configuration */
|
330
|
+
export class AnimationComponent {
|
331
|
+
preview = false;
|
332
|
+
retarget = false;
|
333
|
+
autoplay = false;
|
334
|
+
playCount = 0;
|
335
|
+
speed = 1.0;
|
336
|
+
skin = null;
|
337
|
+
animation = null;
|
338
|
+
}
|
339
|
+
/** Light type enum */
|
340
|
+
export var LightType;
|
341
|
+
(function (LightType) {
|
342
|
+
/** Point light type */
|
343
|
+
LightType["Point"] = "point";
|
344
|
+
/** Spot light type */
|
345
|
+
LightType["Spot"] = "spot";
|
346
|
+
/** Sun light type */
|
347
|
+
LightType["Sun"] = "sun";
|
348
|
+
})(LightType || (LightType = {}));
|
349
|
+
/** 'light' component configuration */
|
350
|
+
export class LightComponent {
|
351
|
+
type = LightType.Point;
|
352
|
+
color = [1.0, 1.0, 1.0];
|
353
|
+
intensity = 1;
|
354
|
+
shadowRange = 10.0;
|
355
|
+
outerAngle = 90;
|
356
|
+
innerAngle = 45;
|
357
|
+
shadows = false;
|
358
|
+
shadowBias = 0.0012;
|
359
|
+
shadowNormalBias = 0.001;
|
360
|
+
shadowTexelSize = 1.0;
|
361
|
+
cascadeCount = 4;
|
362
|
+
}
|
363
|
+
/** 'view' component configuration */
|
364
|
+
export class ViewComponent {
|
365
|
+
fov = 90;
|
366
|
+
near = 0.01;
|
367
|
+
far = 100;
|
368
|
+
}
|
369
|
+
/** Settings for a sphere physics shape */
|
370
|
+
export class PhysXSphereConfig {
|
371
|
+
radius = 0.25;
|
372
|
+
}
|
373
|
+
/** Settings for a box physics shape */
|
374
|
+
export class PhysXBoxConfig {
|
375
|
+
extents = [0.25, 0.25, 0.25];
|
376
|
+
}
|
377
|
+
/** Settings for a capsule physics shape */
|
378
|
+
export class PhysXCapsuleConfig {
|
379
|
+
radius = 0.15;
|
380
|
+
halfHeight = 0.25;
|
381
|
+
}
|
382
|
+
/** Settings for a triangle mesh physics shape */
|
383
|
+
export class PhysXTriangleMeshConfig {
|
384
|
+
mesh = null;
|
385
|
+
scaling = [1, 1, 1];
|
386
|
+
}
|
387
|
+
/** Settings for a convex mesh physics shape */
|
388
|
+
export class PhysXConvexMeshConfig {
|
389
|
+
mesh = null;
|
390
|
+
scaling = [1, 1, 1];
|
391
|
+
}
|
392
|
+
/** Physics shape type enum */
|
393
|
+
export var PhysXShapeType;
|
394
|
+
(function (PhysXShapeType) {
|
395
|
+
PhysXShapeType["Sphere"] = "sphere";
|
396
|
+
PhysXShapeType["Box"] = "box";
|
397
|
+
PhysXShapeType["Capsule"] = "capsule";
|
398
|
+
PhysXShapeType["TriangleMesh"] = "triangleMesh";
|
399
|
+
PhysXShapeType["ConvexMesh"] = "convexMesh";
|
400
|
+
})(PhysXShapeType || (PhysXShapeType = {}));
|
401
|
+
/** 'physx' component configuration */
|
402
|
+
export class PhysXComponent {
|
403
|
+
static = false;
|
404
|
+
kinematic = false;
|
405
|
+
simulate = true;
|
406
|
+
allowQuery = true;
|
407
|
+
allowSimulation = true;
|
408
|
+
mass = 1.0;
|
409
|
+
shape = PhysXShapeType.Sphere;
|
410
|
+
sphere;
|
411
|
+
box;
|
412
|
+
capsule;
|
413
|
+
triangleMesh;
|
414
|
+
convexMesh;
|
415
|
+
linearDamping = 0.0;
|
416
|
+
angularDamping = 0.05;
|
417
|
+
staticFriction = 0.5;
|
418
|
+
dynamicFriction = 0.5;
|
419
|
+
bounciness = 0.5;
|
420
|
+
gravity = true;
|
421
|
+
trigger = false;
|
422
|
+
block = 255;
|
423
|
+
groups = 255;
|
424
|
+
lockAxis = 0;
|
425
|
+
sleepOnActivate = false;
|
426
|
+
translationOffset = [0, 0, 0];
|
427
|
+
rotationOffset = [0, 0, 0, 1];
|
428
|
+
solverPositionIterations = 4;
|
429
|
+
solverVelocityIterations = 1;
|
430
|
+
}
|
431
|
+
/** 'mesh' component configuration */
|
432
|
+
export class MeshComponent {
|
433
|
+
material = null;
|
434
|
+
mesh = null;
|
435
|
+
skin = null;
|
436
|
+
}
|
437
|
+
/** Text effect type enum */
|
438
|
+
export var TextEffectType;
|
439
|
+
(function (TextEffectType) {
|
440
|
+
TextEffectType["None"] = "none";
|
441
|
+
TextEffectType["Outline"] = "outline";
|
442
|
+
})(TextEffectType || (TextEffectType = {}));
|
443
|
+
/** 'text' component configuration */
|
444
|
+
export class TextComponent {
|
445
|
+
alignment = 'center';
|
446
|
+
justification = 'middle';
|
447
|
+
characterSpacing = 0.0;
|
448
|
+
lineSpacing = 1.2;
|
449
|
+
effect = TextEffectType.None;
|
450
|
+
text = 'Wonderland Engine';
|
451
|
+
material = 'DefaultFontMaterial';
|
452
|
+
}
|
453
|
+
/** Settings for a sphere collider */
|
454
|
+
export class SphereConfig {
|
455
|
+
radius = 1.0;
|
456
|
+
}
|
457
|
+
/** Settings for a AxisAlignedBoundingBox collider */
|
458
|
+
export class AABBConfig {
|
459
|
+
extents = [1.0, 1.0, 1.0];
|
460
|
+
}
|
461
|
+
/** Settings for a box collider */
|
462
|
+
export class BoxConfig {
|
463
|
+
extents = [1.0, 1.0, 1.0];
|
464
|
+
}
|
465
|
+
/** 'collision' component configuration */
|
466
|
+
export class CollisionComponent {
|
467
|
+
collider = 'sphere';
|
468
|
+
sphere;
|
469
|
+
aabb;
|
470
|
+
box;
|
471
|
+
groups = 255;
|
472
|
+
}
|
473
|
+
/** Input type enum */
|
474
|
+
export var InputType;
|
475
|
+
(function (InputType) {
|
476
|
+
InputType["Head"] = "head";
|
477
|
+
InputType["EyeLeft"] = "eye left";
|
478
|
+
InputType["EyeRight"] = "eye right";
|
479
|
+
InputType["HandLeft"] = "hand left";
|
480
|
+
InputType["HandRight"] = "hand right";
|
481
|
+
InputType["RayLeft"] = "ray left";
|
482
|
+
InputType["RayRight"] = "ray right";
|
483
|
+
})(InputType || (InputType = {}));
|
484
|
+
/** 'input' component configuration */
|
485
|
+
export class InputComponent {
|
486
|
+
type = InputType.Head;
|
487
|
+
}
|
488
|
+
export class AnimationEvent {
|
489
|
+
time = 0.0;
|
490
|
+
name = '';
|
491
|
+
}
|
492
|
+
/** Animation resource */
|
493
|
+
export class AnimationResource {
|
494
|
+
/** Name of the animation */
|
495
|
+
name = 'animation';
|
496
|
+
/** Whether to compress the animation */
|
497
|
+
pack = true;
|
498
|
+
/** Targets influenced per track */
|
499
|
+
targets = [];
|
500
|
+
/** Animation events track */
|
501
|
+
events = [];
|
502
|
+
}
|
503
|
+
/** Component configuration */
|
504
|
+
export class ComponentConfig {
|
505
|
+
/** Component type */
|
506
|
+
type = null;
|
507
|
+
/** Whether the component is active */
|
508
|
+
active = true;
|
509
|
+
/** Configuration for animation components */
|
510
|
+
animation;
|
511
|
+
/** Configuration for collision components */
|
512
|
+
collision;
|
513
|
+
/** Configuration for input components */
|
514
|
+
input;
|
515
|
+
/** Configuration for light components */
|
516
|
+
light;
|
517
|
+
/** Configuration for mesh components */
|
518
|
+
mesh;
|
519
|
+
/** Configuration for physx components */
|
520
|
+
physx;
|
521
|
+
/** Configuration for text components */
|
522
|
+
text;
|
523
|
+
/** Configuration for view components */
|
524
|
+
view;
|
525
|
+
}
|
526
|
+
/** Object resource */
|
527
|
+
export class ObjectResource {
|
528
|
+
/** Name of the object */
|
529
|
+
name = 'object';
|
530
|
+
/** Translation vector */
|
531
|
+
translation = [0, 0, 0];
|
532
|
+
/** Rotation quaternion */
|
533
|
+
rotation = [0, 0, 0, 1];
|
534
|
+
/** Scaling vector */
|
535
|
+
scaling = [1, 1, 1];
|
536
|
+
/** Parent object, or null if parent is root */
|
537
|
+
parent = null;
|
538
|
+
/** Skin this object is part of, or `null`, if not a joint. */
|
539
|
+
skin = null;
|
540
|
+
/** List of components on this object */
|
541
|
+
components = [];
|
542
|
+
}
|
543
|
+
/** Skin resource */
|
544
|
+
export class SkinResource {
|
545
|
+
/** Name of the skin */
|
546
|
+
name = 'skin';
|
547
|
+
/** List of objects that make up the joints of this skin */
|
548
|
+
joints = [];
|
549
|
+
}
|
550
|
+
/** Blend function enum for {@link PipelineResource} */
|
551
|
+
export var BlendFunction;
|
552
|
+
(function (BlendFunction) {
|
553
|
+
BlendFunction["Zero"] = "zero";
|
554
|
+
BlendFunction["One"] = "one";
|
555
|
+
BlendFunction["SourceColor"] = "source color";
|
556
|
+
BlendFunction["OnceMinusSourceColor"] = "one minus source color";
|
557
|
+
BlendFunction["SourceAlpha"] = "source alpha";
|
558
|
+
BlendFunction["SourceAlphaSaturate"] = "source alpha saturate";
|
559
|
+
BlendFunction["OneMinusSourceAlpha"] = "one minus source alpha";
|
560
|
+
BlendFunction["DestinationColor"] = "destination color";
|
561
|
+
BlendFunction["OneMinusDestinationColor"] = "one minus destination color";
|
562
|
+
BlendFunction["DestinationAlpha"] = "destination alpha";
|
563
|
+
BlendFunction["OneMinusDestinationAlpha"] = "one minus destination alpha";
|
564
|
+
})(BlendFunction || (BlendFunction = {}));
|
565
|
+
/** Blend equation enum for {@link PipelineResource} */
|
566
|
+
export var BlendEquation;
|
567
|
+
(function (BlendEquation) {
|
568
|
+
BlendEquation["Add"] = "add";
|
569
|
+
BlendEquation["Subtract"] = "subtract";
|
570
|
+
BlendEquation["ReverseSubtract"] = "reverse subtract";
|
571
|
+
BlendEquation["Min"] = "min";
|
572
|
+
BlendEquation["Max"] = "max";
|
573
|
+
})(BlendEquation || (BlendEquation = {}));
|
574
|
+
/** Depth function enum for {@link PipelineResource} */
|
575
|
+
export var DepthFunction;
|
576
|
+
(function (DepthFunction) {
|
577
|
+
DepthFunction["Never"] = "never";
|
578
|
+
DepthFunction["Always"] = "always";
|
579
|
+
DepthFunction["Less"] = "less";
|
580
|
+
DepthFunction["LessOrEqual"] = "less or equal";
|
581
|
+
DepthFunction["Equal"] = "equal";
|
582
|
+
DepthFunction["NotEqual"] = "not equal";
|
583
|
+
DepthFunction["GreaterOrEqual"] = "greater or equal";
|
584
|
+
DepthFunction["Greater"] = "greater";
|
585
|
+
})(DepthFunction || (DepthFunction = {}));
|
586
|
+
/** Pipeline resource */
|
587
|
+
export class PipelineResource {
|
588
|
+
name = 'pipeline';
|
589
|
+
doubleSided = false;
|
590
|
+
castShadows = false;
|
591
|
+
depthTest = true;
|
592
|
+
depthWrite = true;
|
593
|
+
blending = false;
|
594
|
+
sampleAlphaToCoverage = false;
|
595
|
+
shader = null;
|
596
|
+
viewVertexShader = null;
|
597
|
+
features = {};
|
598
|
+
blendSrcRgb = BlendFunction.One;
|
599
|
+
blendSrcAlpha = BlendFunction.One;
|
600
|
+
blendDestRgb = BlendFunction.Zero;
|
601
|
+
blendDestAlpha = BlendFunction.Zero;
|
602
|
+
blendEqRgb = BlendEquation.Add;
|
603
|
+
blendEqAlpha = BlendEquation.Add;
|
604
|
+
depthFunction = DepthFunction.Less;
|
605
|
+
}
|
606
|
+
/** Font resource */
|
607
|
+
export class FontResource {
|
608
|
+
/** Name of the font */
|
609
|
+
name = 'font';
|
610
|
+
/** Which characters need to be renderable with this font */
|
611
|
+
characters = 'abcdefghijklmnopqrstuvwxyz\nABCDEFGHIJKLMNOPQRSTUVWXYZ\n0123456789\n:-_+*,.!`"\'?°=\\/\n()[]<>{}$&%@|’‘ ';
|
612
|
+
/** Whether to support the "outline" effect with this font */
|
613
|
+
outline = false;
|
614
|
+
/** Size of the outline */
|
615
|
+
outlineSize = 0.1;
|
616
|
+
}
|
617
|
+
/** Language resource */
|
618
|
+
export class LanguageResource {
|
619
|
+
/** Name of the language */
|
620
|
+
name = 'language';
|
621
|
+
/** Custom terms */
|
622
|
+
strings = {};
|
623
|
+
}
|
624
|
+
/**
|
625
|
+
* @brief Access to Wonderland Editor's data
|
626
|
+
*
|
627
|
+
* Hold control and hover any field in Wonderland Editor to see its JSON path.
|
628
|
+
* The path is equivalent to how you find the matching chain of properties.
|
629
|
+
* @example
|
630
|
+
*
|
631
|
+
* ```
|
632
|
+
* /objects/123/components/0/text/text
|
633
|
+
* ```
|
634
|
+
*
|
635
|
+
* Will match the following code:
|
636
|
+
*
|
637
|
+
* ```ts
|
638
|
+
* WL.data.objects[123].components[0].text.text
|
639
|
+
* ```
|
640
|
+
*/
|
641
|
+
export class EditorData {
|
642
|
+
/** Project settings */
|
643
|
+
settings = new Settings();
|
644
|
+
/** List of scene file paths */
|
645
|
+
files = [];
|
646
|
+
/** Animation resources */
|
647
|
+
animations = [];
|
648
|
+
/** Object resources */
|
649
|
+
objects = [];
|
650
|
+
/** Skin resources */
|
651
|
+
skins = [];
|
652
|
+
/** Image resources */
|
653
|
+
images = [];
|
654
|
+
/** Shader resources */
|
655
|
+
shaders = [];
|
656
|
+
/** Mesh resources */
|
657
|
+
meshes = [];
|
658
|
+
/** Texture resources */
|
659
|
+
textures = [];
|
660
|
+
/** Material resources */
|
661
|
+
materials = [];
|
662
|
+
/** Font resources */
|
663
|
+
fonts = [];
|
664
|
+
/** Pipeline resources */
|
665
|
+
pipelines = [];
|
666
|
+
/** Language resources */
|
667
|
+
languages = [];
|
668
|
+
}
|
669
|
+
export let data = (global._wl_internalBinding ?? (() => { }))('data');
|
package/dist/index.d.ts
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
export * from './data.js';
|
2
|
+
export * as ui from './ui.js';
|
3
|
+
export * as tools from './tools.js';
|
4
|
+
/** Editor plugin */
|
5
|
+
export declare class EditorPlugin {
|
6
|
+
name: string;
|
7
|
+
draw?: () => void;
|
8
|
+
preProjectSave?: () => boolean;
|
9
|
+
postProjectLoad?: () => boolean;
|
10
|
+
prePackage?: () => boolean;
|
11
|
+
postPackage?: () => boolean;
|
12
|
+
}
|
package/dist/index.js
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
export * from './data.js';
|
2
|
+
import * as ui_1 from './ui.js';
|
3
|
+
export { ui_1 as ui };
|
4
|
+
import * as tools_1 from './tools.js';
|
5
|
+
export { tools_1 as tools };
|
6
|
+
/** Editor plugin */
|
7
|
+
export class EditorPlugin {
|
8
|
+
name = 'Editor Plugin';
|
9
|
+
draw;
|
10
|
+
preProjectSave;
|
11
|
+
postProjectLoad;
|
12
|
+
prePackage;
|
13
|
+
postPackage;
|
14
|
+
}
|