ohzi-core 6.2.3 → 6.3.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/build/index.module.js +1 -1
- package/build/index.module.js.map +1 -1
- package/package.json +1 -1
- package/src/CustomBezierCurve.js +2 -2
- package/src/Debug.js +28 -28
- package/src/EventManager.js +1 -1
- package/src/Graphics.js +12 -12
- package/src/KeyboardInput.js +1 -1
- package/src/OS.js +5 -5
- package/src/UI.js +1 -1
- package/src/action_sequencer/ActionSequencer.js +17 -12
- package/src/action_sequencer/VectorInterpolator.js +1 -1
- package/src/canvas_drawer/CanvasDrawer.js +8 -8
- package/src/canvas_drawer/MultiLineTextDrawer.js +3 -3
- package/src/canvas_drawer/SimpleTextDrawer.js +1 -1
- package/src/components/EdgeMesh.js +17 -17
- package/src/components/GeometryEdgeVisualizer.js +1 -1
- package/src/components/Grid.js +3 -3
- package/src/components/Line.js +16 -16
- package/src/components/MultiLinePath.js +1 -1
- package/src/components/MultiLineText2D.js +1 -1
- package/src/components/ObjectAxis.js +3 -3
- package/src/components/ObjectOrientedBoundingBox.js +19 -19
- package/src/components/Shape2D.js +7 -7
- package/src/components/Shape3D.js +5 -5
- package/src/components/Text2D.js +3 -3
- package/src/components/UIElement.js +2 -2
- package/src/components/UpdatableMaterialMesh.js +1 -1
- package/src/components/WorldImage.js +4 -4
- package/src/components/mouse_interactors/ObjectRotator.js +2 -2
- package/src/components/sdf_text/SDFText.js +10 -10
- package/src/components/sdf_text/SDFTextBatch.js +24 -24
- package/src/components/sdf_text/TextGlyph.js +2 -2
- package/src/data_textures/RGBADataTexture.js +1 -1
- package/src/data_textures/RGBAFloatDataTexture.js +1 -1
- package/src/data_textures/RGBDataTexture.js +1 -1
- package/src/data_textures/RGBFloatDataTexture.js +1 -1
- package/src/editor/ManipulatorHandle.js +4 -4
- package/src/editor/ObjectEditor.js +2 -2
- package/src/editor/ObjectManipulator.js +3 -3
- package/src/gpu_particles/GPUParticleSystem.js +4 -4
- package/src/gpu_particles/ParticleAttribute.js +4 -4
- package/src/gpu_particles/ParticlePositionAttribute.js +2 -2
- package/src/materials/MedianFilterMaterial.js +1 -1
- package/src/materials/SSAOMaterial.js +5 -5
- package/src/materials/ScreenSpaceTextureMaterial.js +2 -2
- package/src/materials/UnrealBloomComposeMaterial.js +1 -1
- package/src/materials/UnrealBlurMaterial.js +1 -1
- package/src/materials/UnrealComposeMaterial.js +1 -1
- package/src/object_pool/Pool.js +3 -3
- package/src/primitives/Arrow.js +6 -6
- package/src/primitives/Cube.js +2 -2
- package/src/primitives/HorizontalPlane.js +1 -1
- package/src/primitives/Sphere.js +2 -2
- package/src/primitives/VerticalPlane.js +1 -1
- package/src/render_mode/DeferredRender.js +10 -10
- package/src/render_mode/PlanarReflectionsRender.js +3 -3
- package/src/render_mode/TransparencyMixRender.js +1 -1
- package/src/render_utilities/Blitter.js +7 -7
- package/src/render_utilities/GaussianBlurrer.js +3 -3
- package/src/render_utilities/MedianFilter.js +1 -1
- package/src/resource_loader/AbstractLoader.js +1 -1
- package/src/resource_loader/BasisLoader.js +1 -1
- package/src/resource_loader/CubemapLoader.js +1 -1
- package/src/resource_loader/DAELoader.js +1 -1
- package/src/resource_loader/DDSLoader.js +1 -1
- package/src/resource_loader/FileLoader.js +1 -1
- package/src/resource_loader/FontLoader.js +1 -1
- package/src/resource_loader/GLTFDRACOLoader.js +1 -1
- package/src/resource_loader/GLTFLoader.js +1 -1
- package/src/resource_loader/HDRCubeTextureLoader.js +1 -1
- package/src/resource_loader/JSONLoader.js +1 -1
- package/src/resource_loader/OBJLoader.js +1 -1
- package/src/resource_loader/PointArrayLoader.js +6 -6
- package/src/resource_loader/RGBETextureLoader.js +1 -1
- package/src/resource_loader/SVGLoader.js +1 -1
- package/src/resource_loader/TextLoader.js +1 -1
- package/src/static_batcher/GeometryBatch.js +20 -20
- package/src/static_batcher/GeometryBatcher.js +7 -7
- package/src/static_batcher/MeshBatcher.js +8 -8
- package/src/utilities/ArrayUtilities.js +4 -4
- package/src/utilities/CameraUtilities.js +24 -24
- package/src/utilities/EasingFunctions.js +19 -8
- package/src/utilities/FrustumPointFitter.js +55 -55
- package/src/utilities/GeometryUtilities.js +7 -7
- package/src/utilities/ImageUtilities.js +4 -4
- package/src/utilities/MeshSampler.js +33 -33
- package/src/utilities/ModelUtilities.js +2 -2
- package/src/utilities/OMath.js +4 -4
- package/src/utilities/ObjectUtilities.js +4 -4
- package/src/utilities/OrthographicFrustumPointFitter.js +10 -10
- package/src/utilities/PerspectiveFrustumPointFitter.js +55 -55
- package/src/view_components/ApplicationView.js +2 -2
- package/src/view_components/ViewComponent.js +26 -2
- package/src/view_components/ViewComponentManager.js +11 -1
- package/src/view_components/ViewManager.js +20 -2
- package/src/view_components/transition/ActionSequencerBuilder.js +18 -18
- package/src/view_components/transition/DrawIOAnimationSheet.js +20 -20
- package/src/view_components/transition/TransitionTable.js +1 -1
- package/src/view_components/transition/ViewStateTransitionHandler.js +2 -1
|
@@ -13,10 +13,10 @@ export default class ActionSequencerBuilder
|
|
|
13
13
|
from_animation_sheet(animation_data, current_context, initial_context)
|
|
14
14
|
{
|
|
15
15
|
initial_context = initial_context || this.initial_state_data;
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
const tracks = animation_data.animation_tracks;
|
|
17
|
+
const triggers = animation_data.triggers;
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
const initial_tracks = this.state_to_tracks(this.initial_state_data);
|
|
20
20
|
|
|
21
21
|
for (let i = 0; i < initial_tracks.length; i++)
|
|
22
22
|
{
|
|
@@ -26,19 +26,19 @@ export default class ActionSequencerBuilder
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
const sequencer = new ActionSequencer(current_context);
|
|
30
30
|
|
|
31
31
|
for (let i = 0; i < tracks.length; i++)
|
|
32
32
|
{
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
const t = tracks[i];
|
|
34
|
+
const interpolator = new NumberInterpolator(t.attribute_name, current_context[t.attribute_name], t.to_value, t.easing_function);
|
|
35
35
|
sequencer.add_action_interpolator(t.from_time, t.to_time, interpolator, true);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
for (let i = 0; i < triggers.length; i++)
|
|
39
39
|
{
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
const t = triggers[i];
|
|
41
|
+
const action_event = new ActionEvent(t.name, t.method);
|
|
42
42
|
sequencer.add_action_event(t.at_time, action_event);
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -47,9 +47,9 @@ export default class ActionSequencerBuilder
|
|
|
47
47
|
|
|
48
48
|
state_to_tracks(state)
|
|
49
49
|
{
|
|
50
|
-
|
|
50
|
+
const tracks = [];
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
const keys = Object.keys(state);
|
|
53
53
|
|
|
54
54
|
for (let i = 0; i < keys.length; i++)
|
|
55
55
|
{
|
|
@@ -67,22 +67,22 @@ export default class ActionSequencerBuilder
|
|
|
67
67
|
|
|
68
68
|
from_draw_io(xml, context)
|
|
69
69
|
{
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
const transition_data = (new DrawIOAnimationSheet()).parse(xml);
|
|
71
|
+
const tracks = transition_data.animation_tracks;
|
|
72
|
+
const triggers = transition_data.triggers;
|
|
73
|
+
const sequencer = new ActionSequencer(context);
|
|
74
74
|
|
|
75
75
|
for (let i = 0; i < tracks.length; i++)
|
|
76
76
|
{
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
const t = tracks[i];
|
|
78
|
+
const interpolator = new NumberInterpolator(t.attribute_name, context[t.attribute_name], t.to_value, t.easing_function);
|
|
79
79
|
sequencer.add_action_interpolator(t.from_time, t.to_time, interpolator, true);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
for (let i = 0; i < triggers.length; i++)
|
|
83
83
|
{
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
const t = triggers[i];
|
|
85
|
+
const action_event = new ActionEvent(t.name, t.method);
|
|
86
86
|
sequencer.add_action_event(t.at_time, action_event);
|
|
87
87
|
}
|
|
88
88
|
|
|
@@ -7,30 +7,30 @@ export default class DrawIOAnimationSheet
|
|
|
7
7
|
|
|
8
8
|
parse(xml_document)
|
|
9
9
|
{
|
|
10
|
-
|
|
10
|
+
const doc = new DOMParser().parseFromString(xml_document, 'text/xml');
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
const animation_nodes = doc.querySelectorAll('mxGeometry');
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
const animation_tracks = [];
|
|
15
|
+
const triggers = [];
|
|
16
16
|
|
|
17
17
|
for (let i = 0; i < animation_nodes.length; i++)
|
|
18
18
|
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const node = animation_nodes[i];
|
|
20
|
+
const parent_node = node.parentElement;
|
|
21
|
+
const data = parent_node.getAttribute('value');
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
const x_pos = this.get_node_x_position(node);
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
const from = x_pos / 100;
|
|
26
|
+
const duration = parseFloat(node.getAttribute('width')) / 100;
|
|
27
27
|
|
|
28
28
|
// is trigger
|
|
29
29
|
if (parent_node.getAttribute('style').includes('rhombus;'))
|
|
30
30
|
{
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
const split_data = data.split('.');
|
|
32
|
+
const trigger_name = split_data[0];
|
|
33
|
+
const trigger_method = split_data[1];
|
|
34
34
|
|
|
35
35
|
triggers.push({
|
|
36
36
|
name: trigger_name,
|
|
@@ -39,18 +39,18 @@ export default class DrawIOAnimationSheet
|
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
const valid_element = parent_node.getAttribute('style').includes('rounded=0;') &&
|
|
43
43
|
!parent_node.getAttribute('style').includes('text;');
|
|
44
44
|
|
|
45
45
|
if (valid_element && data !== '' && !data.includes(' '))
|
|
46
46
|
{
|
|
47
|
-
|
|
47
|
+
const split_data = data.split('=');
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
const attribute_name = split_data[0];
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
const value_data = split_data[1].split('--');
|
|
52
|
+
const to_value = parseFloat(value_data[0]);
|
|
53
|
+
const easing_function = value_data[1];
|
|
54
54
|
|
|
55
55
|
if (split_data.length !== 2)
|
|
56
56
|
{
|
|
@@ -84,7 +84,7 @@ export default class DrawIOAnimationSheet
|
|
|
84
84
|
|
|
85
85
|
get_node_x_position(node)
|
|
86
86
|
{
|
|
87
|
-
|
|
87
|
+
const x_pos = node.getAttribute('x');
|
|
88
88
|
return x_pos === null ? 0 : parseFloat(x_pos);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
@@ -14,7 +14,7 @@ export default class TransitionTable
|
|
|
14
14
|
{
|
|
15
15
|
if (this.transitions[i].to === to_state)
|
|
16
16
|
{
|
|
17
|
-
|
|
17
|
+
const action_sequencer = new ActionSequencerBuilder(this.initial_state_data).from_animation_sheet(this.transitions[i].data, current_context);
|
|
18
18
|
|
|
19
19
|
return action_sequencer;
|
|
20
20
|
}
|
|
@@ -28,9 +28,10 @@ export default class ViewStateTransitionHandler
|
|
|
28
28
|
|
|
29
29
|
this.last_state.before_exit();
|
|
30
30
|
this.current_state.show();
|
|
31
|
-
this.current_state.before_enter();
|
|
32
31
|
|
|
33
32
|
this.action_sequencer = this.transition_table.get(this.current_state.name, this.current_state_data);
|
|
33
|
+
this.current_state.before_enter();
|
|
34
|
+
|
|
34
35
|
this.action_sequencer.play();
|
|
35
36
|
|
|
36
37
|
this.transitioning = true;
|