Skip to content

Commit

Permalink
Merge branch '4.1' into 4.2-beta
Browse files Browse the repository at this point in the history
# 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
  • Loading branch information
badlogic committed Nov 28, 2023
2 parents ffabff9 + 5d4b86e commit 355a91d
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions spine-c/spine-c/src/spine/IkConstraint.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ void spIkConstraint_apply1(spBone *bone, float targetX, float targetY, int /*boo

switch (bone->data->transformMode) {
case SP_TRANSFORMMODE_ONLYTRANSLATION:
tx = targetX - bone->worldX;
ty = targetY - bone->worldY;
tx = (targetX - bone->worldX) * SIGNUM(bone->skeleton->scaleX);
ty = (targetY - bone->worldY) * SIGNUM(bone->skeleton->scaleY);
break;
case SP_TRANSFORMMODE_NOROTATIONORREFLECTION: {
s = ABS(pa * pd - pb * pc) / MAX(0.0001f, pa * pa + pc * pc);
Expand Down
4 changes: 2 additions & 2 deletions spine-cpp/spine-cpp/src/spine/IkConstraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ void IkConstraint::apply(Bone &bone, float targetX, float targetY, bool compress

switch (bone._data.getTransformMode()) {
case TransformMode_OnlyTranslation:
tx = targetX - bone._worldX;
ty = targetY - bone._worldY;
tx = (targetX - bone._worldX) * MathUtil::sign(bone.getSkeleton().getScaleX());
ty = (targetY - bone._worldY) * MathUtil::sign(bone.getSkeleton().getScaleY());
break;
case TransformMode_NoRotationOrReflection: {
float s = MathUtil::abs(pa * pd - pb * pc) / MathUtil::max(0.0001f, pa * pa + pc * pc);
Expand Down
5 changes: 5 additions & 0 deletions spine-flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# 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.
# 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
* 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.
Expand Down
4 changes: 2 additions & 2 deletions spine-haxe/spine-haxe/spine/IkConstraint.hx
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ class IkConstraint implements Updatable {
ty:Float = 0;
switch (bone.data.transformMode) {
case TransformMode.onlyTranslation:
tx = targetX - bone.worldX;
ty = targetY - bone.worldY;
tx = (targetX - bone.worldX) * MathUtils.signum(bone.skeleton.scaleX);
ty = (targetY - bone.worldY) * MathUtils.signum(bone.skeleton.scaleY);
case TransformMode.noRotationOrReflection:
var s = Math.abs(pa * pd - pb * pc) / Math.max(0.0001, pa * pa + pc * pc);
var sa:Float = pa / bone.skeleton.scaleX;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ static public void apply (Bone bone, float targetX, float targetY, boolean compr
float rotationIK = -bone.ashearX - bone.arotation, tx, ty;
switch (bone.data.transformMode) {
case onlyTranslation:
tx = targetX - bone.worldX;
ty = targetY - bone.worldY;
tx = (targetX - bone.worldX) * Math.signum(bone.skeleton.scaleX);
ty = (targetY - bone.worldY) * Math.signum(bone.skeleton.scaleY);
break;
case noRotationOrReflection:
float s = Math.abs(pa * pd - pb * pc) / Math.max(0.0001f, pa * pa + pc * pc);
Expand Down
4 changes: 2 additions & 2 deletions spine-ts/spine-core/src/IkConstraint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ export class IkConstraint implements Updatable {

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

0 comments on commit 355a91d

Please sign in to comment.