mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[csharp] Removed unnecessary porting differences.
This commit is contained in:
parent
e601f889b7
commit
237f1fd968
@ -152,7 +152,6 @@ namespace Spine {
|
|||||||
child.UpdateWorldTransform ();
|
child.UpdateWorldTransform ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//float px = parent.x, py = parent.y, psx = parent.scaleX, psy = parent.scaleY, csx = child.scaleX;
|
|
||||||
if (!parent.appliedValid) parent.UpdateAppliedTransform();
|
if (!parent.appliedValid) parent.UpdateAppliedTransform();
|
||||||
if (!child.appliedValid) child.UpdateAppliedTransform();
|
if (!child.appliedValid) child.UpdateAppliedTransform();
|
||||||
float px = parent.ax, py = parent.ay, psx = parent.ascaleX, sx = psx, psy = parent.ascaleY, csx = child.ascaleX;
|
float px = parent.ax, py = parent.ay, psx = parent.ascaleX, sx = psx, psy = parent.ascaleY, csx = child.ascaleX;
|
||||||
|
|||||||
@ -81,8 +81,7 @@ namespace Spine {
|
|||||||
if (!translate && !rotate) return;
|
if (!translate && !rotate) return;
|
||||||
|
|
||||||
PathConstraintData data = this.data;
|
PathConstraintData data = this.data;
|
||||||
SpacingMode spacingMode = data.spacingMode;
|
bool percentSpacing = data.spacingMode == SpacingMode.Percent;
|
||||||
bool percentSpacing = spacingMode == SpacingMode.Percent;
|
|
||||||
RotateMode rotateMode = data.rotateMode;
|
RotateMode rotateMode = data.rotateMode;
|
||||||
bool tangents = rotateMode == RotateMode.Tangent, scale = rotateMode == RotateMode.ChainScale;
|
bool tangents = rotateMode == RotateMode.Tangent, scale = rotateMode == RotateMode.ChainScale;
|
||||||
int boneCount = this.bones.Count, spacesCount = tangents ? boneCount : boneCount + 1;
|
int boneCount = this.bones.Count, spacesCount = tangents ? boneCount : boneCount + 1;
|
||||||
@ -158,9 +157,8 @@ namespace Spine {
|
|||||||
float length = bone.data.length;
|
float length = bone.data.length;
|
||||||
boneX += (length * (cos * a - sin * c) - dx) * rotateMix;
|
boneX += (length * (cos * a - sin * c) - dx) * rotateMix;
|
||||||
boneY += (length * (sin * a + cos * c) - dy) * rotateMix;
|
boneY += (length * (sin * a + cos * c) - dy) * rotateMix;
|
||||||
} else {
|
} else
|
||||||
r += offsetRotation;
|
r += offsetRotation;
|
||||||
}
|
|
||||||
if (r > MathUtils.PI)
|
if (r > MathUtils.PI)
|
||||||
r -= MathUtils.PI2;
|
r -= MathUtils.PI2;
|
||||||
else if (r < -MathUtils.PI) //
|
else if (r < -MathUtils.PI) //
|
||||||
@ -186,11 +184,10 @@ namespace Spine {
|
|||||||
bool closed = path.Closed;
|
bool closed = path.Closed;
|
||||||
int verticesLength = path.WorldVerticesLength, curveCount = verticesLength / 6, prevCurve = NONE;
|
int verticesLength = path.WorldVerticesLength, curveCount = verticesLength / 6, prevCurve = NONE;
|
||||||
|
|
||||||
float pathLength;
|
|
||||||
if (!path.ConstantSpeed) {
|
if (!path.ConstantSpeed) {
|
||||||
float[] lengths = path.Lengths;
|
float[] lengths = path.Lengths;
|
||||||
curveCount -= closed ? 1 : 2;
|
curveCount -= closed ? 1 : 2;
|
||||||
pathLength = lengths[curveCount];
|
float pathLength = lengths[curveCount];
|
||||||
if (percentPosition) position *= pathLength;
|
if (percentPosition) position *= pathLength;
|
||||||
if (percentSpacing) {
|
if (percentSpacing) {
|
||||||
for (int i = 0; i < spacesCount; i++)
|
for (int i = 0; i < spacesCount; i++)
|
||||||
@ -265,7 +262,7 @@ namespace Spine {
|
|||||||
|
|
||||||
// Curve lengths.
|
// Curve lengths.
|
||||||
float[] curves = this.curves.Resize(curveCount).Items;
|
float[] curves = this.curves.Resize(curveCount).Items;
|
||||||
pathLength = 0;
|
float pathLength = 0;
|
||||||
float x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;
|
float x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;
|
||||||
float tmpx, tmpy, dddfx, dddfy, ddfx, ddfy, dfx, dfy;
|
float tmpx, tmpy, dddfx, dddfy, ddfx, ddfy, dfx, dfy;
|
||||||
for (int i = 0, w = 2; i < curveCount; i++, w += 6) {
|
for (int i = 0, w = 2; i < curveCount; i++, w += 6) {
|
||||||
|
|||||||
@ -133,7 +133,7 @@ namespace Spine {
|
|||||||
var ikConstraints = this.ikConstraints;
|
var ikConstraints = this.ikConstraints;
|
||||||
var transformConstraints = this.transformConstraints;
|
var transformConstraints = this.transformConstraints;
|
||||||
var pathConstraints = this.pathConstraints;
|
var pathConstraints = this.pathConstraints;
|
||||||
int ikCount = IkConstraints.Count, transformCount = transformConstraints.Count, pathCount = pathConstraints.Count;
|
int ikCount = ikConstraints.Count, transformCount = transformConstraints.Count, pathCount = pathConstraints.Count;
|
||||||
int constraintCount = ikCount + transformCount + pathCount;
|
int constraintCount = ikCount + transformCount + pathCount;
|
||||||
//outer:
|
//outer:
|
||||||
for (int i = 0; i < constraintCount; i++) {
|
for (int i = 0; i < constraintCount; i++) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user