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

Method rotateKps

web/observatory/js/pose-system.js:48–55  ·  view source on GitHub ↗
(kps, cx, cz, angle)

Source from the content-addressed store, hash-verified

46 // ---- Rotation utility --------------------------------------------------
47
48 rotateKps(kps, cx, cz, angle) {
49 const cos = Math.cos(angle), sin = Math.sin(angle);
50 for (const kp of kps) {
51 const dx = kp[0] - cx, dz = kp[2] - cz;
52 kp[0] = cx + dx * cos - dz * sin;
53 kp[2] = cz + dx * sin + dz * cos;
54 }
55 }
56
57 // ---- Standing ----------------------------------------------------------
58 // Weight shift between feet, idle head look-around, breathing

Callers 1

generateKeypointsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected