Merge branch '4.1' into 4.2-beta

# Conflicts:
#	spine-flutter/CHANGELOG.md
#	spine-flutter/lib/assets/libspine_flutter.wasm
#	spine-flutter/pubspec.yaml
#	spine-ts/package-lock.json
#	spine-ts/package.json
#	spine-ts/spine-canvas/package.json
#	spine-ts/spine-core/package.json
#	spine-ts/spine-phaser/package.json
#	spine-ts/spine-pixi/package.json
#	spine-ts/spine-player/package.json
#	spine-ts/spine-threejs/package.json
#	spine-ts/spine-webgl/package.json
This commit is contained in:
Mario Zechner 2023-11-28 13:41:20 +01:00
commit 355a91de79
6 changed files with 15 additions and 10 deletions

View File

@ -80,8 +80,8 @@ void spIkConstraint_apply1(spBone *bone, float targetX, float targetY, int /*boo
switch (bone->data->transformMode) { switch (bone->data->transformMode) {
case SP_TRANSFORMMODE_ONLYTRANSLATION: case SP_TRANSFORMMODE_ONLYTRANSLATION:
tx = targetX - bone->worldX; tx = (targetX - bone->worldX) * SIGNUM(bone->skeleton->scaleX);
ty = targetY - bone->worldY; ty = (targetY - bone->worldY) * SIGNUM(bone->skeleton->scaleY);
break; break;
case SP_TRANSFORMMODE_NOROTATIONORREFLECTION: { case SP_TRANSFORMMODE_NOROTATIONORREFLECTION: {
s = ABS(pa * pd - pb * pc) / MAX(0.0001f, pa * pa + pc * pc); s = ABS(pa * pd - pb * pc) / MAX(0.0001f, pa * pa + pc * pc);

View File

@ -47,8 +47,8 @@ void IkConstraint::apply(Bone &bone, float targetX, float targetY, bool compress
switch (bone._data.getTransformMode()) { switch (bone._data.getTransformMode()) {
case TransformMode_OnlyTranslation: case TransformMode_OnlyTranslation:
tx = targetX - bone._worldX; tx = (targetX - bone._worldX) * MathUtil::sign(bone.getSkeleton().getScaleX());
ty = targetY - bone._worldY; ty = (targetY - bone._worldY) * MathUtil::sign(bone.getSkeleton().getScaleY());
break; break;
case TransformMode_NoRotationOrReflection: { case TransformMode_NoRotationOrReflection: {
float s = MathUtil::abs(pa * pd - pb * pc) / MathUtil::max(0.0001f, pa * pa + pc * pc); float s = MathUtil::abs(pa * pd - pb * pc) / MathUtil::max(0.0001f, pa * pa + pc * pc);

View File

@ -1,5 +1,10 @@
# 4.2.18 # 4.2.18
* Fixes compilation errors due to API change in Flutter 3.16.0, see [this issue](https://github.com/EsotericSoftware/spine-runtimes/issues/2420). **Note**: Depending on this version requires your project to depend on Flutter >= 3.16.0 as well. * Fixes compilation errors due to API change in Flutter 3.16.0, see [this issue](https://github.com/EsotericSoftware/spine-runtimes/issues/2420). **Note**: Depending on this version requires your project to depend on Flutter >= 3.16.0 as well.
# 4.1.10
# Update WASM binaries
# 4.1.9
# Fixes #2412, single bone, translation only IK constraints did not take skeleton scale into account.
# 4.1.8 # 4.1.8
* Fixes compilation errors due to API change in Flutter 3.16.0, see [this issue](https://github.com/EsotericSoftware/spine-runtimes/issues/2420). **Note**: Depending on this version requires your project to depend on Flutter >= 3.16.0 as well. * Fixes compilation errors due to API change in Flutter 3.16.0, see [this issue](https://github.com/EsotericSoftware/spine-runtimes/issues/2420). **Note**: Depending on this version requires your project to depend on Flutter >= 3.16.0 as well.

View File

@ -95,8 +95,8 @@ class IkConstraint implements Updatable {
ty:Float = 0; ty:Float = 0;
switch (bone.data.transformMode) { switch (bone.data.transformMode) {
case TransformMode.onlyTranslation: case TransformMode.onlyTranslation:
tx = targetX - bone.worldX; tx = (targetX - bone.worldX) * MathUtils.signum(bone.skeleton.scaleX);
ty = targetY - bone.worldY; ty = (targetY - bone.worldY) * MathUtils.signum(bone.skeleton.scaleY);
case TransformMode.noRotationOrReflection: case TransformMode.noRotationOrReflection:
var s = Math.abs(pa * pd - pb * pc) / Math.max(0.0001, pa * pa + pc * pc); var s = Math.abs(pa * pd - pb * pc) / Math.max(0.0001, pa * pa + pc * pc);
var sa:Float = pa / bone.skeleton.scaleX; var sa:Float = pa / bone.skeleton.scaleX;

View File

@ -191,8 +191,8 @@ public class IkConstraint implements Updatable {
float rotationIK = -bone.ashearX - bone.arotation, tx, ty; float rotationIK = -bone.ashearX - bone.arotation, tx, ty;
switch (bone.data.transformMode) { switch (bone.data.transformMode) {
case onlyTranslation: case onlyTranslation:
tx = targetX - bone.worldX; tx = (targetX - bone.worldX) * Math.signum(bone.skeleton.scaleX);
ty = targetY - bone.worldY; ty = (targetY - bone.worldY) * Math.signum(bone.skeleton.scaleY);
break; break;
case noRotationOrReflection: case noRotationOrReflection:
float s = Math.abs(pa * pd - pb * pc) / Math.max(0.0001f, pa * pa + pc * pc); float s = Math.abs(pa * pd - pb * pc) / Math.max(0.0001f, pa * pa + pc * pc);

View File

@ -122,8 +122,8 @@ export class IkConstraint implements Updatable {
switch (bone.data.transformMode) { switch (bone.data.transformMode) {
case TransformMode.OnlyTranslation: case TransformMode.OnlyTranslation:
tx = targetX - bone.worldX; tx = (targetX - bone.worldX) * MathUtils.signum(bone.skeleton.scaleX);
ty = targetY - bone.worldY; ty = (targetY - bone.worldY) * MathUtils.signum(bone.skeleton.scaleY);
break; break;
case TransformMode.NoRotationOrReflection: case TransformMode.NoRotationOrReflection:
let s = Math.abs(pa * pd - pb * pc) / Math.max(0.0001, pa * pa + pc * pc); let s = Math.abs(pa * pd - pb * pc) / Math.max(0.0001, pa * pa + pc * pc);