mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 09:46:02 +08:00
[csharp] Port of commit ad71a986a, PhysicsConstraint clean up.
This commit is contained in:
parent
42079d1d23
commit
59bcffcf42
@ -158,7 +158,7 @@ namespace Spine {
|
|||||||
ux = bx;
|
ux = bx;
|
||||||
uy = by;
|
uy = by;
|
||||||
} else {
|
} else {
|
||||||
float a = remaining, i = inertia, t = data.step, f = skeleton.data.referenceScale;
|
float a = remaining, i = inertia, t = data.step, f = skeleton.data.referenceScale, d = -1;
|
||||||
float qx = data.limit * delta, qy = qx * Math.Abs(skeleton.ScaleY);
|
float qx = data.limit * delta, qy = qx * Math.Abs(skeleton.ScaleY);
|
||||||
qx *= Math.Abs(skeleton.ScaleX);
|
qx *= Math.Abs(skeleton.ScaleX);
|
||||||
|
|
||||||
@ -174,8 +174,8 @@ namespace Spine {
|
|||||||
uy = by;
|
uy = by;
|
||||||
}
|
}
|
||||||
if (a >= t) {
|
if (a >= t) {
|
||||||
|
d = (float)Math.Pow(damping, 60 * t);
|
||||||
float m = massInverse * t, e = strength, w = wind * f, g = (Bone.yDown ? -gravity : gravity) * f;
|
float m = massInverse * t, e = strength, w = wind * f, g = (Bone.yDown ? -gravity : gravity) * f;
|
||||||
float d = (float)Math.Pow(damping, 60 * t);
|
|
||||||
do {
|
do {
|
||||||
if (x) {
|
if (x) {
|
||||||
xVelocity += (w - xOffset * e) * m;
|
xVelocity += (w - xOffset * e) * m;
|
||||||
@ -221,10 +221,10 @@ namespace Spine {
|
|||||||
float r = l * bone.WorldScaleX;
|
float r = l * bone.WorldScaleX;
|
||||||
if (r > 0) scaleOffset += (dx * c + dy * s) * i / r;
|
if (r > 0) scaleOffset += (dx * c + dy * s) * i / r;
|
||||||
}
|
}
|
||||||
a = this.remaining;
|
a = remaining;
|
||||||
if (a >= t) {
|
if (a >= t) {
|
||||||
float m = massInverse * t, e = strength, w = wind, g = (Bone.yDown ? -gravity : gravity);
|
if (d == -1) d = (float)Math.Pow(damping, 60 * t);
|
||||||
float d = (float)Math.Pow(damping, 60 * t), h = l / f;
|
float m = massInverse * t, e = strength, w = wind, g = (Bone.yDown ? -gravity : gravity), h = l / f;
|
||||||
while (true) {
|
while (true) {
|
||||||
a -= t;
|
a -= t;
|
||||||
if (scaleX) {
|
if (scaleX) {
|
||||||
@ -245,7 +245,7 @@ namespace Spine {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.remaining = a;
|
remaining = a;
|
||||||
}
|
}
|
||||||
cx = bone.worldX;
|
cx = bone.worldX;
|
||||||
cy = bone.worldY;
|
cy = bone.worldY;
|
||||||
@ -299,7 +299,7 @@ namespace Spine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>The bone constrained by this physics constraint.</summary>
|
/// <summary>The bone constrained by this physics constraint.</summary>
|
||||||
public Bone Bone { get {return bone;} set { bone = value; } }
|
public Bone Bone { get { return bone; } set { bone = value; } }
|
||||||
public float Inertia { get { return inertia; } set { inertia = value; } }
|
public float Inertia { get { return inertia; } set { inertia = value; } }
|
||||||
public float Strength { get { return strength; } set { strength = value; } }
|
public float Strength { get { return strength; } set { strength = value; } }
|
||||||
public float Damping { get { return damping; } set { damping = value; } }
|
public float Damping { get { return damping; } set { damping = value; } }
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"name": "com.esotericsoftware.spine.spine-csharp",
|
"name": "com.esotericsoftware.spine.spine-csharp",
|
||||||
"displayName": "spine-csharp Runtime",
|
"displayName": "spine-csharp Runtime",
|
||||||
"description": "This plugin provides the spine-csharp core runtime.",
|
"description": "This plugin provides the spine-csharp core runtime.",
|
||||||
"version": "4.2.26",
|
"version": "4.2.27",
|
||||||
"unity": "2018.3",
|
"unity": "2018.3",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Esoteric Software",
|
"name": "Esoteric Software",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user