ohzi-core 5.18.3 → 6.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ohzi-core",
3
- "version": "5.18.3",
3
+ "version": "6.0.0",
4
4
  "description": "OHZI Core Library",
5
5
  "module": "build/index.module.js",
6
6
  "source": "src/index.js",
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "homepage": "https://github.com/ohzinteractive/core#readme",
42
42
  "dependencies": {
43
- "pit-js": "1.6.0",
43
+ "pit-js": "1.7.0",
44
44
  "three": "^0.134.0"
45
45
  },
46
46
  "devDependencies": {
@@ -17,4 +17,7 @@ export default class BaseApplication
17
17
 
18
18
  on_pre_render()
19
19
  {}
20
+
21
+ on_frame_end()
22
+ {}
20
23
  }
package/src/RenderLoop.js CHANGED
@@ -49,12 +49,14 @@ export default class RenderLoop
49
49
  Debug.render(this.graphics); // render debug layer
50
50
 
51
51
  // ###### END CYCLE #######
52
- Input.clear();
53
- UI.clear();
54
- Debug.clear();
55
52
 
56
53
  this._frame_id = requestAnimationFrame(this.update.bind(this));
54
+ this.target_application.on_frame_end();
57
55
  this.frames_passed++;
56
+
57
+ Input.clear();
58
+ UI.clear();
59
+ Debug.clear();
58
60
  }
59
61
 
60
62
  start()
@@ -6,7 +6,7 @@ export default class ActionSequencer
6
6
  constructor(context)
7
7
  {
8
8
  this.elapsed_time = -0.00001;
9
-
9
+ this.playback_speed = 1;
10
10
  this.playing = false;
11
11
 
12
12
  this.action_events = [];
@@ -52,8 +52,8 @@ export default class ActionSequencer
52
52
  {
53
53
  if (this.playing)
54
54
  {
55
- this.__play_clips(this.elapsed_time, this.elapsed_time + delta_time);
56
- this.elapsed_time = this.elapsed_time + delta_time;
55
+ this.__play_clips(this.elapsed_time, this.elapsed_time + delta_time * this.playback_speed);
56
+ this.elapsed_time = this.elapsed_time + delta_time * this.playback_speed;
57
57
  }
58
58
  }
59
59
 
package/src/index.js CHANGED
@@ -4,7 +4,6 @@ import ApplicationView from './view_components/ApplicationView';
4
4
  import BaseApplication from './BaseApplication';
5
5
  import BaseRender from './render_mode/BaseRender';
6
6
  import BaseShaderMaterial from './materials/BaseShaderMaterial';
7
- import BasisLoader from './resource_loader/BasisLoader.js';
8
7
  import BlitMaterial from './materials/BlitMaterial';
9
8
  import Browser from './Browser';
10
9
  import CameraManager from './CameraManager';
@@ -19,7 +18,6 @@ import EventManager from './EventManager';
19
18
  import Graphics from './Graphics';
20
19
  import Input from './Input';
21
20
  import Initializer from './Initializer';
22
- import JSONLoader from './resource_loader/JSONLoader';
23
21
  import NormalAORender from './render_mode/NormalAORender';
24
22
  import NormalRender from './render_mode/NormalRender';
25
23
  import UnrealBloomRender from './render_mode/UnrealBloomRender';
@@ -27,8 +25,6 @@ import OrthographicCamera from './OrthographicCamera';
27
25
  import OS from './OS';
28
26
  import PerspectiveCamera from './PerspectiveCamera';
29
27
  import RenderLoop from './RenderLoop';
30
- import ResourceBatch from './resource_loader/ResourceBatch';
31
- import ResourceContainer from './ResourceContainer';
32
28
  import SceneManager from './SceneManager';
33
29
  import Screen from './Screen';
34
30
  import SimpleTextDrawer from './canvas_drawer/SimpleTextDrawer';
@@ -89,13 +85,32 @@ import DualFilteringBlurMaterial from './materials/DualFilteringBlurMaterial';
89
85
  import * as BufferGeometryUtils from 'three/examples/jsm/utils/BufferGeometryUtils.js';
90
86
  import MeshBatcher from './static_batcher/MeshBatcher';
91
87
 
88
+ import AudioLoader from './resource_loader/AudioLoader';
89
+ import BasisLoader from './resource_loader/BasisLoader';
90
+ import CubemapLoader from './resource_loader/CubemapLoader';
91
+ import DAELoader from './resource_loader/DAELoader';
92
+ import FileLoader from './resource_loader/FileLoader';
93
+ import FontLoader from './resource_loader/FontLoader';
94
+ import GLTFLoader from './resource_loader/GLTFLoader';
95
+ import GLTFDRACOLoader from './resource_loader/GLTFDRACOLoader';
96
+ import HDRCubeTextureLoader from './resource_loader/HDRCubeTextureLoader';
97
+ import JSONLoader from './resource_loader/JSONLoader';
98
+ import OBJLoader from './resource_loader/OBJLoader';
99
+ import PointArrayLoader from './resource_loader/PointArrayLoader';
100
+ import RGBETextureLoader from './resource_loader/RGBETextureLoader';
101
+ import TextLoader from './resource_loader/TextLoader';
102
+ import TextureLoader from './resource_loader/TextureLoader';
103
+ import VideoLoader from './resource_loader/VideoLoader';
104
+
105
+ import ResourceBatch from './resource_loader/ResourceBatch';
106
+ import ResourceContainer from './ResourceContainer';
107
+
92
108
  export {
93
109
  AbstractLoader,
94
110
  ActionSequencerBuilder,
95
111
  ApplicationView,
96
112
  BaseApplication,
97
113
  BaseShaderMaterial,
98
- BasisLoader,
99
114
  Browser,
100
115
  CameraManager,
101
116
  Capabilities,
@@ -109,7 +124,6 @@ export {
109
124
  Graphics,
110
125
  Input,
111
126
  Initializer,
112
- JSONLoader,
113
127
  NormalAORender,
114
128
  NormalRender,
115
129
  UnrealBloomRender,
@@ -117,8 +131,6 @@ export {
117
131
  OS,
118
132
  PerspectiveCamera,
119
133
  RenderLoop,
120
- ResourceBatch,
121
- ResourceContainer,
122
134
  SceneManager,
123
135
  Screen,
124
136
  SimpleTextDrawer,
@@ -175,5 +187,25 @@ export {
175
187
 
176
188
  DualFilteringBlurMaterial,
177
189
  BufferGeometryUtils,
178
- MeshBatcher
190
+ MeshBatcher,
191
+
192
+ AudioLoader,
193
+ BasisLoader,
194
+ CubemapLoader,
195
+ DAELoader,
196
+ FileLoader,
197
+ FontLoader,
198
+ GLTFLoader,
199
+ GLTFDRACOLoader,
200
+ HDRCubeTextureLoader,
201
+ JSONLoader,
202
+ OBJLoader,
203
+ PointArrayLoader,
204
+ RGBETextureLoader,
205
+ TextLoader,
206
+ TextureLoader,
207
+ VideoLoader,
208
+
209
+ ResourceBatch,
210
+ ResourceContainer
179
211
  };
@@ -1,20 +1,4 @@
1
- import TextureLoader from './TextureLoader';
2
- import GLTFLoader from './GLTFLoader';
3
- import DAELoader from './DAELoader';
4
- import TextLoader from './TextLoader';
5
- import CubemapLoader from './CubemapLoader';
6
- import AudioLoader from './AudioLoader';
7
- import JSONLoader from './JSONLoader';
8
- import OBJLoader from './OBJLoader';
9
- import FontLoader from './FontLoader';
10
- import RGBETextureLoader from './RGBETextureLoader';
11
- import PointArrayLoader from './PointArrayLoader';
12
- import HDRCubeTextureLoader from './HDRCubeTextureLoader';
13
- import GLTFDRACOLoader from './GLTFDRACOLoader';
14
- import BasisLoader from './BasisLoader';
15
1
  import ResourceContainer from '../ResourceContainer';
16
- import FileLoader from './FileLoader';
17
- import VideoLoader from './VideoLoader';
18
2
 
19
3
  export default class ResourceBatch
20
4
  {
@@ -24,86 +8,6 @@ export default class ResourceBatch
24
8
  this.batch_name = batch_name || 'unnamed batch';
25
9
  }
26
10
 
27
- add_texture(resource_id, url, size)
28
- {
29
- this.resource_loaders.push(new TextureLoader(resource_id, url, size));
30
- }
31
-
32
- add_gltf(resource_id, url, size)
33
- {
34
- this.resource_loaders.push(new GLTFLoader(resource_id, url, size));
35
- }
36
-
37
- add_basis(resource_id, url, renderer, loader, size)
38
- {
39
- this.resource_loaders.push(new BasisLoader(resource_id, url, renderer, loader, size));
40
- }
41
-
42
- add_gltf_draco(resource_id, url, size)
43
- {
44
- this.resource_loaders.push(new GLTFDRACOLoader(resource_id, url, size));
45
- }
46
-
47
- add_dae(resource_id, url, size)
48
- {
49
- this.resource_loaders.push(new DAELoader(resource_id, url, size));
50
- }
51
-
52
- add_obj(resource_id, url, size)
53
- {
54
- this.resource_loaders.push(new OBJLoader(resource_id, url, size));
55
- }
56
-
57
- add_file(resource_id, url, size)
58
- {
59
- this.resource_loaders.push(new FileLoader(resource_id, url, size));
60
- }
61
-
62
- add_text(resource_id, url, size)
63
- {
64
- this.resource_loaders.push(new TextLoader(resource_id, url, size));
65
- }
66
-
67
- add_cubemap(resource_id, url, size)
68
- {
69
- this.resource_loaders.push(new CubemapLoader(resource_id, url, size));
70
- }
71
-
72
- add_audio(resource_id, url, loop, volume, size, positional)
73
- {
74
- this.resource_loaders.push(new AudioLoader(resource_id, url, loop, volume, size, positional));
75
- }
76
-
77
- add_video(resource_id, url, size)
78
- {
79
- this.resource_loaders.push(new VideoLoader(resource_id, url, size));
80
- }
81
-
82
- add_json(resource_id, url, size)
83
- {
84
- this.resource_loaders.push(new JSONLoader(resource_id, url, size));
85
- }
86
-
87
- add_point_array(resource_id, url, size)
88
- {
89
- this.resource_loaders.push(new PointArrayLoader(resource_id, url, size));
90
- }
91
-
92
- add_hdr(resource_id, url, size)
93
- {
94
- this.resource_loaders.push(new RGBETextureLoader(resource_id, url, size));
95
- }
96
-
97
- add_hdr_cubemap(resource_id, url, size)
98
- {
99
- this.resource_loaders.push(new HDRCubeTextureLoader(resource_id, url, size));
100
- }
101
-
102
- add_font(resource_id, url, size)
103
- {
104
- this.resource_loaders.push(new FontLoader(resource_id, url, size));
105
- }
106
-
107
11
  add_loader(loader)
108
12
  {
109
13
  this.resource_loaders.push(loader);