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

Method generateKeypoints

web/observatory/js/pose-system.js:17–44  ·  view source on GitHub ↗
(person, elapsed, breathPulse)

Source from the content-addressed store, hash-verified

15 // ---- Entry point -------------------------------------------------------
16
17 generateKeypoints(person, elapsed, breathPulse) {
18 const pose = person.pose || 'standing';
19 const pos = person.position || [0, 0, 0];
20 const facing = person.facing || 0;
21 const px = pos[0], pz = pos[2];
22 const ms = person.motion_score || 0;
23 const bp = breathPulse;
24
25 let kps;
26 switch (pose) {
27 case 'lying': kps = this.poseLying(px, pos[1] || 0, pz, elapsed, bp); break;
28 case 'sitting': kps = this.poseSitting(px, pz, elapsed, bp); break;
29 case 'fallen': kps = this.poseFallen(px, pz, elapsed); break;
30 case 'falling': kps = this.poseFalling(px, pz, elapsed, person.fallProgress || 0); break;
31 case 'exercising': kps = this.poseExercising(px, pz, elapsed, person.exerciseType, person.exerciseTime); break;
32 case 'gesturing': kps = this.poseGesturing(px, pz, elapsed, person.gestureType, person.gestureIntensity || 0); break;
33 case 'crouching': kps = this.poseCrouching(px, pz, elapsed, bp); break;
34 case 'walking': kps = this.poseWalking(px, pz, elapsed, ms, bp); break;
35 case 'standing':
36 default: kps = this.poseStanding(px, pz, elapsed, ms, bp); break;
37 }
38
39 // Apply facing rotation
40 if (Math.abs(facing) > 0.01) {
41 this.rotateKps(kps, px, pz, facing);
42 }
43 return kps;
44 }
45
46 // ---- Rotation utility --------------------------------------------------
47

Callers 1

updateMethod · 0.80

Calls 10

poseLyingMethod · 0.95
poseSittingMethod · 0.95
poseFallenMethod · 0.95
poseFallingMethod · 0.95
poseExercisingMethod · 0.95
poseGesturingMethod · 0.95
poseCrouchingMethod · 0.95
poseWalkingMethod · 0.95
poseStandingMethod · 0.95
rotateKpsMethod · 0.95

Tested by

no test coverage detected