ohzi-core 11.2.4 → 12.0.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.
Files changed (101) hide show
  1. package/build/index.mjs +2 -0
  2. package/build/index.mjs.map +1 -0
  3. package/package.json +10 -8
  4. package/src/BaseApplication.js +0 -3
  5. package/src/Browser.js +4 -4
  6. package/src/Initializer.js +5 -1
  7. package/src/OS.js +2 -2
  8. package/src/RenderLoop.js +9 -9
  9. package/src/ResourceContainer.js +0 -1
  10. package/src/Screen.js +55 -0
  11. package/src/Time.js +2 -14
  12. package/src/action_sequencer/ActionSequencer.js +7 -3
  13. package/src/gpu_particles/ParticleAttribute.js +2 -2
  14. package/src/index.js +18 -12
  15. package/src/loaders/AsyncAbstractLoader.js +144 -0
  16. package/src/loaders/AsyncAudiosLoader.js +34 -0
  17. package/src/loaders/AsyncObjectsLoader.js +38 -0
  18. package/src/loaders/AsyncTexturesLoader.js +70 -0
  19. package/src/loaders/assets_loader/AbstractLoader.js +129 -0
  20. package/src/loaders/assets_loader/AssetLoader.js +24 -0
  21. package/src/loaders/assets_loader/AsyncAssetsLoaderWorker.js +69 -0
  22. package/src/loaders/assets_loader/ResourceBatch.js +86 -0
  23. package/src/loaders/assets_loader/ResourceContainer.js +37 -0
  24. package/src/loaders/assets_loader/ResourceLoaderChecker.js +39 -0
  25. package/src/render_mode/NormalAORender.js +2 -2
  26. package/src/resource_loader/AsyncTextureLoader.js +1 -3
  27. package/src/resource_loader/BasisLoader.js +4 -0
  28. package/src/scenes/AbstractScene.js +166 -0
  29. package/src/scenes/loading_states/CompilatorManager.js +41 -0
  30. package/src/scenes/loading_states/HighQualityLoadingState.js +28 -0
  31. package/src/scenes/loading_states/LoadingState.js +106 -0
  32. package/src/scenes/loading_states/RegularLoadingState.js +41 -0
  33. package/src/utilities/OMath.js +2 -0
  34. package/src/view_components/ApplicationView.js +26 -3
  35. package/src/view_components/TransitionManager.js +15 -0
  36. package/src/view_components/ViewComponent.js +26 -12
  37. package/src/view_components/ViewComponentManager.js +10 -0
  38. package/src/view_components/ViewManager.js +52 -14
  39. package/src/view_components/ViewState.js +7 -7
  40. package/src/view_components/transition/ActionSequencerBuilder.js +3 -3
  41. package/src/view_components/transition/TransitionTable.js +2 -9
  42. package/types/BaseApplication.d.ts +0 -1
  43. package/types/Browser.d.ts +1 -1
  44. package/types/CameraManager.d.ts +4 -2
  45. package/types/Graphics.d.ts +3 -8
  46. package/types/Initializer.d.ts +1 -1
  47. package/types/RenderLoop.d.ts +2 -1
  48. package/types/SceneManager.d.ts +3 -1
  49. package/types/Time.d.ts +0 -5
  50. package/types/action_sequencer/ActionSequencer.d.ts +2 -2
  51. package/types/canvas_drawer/SimpleTextDrawer.d.ts +1 -0
  52. package/types/index.d.ts +122 -105
  53. package/types/loaders/AsyncAbstractLoader.d.ts +27 -0
  54. package/types/loaders/AsyncAudiosLoader.d.ts +5 -0
  55. package/types/loaders/AsyncObjectsLoader.d.ts +6 -0
  56. package/types/loaders/AsyncTexturesLoader.d.ts +8 -0
  57. package/types/render_mode/NormalAORender.d.ts +0 -1
  58. package/types/resource_loader/AsyncTextureLoader.d.ts +1 -1
  59. package/types/resource_loader/AudioLoader.d.ts +1 -0
  60. package/types/resource_loader/BasisLoader.d.ts +1 -0
  61. package/types/resource_loader/CubemapLoader.d.ts +1 -0
  62. package/types/resource_loader/DAELoader.d.ts +1 -0
  63. package/types/resource_loader/FileLoader.d.ts +1 -0
  64. package/types/resource_loader/FontLoader.d.ts +1 -0
  65. package/types/resource_loader/GLTFDRACOLoader.d.ts +1 -0
  66. package/types/resource_loader/GLTFLoader.d.ts +1 -0
  67. package/types/resource_loader/HDRCubeTextureLoader.d.ts +1 -0
  68. package/types/resource_loader/OBJLoader.d.ts +1 -0
  69. package/types/resource_loader/PointArrayLoader.d.ts +1 -0
  70. package/types/resource_loader/RGBETextureLoader.d.ts +1 -0
  71. package/types/resource_loader/TextLoader.d.ts +1 -0
  72. package/types/scenes/AbstractScene.d.ts +31 -0
  73. package/types/scenes/loading_states/CompilatorManager.d.ts +8 -0
  74. package/types/scenes/loading_states/HighQualityLoadingState.d.ts +3 -0
  75. package/types/scenes/loading_states/LoadingState.d.ts +28 -0
  76. package/types/scenes/loading_states/RegularLoadingState.d.ts +5 -0
  77. package/types/utilities/FrustumPointFitter.d.ts +3 -1
  78. package/types/utilities/OMath.d.ts +9 -9
  79. package/types/view_components/ApplicationView.d.ts +3 -1
  80. package/types/view_components/ViewComponent.d.ts +5 -1
  81. package/types/view_components/ViewComponentManager.d.ts +1 -0
  82. package/types/view_components/ViewManager.d.ts +22 -4
  83. package/types/view_components/ViewState.d.ts +3 -0
  84. package/types/view_components/transition/ActionSequencerBuilder.d.ts +1 -1
  85. package/types/view_components/transition/TransitionTable.d.ts +0 -2
  86. package/build/index.module.js +0 -2
  87. package/build/index.module.js.map +0 -1
  88. package/src/view_components/ApplicationViewController.js +0 -85
  89. package/src/view_components/VCManager.js +0 -9
  90. package/src/view_components/ViewComponentController.js +0 -73
  91. package/src/view_components/ViewComponentControllerManager.js +0 -59
  92. package/src/view_components/ViewControllerManager.js +0 -91
  93. package/src/view_components/WorkerToMain.js +0 -25
  94. package/types/blitter_index.d.ts +0 -6
  95. package/types/render_mode/TransparencyMixRender.d.ts +0 -21
  96. package/types/view_components/ApplicationViewController.d.ts +0 -11
  97. package/types/view_components/VCManager.d.ts +0 -5
  98. package/types/view_components/ViewComponentController.d.ts +0 -14
  99. package/types/view_components/ViewComponentControllerManager.d.ts +0 -12
  100. package/types/view_components/ViewControllerManager.d.ts +0 -12
  101. package/types/view_components/WorkerToMain.d.ts +0 -8
@@ -0,0 +1,106 @@
1
+ import { ResourceContainer } from 'ohzi-core';
2
+
3
+ import { AsyncAudiosLoader } from '../../loaders/AsyncAudiosLoader';
4
+ import { AsyncObjectsLoader } from '../../loaders/AsyncObjectsLoader';
5
+ import { AsyncTexturesLoader } from '../../loaders/AsyncTexturesLoader';
6
+ import { CompilatorManager } from './CompilatorManager';
7
+
8
+ export class LoadingState
9
+ {
10
+ constructor(scene, { SceneCompilator, TexturesCompilator, AudiosCompilator })
11
+ {
12
+ this.scene = scene;
13
+
14
+ this.SceneCompilator = SceneCompilator;
15
+ this.TexturesCompilator = TexturesCompilator;
16
+ this.AudiosCompilator = AudiosCompilator;
17
+
18
+ this.loaders = [];
19
+ this.compilators = [];
20
+
21
+ this.callback_called = false;
22
+ }
23
+
24
+ set_assets(scene_objects, scene_textures, scene_sounds)
25
+ {
26
+ this.scene_objects = scene_objects;
27
+ this.scene_textures = scene_textures;
28
+ this.scene_sounds = scene_sounds;
29
+ }
30
+
31
+ get loading_progress()
32
+ {
33
+ let progress = 0;
34
+
35
+ for (let i = 0; i < this.loaders.length; i++)
36
+ {
37
+ const loader = this.loaders[i];
38
+ progress += loader.get_progress();
39
+ }
40
+ return progress / this.loaders.length;
41
+ }
42
+
43
+ load()
44
+ {
45
+ this.setup_loader();
46
+
47
+ // TODO: improve this.
48
+ // We call load method to one of the 3 loaders because they share the same worker.
49
+ this.loaders[0].load();
50
+ }
51
+
52
+ on_enter()
53
+ {
54
+ }
55
+
56
+ on_exit()
57
+ {
58
+ }
59
+
60
+ update()
61
+ {
62
+
63
+ }
64
+
65
+ setup_loader()
66
+ {
67
+ const compilators = [];
68
+
69
+ const assets_worker = ResourceContainer.get('assets_worker');
70
+ assets_worker.postMessage({ type: 'reset', loader_name: this.scene.name });
71
+
72
+ const object_loader = new AsyncObjectsLoader(this.scene.name, this.scene_objects, assets_worker);
73
+ this.loaders.push(object_loader);
74
+ compilators.push(new this.SceneCompilator(this.scene));
75
+
76
+ const textures_loader = new AsyncTexturesLoader(this.scene.name, this.scene_textures, assets_worker);
77
+ this.loaders.push(textures_loader);
78
+ compilators.push(new this.TexturesCompilator(textures_loader.get_assets_names()));
79
+
80
+ const audios_loader = new AsyncAudiosLoader(this.scene.name, this.scene_sounds, assets_worker);
81
+ this.loaders.push(audios_loader);
82
+ compilators.push(new this.AudiosCompilator(audios_loader.get_assets_names()));
83
+
84
+ this.compilator_manager = new CompilatorManager(compilators);
85
+ }
86
+
87
+ is_loaded()
88
+ {
89
+ let loaded = true;
90
+
91
+ for (let i = 0; i < this.loaders.length; i++)
92
+ {
93
+ const loader = this.loaders[i];
94
+
95
+ loaded = loaded && loader.is_loaded();
96
+ }
97
+
98
+ return loaded;
99
+ }
100
+
101
+ is_compiled()
102
+ {
103
+ this.compilator_manager.update();
104
+ return this.compilator_manager.is_finished();
105
+ }
106
+ }
@@ -0,0 +1,41 @@
1
+ import { LoadingState } from './LoadingState';
2
+
3
+ export class RegularLoadingState extends LoadingState
4
+ {
5
+ constructor(scene, compilators)
6
+ {
7
+ super(scene, compilators);
8
+
9
+ this.on_assets_ready_called = false;
10
+ }
11
+
12
+ on_enter()
13
+ {
14
+ super.on_enter();
15
+ // this.setup_loader();
16
+ }
17
+
18
+ on_exit()
19
+ {
20
+ super.on_exit();
21
+ }
22
+
23
+ update()
24
+ {
25
+ super.update();
26
+
27
+ if (this.is_loaded())
28
+ {
29
+ if (!this.on_assets_ready_called)
30
+ {
31
+ this.scene.on_assets_ready();
32
+ this.on_assets_ready_called = true;
33
+ }
34
+
35
+ if (this.is_compiled())
36
+ {
37
+ this.scene.on_assets_compiled();
38
+ }
39
+ }
40
+ }
41
+ }
@@ -1,3 +1,4 @@
1
+
1
2
  class OMath
2
3
  {
3
4
  constructor()
@@ -50,6 +51,7 @@ class OMath
50
51
  projected_point.set(0, 0, 0);
51
52
 
52
53
  const points_on_plane = [];
54
+
53
55
  for (let i = 0; i < points.length; i++)
54
56
  {
55
57
  plane.projectPoint(points[i], projected_point);
@@ -1,16 +1,32 @@
1
+ import { TransitionManager } from './TransitionManager';
1
2
  import { ViewManager } from './ViewManager';
2
3
  import { ViewState } from './ViewState';
3
4
 
4
5
  class ApplicationView extends ViewState
5
6
  {
6
- constructor({ name, url, container })
7
+ constructor({ name, url, container, transition_data })
7
8
  {
8
9
  super(name);
9
10
 
10
11
  this.container = container;
11
12
  this.url = url;
12
13
 
14
+ this.current_opacity = 0;
15
+
16
+ transition_data = transition_data || {
17
+ animation_tracks: [],
18
+ triggers: []
19
+ };
20
+
21
+ const transitions = [
22
+ {
23
+ to: name,
24
+ data: transition_data
25
+ }
26
+ ];
27
+
13
28
  ViewManager.register_view(this);
29
+ TransitionManager.add_transitions(transitions);
14
30
  }
15
31
 
16
32
  before_enter()
@@ -41,9 +57,16 @@ class ApplicationView extends ViewState
41
57
  this.container.classList.remove('before_exit');
42
58
  }
43
59
 
44
- set_opacity(opacity)
60
+ set_opacity(current_state_data)
45
61
  {
46
- this.container.style.opacity = opacity;
62
+ const opacity = current_state_data[`${this.name}_opacity`];
63
+
64
+ if (this.current_opacity > opacity || this.current_opacity < opacity)
65
+ {
66
+ this.current_opacity = opacity;
67
+
68
+ this.container.style.opacity = this.current_opacity;
69
+ }
47
70
  }
48
71
  }
49
72
 
@@ -19,6 +19,16 @@ class TransitionManager
19
19
  return this.transition_handler.current_state_data;
20
20
  }
21
21
 
22
+ get_current_state()
23
+ {
24
+ return this.transition_handler.current_state;
25
+ }
26
+
27
+ go_to_state(state, skip = false)
28
+ {
29
+ this.transition_handler.go_to_state(state, skip);
30
+ }
31
+
22
32
  before_update()
23
33
  {
24
34
  this.transition_handler.before_update();
@@ -44,6 +54,11 @@ class TransitionManager
44
54
  this.transition_table.set_transitions(transitions);
45
55
  }
46
56
 
57
+ set_state(state)
58
+ {
59
+ this.transition_handler.set_state(state);
60
+ }
61
+
47
62
  set_default_state_data(default_state_data)
48
63
  {
49
64
  this.transition_table.set_default_state_data(default_state_data);
@@ -1,13 +1,12 @@
1
1
  import { ViewComponentManager } from './ViewComponentManager';
2
2
 
3
- class ViewComponent
3
+ export class ViewComponent
4
4
  {
5
5
  constructor({ name, container })
6
6
  {
7
7
  this.name = name;
8
8
  this.container = container;
9
-
10
- // this.hidden = true;
9
+ this.hidden = true;
11
10
 
12
11
  ViewComponentManager.register_component(this);
13
12
  }
@@ -19,10 +18,9 @@ class ViewComponent
19
18
  on_enter()
20
19
  {
21
20
  this.container.classList.remove('hidden');
22
-
23
- // this.hidden = false;
24
-
25
21
  ViewComponentManager.enable_component(this);
22
+
23
+ this.hidden = false;
26
24
  }
27
25
 
28
26
  update()
@@ -32,16 +30,32 @@ class ViewComponent
32
30
  on_exit()
33
31
  {
34
32
  this.container.classList.add('hidden');
33
+ ViewComponentManager.disable_component(this);
35
34
 
36
- // this.hidden = true;
35
+ this.hidden = true;
36
+ }
37
37
 
38
- ViewComponentManager.disable_component(this);
38
+ set_opacity(current_state_data)
39
+ {
40
+ this.container.style.opacity = current_state_data[`${this.name}_opacity`];
41
+ this.toggle_hidden();
39
42
  }
40
43
 
41
- set_opacity(opacity)
44
+ toggle_hidden()
42
45
  {
43
- this.container.style.opacity = opacity;
46
+ if (this.container.style.opacity > 0.001)
47
+ {
48
+ if (this.hidden)
49
+ {
50
+ this.on_enter();
51
+ }
52
+ }
53
+ else
54
+ {
55
+ if (!this.hidden)
56
+ {
57
+ this.on_exit();
58
+ }
59
+ }
44
60
  }
45
61
  }
46
-
47
- export { ViewComponent };
@@ -25,14 +25,24 @@ class ViewComponentManager
25
25
 
26
26
  enable_component(component)
27
27
  {
28
+ // const component_to_enable = this.get_component_by_name(component_name);
29
+
28
30
  this.enabled_components.add(component);
29
31
  }
30
32
 
31
33
  disable_component(component)
32
34
  {
35
+ // const component_to_disable = this.get_component_by_name(component_name);
36
+
33
37
  this.enabled_components.delete(component);
34
38
  }
35
39
 
40
+ get_component_by_name(component_name)
41
+ {
42
+ console.warn('DEPRECATED. Use ViewComponentManager.get instead');
43
+ this.get(component_name);
44
+ }
45
+
36
46
  get(component_name)
37
47
  {
38
48
  for (let i = 0; i < this.components.length; i++)
@@ -1,14 +1,19 @@
1
+ import { TransitionManager } from './TransitionManager';
1
2
 
2
3
  class ViewManager
3
4
  {
4
5
  constructor()
5
6
  {
6
7
  this.views = [];
7
- this.main_to_worker = undefined;
8
8
 
9
9
  this.browser_title_suffix = '';
10
10
  }
11
11
 
12
+ update()
13
+ {
14
+ this.__set_views_opacities();
15
+ }
16
+
12
17
  go_to_view(view_name, change_url = true, skip = false)
13
18
  {
14
19
  const v = this.get(view_name);
@@ -19,23 +24,58 @@ class ViewManager
19
24
  this.__change_browser_title(v.url);
20
25
  }
21
26
 
22
- this.main_to_worker.push('go_to_view_controller', [view_name, skip]);
27
+ TransitionManager.go_to_state(v, skip);
23
28
  }
24
29
 
25
30
  go_to_scene(scene_name, change_url = false, skip = false)
26
31
  {
32
+ const next_view = this.get(scene_name);
27
33
  const transition_view = this.get('transition');
28
34
 
29
- transition_view.set_next_view_name(scene_name);
30
-
35
+ transition_view.set_next_view(next_view);
31
36
  this.go_to_view(transition_view.name, change_url, skip);
32
37
  }
33
38
 
39
+ register_view(view)
40
+ {
41
+ this.views.push(view);
42
+ }
43
+
44
+ has_view(view_name)
45
+ {
46
+ for (let i = 0; i < this.views.length; i++)
47
+ {
48
+ if (this.views[i].name === view_name)
49
+ {
50
+ return true;
51
+ }
52
+ }
53
+ return false;
54
+ }
55
+
56
+ set_view(view_name)
57
+ {
58
+ const view = this.get(view_name);
59
+
60
+ TransitionManager.set_state(view);
61
+ }
62
+
34
63
  set_browser_title_suffix(title_suffix)
35
64
  {
36
65
  this.browser_title_suffix = title_suffix;
37
66
  }
38
67
 
68
+ get_current_view()
69
+ {
70
+ return TransitionManager.get_current_state();
71
+ }
72
+
73
+ get_view_by_name(view_name)
74
+ {
75
+ console.warn('DEPRECATED. Use ViewManager.get instead');
76
+ this.get(view_name);
77
+ }
78
+
39
79
  get(view_name)
40
80
  {
41
81
  for (let i = 0; i < this.views.length; i++)
@@ -62,16 +102,6 @@ class ViewManager
62
102
  return undefined;
63
103
  }
64
104
 
65
- register_view(view)
66
- {
67
- this.views.push(view);
68
- }
69
-
70
- set_main_to_worker(main_to_worker)
71
- {
72
- this.main_to_worker = main_to_worker;
73
- }
74
-
75
105
  __change_browser_url(url)
76
106
  {
77
107
  window.history.pushState('', '', url);
@@ -84,6 +114,14 @@ class ViewManager
84
114
  document.title = title ? `${title} | ${this.browser_title_suffix}` : this.browser_title_suffix;
85
115
  }
86
116
 
117
+ __set_views_opacities()
118
+ {
119
+ for (let i = 0; i < this.views.length; i++)
120
+ {
121
+ this.views[i].set_opacity(TransitionManager.current_state_data);
122
+ }
123
+ }
124
+
87
125
  __capitalize(string)
88
126
  {
89
127
  let aux_string = string.toUpperCase().replace('/', '');
@@ -17,31 +17,31 @@ class ViewState
17
17
  {
18
18
  }
19
19
 
20
- before_update()
20
+ before_exit()
21
21
  {
22
22
  }
23
23
 
24
- update()
24
+ on_exit()
25
25
  {
26
26
  }
27
27
 
28
- fixed_update()
28
+ before_update()
29
29
  {
30
30
  }
31
31
 
32
- update_enter_transition(global_view_data, transition_progress, action_sequencer)
32
+ update()
33
33
  {
34
34
  }
35
35
 
36
- update_exit_transition(global_view_data, transition_progress, action_sequencer)
36
+ fixed_update()
37
37
  {
38
38
  }
39
39
 
40
- before_exit()
40
+ update_enter_transition(global_view_data, transition_progress, action_sequencer)
41
41
  {
42
42
  }
43
43
 
44
- on_exit()
44
+ update_exit_transition(global_view_data, transition_progress, action_sequencer)
45
45
  {
46
46
  }
47
47
  }
@@ -1,6 +1,6 @@
1
- import { ActionEvent } from '../../action_sequencer/ActionEvent';
2
1
  import { ActionSequencer } from '../../action_sequencer/ActionSequencer';
3
2
  import { NumberInterpolator } from '../../action_sequencer/NumberInterpolator';
3
+ import { ActionEvent } from '../../action_sequencer/ActionEvent';
4
4
  import { DrawIOAnimationSheet } from './DrawIOAnimationSheet';
5
5
 
6
6
  class ActionSequencerBuilder
@@ -10,7 +10,7 @@ class ActionSequencerBuilder
10
10
  this.default_state_data = default_state_data;
11
11
  }
12
12
 
13
- from_animation_sheet(animation_data, current_context, initial_context, transitions_velocity)
13
+ from_animation_sheet(animation_data, current_context, initial_context)
14
14
  {
15
15
  initial_context = initial_context || this.default_state_data;
16
16
  const tracks = animation_data.animation_tracks;
@@ -26,7 +26,7 @@ class ActionSequencerBuilder
26
26
  }
27
27
  }
28
28
 
29
- const sequencer = new ActionSequencer(current_context, transitions_velocity);
29
+ const sequencer = new ActionSequencer(current_context);
30
30
 
31
31
  for (let i = 0; i < tracks.length; i++)
32
32
  {
@@ -6,8 +6,6 @@ class TransitionTable
6
6
  {
7
7
  this.transitions = [];
8
8
  this.default_state_data = {};
9
-
10
- this.transitions_velocity = 1;
11
9
  }
12
10
 
13
11
  get(from_state_name, to_state_name, current_context)
@@ -16,7 +14,7 @@ class TransitionTable
16
14
  {
17
15
  if (this.transitions[i].from === from_state_name && this.transitions[i].to === to_state_name)
18
16
  {
19
- const action_sequencer = new ActionSequencerBuilder(this.default_state_data).from_animation_sheet(this.transitions[i].data, current_context, this.transitions_velocity);
17
+ const action_sequencer = new ActionSequencerBuilder(this.default_state_data).from_animation_sheet(this.transitions[i].data, current_context);
20
18
  return action_sequencer;
21
19
  }
22
20
  }
@@ -25,7 +23,7 @@ class TransitionTable
25
23
  {
26
24
  if (this.transitions[i].to === to_state_name && this.transitions[i].from === undefined)
27
25
  {
28
- const action_sequencer = new ActionSequencerBuilder(this.default_state_data).from_animation_sheet(this.transitions[i].data, current_context, this.transitions_velocity);
26
+ const action_sequencer = new ActionSequencerBuilder(this.default_state_data).from_animation_sheet(this.transitions[i].data, current_context);
29
27
  return action_sequencer;
30
28
  }
31
29
  }
@@ -51,11 +49,6 @@ class TransitionTable
51
49
  {
52
50
  this.default_state_data = default_state_data;
53
51
  }
54
-
55
- set_transitions_velocity(transitions_velocity)
56
- {
57
- this.transitions_velocity = transitions_velocity;
58
- }
59
52
  }
60
53
 
61
54
  export { TransitionTable };
@@ -8,5 +8,4 @@ export class BaseApplication {
8
8
  on_post_render(): void;
9
9
  on_pre_render(): void;
10
10
  on_frame_end(): void;
11
- dispose(): void;
12
11
  }
@@ -1,7 +1,7 @@
1
1
  export { browser as Browser };
2
2
  declare const browser: Browser;
3
3
  declare class Browser {
4
- init(opr: any, chrome: any): void;
4
+ init(): void;
5
5
  browser_name: string;
6
6
  agent: string;
7
7
  vr_browser_keywords: string[];
@@ -1,9 +1,11 @@
1
+ import { Camera } from "three";
2
+
1
3
  export { camera_manager as CameraManager };
2
4
  declare const camera_manager: CameraManager;
3
5
  declare class CameraManager {
4
6
  init(): void;
5
- _current: any;
6
- _spectator: any;
7
+ _current: Camera;
8
+ _spectator: Camera;
7
9
  set current(arg: any);
8
10
  get current(): any;
9
11
  set spectator(arg: any);
@@ -1,13 +1,7 @@
1
1
  export { graphics as Graphics };
2
2
  declare const graphics: Graphics;
3
3
  declare class Graphics {
4
- init({ canvas, core_attributes, context_attributes, threejs_attributes, dpr }: {
5
- canvas: any;
6
- core_attributes: any;
7
- context_attributes: any;
8
- threejs_attributes: any;
9
- dpr: any;
10
- }): void;
4
+ init(canvas: any, core_attributes: any, context_attributes: any, threejs_attributes: any): void;
11
5
  _renderer: any;
12
6
  blitter: Blitter;
13
7
  canvas: any;
@@ -35,6 +29,7 @@ declare class Graphics {
35
29
  threejs_attributes: {
36
30
  logarithmicDepthBuffer: boolean;
37
31
  };
32
+ resize_observer: ResizeObserver;
38
33
  get dom_element(): any;
39
34
  get depth_normals_RT(): any;
40
35
  set_state(new_state: any): void;
@@ -45,7 +40,7 @@ declare class Graphics {
45
40
  __apply_override_material(scene: any, mat: any): void;
46
41
  readback_RT(RT: any, buffer: any): void;
47
42
  clear(RT: any, camera: any, clear_depth: any, clear_stencil: any): void;
48
- on_resize(entries: any, dpr: any): void;
43
+ on_resize(entries: any): void;
49
44
  material_pass(mat: any, dst: any): void;
50
45
  blit(src_RT: any, dst_RT: any, mat: any): void;
51
46
  blit_clear_with_material(dst_RT: any, mat: any): void;
@@ -2,5 +2,5 @@ export { initializer as Initializer };
2
2
  declare const initializer: Initializer;
3
3
  declare class Initializer {
4
4
  init(input: any): void;
5
- dispose(): void;
5
+ dispose(render_loop: any): void;
6
6
  }
@@ -1,7 +1,8 @@
1
1
  export class RenderLoop {
2
- constructor(target_application: any, graphics: any);
2
+ constructor(target_application: any, graphics: any, input: any);
3
3
  target_application: any;
4
4
  graphics: any;
5
+ input: any;
5
6
  is_running: boolean;
6
7
  frames_passed: number;
7
8
  time_accumulator: number;
@@ -2,9 +2,11 @@ export { scene_manager as SceneManager };
2
2
  declare const scene_manager: SceneManager;
3
3
  declare class SceneManager {
4
4
  init(): void;
5
- _current: any;
5
+ _current: Scene;
6
6
  add_scene(name: any): void;
7
7
  set current(arg: any);
8
8
  get current(): any;
9
9
  dispose(): void;
10
10
  }
11
+
12
+ import { Scene } from "three";
package/types/Time.d.ts CHANGED
@@ -18,11 +18,6 @@ declare class Time {
18
18
  get fdt(): number;
19
19
  get dt(): any;
20
20
  get sdt(): any;
21
- to_json(): {
22
- elapsed_time: any;
23
- delta_time: any;
24
- smooth_delta_time: any;
25
- };
26
21
  __set_frame_interpolation(value: any): void;
27
22
  __update(): void;
28
23
  __calculate_smooth_delta_time(): void;
@@ -1,5 +1,5 @@
1
1
  export class ActionSequencer {
2
- constructor(context: {}, transitions_velocity: any);
2
+ constructor(context?: {});
3
3
  previous_elapsed_time: number;
4
4
  elapsed_time: number;
5
5
  playback_speed: number;
@@ -32,5 +32,5 @@ export class ActionSequencer {
32
32
  is_channel_redefined(channel_name: any): boolean;
33
33
  __linear_map_01(value: any, from_range_start_value: any, from_range_end_value: any): number;
34
34
  __get_current_keyframe(channel_name: any, time: any): any;
35
- __get_playback_speed(transitions_velocity: any): number;
35
+ __get_playback_speed(): number;
36
36
  }
@@ -1,5 +1,6 @@
1
1
  export class SimpleTextDrawer extends CanvasDrawer {
2
2
  constructor();
3
3
  text_margin: any;
4
+ __draw(text: any, ctxOptions: any, canvas: any, ctx: any): void;
4
5
  }
5
6
  import { CanvasDrawer } from "./CanvasDrawer";