mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
Apply formatting
This commit is contained in:
parent
6bcef32208
commit
355f7ed15b
@ -466,17 +466,17 @@ void PhysicsConstraint::update(Physics physics) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PhysicsConstraint::rotate(float x, float y, float degrees) {
|
void PhysicsConstraint::rotate(float x, float y, float degrees) {
|
||||||
float r = degrees * MathUtil::Deg_Rad, cos = MathUtil::cos(r), sin = MathUtil::sin(r);
|
float r = degrees * MathUtil::Deg_Rad, cos = MathUtil::cos(r), sin = MathUtil::sin(r);
|
||||||
r = _tx * cos - _ty * sin;
|
r = _tx * cos - _ty * sin;
|
||||||
_ty = _tx * sin + _ty * cos;
|
_ty = _tx * sin + _ty * cos;
|
||||||
_tx = r;
|
_tx = r;
|
||||||
float dx = _cx - x, dy = _cy - y;
|
float dx = _cx - x, dy = _cy - y;
|
||||||
translate(dx * cos - dy * sin - dx, dx * sin + dy * cos - dy);
|
translate(dx * cos - dy * sin - dx, dx * sin + dy * cos - dy);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PhysicsConstraint::translate(float x, float y) {
|
void PhysicsConstraint::translate(float x, float y) {
|
||||||
_ux -= x;
|
_ux -= x;
|
||||||
_uy -= y;
|
_uy -= y;
|
||||||
_cx -= x;
|
_cx -= x;
|
||||||
_cy -= y;
|
_cy -= y;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -713,13 +713,13 @@ void Skeleton::update(float delta) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Skeleton::physicsTranslate(float x, float y) {
|
void Skeleton::physicsTranslate(float x, float y) {
|
||||||
for (int i = 0; i < (int)_physicsConstraints.size(); i++) {
|
for (int i = 0; i < (int) _physicsConstraints.size(); i++) {
|
||||||
_physicsConstraints[i]->translate(x, y);
|
_physicsConstraints[i]->translate(x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Skeleton::physicsRotate(float x, float y, float degrees) {
|
void Skeleton::physicsRotate(float x, float y, float degrees) {
|
||||||
for (int i = 0; i < (int)_physicsConstraints.size(); i++) {
|
for (int i = 0; i < (int) _physicsConstraints.size(); i++) {
|
||||||
_physicsConstraints[i]->rotate(x, y, degrees);
|
_physicsConstraints[i]->rotate(x, y, degrees);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -852,7 +852,7 @@ export class SkeletonBinary {
|
|||||||
const softness2 = (flags & 4) != 0 ? input.readFloat() * scale : 0;
|
const softness2 = (flags & 4) != 0 ? input.readFloat() * scale : 0;
|
||||||
if ((flags & 64) != 0) {
|
if ((flags & 64) != 0) {
|
||||||
timeline.setStepped(frame);
|
timeline.setStepped(frame);
|
||||||
} else if ((flags & 128) != 0) {
|
} else if ((flags & 128) != 0) {
|
||||||
setBezier(input, timeline, bezier++, frame, 0, time, time2, mix, mix2, 1);
|
setBezier(input, timeline, bezier++, frame, 0, time, time2, mix, mix2, 1);
|
||||||
setBezier(input, timeline, bezier++, frame, 1, time, time2, softness, softness2, scale);
|
setBezier(input, timeline, bezier++, frame, 1, time, time2, softness, softness2, scale);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user