(kps, cx, cz, angle)
| 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 |