@ikijs/engine 0.1.1 → 0.2.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/README.md +2 -2
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +17 -3
package/dist/index.mjs
CHANGED
|
@@ -1049,6 +1049,8 @@ var SWAY_X_AMP_B_DEG = 1.3;
|
|
|
1049
1049
|
var SWAY_X_PERIOD_B_MS = 9700;
|
|
1050
1050
|
var SWAY_Y_AMP_DEG = 1.6;
|
|
1051
1051
|
var SWAY_Y_PERIOD_MS = 7300;
|
|
1052
|
+
var SWAY_Z_AMP_DEG = 1.1;
|
|
1053
|
+
var SWAY_Z_PERIOD_MS = 11300;
|
|
1052
1054
|
function lerp(a, b, t) {
|
|
1053
1055
|
return a + (b - a) * t;
|
|
1054
1056
|
}
|
|
@@ -1122,6 +1124,7 @@ var IdleMotion = class {
|
|
|
1122
1124
|
this.sink(StandardParameter.EyeballY, this.gazeCurrentY);
|
|
1123
1125
|
this.sink(StandardParameter.AngleX, this.swayX());
|
|
1124
1126
|
this.sink(StandardParameter.AngleY, this.swayY());
|
|
1127
|
+
this.sink(StandardParameter.AngleZ, this.swayZ());
|
|
1125
1128
|
}
|
|
1126
1129
|
// ---------------------------------------------------------------------------
|
|
1127
1130
|
// Private helpers
|
|
@@ -1134,6 +1137,7 @@ var IdleMotion = class {
|
|
|
1134
1137
|
this.sink(StandardParameter.EyeballY, 0);
|
|
1135
1138
|
this.sink(StandardParameter.AngleX, 0);
|
|
1136
1139
|
this.sink(StandardParameter.AngleY, 0);
|
|
1140
|
+
this.sink(StandardParameter.AngleZ, 0);
|
|
1137
1141
|
}
|
|
1138
1142
|
/** Returns the current eye-open value (0..1) and advances blink state. */
|
|
1139
1143
|
advanceBlink() {
|
|
@@ -1165,6 +1169,10 @@ var IdleMotion = class {
|
|
|
1165
1169
|
swayY() {
|
|
1166
1170
|
return SWAY_Y_AMP_DEG * Math.sin(2 * Math.PI * this.clockMs / SWAY_Y_PERIOD_MS);
|
|
1167
1171
|
}
|
|
1172
|
+
/** Head roll sway in degrees, pure function of the internal clock. */
|
|
1173
|
+
swayZ() {
|
|
1174
|
+
return SWAY_Z_AMP_DEG * Math.sin(2 * Math.PI * this.clockMs / SWAY_Z_PERIOD_MS);
|
|
1175
|
+
}
|
|
1168
1176
|
/** Ease gaze current toward target; pick a new target on the internal clock. */
|
|
1169
1177
|
advanceGaze(dt) {
|
|
1170
1178
|
if (this.clockMs >= this.nextGazeRetargetMs) {
|