Formatting

This commit is contained in:
Mario Zechner 2024-07-24 14:37:16 +02:00
parent 83ac01e76c
commit 1d0b33fb69
4 changed files with 17 additions and 17 deletions

View File

@ -122,20 +122,20 @@ void spPhysicsConstraint_update(spPhysicsConstraint *self, spPhysics physics) {
self->uy = by;
} else {
// float a = self->remaining, i = self->inertia, q = self->data->limit * delta, t = self->data->step, f = self->skeleton->data->referenceScale, d = -1;
float a = self->remaining, i = self->inertia, t = self->data->step, f = self->skeleton->data->referenceScale;
float qx = self->data->limit * delta, qy = qx * ABS(self->skeleton->scaleX);
qx *= ABS(self->skeleton->scaleY);
float a = self->remaining, i = self->inertia, t = self->data->step, f = self->skeleton->data->referenceScale;
float qx = self->data->limit * delta, qy = qx * ABS(self->skeleton->scaleX);
qx *= ABS(self->skeleton->scaleY);
if (x || y) {
if (x) {
float u = (self->ux - bx) * i;
self->xOffset += u > qx ? qx : u < -qx ? -qx
: u;
: u;
self->ux = bx;
}
if (y) {
float u = (self->uy - by) * i;
self->yOffset += u > qy ? qy : u < -qy ? -qy
: u;
: u;
self->uy = by;
}
if (a >= t) {
@ -190,7 +190,7 @@ void spPhysicsConstraint_update(spPhysicsConstraint *self, spPhysics physics) {
a = self->remaining;
if (a >= t) {
float m = self->massInverse * t, e = self->strength, w = self->wind, g = self->gravity, h = l / f;
float d = POW(self->damping, 60 * t);
float d = POW(self->damping, 60 * t);
while (-1) {
a -= t;
if (scaleX) {

View File

@ -105,7 +105,7 @@ bool MathUtil::isNan(float v) {
}
float MathUtil::quietNan() {
return std::nan("");
return std::nan("");
}
float MathUtil::random() {

View File

@ -334,20 +334,20 @@ void PhysicsConstraint::update(Physics physics) {
_ux = bx;
_uy = by;
} else {
float a = _remaining, i = _inertia, t = _data._step, f = _skeleton.getData()->getReferenceScale();
float qx = _data._limit * delta, qy = qx * MathUtil::abs(_skeleton.getScaleX());
qx *= MathUtil::abs(_skeleton.getScaleY());
float a = _remaining, i = _inertia, t = _data._step, f = _skeleton.getData()->getReferenceScale();
float qx = _data._limit * delta, qy = qx * MathUtil::abs(_skeleton.getScaleX());
qx *= MathUtil::abs(_skeleton.getScaleY());
if (x || y) {
if (x) {
float u = (_ux - bx) * i;
_xOffset += u > qx ? qx : u < -qx ? -qx
: u;
: u;
_ux = bx;
}
if (y) {
float u = (_uy - by) * i;
_yOffset += u > qy ? qy : u < -qy ? -qy
: u;
: u;
_uy = by;
}
if (a >= t) {
@ -402,7 +402,7 @@ void PhysicsConstraint::update(Physics physics) {
a = _remaining;
if (a >= t) {
float m = _massInverse * t, e = _strength, w = _wind, g = _gravity * (Bone::yDown ? -1 : 1), h = l / f;
float d = MathUtil::pow(_damping, 60 * t);
float d = MathUtil::pow(_damping, 60 * t);
while (true) {
a -= t;
if (scaleX) {

View File

@ -363,10 +363,10 @@ bool SkeletonClipping::clip(float x1, float y1, float x2, float y2, float x3, fl
} else
originalOutput->setSize(originalOutput->size() - 2, 0);
if (originalOutput->size() < 6) {
originalOutput->clear();
return false;
}
if (originalOutput->size() < 6) {
originalOutput->clear();
return false;
}
return clipped;
}