ohzi-core 11.1.2 → 11.2.1
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/build/index.module.js +1 -1
- package/build/index.module.js.map +1 -1
- package/package.json +3 -3
- package/src/Browser.js +5 -16
- package/src/Graphics.js +25 -0
- package/src/Initializer.js +0 -2
- package/src/ResourceContainer.js +0 -3
- package/src/components/EdgeMesh.js +6 -15
- package/src/editor/ObjectManipulator.js +1 -9
- package/src/index.js +1 -2
- package/src/primitives/Arrow.js +1 -1
- package/src/resource_loader/HDRCubeTextureLoader.js +25 -19
- package/src/static_batcher/GeometryBatcher.js +1 -1
- package/src/static_batcher/MeshBatcher.js +1 -1
- package/types/index.d.ts +74 -74
- package/src/EventManager.js +0 -151
- package/types/EventManager.d.ts +0 -44
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ohzi-core",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "11.1
|
|
5
|
-
"description": "OHZI Core Library",
|
|
4
|
+
"version": "11.2.1",
|
|
5
|
+
"description": "OHZI Interactive Core Library",
|
|
6
6
|
"source": "src/index.js",
|
|
7
7
|
"module": "build/index.module.js",
|
|
8
8
|
"types": "types/index.d.ts",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"registry": "https://registry.npmjs.org/"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"three": "0.
|
|
47
|
+
"three": "0.161.0"
|
|
48
48
|
},
|
|
49
49
|
"standardx": {
|
|
50
50
|
"ignore": [
|
package/src/Browser.js
CHANGED
|
@@ -1,32 +1,26 @@
|
|
|
1
1
|
|
|
2
2
|
class Browser
|
|
3
3
|
{
|
|
4
|
-
init(
|
|
4
|
+
async init()
|
|
5
5
|
{
|
|
6
6
|
this.browser_name = '';
|
|
7
|
-
this.agent = navigator.userAgent.toLowerCase();
|
|
7
|
+
this.agent = window.navigator.userAgent.toLowerCase();
|
|
8
8
|
|
|
9
|
-
// vr specific
|
|
10
|
-
this.vr_browser_keywords = ['oculusbrowser', 'oculus', 'vive', 'rift', 'windowsmr', 'cardboard', 'daydream', 'wolvic'];
|
|
11
|
-
this.vr_browser_name = this.vr_browser_keywords.find(keyword => this.agent.includes(keyword));
|
|
12
|
-
// Check for WebXR support (indicating VR capabilities)
|
|
13
9
|
this.has_web_xr_support = 'xr' in navigator;
|
|
10
|
+
this.is_vr = this.has_web_xr_support && await navigator.xr.isSessionSupported('immersive-vr');
|
|
14
11
|
|
|
15
12
|
switch (true)
|
|
16
13
|
{
|
|
17
|
-
case this.vr_browser_name !== undefined && this.has_web_xr_support:
|
|
18
|
-
this.browser_name = this.vr_browser_name;
|
|
19
|
-
break;
|
|
20
14
|
case this.agent.indexOf('edge') > -1:
|
|
21
15
|
this.browser_name = 'edge_ie';
|
|
22
16
|
break;
|
|
23
17
|
case this.agent.indexOf('edg') > -1:
|
|
24
18
|
this.browser_name = 'edge_chromium';
|
|
25
19
|
break;
|
|
26
|
-
case this.agent.indexOf('opr') > -1 && !!opr:
|
|
20
|
+
case this.agent.indexOf('opr') > -1 && !!window.opr:
|
|
27
21
|
this.browser_name = 'opera';
|
|
28
22
|
break;
|
|
29
|
-
case this.agent.indexOf('chrome') > -1 && !!chrome:
|
|
23
|
+
case this.agent.indexOf('chrome') > -1 && !!window.chrome:
|
|
30
24
|
this.browser_name = 'chrome';
|
|
31
25
|
break;
|
|
32
26
|
case this.agent.indexOf('trident') > -1:
|
|
@@ -71,11 +65,6 @@ class Browser
|
|
|
71
65
|
return this.browser_name === 'edge_chromium';
|
|
72
66
|
}
|
|
73
67
|
|
|
74
|
-
get is_vr()
|
|
75
|
-
{
|
|
76
|
-
return this.vr_browser_keywords.includes(this.browser_name);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
68
|
get has_webm()
|
|
80
69
|
{
|
|
81
70
|
return !!(this.is_chrome || this.is_firefox || this.is_edge_chromium);
|
package/src/Graphics.js
CHANGED
|
@@ -2,6 +2,7 @@ import { CameraManager } from './CameraManager';
|
|
|
2
2
|
import { Capabilities } from './Capabilities';
|
|
3
3
|
import { OScreen } from './OScreen';
|
|
4
4
|
import { SceneManager } from './SceneManager';
|
|
5
|
+
|
|
5
6
|
import { BaseRender } from './render_mode/BaseRender';
|
|
6
7
|
import { Blitter } from './render_utilities/Blitter';
|
|
7
8
|
import { DepthAndNormalsRenderer } from './render_utilities/DepthAndNormalsRenderer';
|
|
@@ -175,6 +176,30 @@ class Graphics
|
|
|
175
176
|
this.__apply_override_material(scene, undefined);
|
|
176
177
|
}
|
|
177
178
|
|
|
179
|
+
compile(scene, camera, RT, override_mat)
|
|
180
|
+
{
|
|
181
|
+
this.__apply_override_material(scene, override_mat);
|
|
182
|
+
|
|
183
|
+
this._renderer.setRenderTarget(RT === undefined ? null : RT);
|
|
184
|
+
this._renderer.compile(scene || SceneManager.current,
|
|
185
|
+
camera || CameraManager.current);
|
|
186
|
+
|
|
187
|
+
this.__apply_override_material(scene, undefined);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
async compile_async(scene, camera, RT, override_mat, target_scene)
|
|
191
|
+
{
|
|
192
|
+
this.__apply_override_material(scene, override_mat);
|
|
193
|
+
|
|
194
|
+
this._renderer.setRenderTarget(RT === undefined ? null : RT);
|
|
195
|
+
const promise = this._renderer.compileAsync(scene || SceneManager.current,
|
|
196
|
+
camera || CameraManager.current, target_scene);
|
|
197
|
+
|
|
198
|
+
this.__apply_override_material(scene, undefined);
|
|
199
|
+
|
|
200
|
+
return promise;
|
|
201
|
+
}
|
|
202
|
+
|
|
178
203
|
render_scene(scene)
|
|
179
204
|
{
|
|
180
205
|
if (scene.on_pre_render)
|
package/src/Initializer.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CameraManager } from './CameraManager';
|
|
2
2
|
import { Capabilities } from './Capabilities';
|
|
3
3
|
import { Debug } from './Debug';
|
|
4
|
-
import { EventManager } from './EventManager';
|
|
5
4
|
import { Graphics } from './Graphics';
|
|
6
5
|
import { OS } from './OS';
|
|
7
6
|
import { OScreen } from './OScreen';
|
|
@@ -24,7 +23,6 @@ class Initializer
|
|
|
24
23
|
CameraManager.init();
|
|
25
24
|
CameraUtilities.init(input);
|
|
26
25
|
Capabilities.init();
|
|
27
|
-
EventManager.init();
|
|
28
26
|
GeometryBatcher.init();
|
|
29
27
|
|
|
30
28
|
OS.init();
|
package/src/ResourceContainer.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { EventManager } from './EventManager';
|
|
2
1
|
|
|
3
2
|
class ResourceContainer
|
|
4
3
|
{
|
|
@@ -21,8 +20,6 @@ class ResourceContainer
|
|
|
21
20
|
this.resources[name] = resource;
|
|
22
21
|
this.resources_by_url[url] = resource;
|
|
23
22
|
}
|
|
24
|
-
|
|
25
|
-
EventManager.fire_resource_loaded({ name: name, value: resource });
|
|
26
23
|
}
|
|
27
24
|
|
|
28
25
|
get_resource(name)
|
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
import edge_line_vert from '../shaders/edges/edges.vert';
|
|
2
|
-
import edge_line_frag from '../shaders/edges/edges.frag';
|
|
3
|
-
import corners_vert from '../shaders/edges/corners.vert';
|
|
4
1
|
import corners_frag from '../shaders/edges/corners.frag';
|
|
2
|
+
import corners_vert from '../shaders/edges/corners.vert';
|
|
3
|
+
import edge_line_frag from '../shaders/edges/edges.frag';
|
|
4
|
+
import edge_line_vert from '../shaders/edges/edges.vert';
|
|
5
5
|
|
|
6
6
|
import * as BufferGeometryUtils from 'three/examples/jsm/utils/BufferGeometryUtils.js';
|
|
7
7
|
|
|
8
|
-
import { Object3D } from 'three';
|
|
9
|
-
import { ShaderMaterial } from 'three';
|
|
10
|
-
import { Color } from 'three';
|
|
11
|
-
import { Mesh } from 'three';
|
|
12
|
-
import { EdgesGeometry } from 'three';
|
|
13
|
-
import { LineSegments } from 'three';
|
|
14
|
-
import { LineBasicMaterial } from 'three';
|
|
15
|
-
import { Vector3 } from 'three';
|
|
16
|
-
import { PlaneGeometry } from 'three';
|
|
17
|
-
import { BufferAttribute } from 'three';
|
|
8
|
+
import { BufferAttribute, Color, EdgesGeometry, LineBasicMaterial, LineSegments, Mesh, Object3D, PlaneGeometry, ShaderMaterial, Vector3 } from 'three';
|
|
18
9
|
|
|
19
10
|
class EdgeMesh extends Object3D
|
|
20
11
|
{
|
|
@@ -114,7 +105,7 @@ class EdgeMesh extends Object3D
|
|
|
114
105
|
buffer_geometries.push(geometry);
|
|
115
106
|
}
|
|
116
107
|
|
|
117
|
-
return BufferGeometryUtils.
|
|
108
|
+
return BufferGeometryUtils.mergeGeometries(buffer_geometries);
|
|
118
109
|
}
|
|
119
110
|
|
|
120
111
|
__get_corners_geometry(geometry_vertices)
|
|
@@ -135,7 +126,7 @@ class EdgeMesh extends Object3D
|
|
|
135
126
|
plane_geometry.setAttribute('w_pos', new BufferAttribute(pos_array, 3));
|
|
136
127
|
circle_buffer_geometries.push(plane_geometry);
|
|
137
128
|
}
|
|
138
|
-
return BufferGeometryUtils.
|
|
129
|
+
return BufferGeometryUtils.mergeGeometries(circle_buffer_geometries);
|
|
139
130
|
}
|
|
140
131
|
|
|
141
132
|
set_visible(boolean)
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { ManipulatorHandle } from '../editor/ManipulatorHandle';
|
|
2
|
-
import { EventManager } from '../EventManager';
|
|
3
2
|
|
|
4
|
-
import { Object3D } from 'three';
|
|
5
|
-
import { Vector2 } from 'three';
|
|
6
|
-
import { Vector3 } from 'three';
|
|
3
|
+
import { Object3D, Vector2, Vector3 } from 'three';
|
|
7
4
|
|
|
8
5
|
class ObjectManipulator extends Object3D
|
|
9
6
|
{
|
|
@@ -59,11 +56,6 @@ class ObjectManipulator extends Object3D
|
|
|
59
56
|
this.tmp_local_pos.copy(this.position);
|
|
60
57
|
this.target_obj.parent.worldToLocal(this.tmp_local_pos);
|
|
61
58
|
this.target_obj.position.copy(this.tmp_local_pos);
|
|
62
|
-
const scope = this;
|
|
63
|
-
EventManager.fire_unit_position_updated({
|
|
64
|
-
unit_id: scope.target_obj.name,
|
|
65
|
-
position: scope.target_obj.position
|
|
66
|
-
});
|
|
67
59
|
}
|
|
68
60
|
}
|
|
69
61
|
|
package/src/index.js
CHANGED
|
@@ -16,7 +16,6 @@ import { CanvasDrawer } from './canvas_drawer/CanvasDrawer';
|
|
|
16
16
|
import { SimpleTextDrawer } from './canvas_drawer/SimpleTextDrawer';
|
|
17
17
|
import { Capabilities } from './Capabilities';
|
|
18
18
|
import { Debug } from './Debug';
|
|
19
|
-
import { EventManager } from './EventManager';
|
|
20
19
|
import { Graphics } from './Graphics';
|
|
21
20
|
import { CSSAnimator } from './html_utilities/CSSAnimator';
|
|
22
21
|
import { Initializer } from './Initializer';
|
|
@@ -119,7 +118,7 @@ import { ResourceContainer } from './ResourceContainer';
|
|
|
119
118
|
|
|
120
119
|
export {
|
|
121
120
|
AbstractLoader, ActionEvent, ActionInterpolator, ActionSequencer, ActionSequencerBuilder, AddMaterial, ApplicationView, ApplicationViewController, ArrayUtilities, Arrow, AsyncTextureLoader, AudioLoader, BaseApplication, BaseRender, BaseShaderMaterial, BasisLoader, BlitMaterial, Blurrer, Browser, BufferGeometryUtils, CameraManager, CameraUtilities, CanvasDrawer, Capabilities,
|
|
122
|
-
CSSAnimator, Cube, CubemapLoader, DAELoader, Debug, DebugNormalsRender, DrawIOAnimationSheet, DualFilteringBlurMaterial, DualFilteringBlurrer, EasingFunctions,
|
|
121
|
+
CSSAnimator, Cube, CubemapLoader, DAELoader, Debug, DebugNormalsRender, DrawIOAnimationSheet, DualFilteringBlurMaterial, DualFilteringBlurrer, EasingFunctions, FileLoader,
|
|
123
122
|
FontLoader, FrustumPointFitter, GaussianBlurrer, GeometryUtilities, GLTFDRACOLoader, GLTFLoader, GPUParticleSystem, Graphics, Grid, HDRCubeTextureLoader, HorizontalPlane, HTMLUtilities,
|
|
124
123
|
ImageUtilities, Initializer, JSONLoader, KeyboardInput, Line, MedianFilter, MeshBatcher, MeshSampler,
|
|
125
124
|
ModelUtilities, NormalAORender, NormalRender, NumberInterpolator, ObjectUtilities, OBJLoader, OMath, OrthographicCamera, OrthographicFrustumPointFitter, OS, OScreen, ParticleAttribute,
|
package/src/primitives/Arrow.js
CHANGED
|
@@ -17,7 +17,7 @@ class Arrow extends Mesh
|
|
|
17
17
|
const cone_geometry = new ConeGeometry(0.1, cone_height, 32);
|
|
18
18
|
cone_geometry.translate(0, cylinder_height + cone_height / 2, 0);
|
|
19
19
|
|
|
20
|
-
const buffer_geometry = BufferGeometryUtils.
|
|
20
|
+
const buffer_geometry = BufferGeometryUtils.mergeGeometries([cylinder_geo, cone_geometry]);
|
|
21
21
|
buffer_geometry.rotateX(3.14 / 2);
|
|
22
22
|
|
|
23
23
|
const material = new MeshBasicMaterial({ color: color });
|
|
@@ -1,43 +1,49 @@
|
|
|
1
1
|
import { AbstractLoader } from './AbstractLoader';
|
|
2
2
|
|
|
3
3
|
import { HDRCubeTextureLoader as THDRCubeTextureLoader } from 'three/examples/jsm/loaders/HDRCubeTextureLoader.js';
|
|
4
|
-
import { UnsignedByteType } from 'three';
|
|
5
4
|
|
|
6
5
|
class HDRCubeTextureLoader extends AbstractLoader
|
|
7
6
|
{
|
|
8
|
-
constructor(resource_id, url, size)
|
|
7
|
+
constructor(resource_id, url, extension, size)
|
|
9
8
|
{
|
|
10
9
|
super(resource_id, url, size);
|
|
11
10
|
this.loader = new THDRCubeTextureLoader();
|
|
12
|
-
this.
|
|
11
|
+
this.loader.setPath(url + '/');
|
|
12
|
+
// this.loader.setDataType(UnsignedByteType);
|
|
13
|
+
this.urls = [
|
|
14
|
+
`px.${extension}`,
|
|
15
|
+
`nx.${extension}`,
|
|
16
|
+
`py.${extension}`,
|
|
17
|
+
`ny.${extension}`,
|
|
18
|
+
`pz.${extension}`,
|
|
19
|
+
`nz.${extension}`
|
|
20
|
+
];
|
|
13
21
|
}
|
|
14
22
|
|
|
15
23
|
on_preloaded_finished(resource_container)
|
|
16
24
|
{
|
|
17
25
|
if (resource_container.resources_by_url[this.url] === undefined)
|
|
18
26
|
{
|
|
19
|
-
this.loader.
|
|
20
|
-
|
|
21
|
-
.
|
|
22
|
-
{
|
|
23
|
-
resource_container.set_resource(this.resource_id, this.url, hdr);
|
|
27
|
+
this.loader.load(this.urls, (hdr) =>
|
|
28
|
+
{
|
|
29
|
+
resource_container.set_resource(this.resource_id, this.url, hdr);
|
|
24
30
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
this.__update_downloaded_bytes(1, 1);
|
|
32
|
+
this.__loading_ended();
|
|
33
|
+
},
|
|
34
|
+
(xhr) =>
|
|
35
|
+
{
|
|
30
36
|
// if (xhr)
|
|
31
37
|
// {
|
|
32
38
|
// let total = xhr.total || this.total_bytes;
|
|
33
39
|
// this.__update_downloaded_bytes(xhr.loaded, total);
|
|
34
40
|
// }
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
},
|
|
42
|
+
(msg) =>
|
|
43
|
+
{
|
|
44
|
+
this.__set_error(msg + '\n\n\t If the error says something about unexpected token < in JSON then the probably the problem is related to the file not being found. Check the name and path of the resource');
|
|
45
|
+
this.__loading_ended();
|
|
46
|
+
});
|
|
41
47
|
}
|
|
42
48
|
else
|
|
43
49
|
{
|
|
@@ -36,7 +36,7 @@ class GeometryBatcher
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
const buffer_attribute = new BufferAttribute(new Float32Array(attr_accessor_uvs), 2);
|
|
39
|
-
const buffer_geometry = BufferGeometryUtils.
|
|
39
|
+
const buffer_geometry = BufferGeometryUtils.mergeGeometries(buffer_geometries);
|
|
40
40
|
buffer_geometry.setAttribute('attr_accessor_uv', buffer_attribute);
|
|
41
41
|
|
|
42
42
|
this.batches.push(new GeometryBatch(buffer_geometry, texture_width));
|
|
@@ -41,7 +41,7 @@ class MeshBatcher
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
const buffer_geometry = BufferGeometryUtils.
|
|
44
|
+
const buffer_geometry = BufferGeometryUtils.mergeGeometries(geometries);
|
|
45
45
|
|
|
46
46
|
const buffer_attribute = new BufferAttribute(new Float32Array(attr_mesh_id), 1);
|
|
47
47
|
buffer_geometry.setAttribute('mesh_id', buffer_attribute);
|
package/types/index.d.ts
CHANGED
|
@@ -1,106 +1,106 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseApplication } from "./BaseApplication";
|
|
2
|
+
import { Browser } from "./Browser";
|
|
3
|
+
import { CameraManager } from "./CameraManager";
|
|
4
|
+
import { Capabilities } from "./Capabilities";
|
|
5
|
+
import { Debug } from "./Debug";
|
|
6
|
+
import { Graphics } from "./Graphics";
|
|
7
|
+
import { Initializer } from "./Initializer";
|
|
8
|
+
import { KeyboardInput } from "./KeyboardInput";
|
|
9
|
+
import { OS } from "./OS";
|
|
10
|
+
import { OScreen } from "./OScreen";
|
|
11
|
+
import { OrthographicCamera } from "./OrthographicCamera";
|
|
12
|
+
import { PerspectiveCamera } from "./PerspectiveCamera";
|
|
13
|
+
import { RenderLoop } from "./RenderLoop";
|
|
14
|
+
import { ResourceContainer } from "./ResourceContainer";
|
|
15
|
+
import { SceneManager } from "./SceneManager";
|
|
16
|
+
import { Time } from "./Time";
|
|
17
|
+
import { UI } from "./UI";
|
|
2
18
|
import { ActionEvent } from "./action_sequencer/ActionEvent";
|
|
3
19
|
import { ActionInterpolator } from "./action_sequencer/ActionInterpolator";
|
|
4
20
|
import { ActionSequencer } from "./action_sequencer/ActionSequencer";
|
|
5
|
-
import {
|
|
21
|
+
import { NumberInterpolator } from "./action_sequencer/NumberInterpolator";
|
|
22
|
+
import { VectorInterpolator } from "./action_sequencer/VectorInterpolator";
|
|
23
|
+
import { CanvasDrawer } from "./canvas_drawer/CanvasDrawer";
|
|
24
|
+
import { SimpleTextDrawer } from "./canvas_drawer/SimpleTextDrawer";
|
|
25
|
+
import { Grid } from "./components/Grid";
|
|
26
|
+
import { Line } from "./components/Line";
|
|
27
|
+
import { Text2D } from "./components/Text2D";
|
|
28
|
+
import { UIElement } from "./components/UIElement";
|
|
29
|
+
import { UpdatableMaterialMesh } from "./components/UpdatableMaterialMesh";
|
|
30
|
+
import { WorldImage } from "./components/WorldImage";
|
|
31
|
+
import { SDFTextBatch } from "./components/sdf_text/SDFTextBatch";
|
|
32
|
+
import { GPUParticleSystem } from "./gpu_particles/GPUParticleSystem";
|
|
33
|
+
import { ParticleAttribute } from "./gpu_particles/ParticleAttribute";
|
|
34
|
+
import { ParticlePositionAttribute } from "./gpu_particles/ParticlePositionAttribute";
|
|
35
|
+
import { CSSAnimator } from "./html_utilities/CSSAnimator";
|
|
6
36
|
import { AddMaterial } from "./materials/AddMaterial";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
37
|
+
import { BaseShaderMaterial } from "./materials/BaseShaderMaterial";
|
|
38
|
+
import { BlitMaterial } from "./materials/BlitMaterial";
|
|
39
|
+
import { DualFilteringBlurMaterial } from "./materials/DualFilteringBlurMaterial";
|
|
40
|
+
import { UnrealBloomComposeMaterial } from "./materials/UnrealBloomComposeMaterial";
|
|
10
41
|
import { Arrow } from "./primitives/Arrow";
|
|
42
|
+
import { Cube } from "./primitives/Cube";
|
|
43
|
+
import { HorizontalPlane } from "./primitives/HorizontalPlane";
|
|
44
|
+
import { Sphere } from "./primitives/Sphere";
|
|
45
|
+
import { VerticalPlane } from "./primitives/VerticalPlane";
|
|
46
|
+
import { BaseRender } from "./render_mode/BaseRender";
|
|
47
|
+
import { DebugNormalsRender } from "./render_mode/DebugNormalsRender";
|
|
48
|
+
import { NormalAORender } from "./render_mode/NormalAORender";
|
|
49
|
+
import { NormalRender } from "./render_mode/NormalRender";
|
|
50
|
+
import { UnrealBloomRender } from "./render_mode/UnrealBloomRender";
|
|
51
|
+
import { VRRender } from "./render_mode/VRRender";
|
|
52
|
+
import { Blurrer } from "./render_utilities/Blurrer";
|
|
53
|
+
import { DualFilteringBlurrer } from "./render_utilities/DualFilteringBlurrer";
|
|
54
|
+
import { GaussianBlurrer } from "./render_utilities/GaussianBlurrer";
|
|
55
|
+
import { MedianFilter } from "./render_utilities/MedianFilter";
|
|
56
|
+
import { AbstractLoader } from "./resource_loader/AbstractLoader";
|
|
11
57
|
import { AsyncTextureLoader } from "./resource_loader/AsyncTextureLoader";
|
|
12
58
|
import { AudioLoader } from "./resource_loader/AudioLoader";
|
|
13
|
-
import { BaseApplication } from "./BaseApplication";
|
|
14
|
-
import { BaseRender } from "./render_mode/BaseRender";
|
|
15
|
-
import { BaseShaderMaterial } from "./materials/BaseShaderMaterial";
|
|
16
59
|
import { BasisLoader } from "./resource_loader/BasisLoader";
|
|
17
|
-
import { BlitMaterial } from "./materials/BlitMaterial";
|
|
18
|
-
import { Blurrer } from "./render_utilities/Blurrer";
|
|
19
|
-
import { Browser } from "./Browser";
|
|
20
|
-
import { CameraManager } from "./CameraManager";
|
|
21
|
-
import { CameraUtilities } from "./utilities/CameraUtilities";
|
|
22
|
-
import { CanvasDrawer } from "./canvas_drawer/CanvasDrawer";
|
|
23
|
-
import { Capabilities } from "./Capabilities";
|
|
24
|
-
import { CSSAnimator } from "./html_utilities/CSSAnimator";
|
|
25
|
-
import { Cube } from "./primitives/Cube";
|
|
26
60
|
import { CubemapLoader } from "./resource_loader/CubemapLoader";
|
|
27
61
|
import { DAELoader } from "./resource_loader/DAELoader";
|
|
28
|
-
import { Debug } from "./Debug";
|
|
29
|
-
import { DebugNormalsRender } from "./render_mode/DebugNormalsRender";
|
|
30
|
-
import { DrawIOAnimationSheet } from "./view_components/transition/DrawIOAnimationSheet";
|
|
31
|
-
import { DualFilteringBlurMaterial } from "./materials/DualFilteringBlurMaterial";
|
|
32
|
-
import { DualFilteringBlurrer } from "./render_utilities/DualFilteringBlurrer";
|
|
33
|
-
import { EasingFunctions } from "./utilities/EasingFunctions";
|
|
34
|
-
import { EventManager } from "./EventManager";
|
|
35
62
|
import { FileLoader } from "./resource_loader/FileLoader";
|
|
36
63
|
import { FontLoader } from "./resource_loader/FontLoader";
|
|
37
|
-
import { FrustumPointFitter } from "./utilities/FrustumPointFitter";
|
|
38
|
-
import { GaussianBlurrer } from "./render_utilities/GaussianBlurrer";
|
|
39
|
-
import { GeometryUtilities } from "./utilities/GeometryUtilities";
|
|
40
64
|
import { GLTFDRACOLoader } from "./resource_loader/GLTFDRACOLoader";
|
|
41
65
|
import { GLTFLoader } from "./resource_loader/GLTFLoader";
|
|
42
|
-
import { GPUParticleSystem } from "./gpu_particles/GPUParticleSystem";
|
|
43
|
-
import { Graphics } from "./Graphics";
|
|
44
|
-
import { Grid } from "./components/Grid";
|
|
45
66
|
import { HDRCubeTextureLoader } from "./resource_loader/HDRCubeTextureLoader";
|
|
46
|
-
import { HorizontalPlane } from "./primitives/HorizontalPlane";
|
|
47
|
-
import { HTMLUtilities } from "./utilities/HTMLUtilities";
|
|
48
|
-
import { ImageUtilities } from "./utilities/ImageUtilities";
|
|
49
|
-
import { Initializer } from "./Initializer";
|
|
50
67
|
import { JSONLoader } from "./resource_loader/JSONLoader";
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
68
|
+
import { OBJLoader } from "./resource_loader/OBJLoader";
|
|
69
|
+
import { PointArrayLoader } from "./resource_loader/PointArrayLoader";
|
|
70
|
+
import { RGBETextureLoader } from "./resource_loader/RGBETextureLoader";
|
|
71
|
+
import { ResourceBatch } from "./resource_loader/ResourceBatch";
|
|
72
|
+
import { TextLoader } from "./resource_loader/TextLoader";
|
|
73
|
+
import { TextureLoader } from "./resource_loader/TextureLoader";
|
|
74
|
+
import { VideoLoader } from "./resource_loader/VideoLoader";
|
|
54
75
|
import { MeshBatcher } from "./static_batcher/MeshBatcher";
|
|
76
|
+
import { ArrayUtilities } from "./utilities/ArrayUtilities";
|
|
77
|
+
import { CameraUtilities } from "./utilities/CameraUtilities";
|
|
78
|
+
import { EasingFunctions } from "./utilities/EasingFunctions";
|
|
79
|
+
import { FrustumPointFitter } from "./utilities/FrustumPointFitter";
|
|
80
|
+
import { GeometryUtilities } from "./utilities/GeometryUtilities";
|
|
81
|
+
import { HTMLUtilities } from "./utilities/HTMLUtilities";
|
|
82
|
+
import { ImageUtilities } from "./utilities/ImageUtilities";
|
|
55
83
|
import { MeshSampler } from "./utilities/MeshSampler";
|
|
56
84
|
import { ModelUtilities } from "./utilities/ModelUtilities";
|
|
57
|
-
import { NormalAORender } from "./render_mode/NormalAORender";
|
|
58
|
-
import { NormalRender } from "./render_mode/NormalRender";
|
|
59
|
-
import { NumberInterpolator } from "./action_sequencer/NumberInterpolator";
|
|
60
|
-
import { ObjectUtilities } from "./utilities/ObjectUtilities";
|
|
61
|
-
import { OBJLoader } from "./resource_loader/OBJLoader";
|
|
62
85
|
import { OMath } from "./utilities/OMath";
|
|
63
|
-
import {
|
|
86
|
+
import { ObjectUtilities } from "./utilities/ObjectUtilities";
|
|
64
87
|
import { OrthographicFrustumPointFitter } from "./utilities/OrthographicFrustumPointFitter";
|
|
65
|
-
import { OS } from "./OS";
|
|
66
|
-
import { OScreen } from "./OScreen";
|
|
67
|
-
import { ParticleAttribute } from "./gpu_particles/ParticleAttribute";
|
|
68
|
-
import { ParticlePositionAttribute } from "./gpu_particles/ParticlePositionAttribute";
|
|
69
|
-
import { PerspectiveCamera } from "./PerspectiveCamera";
|
|
70
88
|
import { PerspectiveFrustumPointFitter } from "./utilities/PerspectiveFrustumPointFitter";
|
|
71
|
-
import { PointArrayLoader } from "./resource_loader/PointArrayLoader";
|
|
72
|
-
import { RenderLoop } from "./RenderLoop";
|
|
73
|
-
import { ResourceBatch } from "./resource_loader/ResourceBatch";
|
|
74
|
-
import { ResourceContainer } from "./ResourceContainer";
|
|
75
|
-
import { RGBETextureLoader } from "./resource_loader/RGBETextureLoader";
|
|
76
|
-
import { SceneManager } from "./SceneManager";
|
|
77
|
-
import { SDFTextBatch } from "./components/sdf_text/SDFTextBatch";
|
|
78
|
-
import { SimpleTextDrawer } from "./canvas_drawer/SimpleTextDrawer";
|
|
79
|
-
import { Sphere } from "./primitives/Sphere";
|
|
80
89
|
import { StringUtilities } from "./utilities/StringUtilities";
|
|
81
|
-
import { Text2D } from "./components/Text2D";
|
|
82
|
-
import { TextLoader } from "./resource_loader/TextLoader";
|
|
83
|
-
import { TextureLoader } from "./resource_loader/TextureLoader";
|
|
84
|
-
import { Time } from "./Time";
|
|
85
90
|
import { TimeUtilities } from "./utilities/TimeUtilities";
|
|
86
|
-
import { TransitionManager } from "./view_components/TransitionManager";
|
|
87
|
-
import { TransitionTable } from "./view_components/transition/TransitionTable";
|
|
88
|
-
import { UI } from "./UI";
|
|
89
|
-
import { UIElement } from "./components/UIElement";
|
|
90
|
-
import { UnrealBloomComposeMaterial } from "./materials/UnrealBloomComposeMaterial";
|
|
91
|
-
import { UnrealBloomRender } from "./render_mode/UnrealBloomRender";
|
|
92
|
-
import { UpdatableMaterialMesh } from "./components/UpdatableMaterialMesh";
|
|
93
91
|
import { Validation } from "./utilities/Validation";
|
|
92
|
+
import { ApplicationView } from "./view_components/ApplicationView";
|
|
93
|
+
import { ApplicationViewController } from "./view_components/ApplicationViewController";
|
|
94
|
+
import { TransitionManager } from "./view_components/TransitionManager";
|
|
94
95
|
import { VCManager } from "./view_components/VCManager";
|
|
95
|
-
import { VectorInterpolator } from "./action_sequencer/VectorInterpolator";
|
|
96
|
-
import { VerticalPlane } from "./primitives/VerticalPlane";
|
|
97
|
-
import { VideoLoader } from "./resource_loader/VideoLoader";
|
|
98
96
|
import { ViewComponent } from "./view_components/ViewComponent";
|
|
99
97
|
import { ViewComponentController } from "./view_components/ViewComponentController";
|
|
100
98
|
import { ViewComponentControllerManager } from "./view_components/ViewComponentControllerManager";
|
|
101
99
|
import { ViewComponentManager } from "./view_components/ViewComponentManager";
|
|
102
100
|
import { ViewManager } from "./view_components/ViewManager";
|
|
103
|
-
import { VRRender } from "./render_mode/VRRender";
|
|
104
101
|
import { WorkerToMain } from "./view_components/WorkerToMain";
|
|
105
|
-
import {
|
|
106
|
-
|
|
102
|
+
import { ActionSequencerBuilder } from "./view_components/transition/ActionSequencerBuilder";
|
|
103
|
+
import { DrawIOAnimationSheet } from "./view_components/transition/DrawIOAnimationSheet";
|
|
104
|
+
import { TransitionTable } from "./view_components/transition/TransitionTable";
|
|
105
|
+
export { AbstractLoader, ActionEvent, ActionInterpolator, ActionSequencer, ActionSequencerBuilder, AddMaterial, ApplicationView, ApplicationViewController, ArrayUtilities, Arrow, AsyncTextureLoader, AudioLoader, BaseApplication, BaseRender, BaseShaderMaterial, BasisLoader, BlitMaterial, Blurrer, Browser, BufferGeometryUtils, CSSAnimator, CameraManager, CameraUtilities, CanvasDrawer, Capabilities, Cube, CubemapLoader, DAELoader, Debug, DebugNormalsRender, DrawIOAnimationSheet, DualFilteringBlurMaterial, DualFilteringBlurrer, EasingFunctions, FileLoader, FontLoader, FrustumPointFitter, GLTFDRACOLoader, GLTFLoader, GPUParticleSystem, GaussianBlurrer, GeometryUtilities, Graphics, Grid, HDRCubeTextureLoader, HTMLUtilities, HorizontalPlane, ImageUtilities, Initializer, JSONLoader, KeyboardInput, Line, MedianFilter, MeshBatcher, MeshSampler, ModelUtilities, NormalAORender, NormalRender, NumberInterpolator, OBJLoader, OMath, OS, OScreen, ObjectUtilities, OrthographicCamera, OrthographicFrustumPointFitter, ParticleAttribute, ParticlePositionAttribute, PerspectiveCamera, PerspectiveFrustumPointFitter, PointArrayLoader, RGBETextureLoader, RenderLoop, ResourceBatch, ResourceContainer, SDFTextBatch, SceneManager, SimpleTextDrawer, Sphere, StringUtilities, Text2D, TextLoader, TextureLoader, Time, TimeUtilities, TransitionManager, TransitionTable, UI, UIElement, UnrealBloomComposeMaterial, UnrealBloomRender, UpdatableMaterialMesh, VCManager, VRRender, Validation, VectorInterpolator, VerticalPlane, VideoLoader, ViewComponent, ViewComponentController, ViewComponentControllerManager, ViewComponentManager, ViewManager, WorkerToMain, WorldImage };
|
|
106
|
+
|
package/src/EventManager.js
DELETED
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
class EventManager
|
|
2
|
-
{
|
|
3
|
-
init()
|
|
4
|
-
{
|
|
5
|
-
this.queue = {};
|
|
6
|
-
|
|
7
|
-
this.zoom_changed_evt = 'zoom_changed';
|
|
8
|
-
this.store_clickd_evt = 'store_clicked';
|
|
9
|
-
this.point_selected_evt = 'point_selected';
|
|
10
|
-
this.config_changed = 'config_changed';
|
|
11
|
-
|
|
12
|
-
this.path_substep_completed = 'path_substep_completed';
|
|
13
|
-
this.path_completed = 'path_completed';
|
|
14
|
-
this.go_to_store_requested_evt = 'go_to_store_requested';
|
|
15
|
-
|
|
16
|
-
this.resource_loaded_evt = 'resource_loaded';
|
|
17
|
-
this.service_clicked_evt = 'service_clicked';
|
|
18
|
-
this.unit_pos_updated_evt = 'unit_position_updated';
|
|
19
|
-
|
|
20
|
-
this.floor_changed_evt = 'floor_changed';
|
|
21
|
-
|
|
22
|
-
this.on_enter_floor_navigation = 'on_enter_floor_navigation';
|
|
23
|
-
this.on_exit_floor_navigation = 'on_exit_floor_navigation';
|
|
24
|
-
|
|
25
|
-
this.on_enter_floor_selection = 'on_enter_floor_selection';
|
|
26
|
-
this.on_exit_floor_selection = 'on_exit_floor_selection';
|
|
27
|
-
|
|
28
|
-
this.on_enter_outside_navigation = 'on_enter_outside_navigation';
|
|
29
|
-
this.on_exit_outside_navigation = 'on_exit_outside_navigation';
|
|
30
|
-
|
|
31
|
-
this.step_selected_evt = 'step_selected';
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
fire(event, payload)
|
|
35
|
-
{
|
|
36
|
-
const queue = this.queue[event];
|
|
37
|
-
|
|
38
|
-
if (queue === undefined)
|
|
39
|
-
{
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
let i = queue.length;
|
|
43
|
-
while (i--)
|
|
44
|
-
{
|
|
45
|
-
queue[i](payload);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
on(event, callback)
|
|
50
|
-
{
|
|
51
|
-
if (typeof this.queue[event] === 'undefined')
|
|
52
|
-
{
|
|
53
|
-
this.queue[event] = [];
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
this.queue[event].push(callback);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
fire_zoom_changed(zoom)
|
|
60
|
-
{
|
|
61
|
-
this.fire(this.zoom_changed_evt, zoom);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
fire_store_selected(store_id)
|
|
65
|
-
{
|
|
66
|
-
this.fire(this.store_clickd_evt, store_id);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
fire_point_selected(hit_data)
|
|
70
|
-
{
|
|
71
|
-
this.fire(this.point_selected_evt, hit_data);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
fire_config_changed()
|
|
75
|
-
{
|
|
76
|
-
this.fire(this.config_changed);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
fire_path_substep_completed(step_number)
|
|
80
|
-
{
|
|
81
|
-
this.fire(this.path_substep_completed, step_number);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
fire_path_completed()
|
|
85
|
-
{
|
|
86
|
-
this.fire(this.path_completed);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
fire_step_selected(step_index)
|
|
90
|
-
{
|
|
91
|
-
this.fire(this.step_selected_evt, step_index);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
fire_go_to_store_requested(store_id)
|
|
95
|
-
{
|
|
96
|
-
this.fire(this.go_to_store_requested_evt, store_id);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
fire_resource_loaded(resource)
|
|
100
|
-
{
|
|
101
|
-
this.fire(this.resource_loaded_evt, resource);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
fire_service_clicked(service)
|
|
105
|
-
{
|
|
106
|
-
this.fire(this.service_clicked_evt, service);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
fire_unit_position_updated(unit_data)
|
|
110
|
-
{
|
|
111
|
-
this.fire(this.unit_pos_updated_evt, unit_data);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
fire_floor_switched(floor_id)
|
|
115
|
-
{
|
|
116
|
-
this.fire(this.floor_changed_evt, floor_id);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
fire_on_enter_floor_navigation(state)
|
|
120
|
-
{
|
|
121
|
-
this.fire(this.on_enter_floor_navigation, state);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
fire_on_exit_floor_navigation(state)
|
|
125
|
-
{
|
|
126
|
-
this.fire(this.on_exit_floor_navigation, state);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
fire_on_enter_floor_selection(state)
|
|
130
|
-
{
|
|
131
|
-
this.fire(this.on_enter_floor_selection, state);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
fire_on_exit_floor_selection(state)
|
|
135
|
-
{
|
|
136
|
-
this.fire(this.on_exit_floor_selection, state);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
fire_on_enter_outside_navigation(state)
|
|
140
|
-
{
|
|
141
|
-
this.fire(this.on_enter_outside_navigation, state);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
fire_on_exit_outside_navigation(state)
|
|
145
|
-
{
|
|
146
|
-
this.fire(this.on_exit_outside_navigation, state);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
const event_manager = new EventManager();
|
|
151
|
-
export { event_manager as EventManager };
|