Give the figure real girdles, fix orbit pinning, add roller pads

Shoulder and pelvis widths grow to human-like proportions per profile
(shoulders wider than hips for neutral/male, reversed for female) and
are now drawn — bars across the attach points that read near-full-width
face-on and as a shoulder/hip nub in profile, so limbs visibly hang
from a torso instead of a point. Orbiting no longer re-solves IK pins
in the rotated view (pins are canvas targets in the authored camera):
the pose resolves first and the posed body rotates, which fixes hands
sticking to stale screen points mid-orbit (Cat-Cow, Bird Dog, Plank).
Leg Extension and Leg Curl swap their ankle bars for a machine roller
disc — a new `roller` prop riding the shin's press side. Fixtures
regenerated; both renderers updated in lockstep.

Claude-Session: https://claude.ai/code/session_01LEoff8bXGBS83tK1c55Mf7
This commit is contained in:
2026-07-06 21:00:03 -04:00
parent fd3bcb513f
commit 5e4980f0d7
106 changed files with 543 additions and 156 deletions
+20 -2
View File
@@ -159,6 +159,10 @@ struct FigureGeometry {
var noseStart, noseEnd: CGPoint?
/// Quadratic Bézier through pelvis mid neck (control = 2·mid (pelvis+neck)/2).
var spineStart, spineControl, spineEnd: CGPoint
/// Shoulder girdle and pelvis bars, drawn with the spine: left attach center
/// right attach, far offsets included so the bars meet the drawn limbs exactly.
var girdle: [CGPoint]
var pelvisBar: [CGPoint]
/// Attach elbow/knee hand (arms: 3 points); hip knee ankle toe (legs: 4).
var limbs: [FigureLimb: [CGPoint]]
/// Parts far-to-near, `"head"` always last (`"spine"`, `"arm_r"`, then `"head"`).
@@ -452,9 +456,14 @@ enum MotionSolver {
return (fixedRank[lhs] ?? 0) < (fixedRank[rhs] ?? 0)
} + ["head"]
func attachPoint(_ v: Vec3, _ limb: FigureLimb) -> CGPoint {
scr(v, shade[limb] == .far ? off : .zero)
}
let geo = FigureGeometry(
headCenter: head, headRadius: prof.headR, noseStart: noseStart, noseEnd: noseEnd,
spineStart: pelvis, spineControl: control, spineEnd: neckB,
girdle: [attachPoint(p.shoulderL, .armL), neckB, attachPoint(p.shoulderR, .armR)],
pelvisBar: [attachPoint(p.hipL, .legL), pelvis, attachPoint(p.hipR, .legR)],
limbs: limbs, order: order, shade: shade)
return (resolved, geo)
}
@@ -500,8 +509,17 @@ struct MotionTimeline {
}
/// The drawable geometry at wall-clock `time`. `yawOffset` turns the camera past
/// the exercise's authored yaw the slow-orbit presentation.
/// the exercise's authored yaw the slow-orbit presentation. Pins are canvas
/// targets in the *authored* view, so the pose resolves there first and the posed
/// body is then rotated; re-pinning in a rotated view would glue hands to screen
/// points that no longer correspond to anything (arms visibly "stuck" mid-orbit).
func geometry(at time: Double, yawOffset: Double = 0) -> FigureGeometry {
MotionSolver.frameGeometry(frame(at: time), prof: profile, cam: cam + yawOffset).1
let frame = frame(at: time)
guard yawOffset != 0 else {
return MotionSolver.frameGeometry(frame, prof: profile, cam: cam).1
}
var posed = MotionSolver.frameGeometry(frame, prof: profile, cam: cam).0
posed.pins = [:]
return MotionSolver.frameGeometry(posed, prof: profile, cam: cam + yawOffset).1
}
}