@needle-tools/engine 2.67.5-pre → 2.67.7-pre
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/CHANGELOG.md +13 -0
- package/dist/needle-engine.js +8732 -8689
- package/dist/needle-engine.umd.cjs +227 -227
- package/lib/engine/engine_context.d.ts +170 -0
- package/lib/engine/engine_context.js +855 -0
- package/lib/engine/engine_context.js.map +1 -0
- package/lib/engine/engine_gizmos.js +7 -0
- package/lib/engine/engine_gizmos.js.map +1 -1
- package/lib/engine/engine_setup.d.ts +1 -166
- package/lib/engine/engine_setup.js +2 -841
- package/lib/engine/engine_setup.js.map +1 -1
- package/lib/engine/engine_time.d.ts +2 -0
- package/lib/engine/engine_time.js +4 -1
- package/lib/engine/engine_time.js.map +1 -1
- package/lib/engine-components/AnimatorController.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/DepthOfField.js +1 -0
- package/lib/engine-components/postprocessing/Effects/DepthOfField.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/Pixelation.js +0 -1
- package/lib/engine-components/postprocessing/Effects/Pixelation.js.map +1 -1
- package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusion.js +3 -3
- package/lib/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusion.js.map +1 -1
- package/lib/engine-components/postprocessing/PostProcessingEffect.js +3 -2
- package/lib/engine-components/postprocessing/PostProcessingEffect.js.map +1 -1
- package/lib/engine-components/postprocessing/PostProcessingHandler.d.ts +1 -0
- package/lib/engine-components/postprocessing/PostProcessingHandler.js +69 -22
- package/lib/engine-components/postprocessing/PostProcessingHandler.js.map +1 -1
- package/lib/engine-components/postprocessing/Volume.js +5 -5
- package/lib/engine-components/postprocessing/Volume.js.map +1 -1
- package/lib/engine-components/postprocessing/VolumeParameter.js +1 -1
- package/lib/engine-components/postprocessing/VolumeParameter.js.map +1 -1
- package/lib/engine-components/ui/Canvas.d.ts +4 -1
- package/lib/engine-components/ui/Canvas.js +17 -1
- package/lib/engine-components/ui/Canvas.js.map +1 -1
- package/lib/engine-components/ui/EventSystem.js +1 -2
- package/lib/engine-components/ui/EventSystem.js.map +1 -1
- package/lib/engine-components/ui/Text.js +4 -0
- package/lib/engine-components/ui/Text.js.map +1 -1
- package/lib/engine-components/ui/Utils.js +6 -4
- package/lib/engine-components/ui/Utils.js.map +1 -1
- package/package.json +1 -1
- package/src/engine/engine_context.ts +957 -0
- package/src/engine/engine_gizmos.ts +7 -0
- package/src/engine/engine_setup.ts +2 -944
- package/src/engine/engine_time.ts +4 -1
- package/src/engine-components/AnimatorController.ts +2 -2
- package/src/engine-components/postprocessing/Effects/DepthOfField.ts +1 -0
- package/src/engine-components/postprocessing/Effects/Pixelation.ts +0 -1
- package/src/engine-components/postprocessing/Effects/ScreenspaceAmbientOcclusion.ts +2 -2
- package/src/engine-components/postprocessing/PostProcessingEffect.ts +3 -2
- package/src/engine-components/postprocessing/PostProcessingHandler.ts +74 -29
- package/src/engine-components/postprocessing/Volume.ts +10 -10
- package/src/engine-components/postprocessing/VolumeParameter.ts +1 -1
- package/src/engine-components/ui/Canvas.ts +19 -1
- package/src/engine-components/ui/EventSystem.ts +1 -2
- package/src/engine-components/ui/Text.ts +3 -0
- package/src/engine-components/ui/Utils.ts +6 -4
|
@@ -1,842 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { Input } from './engine_input';
|
|
4
|
-
import { Physics } from './engine_physics';
|
|
5
|
-
import { Time } from './engine_time';
|
|
6
|
-
import { NetworkConnection } from './engine_networking';
|
|
7
|
-
import * as looputils from './engine_mainloop_utils';
|
|
8
|
-
import * as utils from "./engine_utils";
|
|
9
|
-
import { EffectComposer, RenderPass } from "postprocessing";
|
|
10
|
-
import { AssetDatabase } from './engine_assetdatabase';
|
|
11
|
-
import { logHierarchy } from './engine_three_utils';
|
|
12
|
-
import * as Stats from 'three/examples/jsm/libs/stats.module';
|
|
13
|
-
import { RendererData } from './engine_rendererdata';
|
|
14
|
-
import { Addressables } from './engine_addressables';
|
|
15
|
-
import { Application } from './engine_application';
|
|
16
|
-
import { LightDataRegistry } from './engine_lightdata';
|
|
17
|
-
import { PlayerViewManager } from './engine_playerview';
|
|
18
|
-
import { destroy, foreachComponent } from './engine_gameobject';
|
|
19
|
-
import { ContextEvent, ContextRegistry } from './engine_context_registry';
|
|
20
|
-
// import { createCameraWithOrbitControl } from '../engine-components/CameraUtils';
|
|
21
|
-
const debug = utils.getParam("debugSetup");
|
|
22
|
-
const stats = utils.getParam("stats");
|
|
23
|
-
const debugActive = utils.getParam("debugactive");
|
|
24
|
-
// this is where functions that setup unity scenes will be pushed into
|
|
25
|
-
// those will be accessed from our custom html element to load them into their context
|
|
26
|
-
export const build_scene_functions = {};
|
|
27
|
-
export class ContextArgs {
|
|
28
|
-
name;
|
|
29
|
-
alias;
|
|
30
|
-
domElement;
|
|
31
|
-
renderer = undefined;
|
|
32
|
-
hash;
|
|
33
|
-
constructor(domElement) {
|
|
34
|
-
this.domElement = domElement ?? document.body;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
export var FrameEvent;
|
|
38
|
-
(function (FrameEvent) {
|
|
39
|
-
FrameEvent[FrameEvent["EarlyUpdate"] = 0] = "EarlyUpdate";
|
|
40
|
-
FrameEvent[FrameEvent["Update"] = 1] = "Update";
|
|
41
|
-
FrameEvent[FrameEvent["LateUpdate"] = 2] = "LateUpdate";
|
|
42
|
-
FrameEvent[FrameEvent["OnBeforeRender"] = 3] = "OnBeforeRender";
|
|
43
|
-
FrameEvent[FrameEvent["OnAfterRender"] = 4] = "OnAfterRender";
|
|
44
|
-
FrameEvent[FrameEvent["PrePhysicsStep"] = 9] = "PrePhysicsStep";
|
|
45
|
-
FrameEvent[FrameEvent["PostPhysicsStep"] = 10] = "PostPhysicsStep";
|
|
46
|
-
})(FrameEvent || (FrameEvent = {}));
|
|
47
|
-
export var XRSessionMode;
|
|
48
|
-
(function (XRSessionMode) {
|
|
49
|
-
XRSessionMode["ImmersiveVR"] = "immersive-vr";
|
|
50
|
-
XRSessionMode["ImmersiveAR"] = "immersive-ar";
|
|
51
|
-
})(XRSessionMode || (XRSessionMode = {}));
|
|
52
|
-
export function registerComponent(script, context) {
|
|
53
|
-
if (!script)
|
|
54
|
-
return;
|
|
55
|
-
const new_scripts = context?.new_scripts ?? Context.Current.new_scripts;
|
|
56
|
-
if (!new_scripts.includes(script)) {
|
|
57
|
-
new_scripts.push(script);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
export class Context {
|
|
61
|
-
static _current;
|
|
62
|
-
static get Current() {
|
|
63
|
-
return this._current;
|
|
64
|
-
}
|
|
65
|
-
static set Current(context) {
|
|
66
|
-
ContextRegistry.Current = context;
|
|
67
|
-
this._current = context;
|
|
68
|
-
}
|
|
69
|
-
name;
|
|
70
|
-
alias;
|
|
71
|
-
isManagedExternally = false;
|
|
72
|
-
isPaused = false;
|
|
73
|
-
runInBackground = false;
|
|
74
|
-
/** used to append to loaded assets */
|
|
75
|
-
hash;
|
|
76
|
-
domElement;
|
|
77
|
-
get resolutionScaleFactor() { return this._resolutionScaleFactor; }
|
|
78
|
-
/** use to scale the resolution up or down of the renderer. default is 1 */
|
|
79
|
-
set resolutionScaleFactor(val) {
|
|
80
|
-
if (val === this._resolutionScaleFactor)
|
|
81
|
-
return;
|
|
82
|
-
if (typeof val !== "number")
|
|
83
|
-
return;
|
|
84
|
-
if (val <= 0) {
|
|
85
|
-
console.error("Invalid resolution scale factor", val);
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
this._resolutionScaleFactor = val;
|
|
89
|
-
this.updateSize();
|
|
90
|
-
}
|
|
91
|
-
_resolutionScaleFactor = 1;
|
|
92
|
-
// domElement.clientLeft etc doesnt return absolute position
|
|
93
|
-
_boundingClientRectFrame = -1;
|
|
94
|
-
_boundingClientRect = null;
|
|
95
|
-
_domX;
|
|
96
|
-
_domY;
|
|
97
|
-
calculateBoundingClientRect() {
|
|
98
|
-
// workaround for mozilla webXR viewer
|
|
99
|
-
if (this.isInAR) {
|
|
100
|
-
this._domX = 0;
|
|
101
|
-
this._domY = 0;
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
if (this._boundingClientRectFrame === this.time.frame)
|
|
105
|
-
return;
|
|
106
|
-
this._boundingClientRectFrame = this.time.frame;
|
|
107
|
-
this._boundingClientRect = this.domElement.getBoundingClientRect();
|
|
108
|
-
this._domX = this._boundingClientRect.x;
|
|
109
|
-
this._domY = this._boundingClientRect.y;
|
|
110
|
-
}
|
|
111
|
-
get domWidth() {
|
|
112
|
-
// for mozilla XR
|
|
113
|
-
if (this.isInAR)
|
|
114
|
-
return window.innerWidth;
|
|
115
|
-
return this.domElement.clientWidth;
|
|
116
|
-
}
|
|
117
|
-
get domHeight() {
|
|
118
|
-
// for mozilla XR
|
|
119
|
-
if (this.isInAR)
|
|
120
|
-
return window.innerHeight;
|
|
121
|
-
return this.domElement.clientHeight;
|
|
122
|
-
}
|
|
123
|
-
get domX() {
|
|
124
|
-
this.calculateBoundingClientRect();
|
|
125
|
-
return this._domX;
|
|
126
|
-
}
|
|
127
|
-
get domY() {
|
|
128
|
-
this.calculateBoundingClientRect();
|
|
129
|
-
return this._domY;
|
|
130
|
-
}
|
|
131
|
-
get isInXR() { return this.renderer.xr?.isPresenting || false; }
|
|
132
|
-
xrSessionMode = undefined;
|
|
133
|
-
get isInVR() { return this.xrSessionMode === XRSessionMode.ImmersiveVR; }
|
|
134
|
-
get isInAR() { return this.xrSessionMode === XRSessionMode.ImmersiveAR; }
|
|
135
|
-
get xrSession() { return this.renderer.xr?.getSession(); }
|
|
136
|
-
get arOverlayElement() {
|
|
137
|
-
const el = this.domElement;
|
|
138
|
-
if (typeof el.getAROverlayContainer === "function")
|
|
139
|
-
return el.getAROverlayContainer();
|
|
140
|
-
return this.domElement;
|
|
141
|
-
}
|
|
142
|
-
/** Current event of the update cycle */
|
|
143
|
-
get currentFrameEvent() {
|
|
144
|
-
return this._currentFrameEvent;
|
|
145
|
-
}
|
|
146
|
-
_currentFrameEvent = -1;
|
|
147
|
-
scene;
|
|
148
|
-
renderer;
|
|
149
|
-
composer = null;
|
|
150
|
-
// all scripts
|
|
151
|
-
scripts = [];
|
|
152
|
-
scripts_pausedChanged = [];
|
|
153
|
-
// scripts with update event
|
|
154
|
-
scripts_earlyUpdate = [];
|
|
155
|
-
scripts_update = [];
|
|
156
|
-
scripts_lateUpdate = [];
|
|
157
|
-
scripts_onBeforeRender = [];
|
|
158
|
-
scripts_onAfterRender = [];
|
|
159
|
-
scripts_WithCorroutines = [];
|
|
160
|
-
coroutines = {};
|
|
161
|
-
get mainCamera() {
|
|
162
|
-
if (this.mainCameraComponent) {
|
|
163
|
-
const cam = this.mainCameraComponent;
|
|
164
|
-
if (!cam.cam)
|
|
165
|
-
cam.buildCamera();
|
|
166
|
-
return cam.cam;
|
|
167
|
-
}
|
|
168
|
-
return null;
|
|
169
|
-
}
|
|
170
|
-
mainCameraComponent;
|
|
171
|
-
post_setup_callbacks = [];
|
|
172
|
-
pre_update_callbacks = [];
|
|
173
|
-
pre_render_callbacks = [];
|
|
174
|
-
post_render_callbacks = [];
|
|
175
|
-
new_scripts = [];
|
|
176
|
-
new_script_start = [];
|
|
177
|
-
new_scripts_pre_setup_callbacks = [];
|
|
178
|
-
new_scripts_post_setup_callbacks = [];
|
|
179
|
-
application;
|
|
180
|
-
time;
|
|
181
|
-
input;
|
|
182
|
-
physics;
|
|
183
|
-
connection;
|
|
184
|
-
/**
|
|
185
|
-
* @deprecated AssetDataBase is deprecated
|
|
186
|
-
*/
|
|
187
|
-
assets;
|
|
188
|
-
mainLight = null;
|
|
189
|
-
rendererData;
|
|
190
|
-
addressables;
|
|
191
|
-
lightmaps;
|
|
192
|
-
players;
|
|
193
|
-
get isCreated() { return this._isCreated; }
|
|
194
|
-
_sizeChanged = false;
|
|
195
|
-
_isCreated = false;
|
|
196
|
-
_isVisible = false;
|
|
197
|
-
_stats = stats ? Stats.default() : null;
|
|
198
|
-
constructor(args) {
|
|
199
|
-
this.name = args?.name || "";
|
|
200
|
-
this.alias = args?.alias;
|
|
201
|
-
this.domElement = args?.domElement || document.body;
|
|
202
|
-
this.hash = args?.hash;
|
|
203
|
-
if (args?.renderer) {
|
|
204
|
-
this.renderer = args.renderer;
|
|
205
|
-
this.isManagedExternally = true;
|
|
206
|
-
}
|
|
207
|
-
else {
|
|
208
|
-
const useComposer = utils.getParam("postfx");
|
|
209
|
-
this.renderer = new WebGLRenderer({
|
|
210
|
-
antialias: true
|
|
211
|
-
});
|
|
212
|
-
// some tonemapping other than "NONE" is required for adjusting exposure with EXR environments
|
|
213
|
-
this.renderer.toneMappingExposure = 1; // range [0...inf] instead of the usual -15..15
|
|
214
|
-
this.renderer.toneMapping = THREE.NoToneMapping; // could also set to LinearToneMapping, ACESFilmicToneMapping
|
|
215
|
-
this.renderer.setClearColor(new THREE.Color('lightgrey'), 0);
|
|
216
|
-
// @ts-ignore
|
|
217
|
-
this.renderer.antialias = true;
|
|
218
|
-
// @ts-ignore
|
|
219
|
-
this.renderer.alpha = false;
|
|
220
|
-
this.renderer.shadowMap.enabled = true;
|
|
221
|
-
this.renderer.shadowMap.type = THREE.PCFSoftShadowMap;
|
|
222
|
-
this.renderer.setSize(this.domWidth, this.domHeight);
|
|
223
|
-
this.renderer.outputEncoding = THREE.sRGBEncoding;
|
|
224
|
-
this.renderer.physicallyCorrectLights = true;
|
|
225
|
-
this.composer = useComposer ? new EffectComposer(this.renderer) : null;
|
|
226
|
-
}
|
|
227
|
-
this.scene = new THREE.Scene();
|
|
228
|
-
ContextRegistry.register(this);
|
|
229
|
-
this.application = new Application(this);
|
|
230
|
-
this.time = new Time();
|
|
231
|
-
this.input = new Input(this);
|
|
232
|
-
this.physics = new Physics(this);
|
|
233
|
-
this.connection = new NetworkConnection(this);
|
|
234
|
-
this.assets = new AssetDatabase();
|
|
235
|
-
this.rendererData = new RendererData(this);
|
|
236
|
-
this.addressables = new Addressables(this);
|
|
237
|
-
this.lightmaps = new LightDataRegistry(this);
|
|
238
|
-
this.players = new PlayerViewManager(this);
|
|
239
|
-
const resizeCallback = () => this._sizeChanged = true;
|
|
240
|
-
window.addEventListener('resize', resizeCallback);
|
|
241
|
-
this._disposeCallbacks.push(() => window.removeEventListener('resize', resizeCallback));
|
|
242
|
-
const resizeObserver = new ResizeObserver(_ => this._sizeChanged = true);
|
|
243
|
-
resizeObserver.observe(this.domElement);
|
|
244
|
-
this._disposeCallbacks.push(() => resizeObserver.disconnect());
|
|
245
|
-
this._intersectionObserver = new IntersectionObserver(entries => {
|
|
246
|
-
this._isVisible = entries[0].isIntersecting;
|
|
247
|
-
});
|
|
248
|
-
this._disposeCallbacks.push(() => this._intersectionObserver?.disconnect());
|
|
249
|
-
}
|
|
250
|
-
_intersectionObserver = null;
|
|
251
|
-
internalOnUpdateVisible() {
|
|
252
|
-
this._intersectionObserver?.disconnect();
|
|
253
|
-
this._intersectionObserver?.observe(this.domElement);
|
|
254
|
-
}
|
|
255
|
-
_disposeCallbacks = [];
|
|
256
|
-
// private _requestSizeUpdate : boolean = false;
|
|
257
|
-
updateSize() {
|
|
258
|
-
if (!this.isManagedExternally && !this.renderer.xr.isPresenting) {
|
|
259
|
-
this._sizeChanged = false;
|
|
260
|
-
const scaleFactor = this.resolutionScaleFactor;
|
|
261
|
-
const width = this.domWidth * scaleFactor;
|
|
262
|
-
const height = this.domHeight * scaleFactor;
|
|
263
|
-
const camera = this.mainCamera;
|
|
264
|
-
this.updateAspect(camera);
|
|
265
|
-
this.renderer.setSize(width, height);
|
|
266
|
-
this.renderer.setPixelRatio(window.devicePixelRatio);
|
|
267
|
-
// avoid setting pixel values here since this can cause pingpong updates
|
|
268
|
-
// e.g. when system scale is set to 125%
|
|
269
|
-
// https://github.com/needle-tools/needle-engine-support/issues/69
|
|
270
|
-
this.renderer.domElement.style.width = "100%";
|
|
271
|
-
this.renderer.domElement.style.height = "100%";
|
|
272
|
-
if (this.composer) {
|
|
273
|
-
this.composer.setSize?.call(this.composer, width, height);
|
|
274
|
-
if ("setPixelRatio" in this.composer && typeof this.composer.setPixelRatio === "function")
|
|
275
|
-
this.composer.setPixelRatio?.call(this.composer, window.devicePixelRatio);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
updateAspect(camera, width, height) {
|
|
280
|
-
if (!camera)
|
|
281
|
-
return;
|
|
282
|
-
if (width === undefined)
|
|
283
|
-
width = this.domWidth;
|
|
284
|
-
if (height === undefined)
|
|
285
|
-
height = this.domHeight;
|
|
286
|
-
const pa = camera.aspect;
|
|
287
|
-
camera.aspect = width / height;
|
|
288
|
-
if (pa !== camera.aspect)
|
|
289
|
-
camera.updateProjectionMatrix();
|
|
290
|
-
}
|
|
291
|
-
onCreate(buildScene, opts) {
|
|
292
|
-
if (this._isCreated) {
|
|
293
|
-
console.warn("Context already created");
|
|
294
|
-
return null;
|
|
295
|
-
}
|
|
296
|
-
this._isCreated = true;
|
|
297
|
-
return this.internalOnCreate(buildScene, opts);
|
|
298
|
-
}
|
|
299
|
-
onDestroy() {
|
|
300
|
-
if (!this._isCreated)
|
|
301
|
-
return;
|
|
302
|
-
this._isCreated = false;
|
|
303
|
-
destroy(this.scene, true);
|
|
304
|
-
this.renderer?.setAnimationLoop(null);
|
|
305
|
-
if (!this.isManagedExternally) {
|
|
306
|
-
this.renderer?.dispose();
|
|
307
|
-
}
|
|
308
|
-
for (const cb of this._disposeCallbacks) {
|
|
309
|
-
try {
|
|
310
|
-
cb();
|
|
311
|
-
}
|
|
312
|
-
catch (e) {
|
|
313
|
-
console.error("Error in on dispose callback:", e, cb);
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
if (this.domElement?.parentElement) {
|
|
317
|
-
this.domElement.parentElement.removeChild(this.domElement);
|
|
318
|
-
}
|
|
319
|
-
ContextRegistry.dispatchCallback(ContextEvent.ContextDestroyed, this);
|
|
320
|
-
ContextRegistry.unregister(this);
|
|
321
|
-
}
|
|
322
|
-
registerCoroutineUpdate(script, coroutine, evt) {
|
|
323
|
-
if (!this.coroutines[evt])
|
|
324
|
-
this.coroutines[evt] = [];
|
|
325
|
-
this.coroutines[evt].push({ comp: script, main: coroutine });
|
|
326
|
-
return coroutine;
|
|
327
|
-
}
|
|
328
|
-
unregisterCoroutineUpdate(coroutine, evt) {
|
|
329
|
-
if (!this.coroutines[evt])
|
|
330
|
-
return;
|
|
331
|
-
const idx = this.coroutines[evt].findIndex(c => c.main === coroutine);
|
|
332
|
-
if (idx >= 0)
|
|
333
|
-
this.coroutines[evt].splice(idx, 1);
|
|
334
|
-
}
|
|
335
|
-
stopAllCoroutinesFrom(script) {
|
|
336
|
-
for (const evt in this.coroutines) {
|
|
337
|
-
const rout = this.coroutines[evt];
|
|
338
|
-
for (let i = rout.length - 1; i >= 0; i--) {
|
|
339
|
-
const r = rout[i];
|
|
340
|
-
if (r.comp === script) {
|
|
341
|
-
rout.splice(i, 1);
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
_cameraStack = [];
|
|
347
|
-
setCurrentCamera(cam) {
|
|
348
|
-
if (!cam)
|
|
349
|
-
return;
|
|
350
|
-
if (!cam.cam)
|
|
351
|
-
cam.buildCamera(); // < to build camera
|
|
352
|
-
if (!cam.cam) {
|
|
353
|
-
console.warn("Camera component is missing camera", cam);
|
|
354
|
-
return;
|
|
355
|
-
}
|
|
356
|
-
const index = this._cameraStack.indexOf(cam);
|
|
357
|
-
if (index >= 0)
|
|
358
|
-
this._cameraStack.splice(index, 1);
|
|
359
|
-
this._cameraStack.push(cam);
|
|
360
|
-
this.mainCameraComponent = cam;
|
|
361
|
-
const camera = cam.cam;
|
|
362
|
-
if (camera.isPerspectiveCamera)
|
|
363
|
-
this.updateAspect(camera);
|
|
364
|
-
this.mainCameraComponent?.applyClearFlagsIfIsActiveCamera();
|
|
365
|
-
}
|
|
366
|
-
removeCamera(cam) {
|
|
367
|
-
if (!cam)
|
|
368
|
-
return;
|
|
369
|
-
const index = this._cameraStack.indexOf(cam);
|
|
370
|
-
if (index >= 0)
|
|
371
|
-
this._cameraStack.splice(index, 1);
|
|
372
|
-
if (this.mainCameraComponent === cam) {
|
|
373
|
-
this.mainCameraComponent = undefined;
|
|
374
|
-
if (this._cameraStack.length > 0) {
|
|
375
|
-
const last = this._cameraStack[this._cameraStack.length - 1];
|
|
376
|
-
this.setCurrentCamera(last);
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
_onBeforeRenderListeners = {};
|
|
381
|
-
/** use this to subscribe to onBeforeRender events on threejs objects */
|
|
382
|
-
addBeforeRenderListener(target, callback) {
|
|
383
|
-
if (!this._onBeforeRenderListeners[target.uuid]) {
|
|
384
|
-
this._onBeforeRenderListeners[target.uuid] = [];
|
|
385
|
-
const onBeforeRenderCallback = (renderer, scene, camera, geometry, material, group) => {
|
|
386
|
-
const arr = this._onBeforeRenderListeners[target.uuid];
|
|
387
|
-
if (!arr)
|
|
388
|
-
return;
|
|
389
|
-
for (let i = 0; i < arr.length; i++) {
|
|
390
|
-
const fn = arr[i];
|
|
391
|
-
fn(renderer, scene, camera, geometry, material, group);
|
|
392
|
-
}
|
|
393
|
-
};
|
|
394
|
-
target.onBeforeRender = onBeforeRenderCallback;
|
|
395
|
-
}
|
|
396
|
-
this._onBeforeRenderListeners[target.uuid].push(callback);
|
|
397
|
-
}
|
|
398
|
-
removeBeforeRenderListener(target, callback) {
|
|
399
|
-
if (this._onBeforeRenderListeners[target.uuid]) {
|
|
400
|
-
const arr = this._onBeforeRenderListeners[target.uuid];
|
|
401
|
-
const idx = arr.indexOf(callback);
|
|
402
|
-
if (idx >= 0)
|
|
403
|
-
arr.splice(idx, 1);
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
_requireDepthTexture = false;
|
|
407
|
-
_requireColorTexture = false;
|
|
408
|
-
_renderTarget;
|
|
409
|
-
_isRendering = false;
|
|
410
|
-
get isRendering() { return this._isRendering; }
|
|
411
|
-
setRequireDepth(val) {
|
|
412
|
-
this._requireDepthTexture = val;
|
|
413
|
-
}
|
|
414
|
-
setRequireColor(val) {
|
|
415
|
-
this._requireColorTexture = val;
|
|
416
|
-
}
|
|
417
|
-
get depthTexture() {
|
|
418
|
-
return this._renderTarget?.depthTexture || null;
|
|
419
|
-
}
|
|
420
|
-
get opaqueColorTexture() {
|
|
421
|
-
return this._renderTarget?.texture || null;
|
|
422
|
-
}
|
|
423
|
-
/** returns true if the dom element is visible on screen */
|
|
424
|
-
get isVisibleToUser() {
|
|
425
|
-
if (this.isInXR)
|
|
426
|
-
return true;
|
|
427
|
-
if (!this._isVisible)
|
|
428
|
-
return false;
|
|
429
|
-
const style = getComputedStyle(this.domElement);
|
|
430
|
-
return style.visibility !== "hidden" && style.display !== "none" && style.opacity !== "0";
|
|
431
|
-
}
|
|
432
|
-
async internalOnCreate(buildScene, opts) {
|
|
433
|
-
// TODO: we could configure if we need physics
|
|
434
|
-
await this.physics.createWorld();
|
|
435
|
-
// load and create scene
|
|
436
|
-
let prepare_succeeded = true;
|
|
437
|
-
try {
|
|
438
|
-
Context.Current = this;
|
|
439
|
-
if (buildScene)
|
|
440
|
-
await buildScene(this, opts);
|
|
441
|
-
}
|
|
442
|
-
catch (err) {
|
|
443
|
-
console.error(err);
|
|
444
|
-
prepare_succeeded = false;
|
|
445
|
-
}
|
|
446
|
-
if (!prepare_succeeded)
|
|
447
|
-
return;
|
|
448
|
-
this.internalOnUpdateVisible();
|
|
449
|
-
// console.log(prepare_succeeded);
|
|
450
|
-
if (!this.isManagedExternally)
|
|
451
|
-
this.domElement.prepend(this.renderer.domElement);
|
|
452
|
-
Context._current = this;
|
|
453
|
-
// Setup
|
|
454
|
-
Context._current = this;
|
|
455
|
-
for (let i = 0; i < this.new_scripts.length; i++) {
|
|
456
|
-
const script = this.new_scripts[i];
|
|
457
|
-
if (script.gameObject !== undefined && script.gameObject !== null) {
|
|
458
|
-
if (script.gameObject.userData === undefined)
|
|
459
|
-
script.gameObject.userData = {};
|
|
460
|
-
if (script.gameObject.userData.components === undefined)
|
|
461
|
-
script.gameObject.userData.components = [];
|
|
462
|
-
const arr = script.gameObject.userData.components;
|
|
463
|
-
if (!arr.includes(script))
|
|
464
|
-
arr.push(script);
|
|
465
|
-
}
|
|
466
|
-
// if (script.gameObject && !this.raycastTargets.includes(script.gameObject)) {
|
|
467
|
-
// this.raycastTargets.push(script.gameObject);
|
|
468
|
-
// }
|
|
469
|
-
}
|
|
470
|
-
// const context = new SerializationContext(this.scene);
|
|
471
|
-
// for (let i = 0; i < this.new_scripts.length; i++) {
|
|
472
|
-
// const script = this.new_scripts[i];
|
|
473
|
-
// const ser = script as unknown as ISerializable;
|
|
474
|
-
// if (ser.$serializedTypes === undefined) continue;
|
|
475
|
-
// context.context = this;
|
|
476
|
-
// context.object = script.gameObject;
|
|
477
|
-
// deserializeObject(ser, script, context);
|
|
478
|
-
// }
|
|
479
|
-
// resolve post setup callbacks (things that rely on threejs objects having references to components)
|
|
480
|
-
if (this.post_setup_callbacks) {
|
|
481
|
-
for (let i = 0; i < this.post_setup_callbacks.length; i++) {
|
|
482
|
-
Context._current = this;
|
|
483
|
-
await this.post_setup_callbacks[i](this);
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
if (!this.mainCamera) {
|
|
487
|
-
Context._current = this;
|
|
488
|
-
let camera = null;
|
|
489
|
-
foreachComponent(this.scene, comp => {
|
|
490
|
-
const cam = comp;
|
|
491
|
-
if (cam?.isCamera) {
|
|
492
|
-
looputils.updateActiveInHierarchyWithoutEventCall(cam.gameObject);
|
|
493
|
-
if (!cam.activeAndEnabled)
|
|
494
|
-
return undefined;
|
|
495
|
-
if (cam.tag === "MainCamera") {
|
|
496
|
-
camera = cam;
|
|
497
|
-
return true;
|
|
498
|
-
}
|
|
499
|
-
else
|
|
500
|
-
camera = cam;
|
|
501
|
-
}
|
|
502
|
-
return undefined;
|
|
503
|
-
});
|
|
504
|
-
if (camera) {
|
|
505
|
-
this.setCurrentCamera(camera);
|
|
506
|
-
}
|
|
507
|
-
else {
|
|
508
|
-
ContextRegistry.dispatchCallback(ContextEvent.MissingCamera, this);
|
|
509
|
-
if (!this.mainCamera && !this.isManagedExternally)
|
|
510
|
-
console.error("MISSING camera", this);
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
Context._current = this;
|
|
514
|
-
looputils.processNewScripts(this);
|
|
515
|
-
// const mainCam = this.mainCameraComponent as Camera;
|
|
516
|
-
// if (mainCam) {
|
|
517
|
-
// mainCam.applyClearFlagsIfIsActiveCamera();
|
|
518
|
-
// }
|
|
519
|
-
if (!this.isManagedExternally && this.composer && this.mainCamera) {
|
|
520
|
-
const renderPass = new RenderPass(this.scene, this.mainCamera);
|
|
521
|
-
this.renderer.setSize(this.domWidth, this.domHeight);
|
|
522
|
-
this.composer.addPass(renderPass);
|
|
523
|
-
this.composer.setSize(this.domWidth, this.domHeight);
|
|
524
|
-
}
|
|
525
|
-
this._sizeChanged = true;
|
|
526
|
-
if (this._stats) {
|
|
527
|
-
this._stats.showPanel(1);
|
|
528
|
-
this.domElement.appendChild(this._stats.dom);
|
|
529
|
-
}
|
|
530
|
-
this.renderer.setAnimationLoop(this.render.bind(this));
|
|
531
|
-
if (debug)
|
|
532
|
-
logHierarchy(this.scene, true);
|
|
533
|
-
ContextRegistry.dispatchCallback(ContextEvent.ContextCreated, this);
|
|
534
|
-
}
|
|
535
|
-
render(_, frame) {
|
|
536
|
-
this._currentFrameEvent = -1;
|
|
537
|
-
if (this.onHandlePaused())
|
|
538
|
-
return;
|
|
539
|
-
this._stats?.begin();
|
|
540
|
-
Context._current = this;
|
|
541
|
-
this.time.update();
|
|
542
|
-
looputils.processNewScripts(this);
|
|
543
|
-
looputils.updateIsActive(this.scene);
|
|
544
|
-
looputils.processStart(this);
|
|
545
|
-
while (this._cameraStack.length > 0 && (!this.mainCameraComponent || this.mainCameraComponent.destroyed)) {
|
|
546
|
-
this._cameraStack.splice(this._cameraStack.length - 1, 1);
|
|
547
|
-
const last = this._cameraStack[this._cameraStack.length - 1];
|
|
548
|
-
this.setCurrentCamera(last);
|
|
549
|
-
}
|
|
550
|
-
if (this.pre_update_callbacks) {
|
|
551
|
-
for (const i in this.pre_update_callbacks) {
|
|
552
|
-
this.pre_update_callbacks[i]();
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
this._currentFrameEvent = FrameEvent.EarlyUpdate;
|
|
556
|
-
for (let i = 0; i < this.scripts_earlyUpdate.length; i++) {
|
|
557
|
-
const script = this.scripts_earlyUpdate[i];
|
|
558
|
-
if (!script.activeAndEnabled)
|
|
559
|
-
continue;
|
|
560
|
-
if (script.earlyUpdate !== undefined) {
|
|
561
|
-
Context._current = this;
|
|
562
|
-
script.earlyUpdate();
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
this.executeCoroutines(FrameEvent.EarlyUpdate);
|
|
566
|
-
if (this.onHandlePaused())
|
|
567
|
-
return;
|
|
568
|
-
this._currentFrameEvent = FrameEvent.Update;
|
|
569
|
-
for (let i = 0; i < this.scripts_update.length; i++) {
|
|
570
|
-
const script = this.scripts_update[i];
|
|
571
|
-
if (!script.activeAndEnabled)
|
|
572
|
-
continue;
|
|
573
|
-
if (script.update !== undefined) {
|
|
574
|
-
Context._current = this;
|
|
575
|
-
script.update();
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
this.executeCoroutines(FrameEvent.Update);
|
|
579
|
-
if (this.onHandlePaused())
|
|
580
|
-
return;
|
|
581
|
-
this._currentFrameEvent = FrameEvent.LateUpdate;
|
|
582
|
-
for (let i = 0; i < this.scripts_lateUpdate.length; i++) {
|
|
583
|
-
const script = this.scripts_lateUpdate[i];
|
|
584
|
-
if (!script.activeAndEnabled)
|
|
585
|
-
continue;
|
|
586
|
-
if (script.lateUpdate !== undefined) {
|
|
587
|
-
Context._current = this;
|
|
588
|
-
script.lateUpdate();
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
// this.mainLight = null;
|
|
592
|
-
this.executeCoroutines(FrameEvent.LateUpdate);
|
|
593
|
-
if (this.onHandlePaused())
|
|
594
|
-
return;
|
|
595
|
-
const physicsSteps = 1;
|
|
596
|
-
const dt = this.time.deltaTime / physicsSteps;
|
|
597
|
-
for (let i = 0; i < physicsSteps; i++) {
|
|
598
|
-
this._currentFrameEvent = FrameEvent.PrePhysicsStep;
|
|
599
|
-
this.executeCoroutines(FrameEvent.PrePhysicsStep);
|
|
600
|
-
this.physics.step(dt);
|
|
601
|
-
this._currentFrameEvent = FrameEvent.PostPhysicsStep;
|
|
602
|
-
this.executeCoroutines(FrameEvent.PostPhysicsStep);
|
|
603
|
-
}
|
|
604
|
-
this.physics.postStep();
|
|
605
|
-
if (this.onHandlePaused())
|
|
606
|
-
return;
|
|
607
|
-
if (this.isVisibleToUser) {
|
|
608
|
-
this._currentFrameEvent = FrameEvent.OnBeforeRender;
|
|
609
|
-
// should we move these callbacks in the regular three onBeforeRender events?
|
|
610
|
-
for (let i = 0; i < this.scripts_onBeforeRender.length; i++) {
|
|
611
|
-
const script = this.scripts_onBeforeRender[i];
|
|
612
|
-
if (!script.activeAndEnabled)
|
|
613
|
-
continue;
|
|
614
|
-
// if(script.isActiveAndEnabled === false) continue;
|
|
615
|
-
if (script.onBeforeRender !== undefined) {
|
|
616
|
-
Context._current = this;
|
|
617
|
-
script.onBeforeRender(frame);
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
this.executeCoroutines(FrameEvent.OnBeforeRender);
|
|
621
|
-
if (this._sizeChanged)
|
|
622
|
-
this.updateSize();
|
|
623
|
-
if (this.pre_render_callbacks) {
|
|
624
|
-
for (const i in this.pre_render_callbacks) {
|
|
625
|
-
this.pre_render_callbacks[i]();
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
if (!this.isManagedExternally) {
|
|
629
|
-
looputils.runPrewarm(this);
|
|
630
|
-
this._currentFrameEvent = -10;
|
|
631
|
-
this.renderNow();
|
|
632
|
-
this._currentFrameEvent = FrameEvent.OnAfterRender;
|
|
633
|
-
}
|
|
634
|
-
for (let i = 0; i < this.scripts_onAfterRender.length; i++) {
|
|
635
|
-
const script = this.scripts_onAfterRender[i];
|
|
636
|
-
if (!script.activeAndEnabled)
|
|
637
|
-
continue;
|
|
638
|
-
if (script.onAfterRender !== undefined) {
|
|
639
|
-
Context._current = this;
|
|
640
|
-
script.onAfterRender();
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
this.executeCoroutines(FrameEvent.OnAfterRender);
|
|
644
|
-
if (this.post_render_callbacks) {
|
|
645
|
-
for (const i in this.post_render_callbacks) {
|
|
646
|
-
this.post_render_callbacks[i]();
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
this._currentFrameEvent = -1;
|
|
651
|
-
this.connection.sendBufferedMessagesNow();
|
|
652
|
-
this._stats?.end();
|
|
653
|
-
if (this.time.frame === 1) {
|
|
654
|
-
this.domElement.dispatchEvent(new CustomEvent("ready"));
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
renderNow(camera) {
|
|
658
|
-
if (!camera) {
|
|
659
|
-
camera = this.mainCamera;
|
|
660
|
-
if (!camera)
|
|
661
|
-
return false;
|
|
662
|
-
}
|
|
663
|
-
this._isRendering = true;
|
|
664
|
-
this.renderRequiredTextures();
|
|
665
|
-
// if (camera === this.mainCameraComponent?.cam) {
|
|
666
|
-
// if (this.mainCameraComponent.activeTexture) {
|
|
667
|
-
// }
|
|
668
|
-
// }
|
|
669
|
-
if (this.composer && !this.isInXR) {
|
|
670
|
-
this.composer.render(this.time.deltaTime);
|
|
671
|
-
}
|
|
672
|
-
else if (camera) {
|
|
673
|
-
this.renderer.render(this.scene, camera);
|
|
674
|
-
}
|
|
675
|
-
this._isRendering = false;
|
|
676
|
-
return true;
|
|
677
|
-
}
|
|
678
|
-
/** returns true if we should return out of the frame loop */
|
|
679
|
-
_wasPaused = false;
|
|
680
|
-
onHandlePaused() {
|
|
681
|
-
const paused = this.evaluatePaused();
|
|
682
|
-
if (this._wasPaused !== paused) {
|
|
683
|
-
if (debugActive)
|
|
684
|
-
console.log("Paused?", paused, "context:" + this.alias);
|
|
685
|
-
for (let i = 0; i < this.scripts_pausedChanged.length; i++) {
|
|
686
|
-
const script = this.scripts_pausedChanged[i];
|
|
687
|
-
if (!script.activeAndEnabled)
|
|
688
|
-
continue;
|
|
689
|
-
if (script.onPausedChanged !== undefined) {
|
|
690
|
-
Context._current = this;
|
|
691
|
-
script.onPausedChanged(paused, this._wasPaused);
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
this._wasPaused = paused;
|
|
696
|
-
return paused;
|
|
697
|
-
}
|
|
698
|
-
evaluatePaused() {
|
|
699
|
-
if (this.isInXR)
|
|
700
|
-
return false;
|
|
701
|
-
if (this.isPaused)
|
|
702
|
-
return true;
|
|
703
|
-
// if the element is not visible use the runInBackground flag to determine if we should continue
|
|
704
|
-
if (this.runInBackground) {
|
|
705
|
-
return false;
|
|
706
|
-
}
|
|
707
|
-
const paused = !this.isVisibleToUser;
|
|
708
|
-
return paused;
|
|
709
|
-
}
|
|
710
|
-
renderRequiredTextures() {
|
|
711
|
-
if (!this.mainCamera)
|
|
712
|
-
return;
|
|
713
|
-
if (!this._requireDepthTexture && !this._requireColorTexture)
|
|
714
|
-
return;
|
|
715
|
-
if (!this._renderTarget) {
|
|
716
|
-
this._renderTarget = new THREE.WebGLRenderTarget(this.domWidth, this.domHeight);
|
|
717
|
-
if (this._requireDepthTexture) {
|
|
718
|
-
const dt = new DepthTexture(this.domWidth, this.domHeight);
|
|
719
|
-
;
|
|
720
|
-
this._renderTarget.depthTexture = dt;
|
|
721
|
-
}
|
|
722
|
-
if (this._requireColorTexture) {
|
|
723
|
-
this._renderTarget.texture = new THREE.Texture();
|
|
724
|
-
this._renderTarget.texture.generateMipmaps = false;
|
|
725
|
-
this._renderTarget.texture.minFilter = THREE.NearestFilter;
|
|
726
|
-
this._renderTarget.texture.magFilter = THREE.NearestFilter;
|
|
727
|
-
this._renderTarget.texture.format = THREE.RGBAFormat;
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
const rt = this._renderTarget;
|
|
731
|
-
if (rt.texture) {
|
|
732
|
-
rt.texture.encoding = this.renderer.outputEncoding;
|
|
733
|
-
}
|
|
734
|
-
const prevTarget = this.renderer.getRenderTarget();
|
|
735
|
-
this.renderer.setRenderTarget(rt);
|
|
736
|
-
this.renderer.render(this.scene, this.mainCamera);
|
|
737
|
-
this.renderer.setRenderTarget(prevTarget);
|
|
738
|
-
}
|
|
739
|
-
executeCoroutines(evt) {
|
|
740
|
-
if (this.coroutines[evt]) {
|
|
741
|
-
const evts = this.coroutines[evt];
|
|
742
|
-
for (let i = 0; i < evts.length; i++) {
|
|
743
|
-
try {
|
|
744
|
-
const evt = evts[i];
|
|
745
|
-
// TODO we might want to keep coroutines playing even if the component is disabled or inactive
|
|
746
|
-
const remove = !evt.comp || evt.comp.destroyed || !evt.main || evt.comp["enabled"] === false;
|
|
747
|
-
if (remove) {
|
|
748
|
-
evts.splice(i, 1);
|
|
749
|
-
--i;
|
|
750
|
-
continue;
|
|
751
|
-
}
|
|
752
|
-
const iter = evt.chained;
|
|
753
|
-
if (iter && iter.length > 0) {
|
|
754
|
-
const last = iter[iter.length - 1];
|
|
755
|
-
const res = last.next();
|
|
756
|
-
if (res.done) {
|
|
757
|
-
iter.pop();
|
|
758
|
-
}
|
|
759
|
-
if (isGenerator(res)) {
|
|
760
|
-
if (!evt.chained)
|
|
761
|
-
evt.chained = [];
|
|
762
|
-
evt.chained.push(res.value);
|
|
763
|
-
}
|
|
764
|
-
if (!res.done)
|
|
765
|
-
continue;
|
|
766
|
-
}
|
|
767
|
-
const res = evt.main.next();
|
|
768
|
-
if (res.done === true) {
|
|
769
|
-
evts.splice(i, 1);
|
|
770
|
-
--i;
|
|
771
|
-
continue;
|
|
772
|
-
}
|
|
773
|
-
const val = res.value;
|
|
774
|
-
if (isGenerator(val)) {
|
|
775
|
-
// invoke once if its a generator
|
|
776
|
-
// this means e.g. WaitForFrame(1) works and will capture
|
|
777
|
-
// the frame it was created
|
|
778
|
-
const gen = val;
|
|
779
|
-
const res = gen.next();
|
|
780
|
-
if (res.done)
|
|
781
|
-
continue;
|
|
782
|
-
if (!evt.chained)
|
|
783
|
-
evt.chained = [];
|
|
784
|
-
evt.chained.push(val);
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
catch (e) {
|
|
788
|
-
console.error(e);
|
|
789
|
-
}
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
function isGenerator(val) {
|
|
793
|
-
if (val) {
|
|
794
|
-
if (val.next && val.return) {
|
|
795
|
-
return true;
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
return false;
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
// const scene = new THREE.Scene();
|
|
803
|
-
// const useComposer = utils.getParam("postfx");
|
|
804
|
-
// const renderer = new WebGLRenderer({ antialias: true });
|
|
805
|
-
// const composer = useComposer ? new EffectComposer(renderer) : undefined;
|
|
806
|
-
// renderer.setClearColor(new THREE.Color('lightgrey'), 0)
|
|
807
|
-
// renderer.antialias = true;
|
|
808
|
-
// renderer.alpha = false;
|
|
809
|
-
// renderer.shadowMap.enabled = true;
|
|
810
|
-
// renderer.shadowMap.type = THREE.PCFSoftShadowMap;
|
|
811
|
-
// renderer.setSize(window.innerWidth, window.innerHeight);
|
|
812
|
-
// renderer.outputEncoding = THREE.sRGBEncoding;
|
|
813
|
-
// renderer.physicallyCorrectLights = true;
|
|
814
|
-
// document.body.appendChild(renderer.domElement);
|
|
815
|
-
// // generation pushes loading requests in this array
|
|
816
|
-
// const sceneData: {
|
|
817
|
-
// mainCamera: THREE.Camera | undefined
|
|
818
|
-
// } = {
|
|
819
|
-
// preparing: [],
|
|
820
|
-
// resolving: [],
|
|
821
|
-
// scripts: [],
|
|
822
|
-
// raycastTargets: [],
|
|
823
|
-
// mainCamera: undefined,
|
|
824
|
-
// mainCameraComponent: undefined,
|
|
825
|
-
// };
|
|
826
|
-
// // contains a list of functions to be called after loading is done
|
|
827
|
-
// const post_setup_callbacks = [];
|
|
828
|
-
// const pre_render_Callbacks = [];
|
|
829
|
-
// const post_render_callbacks = [];
|
|
830
|
-
// const new_scripts = [];
|
|
831
|
-
// const new_scripts_post_setup_callbacks = [];
|
|
832
|
-
// const new_scripts_pre_setup_callbacks = [];
|
|
833
|
-
// export {
|
|
834
|
-
// scene, renderer, composer,
|
|
835
|
-
// new_scripts,
|
|
836
|
-
// new_scripts_post_setup_callbacks, new_scripts_pre_setup_callbacks,
|
|
837
|
-
// sceneData,
|
|
838
|
-
// post_setup_callbacks,
|
|
839
|
-
// pre_render_Callbacks,
|
|
840
|
-
// post_render_callbacks
|
|
841
|
-
// }
|
|
1
|
+
// TODO: change all usings to the new path:
|
|
2
|
+
export * from "./engine_context";
|
|
842
3
|
//# sourceMappingURL=engine_setup.js.map
|