ohzi-core 6.3.5 → 6.3.6

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": "6.3.5",
3
+ "version": "6.3.6",
4
4
  "description": "OHZI Core Library",
5
5
  "source": "src/index.js",
6
6
  "module": "build/index.module.js",
@@ -188,6 +188,21 @@ export default class ActionSequencer
188
188
  return this.channels[channel_name];
189
189
  }
190
190
 
191
+ is_channel_redefined(channel_name)
192
+ {
193
+ for (let i = 0; i < this.channels[channel_name].length; i++)
194
+ {
195
+ const keyframe = this.channels[channel_name][i];
196
+
197
+ if (keyframe.interpolator.initial)
198
+ {
199
+ return false;
200
+ }
201
+ }
202
+
203
+ return true;
204
+ }
205
+
191
206
  __linear_map_01(value,
192
207
  from_range_start_value,
193
208
  from_range_end_value)
@@ -3,13 +3,14 @@ import { Math as TMath } from 'three';
3
3
 
4
4
  export default class NumberInterpolator extends ActionInterpolator
5
5
  {
6
- constructor(attribute_name, from = 0, to = 1, easing_function = 'linear')
6
+ constructor(attribute_name, from = 0, to = 1, initial = false, easing_function = 'linear')
7
7
  {
8
8
  super(easing_function);
9
9
 
10
10
  this.attribute_name = attribute_name;
11
11
  this.from = from;
12
12
  this.to = to;
13
+ this.initial = initial;
13
14
  }
14
15
 
15
16
  update(context, t)
@@ -31,7 +31,14 @@ export default class ActionSequencerBuilder
31
31
  for (let i = 0; i < tracks.length; i++)
32
32
  {
33
33
  const t = tracks[i];
34
- const interpolator = new NumberInterpolator(t.attribute_name, current_context[t.attribute_name], t.to_value, t.easing_function);
34
+ const interpolator = new NumberInterpolator(
35
+ t.attribute_name,
36
+ current_context[t.attribute_name],
37
+ t.to_value,
38
+ t.initial,
39
+ t.easing_function
40
+ );
41
+
35
42
  sequencer.add_action_interpolator(t.from_time, t.to_time, interpolator, true);
36
43
  }
37
44
 
@@ -58,6 +65,7 @@ export default class ActionSequencerBuilder
58
65
  from_time: 0,
59
66
  to_time: 1,
60
67
  to_value: state[keys[i]],
68
+ initial: true,
61
69
  easing_function: 'ease_in_out_cubic'
62
70
  });
63
71
  }
@@ -75,7 +83,14 @@ export default class ActionSequencerBuilder
75
83
  for (let i = 0; i < tracks.length; i++)
76
84
  {
77
85
  const t = tracks[i];
78
- const interpolator = new NumberInterpolator(t.attribute_name, context[t.attribute_name], t.to_value, t.easing_function);
86
+ const interpolator = new NumberInterpolator(
87
+ t.attribute_name,
88
+ context[t.attribute_name],
89
+ t.to_value,
90
+ t.initial,
91
+ t.easing_function
92
+ );
93
+
79
94
  sequencer.add_action_interpolator(t.from_time, t.to_time, interpolator, true);
80
95
  }
81
96