untitled-pixi-live2d-engine 1.3.3 → 1.3.4
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/dist/cubism-legacy.es.js +24 -5
- package/dist/cubism-legacy.js +24 -5
- package/dist/cubism-legacy.min.js +1 -1
- package/dist/cubism.es.js +24 -5
- package/dist/cubism.js +24 -5
- package/dist/cubism.min.js +1 -1
- package/dist/index.es.js +24 -5
- package/dist/index.js +24 -5
- package/dist/index.min.js +1 -1
- package/package.json +1 -1
- package/types/index.d.ts +6 -0
package/dist/index.es.js
CHANGED
|
@@ -105,7 +105,7 @@ const config = {
|
|
|
105
105
|
preserveExpressionOnMotion: true,
|
|
106
106
|
cubism: CubismFrameworkConfig
|
|
107
107
|
};
|
|
108
|
-
const VERSION = "1.3.
|
|
108
|
+
const VERSION = "1.3.4";
|
|
109
109
|
const logger = {
|
|
110
110
|
log(tag, ...messages) {
|
|
111
111
|
if (config.logLevel <= config.LOG_LEVEL_VERBOSE) {
|
|
@@ -3073,7 +3073,7 @@ class Live2DModel extends Container {
|
|
|
3073
3073
|
this.internalModel.updateTransform(internalTransform);
|
|
3074
3074
|
this.internalModel.draw(renderer.gl);
|
|
3075
3075
|
if (this._boundsRetryAfterDraw) {
|
|
3076
|
-
this.updateDrawableBounds();
|
|
3076
|
+
this.updateDrawableBounds(true);
|
|
3077
3077
|
}
|
|
3078
3078
|
renderer.state.resetState();
|
|
3079
3079
|
renderer.texture.resetState();
|
|
@@ -3175,7 +3175,7 @@ class Live2DModel extends Container {
|
|
|
3175
3175
|
}
|
|
3176
3176
|
return this._bounds;
|
|
3177
3177
|
}
|
|
3178
|
-
updateDrawableBounds() {
|
|
3178
|
+
updateDrawableBounds(applyAnchor = false) {
|
|
3179
3179
|
if (!this.internalModel) {
|
|
3180
3180
|
this._bounds.set(0, 0, 0, 0);
|
|
3181
3181
|
this._boundsDirty = false;
|
|
@@ -3219,10 +3219,26 @@ class Live2DModel extends Container {
|
|
|
3219
3219
|
}
|
|
3220
3220
|
this._boundsDirty = false;
|
|
3221
3221
|
this._didViewChangeTick++;
|
|
3222
|
-
if (this.anchorMode === "drawable") {
|
|
3222
|
+
if (applyAnchor && this.anchorMode === "drawable") {
|
|
3223
3223
|
this.onAnchorChange();
|
|
3224
3224
|
}
|
|
3225
3225
|
}
|
|
3226
|
+
/**
|
|
3227
|
+
* Updates the model and its drawable bounds before Pixi calculates filter areas.
|
|
3228
|
+
* Filter pipes collect their framebuffer bounds before the Live2D render pipe runs,
|
|
3229
|
+
* so waiting until `renderLive2D()` is too late for animated vertices.
|
|
3230
|
+
*/
|
|
3231
|
+
prepareForRender() {
|
|
3232
|
+
if (!this.internalModel) {
|
|
3233
|
+
return;
|
|
3234
|
+
}
|
|
3235
|
+
const frameDelta = this.deltaTime;
|
|
3236
|
+
this.deltaTime = 0;
|
|
3237
|
+
if (frameDelta) {
|
|
3238
|
+
this.internalModel.update(frameDelta, this.elapsedTime);
|
|
3239
|
+
}
|
|
3240
|
+
this.updateDrawableBounds();
|
|
3241
|
+
}
|
|
3226
3242
|
generateUID() {
|
|
3227
3243
|
return ++this.currentGlId;
|
|
3228
3244
|
}
|
|
@@ -3256,6 +3272,9 @@ class Live2DModel extends Container {
|
|
|
3256
3272
|
}
|
|
3257
3273
|
};
|
|
3258
3274
|
const effects = this.effects;
|
|
3275
|
+
if (effects == null ? void 0 : effects.length) {
|
|
3276
|
+
this.prepareForRender();
|
|
3277
|
+
}
|
|
3259
3278
|
if (effects) {
|
|
3260
3279
|
for (let i = 0; i < effects.length; i++) {
|
|
3261
3280
|
const effect = effects[i];
|
|
@@ -3287,7 +3306,7 @@ class Live2DModel extends Container {
|
|
|
3287
3306
|
*/
|
|
3288
3307
|
initializeOnModelLoad(_options) {
|
|
3289
3308
|
this.tag = `Live2DModel(${this.internalModel.settings.name})`;
|
|
3290
|
-
this.updateDrawableBounds();
|
|
3309
|
+
this.updateDrawableBounds(true);
|
|
3291
3310
|
if (this.anchorMode === "canvas") {
|
|
3292
3311
|
this.onAnchorChange();
|
|
3293
3312
|
}
|
package/dist/index.js
CHANGED
|
@@ -108,7 +108,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
108
108
|
preserveExpressionOnMotion: true,
|
|
109
109
|
cubism: CubismFrameworkConfig
|
|
110
110
|
};
|
|
111
|
-
const VERSION = "1.3.
|
|
111
|
+
const VERSION = "1.3.4";
|
|
112
112
|
const logger = {
|
|
113
113
|
log(tag, ...messages) {
|
|
114
114
|
if (config.logLevel <= config.LOG_LEVEL_VERBOSE) {
|
|
@@ -3076,7 +3076,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
3076
3076
|
this.internalModel.updateTransform(internalTransform);
|
|
3077
3077
|
this.internalModel.draw(renderer.gl);
|
|
3078
3078
|
if (this._boundsRetryAfterDraw) {
|
|
3079
|
-
this.updateDrawableBounds();
|
|
3079
|
+
this.updateDrawableBounds(true);
|
|
3080
3080
|
}
|
|
3081
3081
|
renderer.state.resetState();
|
|
3082
3082
|
renderer.texture.resetState();
|
|
@@ -3178,7 +3178,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
3178
3178
|
}
|
|
3179
3179
|
return this._bounds;
|
|
3180
3180
|
}
|
|
3181
|
-
updateDrawableBounds() {
|
|
3181
|
+
updateDrawableBounds(applyAnchor = false) {
|
|
3182
3182
|
if (!this.internalModel) {
|
|
3183
3183
|
this._bounds.set(0, 0, 0, 0);
|
|
3184
3184
|
this._boundsDirty = false;
|
|
@@ -3222,10 +3222,26 @@ var __async = (__this, __arguments, generator) => {
|
|
|
3222
3222
|
}
|
|
3223
3223
|
this._boundsDirty = false;
|
|
3224
3224
|
this._didViewChangeTick++;
|
|
3225
|
-
if (this.anchorMode === "drawable") {
|
|
3225
|
+
if (applyAnchor && this.anchorMode === "drawable") {
|
|
3226
3226
|
this.onAnchorChange();
|
|
3227
3227
|
}
|
|
3228
3228
|
}
|
|
3229
|
+
/**
|
|
3230
|
+
* Updates the model and its drawable bounds before Pixi calculates filter areas.
|
|
3231
|
+
* Filter pipes collect their framebuffer bounds before the Live2D render pipe runs,
|
|
3232
|
+
* so waiting until `renderLive2D()` is too late for animated vertices.
|
|
3233
|
+
*/
|
|
3234
|
+
prepareForRender() {
|
|
3235
|
+
if (!this.internalModel) {
|
|
3236
|
+
return;
|
|
3237
|
+
}
|
|
3238
|
+
const frameDelta = this.deltaTime;
|
|
3239
|
+
this.deltaTime = 0;
|
|
3240
|
+
if (frameDelta) {
|
|
3241
|
+
this.internalModel.update(frameDelta, this.elapsedTime);
|
|
3242
|
+
}
|
|
3243
|
+
this.updateDrawableBounds();
|
|
3244
|
+
}
|
|
3229
3245
|
generateUID() {
|
|
3230
3246
|
return ++this.currentGlId;
|
|
3231
3247
|
}
|
|
@@ -3259,6 +3275,9 @@ var __async = (__this, __arguments, generator) => {
|
|
|
3259
3275
|
}
|
|
3260
3276
|
};
|
|
3261
3277
|
const effects = this.effects;
|
|
3278
|
+
if (effects == null ? void 0 : effects.length) {
|
|
3279
|
+
this.prepareForRender();
|
|
3280
|
+
}
|
|
3262
3281
|
if (effects) {
|
|
3263
3282
|
for (let i = 0; i < effects.length; i++) {
|
|
3264
3283
|
const effect = effects[i];
|
|
@@ -3290,7 +3309,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
3290
3309
|
*/
|
|
3291
3310
|
initializeOnModelLoad(_options) {
|
|
3292
3311
|
this.tag = `Live2DModel(${this.internalModel.settings.name})`;
|
|
3293
|
-
this.updateDrawableBounds();
|
|
3312
|
+
this.updateDrawableBounds(true);
|
|
3294
3313
|
if (this.anchorMode === "canvas") {
|
|
3295
3314
|
this.onAnchorChange();
|
|
3296
3315
|
}
|