MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / poseSitting

Method poseSitting

web/observatory/js/pose-system.js:208–241  ·  view source on GitHub ↗
(px, pz, elapsed, bp)

Source from the content-addressed store, hash-verified

206 // Occasional fidget, breathing chest expansion, weight shift
207
208 poseSitting(px, pz, elapsed, bp) {
209 const sway = Math.sin(elapsed * 0.5) * 0.003;
210
211 // Fidget: occasional hand movement (every ~6s a small gesture)
212 const fidgetCycle = elapsed % 6.0;
213 const fidgetActive = fidgetCycle > 5.2 && fidgetCycle < 5.8;
214 const fidgetAmt = fidgetActive ? Math.sin((fidgetCycle - 5.2) * Math.PI / 0.6) * 0.06 : 0;
215
216 // Weight shift side to side (slow)
217 const weightShift = Math.sin(elapsed * 0.25) * 0.008;
218
219 // Chest expansion from breathing
220 const chestExpand = bp * 0.008;
221
222 return [
223 [px + sway + weightShift, 1.15 + bp, pz], // 0 nose
224 [px - 0.03 + sway + weightShift, 1.17 + bp, pz - 0.02], // 1 left eye
225 [px + 0.03 + sway + weightShift, 1.17 + bp, pz - 0.02], // 2 right eye
226 [px - 0.07 + weightShift, 1.15 + bp, pz], // 3 left ear
227 [px + 0.07 + weightShift, 1.15 + bp, pz], // 4 right ear
228 [px - 0.20 - chestExpand + weightShift, 0.95 + bp, pz], // 5 left shoulder
229 [px + 0.20 + chestExpand + weightShift, 0.95 + bp, pz], // 6 right shoulder
230 [px - 0.25 + weightShift, 0.72 + bp, pz + 0.08], // 7 left elbow
231 [px + 0.25 + weightShift, 0.72 + bp, pz + 0.08], // 8 right elbow
232 [px - 0.18 + fidgetAmt, 0.55 + fidgetAmt * 0.3, pz + 0.15], // 9 left wrist (fidgets)
233 [px + 0.18, 0.55, pz + 0.15], // 10 right wrist
234 [px - 0.11 + weightShift * 0.5, 0.48, pz + 0.02], // 11 left hip
235 [px + 0.11 + weightShift * 0.5, 0.48, pz + 0.02], // 12 right hip
236 [px - 0.12, 0.48, pz + 0.4], // 13 left knee
237 [px + 0.12, 0.48, pz + 0.4], // 14 right knee
238 [px - 0.12, 0.04, pz + 0.4], // 15 left ankle
239 [px + 0.12, 0.04, pz + 0.4], // 16 right ankle
240 ];
241 }
242
243 // ---- Fallen ------------------------------------------------------------
244 // Occasional twitch/attempt to move, asymmetric breathing

Callers 1

generateKeypointsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected