untitled-pixi-live2d-engine 1.3.1 → 1.3.3
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 +31 -9
- package/dist/cubism-legacy.js +31 -9
- package/dist/cubism-legacy.min.js +1 -1
- package/dist/cubism.es.js +39 -10
- package/dist/cubism.js +39 -10
- package/dist/cubism.min.js +1 -1
- package/dist/index.es.js +39 -10
- package/dist/index.js +39 -10
- package/dist/index.min.js +1 -1
- package/package.json +1 -1
- package/types/index.d.ts +8 -0
package/dist/cubism.js
CHANGED
|
@@ -2762,7 +2762,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
2762
2762
|
preserveExpressionOnMotion: true,
|
|
2763
2763
|
cubism: CubismFrameworkConfig
|
|
2764
2764
|
};
|
|
2765
|
-
const VERSION = "1.3.
|
|
2765
|
+
const VERSION = "1.3.3";
|
|
2766
2766
|
const logger = {
|
|
2767
2767
|
log(tag, ...messages) {
|
|
2768
2768
|
if (config.logLevel <= config.LOG_LEVEL_VERBOSE) {
|
|
@@ -5611,6 +5611,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
5611
5611
|
* @param options - Options for Live2DModel and Automator.
|
|
5612
5612
|
*/
|
|
5613
5613
|
constructor(options) {
|
|
5614
|
+
var _a;
|
|
5614
5615
|
super();
|
|
5615
5616
|
/** @internal */
|
|
5616
5617
|
__publicField(this, "renderPipeId", "live2d");
|
|
@@ -5629,6 +5630,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
5629
5630
|
*/
|
|
5630
5631
|
__publicField(this, "textures", []);
|
|
5631
5632
|
__publicField(this, "textureOptions");
|
|
5633
|
+
__publicField(this, "anchorMode");
|
|
5632
5634
|
__publicField(this, "textureLODStates", []);
|
|
5633
5635
|
__publicField(this, "textureLODFailures", []);
|
|
5634
5636
|
/** @override
|
|
@@ -5745,6 +5747,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
5745
5747
|
}
|
|
5746
5748
|
});
|
|
5747
5749
|
this.textureOptions = options == null ? void 0 : options.textureOptions;
|
|
5750
|
+
this.anchorMode = (_a = options == null ? void 0 : options.anchorMode) != null ? _a : "canvas";
|
|
5748
5751
|
this.anchor = new pixi_js.ObservablePoint(
|
|
5749
5752
|
{
|
|
5750
5753
|
_onUpdate: () => this.onAnchorChange()
|
|
@@ -5872,6 +5875,10 @@ var __async = (__this, __arguments, generator) => {
|
|
|
5872
5875
|
this._boundsRetryAfterDraw = true;
|
|
5873
5876
|
}
|
|
5874
5877
|
this._boundsDirty = false;
|
|
5878
|
+
this._didViewChangeTick++;
|
|
5879
|
+
if (this.anchorMode === "drawable") {
|
|
5880
|
+
this.onAnchorChange();
|
|
5881
|
+
}
|
|
5875
5882
|
}
|
|
5876
5883
|
generateUID() {
|
|
5877
5884
|
return ++this.currentGlId;
|
|
@@ -5937,8 +5944,10 @@ var __async = (__this, __arguments, generator) => {
|
|
|
5937
5944
|
*/
|
|
5938
5945
|
initializeOnModelLoad(_options) {
|
|
5939
5946
|
this.tag = `Live2DModel(${this.internalModel.settings.name})`;
|
|
5940
|
-
this.onAnchorChange();
|
|
5941
5947
|
this.updateDrawableBounds();
|
|
5948
|
+
if (this.anchorMode === "canvas") {
|
|
5949
|
+
this.onAnchorChange();
|
|
5950
|
+
}
|
|
5942
5951
|
}
|
|
5943
5952
|
/**
|
|
5944
5953
|
* A callback that observes {@link anchor}, invoked when the anchor's values have been changed.
|
|
@@ -5948,10 +5957,18 @@ var __async = (__this, __arguments, generator) => {
|
|
|
5948
5957
|
if (!this.internalModel || !this.pivot) {
|
|
5949
5958
|
return;
|
|
5950
5959
|
}
|
|
5951
|
-
this.
|
|
5952
|
-
|
|
5953
|
-
this.
|
|
5954
|
-
|
|
5960
|
+
if (this.anchorMode === "drawable") {
|
|
5961
|
+
const bounds = this.bounds;
|
|
5962
|
+
this.pivot.set(
|
|
5963
|
+
bounds.minX + this.anchor.x * bounds.width,
|
|
5964
|
+
bounds.minY + this.anchor.y * bounds.height
|
|
5965
|
+
);
|
|
5966
|
+
} else {
|
|
5967
|
+
this.pivot.set(
|
|
5968
|
+
this.anchor.x * this.internalModel.width,
|
|
5969
|
+
this.anchor.y * this.internalModel.height
|
|
5970
|
+
);
|
|
5971
|
+
}
|
|
5955
5972
|
}
|
|
5956
5973
|
/**
|
|
5957
5974
|
* Shorthand to start a motion.
|
|
@@ -6183,9 +6200,14 @@ var __async = (__this, __arguments, generator) => {
|
|
|
6183
6200
|
this.getBounds().set(0, 0, 0, 0);
|
|
6184
6201
|
return;
|
|
6185
6202
|
}
|
|
6186
|
-
const
|
|
6187
|
-
|
|
6188
|
-
|
|
6203
|
+
const bounds = this.bounds;
|
|
6204
|
+
this.getBounds().addFrame(
|
|
6205
|
+
bounds.minX,
|
|
6206
|
+
bounds.minY,
|
|
6207
|
+
bounds.maxX,
|
|
6208
|
+
bounds.maxY,
|
|
6209
|
+
this.transform.matrix
|
|
6210
|
+
);
|
|
6189
6211
|
}
|
|
6190
6212
|
/**
|
|
6191
6213
|
* Updates the model. Note this method just updates the timer,
|
|
@@ -11930,8 +11952,15 @@ var __async = (__this, __arguments, generator) => {
|
|
|
11930
11952
|
array[13] = matrix.ty;
|
|
11931
11953
|
this.renderer.setMvpMatrix(tempMatrix);
|
|
11932
11954
|
const framebuffer = gl.getParameter(gl.FRAMEBUFFER_BINDING);
|
|
11955
|
+
const previousCullFaceMode = gl.getParameter(gl.CULL_FACE_MODE);
|
|
11956
|
+
const determinant = array[0] * array[5] - array[1] * array[4];
|
|
11957
|
+
gl.cullFace(determinant < 0 ? gl.FRONT : gl.BACK);
|
|
11933
11958
|
this.renderer.setRenderState(framebuffer, this.viewport);
|
|
11934
|
-
|
|
11959
|
+
try {
|
|
11960
|
+
this.renderer.drawModel();
|
|
11961
|
+
} finally {
|
|
11962
|
+
gl.cullFace(previousCullFaceMode);
|
|
11963
|
+
}
|
|
11935
11964
|
}
|
|
11936
11965
|
extendParallelMotionManager(managerCount) {
|
|
11937
11966
|
while (this.parallelMotionManager.length < managerCount) {
|