Apply formatting

This commit is contained in:
Mario Zechner 2024-03-19 12:16:35 +01:00
parent 6bcef32208
commit 355f7ed15b
3 changed files with 17 additions and 17 deletions

View File

@ -466,17 +466,17 @@ void PhysicsConstraint::update(Physics physics) {
}
void PhysicsConstraint::rotate(float x, float y, float degrees) {
float r = degrees * MathUtil::Deg_Rad, cos = MathUtil::cos(r), sin = MathUtil::sin(r);
r = _tx * cos - _ty * sin;
_ty = _tx * sin + _ty * cos;
_tx = r;
float dx = _cx - x, dy = _cy - y;
translate(dx * cos - dy * sin - dx, dx * sin + dy * cos - dy);
float r = degrees * MathUtil::Deg_Rad, cos = MathUtil::cos(r), sin = MathUtil::sin(r);
r = _tx * cos - _ty * sin;
_ty = _tx * sin + _ty * cos;
_tx = r;
float dx = _cx - x, dy = _cy - y;
translate(dx * cos - dy * sin - dx, dx * sin + dy * cos - dy);
}
void PhysicsConstraint::translate(float x, float y) {
_ux -= x;
_uy -= y;
_cx -= x;
_cy -= y;
_ux -= x;
_uy -= y;
_cx -= x;
_cy -= y;
}

View File

@ -713,13 +713,13 @@ void Skeleton::update(float delta) {
}
void Skeleton::physicsTranslate(float x, float y) {
for (int i = 0; i < (int)_physicsConstraints.size(); i++) {
_physicsConstraints[i]->translate(x, y);
}
for (int i = 0; i < (int) _physicsConstraints.size(); i++) {
_physicsConstraints[i]->translate(x, y);
}
}
void Skeleton::physicsRotate(float x, float y, float degrees) {
for (int i = 0; i < (int)_physicsConstraints.size(); i++) {
_physicsConstraints[i]->rotate(x, y, degrees);
}
for (int i = 0; i < (int) _physicsConstraints.size(); i++) {
_physicsConstraints[i]->rotate(x, y, degrees);
}
}

View File

@ -852,7 +852,7 @@ export class SkeletonBinary {
const softness2 = (flags & 4) != 0 ? input.readFloat() * scale : 0;
if ((flags & 64) != 0) {
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, 1, time, time2, softness, softness2, scale);
}