Formatting

This commit is contained in:
Davide Tantillo 2025-06-20 15:28:40 +02:00
parent 5cb6577df3
commit bda90bd158
4 changed files with 4 additions and 5 deletions

View File

@ -54,7 +54,7 @@ void IkConstraintTimeline::apply(Skeleton &skeleton, float lastTime, float time,
SP_UNUSED(lastTime); SP_UNUSED(lastTime);
SP_UNUSED(pEvents); SP_UNUSED(pEvents);
IkConstraint *constraintP = (IkConstraint *)skeleton._constraints[_constraintIndex]; IkConstraint *constraintP = (IkConstraint *) skeleton._constraints[_constraintIndex];
IkConstraint &constraint = *constraintP; IkConstraint &constraint = *constraintP;
if (!constraint.isActive()) return; if (!constraint.isActive()) return;

View File

@ -115,7 +115,7 @@ void TransformConstraint::sort(Skeleton &skeleton) {
} }
skeleton._updateCache.add(this); skeleton._updateCache.add(this);
for (size_t i = 0; i < boneCount; i++) { for (size_t i = 0; i < boneCount; i++) {
Bone* bone = bones[i]->_bone; Bone *bone = bones[i]->_bone;
skeleton.sortReset(bone->getChildren()); skeleton.sortReset(bone->getChildren());
skeleton.constrained(*bone); skeleton.constrained(*bone);
} }

View File

@ -305,7 +305,7 @@ public class TransformConstraintData extends ConstraintData<TransformConstraint,
else { else {
s = (float)Math.sqrt(bone.a * bone.a + bone.c * bone.c) / skeleton.scaleX; s = (float)Math.sqrt(bone.a * bone.a + bone.c * bone.c) / skeleton.scaleX;
if (s != 0) s = 1 + (value / s - 1) * pose.mixScaleX; if (s != 0) s = 1 + (value / s - 1) * pose.mixScaleX;
} }
bone.a *= s; bone.a *= s;
bone.c *= s; bone.c *= s;
} }

View File

@ -32,7 +32,6 @@ import { ClippingAttachment } from "./attachments/ClippingAttachment.js";
import { MeshAttachment } from "./attachments/MeshAttachment.js"; import { MeshAttachment } from "./attachments/MeshAttachment.js";
import { RegionAttachment } from "./attachments/RegionAttachment.js"; import { RegionAttachment } from "./attachments/RegionAttachment.js";
import { Bone } from "./Bone.js"; import { Bone } from "./Bone.js";
import { BonePose } from "./BonePose.js";
import { Constraint } from "./Constraint.js"; import { Constraint } from "./Constraint.js";
import { Physics } from "./Physics.js"; import { Physics } from "./Physics.js";
import { PhysicsConstraint } from "./PhysicsConstraint.js"; import { PhysicsConstraint } from "./PhysicsConstraint.js";
@ -49,7 +48,7 @@ import { Color, Utils, Vector2, NumberArrayLike } from "./Utils.js";
export class Skeleton { export class Skeleton {
private static quadTriangles = [0, 1, 2, 2, 3, 0]; private static quadTriangles = [0, 1, 2, 2, 3, 0];
static yDown = false; static yDown = false;
static get yDir(): number { static get yDir (): number {
return Skeleton.yDown ? -1 : 1; return Skeleton.yDown ? -1 : 1;
} }