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

Method poseLying

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

Source from the content-addressed store, hash-verified

145 // Subtle micro-movements, differentiate supine vs side-lying via elapsed hash
146
147 poseLying(px, surfaceY, pz, elapsed, bp) {
148 const y = (surfaceY || 0) + 0.2;
149 const chest = bp * 0.015;
150
151 // Micro-movements -- tiny random-feeling shifts (deterministic from elapsed)
152 const microX = Math.sin(elapsed * 0.17) * 0.004;
153 const microZ = Math.cos(elapsed * 0.13) * 0.003;
154 const fingerTwitch = Math.sin(elapsed * 0.7) * 0.008;
155
156 // Determine supine vs side-lying from a slow oscillation (stays one way for ~20s)
157 const lyingMode = Math.sin(elapsed * 0.05);
158
159 if (lyingMode > 0.3) {
160 // Side-lying (on left side)
161 const curl = Math.sin(elapsed * 0.1) * 0.02; // slight fetal curl
162 return [
163 [px - 0.72 + microX, y + 0.12, pz - 0.08], // 0 nose (turned)
164 [px - 0.70, y + 0.14, pz - 0.10], // 1 left eye
165 [px - 0.70, y + 0.16, pz - 0.06], // 2 right eye (up)
166 [px - 0.76, y + 0.11, pz - 0.12], // 3 left ear (down)
167 [px - 0.76, y + 0.14, pz - 0.04], // 4 right ear
168 [px - 0.45, y + chest + 0.05, pz - 0.12], // 5 left shoulder (down)
169 [px - 0.45, y + chest + 0.2, pz + 0.04], // 6 right shoulder (up)
170 [px - 0.38, y + 0.02, pz - 0.28 + curl], // 7 left elbow
171 [px - 0.35, y + 0.18, pz + 0.15 + fingerTwitch], // 8 right elbow
172 [px - 0.20, y - 0.01, pz - 0.30 + curl], // 9 left wrist
173 [px - 0.18, y + 0.12, pz + 0.25 + fingerTwitch], // 10 right wrist
174 [px + 0.05 + microX, y + chest * 0.4 + 0.03, pz - 0.08], // 11 left hip
175 [px + 0.05 + microX, y + chest * 0.4 + 0.12, pz + 0.06], // 12 right hip
176 [px + 0.40 + curl * 2, y + 0.02, pz - 0.14 + curl], // 13 left knee
177 [px + 0.38 + curl * 2, y + 0.10, pz + 0.10 + curl], // 14 right knee
178 [px + 0.75, y - 0.01, pz - 0.12], // 15 left ankle
179 [px + 0.72, y + 0.04, pz + 0.08], // 16 right ankle
180 ];
181 }
182
183 // Supine (face up) -- default
184 return [
185 [px - 0.75 + microX, y + 0.08, pz + microZ], // 0 nose
186 [px - 0.72, y + 0.1, pz - 0.02 + microZ], // 1 left eye
187 [px - 0.72, y + 0.1, pz + 0.02 + microZ], // 2 right eye
188 [px - 0.78, y + 0.08, pz - 0.05], // 3 left ear
189 [px - 0.78, y + 0.08, pz + 0.05], // 4 right ear
190 [px - 0.45, y + chest, pz - 0.18], // 5 left shoulder
191 [px - 0.45, y + chest, pz + 0.18], // 6 right shoulder
192 [px - 0.42, y, pz - 0.35 + fingerTwitch], // 7 left elbow
193 [px - 0.42, y, pz + 0.35 - fingerTwitch], // 8 right elbow
194 [px - 0.2, y - 0.02, pz - 0.38 + fingerTwitch], // 9 left wrist
195 [px - 0.2, y - 0.02, pz + 0.38 - fingerTwitch], // 10 right wrist
196 [px + 0.05 + microX, y + chest * 0.5, pz - 0.1], // 11 left hip
197 [px + 0.05 + microX, y + chest * 0.5, pz + 0.1], // 12 right hip
198 [px + 0.45, y, pz - 0.11], // 13 left knee
199 [px + 0.45, y, pz + 0.11], // 14 right knee
200 [px + 0.82, y - 0.02, pz - 0.1], // 15 left ankle
201 [px + 0.82, y - 0.02, pz + 0.1], // 16 right ankle
202 ];
203 }
204

Callers 1

generateKeypointsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected