mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[csharp] Port of commit abb4362: PhysicsConstraint, cannot reuse wind/gravity values for rotation.
This commit is contained in:
parent
abb436213c
commit
3b02a3fbab
@ -127,8 +127,8 @@ namespace Spine {
|
|||||||
ux = bx;
|
ux = bx;
|
||||||
uy = by;
|
uy = by;
|
||||||
} else {
|
} else {
|
||||||
float a = remaining, i = p.inertia, f = skeleton.data.referenceScale, d = -1, m = 0, e = 0, ax = 0, ay = 0,
|
float a = remaining, i = p.inertia, f = skeleton.data.referenceScale, d = -1, m = 0, e = 0, qx = data.limit * delta,
|
||||||
qx = data.limit * delta, qy = qx * Math.Abs(skeleton.ScaleY);
|
qy = qx * Math.Abs(skeleton.ScaleY);
|
||||||
qx *= Math.Abs(skeleton.ScaleX);
|
qx *= Math.Abs(skeleton.ScaleX);
|
||||||
|
|
||||||
if (x || y) {
|
if (x || y) {
|
||||||
@ -148,8 +148,8 @@ namespace Spine {
|
|||||||
m = t * p.massInverse;
|
m = t * p.massInverse;
|
||||||
e = p.strength;
|
e = p.strength;
|
||||||
float w = f * p.wind, g = f * p.gravity;
|
float w = f * p.wind, g = f * p.gravity;
|
||||||
ax = (w * skeleton.windX + g * skeleton.gravityX) * skeleton.scaleX;
|
float ax = (w * skeleton.windX + g * skeleton.gravityX) * skeleton.scaleX;
|
||||||
ay = (w * skeleton.windY + g * skeleton.gravityY) * skeleton.ScaleY;
|
float ay = (w * skeleton.windY + g * skeleton.gravityY) * skeleton.ScaleY;
|
||||||
do {
|
do {
|
||||||
if (x) {
|
if (x) {
|
||||||
xVelocity += (ax - xOffset * e) * m;
|
xVelocity += (ax - xOffset * e) * m;
|
||||||
@ -204,10 +204,9 @@ namespace Spine {
|
|||||||
d = (float)Math.Pow(p.damping, 60 * t);
|
d = (float)Math.Pow(p.damping, 60 * t);
|
||||||
m = t * p.massInverse;
|
m = t * p.massInverse;
|
||||||
e = p.strength;
|
e = p.strength;
|
||||||
float w = f * p.wind, g = f * p.gravity;
|
|
||||||
ax = (w * skeleton.windX + g * skeleton.gravityX) * skeleton.scaleX;
|
|
||||||
ay = (w * skeleton.windY + g * skeleton.gravityY) * skeleton.ScaleY;
|
|
||||||
}
|
}
|
||||||
|
float ax = p.wind * skeleton.windX - p.gravity * skeleton.gravityX;
|
||||||
|
float ay = p.wind * skeleton.windY + p.gravity * skeleton.gravityY;
|
||||||
float rs = rotateOffset, ss = scaleOffset, h = l / f;
|
float rs = rotateOffset, ss = scaleOffset, h = l / f;
|
||||||
if (Spine.Bone.yDown) ay = -ay;
|
if (Spine.Bone.yDown) ay = -ay;
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|||||||
@ -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.3.8",
|
"version": "4.3.9",
|
||||||
"unity": "2018.3",
|
"unity": "2018.3",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Esoteric Software",
|
"name": "Esoteric Software",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user