ohzi-core 9.4.0 → 9.4.2

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": "9.4.0",
3
+ "version": "9.4.2",
4
4
  "description": "OHZI Core Library",
5
5
  "source": "src/index.js",
6
6
  "module": "build/index.module.js",
package/src/Browser.js CHANGED
@@ -64,7 +64,7 @@ class Browser
64
64
 
65
65
  get has_webm()
66
66
  {
67
- return this.is_chrome || this.is_firefox || this.is_edge_chromium;
67
+ return !!(this.is_chrome || this.is_firefox || this.is_edge_chromium);
68
68
  }
69
69
 
70
70
  get has_hvec()
@@ -98,7 +98,7 @@ class Browser
98
98
  if ((tem = ua.match(/version\/(\d+)/i)) != null) M.splice(1, 1, tem[1]);
99
99
  version = M.join(' ');
100
100
 
101
- return version.split(' ')[1];
101
+ return Number(version.split(' ')[1]);
102
102
  }
103
103
  }
104
104
 
@@ -6,7 +6,7 @@ class ActionSequencer
6
6
  constructor(context)
7
7
  {
8
8
  this.elapsed_time = -0.00001;
9
- this.playback_speed = 1;
9
+ this.playback_speed = this.__get_playback_speed();
10
10
  this.playing = false;
11
11
 
12
12
  this.action_events = [];
@@ -242,6 +242,22 @@ class ActionSequencer
242
242
 
243
243
  return current;
244
244
  }
245
+
246
+ __get_playback_speed()
247
+ {
248
+ const url_params = new URLSearchParams(window.location.search);
249
+
250
+ const transitions_velocity = url_params.get('transitions_velocity');
251
+
252
+ if (transitions_velocity)
253
+ {
254
+ return Number(transitions_velocity);
255
+ }
256
+ else
257
+ {
258
+ return 1;
259
+ }
260
+ }
245
261
  }
246
262
 
247
263
  export { ActionSequencer };
@@ -4,18 +4,18 @@ import { CubeTextureLoader } from 'three';
4
4
 
5
5
  class CubemapLoader extends AbstractLoader
6
6
  {
7
- constructor(resource_id, url, size)
7
+ constructor(resource_id, url, extension, size)
8
8
  {
9
9
  super(resource_id, url, size);
10
10
  this.loader = new CubeTextureLoader();
11
11
  this.loader.setPath(url + '/');
12
12
  this.urls = [
13
- 'px.png',
14
- 'nx.png',
15
- 'py.png',
16
- 'ny.png',
17
- 'pz.png',
18
- 'nz.png'
13
+ `px.${extension}`,
14
+ `nx.${extension}`,
15
+ `py.${extension}`,
16
+ `ny.${extension}`,
17
+ `pz.${extension}`,
18
+ `nz.${extension}`
19
19
  ];
20
20
  }
21
21
 
@@ -4,6 +4,7 @@ declare class Browser {
4
4
  init(): void;
5
5
  browser_name: string;
6
6
  agent: string;
7
+ version: number;
7
8
  get name(): string;
8
9
  get is_safari(): boolean;
9
10
  get is_chrome(): boolean;
@@ -12,4 +13,5 @@ declare class Browser {
12
13
  get has_webm(): boolean;
13
14
  get has_hvec(): boolean;
14
15
  get preferred_video_extension(): "webm" | "hvec.mp4" | "mp4";
16
+ get_version(): number;
15
17
  }
@@ -1,5 +1,7 @@
1
1
  export class AsyncTextureLoader extends AbstractLoader {
2
2
  constructor(resource_id: any, url: any, size: any);
3
3
  on_preloaded_finished(resource_container: any): void;
4
+ load_with_old_method(resource_container: any): void;
5
+ load_with_new_method(resource_container: any): void;
4
6
  }
5
7
  import { AbstractLoader } from "./AbstractLoader";
@@ -1,5 +1,5 @@
1
1
  export class CubemapLoader extends AbstractLoader {
2
- constructor(resource_id: any, url: any, size: any);
2
+ constructor(resource_id: any, url: any, extension: any, size: any);
3
3
  loader: any;
4
4
  urls: string[];
5
5
  on_preloaded_finished(resource_container: any): void;