@bitefoundry/retrieviewer 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (261) hide show
  1. package/ASSET-PROVENANCE.md +6 -0
  2. package/ASSETS-LICENSE.md +2 -1
  3. package/ATTRIBUTION.md +6 -1
  4. package/COMFORT-ART.md +65 -0
  5. package/DESKTOP-PLATFORMS.md +75 -0
  6. package/INSTALLING.md +8 -5
  7. package/PLUGIN.md +13 -10
  8. package/PREREQUISITES.md +95 -0
  9. package/PUPPY-MEMORY.md +102 -1
  10. package/README.ko.md +110 -0
  11. package/README.md +119 -58
  12. package/RELEASING.md +27 -14
  13. package/THIRD-PARTY-NOTICES.md +5 -3
  14. package/braille.mjs +35 -9
  15. package/examples/live.mjs +2 -2
  16. package/integrations/desktop/platform.mjs +27 -0
  17. package/integrations/linux-overlay/README.md +83 -0
  18. package/integrations/linux-overlay/overlay.py +1094 -0
  19. package/integrations/macos-overlay/README.md +83 -0
  20. package/integrations/macos-overlay/overlay.jxa +639 -0
  21. package/integrations/opencode/runtime.mjs +4 -4
  22. package/integrations/opencode/tui.tsx +1 -1
  23. package/integrations/windows-overlay/Overlay.cs +4 -4
  24. package/integrations/windows-overlay/desktop.mjs +40 -8
  25. package/integrations/windows-overlay/protocol.mjs +11 -7
  26. package/integrations/windows-overlay/worker.mjs +13 -7
  27. package/package.json +41 -14
  28. package/puppy-comfort-sprites.mjs +25 -0
  29. package/puppy-companion-comfort-q5.bin.gz +0 -0
  30. package/puppy-companion-comfort.json +77 -0
  31. package/puppy-companion-life.mjs +49 -16
  32. package/puppy-companion-objects.mjs +12 -0
  33. package/puppy-frame-predictive.mjs +15 -9
  34. package/puppy-frame-store.mjs +2 -2
  35. package/puppy-paper-world.mjs +14 -0
  36. package/puppy-paper.mjs +65 -14
  37. package/retrieviewer-cli.mjs +10 -3
  38. package/retrieviewer-plugin.d.mts +1 -1
  39. package/retrieviewer-plugin.mjs +1 -1
  40. package/retrieviewer.d.mts +10 -4
  41. package/retrieviewer.mjs +20 -14
  42. package/locomotion-core.mjs +0 -21
  43. package/locomotion-puppy.animal +0 -0
  44. package/vendor/procedural-animals/package.json +0 -40
  45. package/vendor/procedural-animals/src/animal.js +0 -146
  46. package/vendor/procedural-animals/src/bake.js +0 -51
  47. package/vendor/procedural-animals/src/build.js +0 -81
  48. package/vendor/procedural-animals/src/core/build/coatKit.js +0 -121
  49. package/vendor/procedural-animals/src/core/build/featherCards.js +0 -189
  50. package/vendor/procedural-animals/src/core/build/finEdges.js +0 -85
  51. package/vendor/procedural-animals/src/core/build/furSlope.js +0 -115
  52. package/vendor/procedural-animals/src/core/build/mesh.js +0 -67
  53. package/vendor/procedural-animals/src/core/build/pipeline.js +0 -272
  54. package/vendor/procedural-animals/src/core/build/seams.js +0 -183
  55. package/vendor/procedural-animals/src/core/build/warp.js +0 -112
  56. package/vendor/procedural-animals/src/core/build/weights.js +0 -393
  57. package/vendor/procedural-animals/src/core/math/vec.js +0 -81
  58. package/vendor/procedural-animals/src/core/motion/actions.js +0 -800
  59. package/vendor/procedural-animals/src/core/motion/bird.js +0 -3063
  60. package/vendor/procedural-animals/src/core/motion/birdActions.js +0 -1059
  61. package/vendor/procedural-animals/src/core/motion/common.js +0 -158
  62. package/vendor/procedural-animals/src/core/motion/index.js +0 -22
  63. package/vendor/procedural-animals/src/core/motion/quadruped.js +0 -2875
  64. package/vendor/procedural-animals/src/core/motion/snake.js +0 -1594
  65. package/vendor/procedural-animals/src/core/motion/spider.js +0 -1810
  66. package/vendor/procedural-animals/src/core/motion/swimmer.js +0 -1047
  67. package/vendor/procedural-animals/src/core/motion/swimmerActions.js +0 -613
  68. package/vendor/procedural-animals/src/core/render/animalObject.js +0 -262
  69. package/vendor/procedural-animals/src/core/render/coatMaterial.js +0 -1301
  70. package/vendor/procedural-animals/src/core/render/dqs.js +0 -159
  71. package/vendor/procedural-animals/src/core/render/eyes.js +0 -676
  72. package/vendor/procedural-animals/src/core/render/membranes.js +0 -77
  73. package/vendor/procedural-animals/src/core/render/skeleton.js +0 -41
  74. package/vendor/procedural-animals/src/core/rig/bird.js +0 -327
  75. package/vendor/procedural-animals/src/core/rig/quadruped.js +0 -76
  76. package/vendor/procedural-animals/src/core/rig/rig.js +0 -79
  77. package/vendor/procedural-animals/src/core/rig/snake.js +0 -76
  78. package/vendor/procedural-animals/src/core/rig/spider.js +0 -110
  79. package/vendor/procedural-animals/src/core/rig/swimmer.js +0 -181
  80. package/vendor/procedural-animals/src/core/sdf/eyeSocket.js +0 -53
  81. package/vendor/procedural-animals/src/core/sdf/mesher.js +0 -238
  82. package/vendor/procedural-animals/src/core/sdf/sdf.js +0 -263
  83. package/vendor/procedural-animals/src/index.d.ts +0 -98
  84. package/vendor/procedural-animals/src/index.js +0 -29
  85. package/vendor/procedural-animals/src/registry.js +0 -48
  86. package/vendor/procedural-animals/src/species/bear/behaviour.js +0 -463
  87. package/vendor/procedural-animals/src/species/bear/claws.js +0 -147
  88. package/vendor/procedural-animals/src/species/bear/coat.js +0 -726
  89. package/vendor/procedural-animals/src/species/bear/index.js +0 -139
  90. package/vendor/procedural-animals/src/species/bear/motion.js +0 -112
  91. package/vendor/procedural-animals/src/species/bear/regions.js +0 -78
  92. package/vendor/procedural-animals/src/species/bear/rig.js +0 -112
  93. package/vendor/procedural-animals/src/species/bear/sculpt.js +0 -272
  94. package/vendor/procedural-animals/src/species/boar/behaviour.js +0 -335
  95. package/vendor/procedural-animals/src/species/boar/coat.js +0 -372
  96. package/vendor/procedural-animals/src/species/boar/index.js +0 -110
  97. package/vendor/procedural-animals/src/species/boar/motion.js +0 -85
  98. package/vendor/procedural-animals/src/species/boar/regions.js +0 -88
  99. package/vendor/procedural-animals/src/species/boar/rig.js +0 -111
  100. package/vendor/procedural-animals/src/species/boar/sculpt.js +0 -285
  101. package/vendor/procedural-animals/src/species/cat/behaviour.js +0 -559
  102. package/vendor/procedural-animals/src/species/cat/coat.js +0 -841
  103. package/vendor/procedural-animals/src/species/cat/index.js +0 -211
  104. package/vendor/procedural-animals/src/species/cat/motion.js +0 -101
  105. package/vendor/procedural-animals/src/species/cat/regions.js +0 -82
  106. package/vendor/procedural-animals/src/species/cat/rig.js +0 -100
  107. package/vendor/procedural-animals/src/species/cat/sculpt.js +0 -266
  108. package/vendor/procedural-animals/src/species/cat/whiskers.js +0 -110
  109. package/vendor/procedural-animals/src/species/cheetah/coat.js +0 -427
  110. package/vendor/procedural-animals/src/species/cheetah/index.js +0 -51
  111. package/vendor/procedural-animals/src/species/cheetah/joints.js +0 -3
  112. package/vendor/procedural-animals/src/species/cheetah/motion.js +0 -77
  113. package/vendor/procedural-animals/src/species/cheetah/regions.js +0 -95
  114. package/vendor/procedural-animals/src/species/cheetah/rig.js +0 -66
  115. package/vendor/procedural-animals/src/species/cheetah/sculpt.js +0 -158
  116. package/vendor/procedural-animals/src/species/chicken/coat.js +0 -313
  117. package/vendor/procedural-animals/src/species/chicken/coverts.js +0 -320
  118. package/vendor/procedural-animals/src/species/chicken/index.js +0 -110
  119. package/vendor/procedural-animals/src/species/chicken/motion.js +0 -177
  120. package/vendor/procedural-animals/src/species/chicken/regions.js +0 -66
  121. package/vendor/procedural-animals/src/species/chicken/rig.js +0 -144
  122. package/vendor/procedural-animals/src/species/chicken/sculpt.js +0 -389
  123. package/vendor/procedural-animals/src/species/chicken/wingLook.js +0 -66
  124. package/vendor/procedural-animals/src/species/chicken/wingStack.js +0 -124
  125. package/vendor/procedural-animals/src/species/cow/behaviour.js +0 -521
  126. package/vendor/procedural-animals/src/species/cow/coat.js +0 -465
  127. package/vendor/procedural-animals/src/species/cow/index.js +0 -118
  128. package/vendor/procedural-animals/src/species/cow/motion.js +0 -81
  129. package/vendor/procedural-animals/src/species/cow/regions.js +0 -98
  130. package/vendor/procedural-animals/src/species/cow/rig.js +0 -116
  131. package/vendor/procedural-animals/src/species/cow/sculpt.js +0 -339
  132. package/vendor/procedural-animals/src/species/crow/coat.js +0 -145
  133. package/vendor/procedural-animals/src/species/crow/index.js +0 -70
  134. package/vendor/procedural-animals/src/species/crow/joints.js +0 -3
  135. package/vendor/procedural-animals/src/species/crow/motion.js +0 -101
  136. package/vendor/procedural-animals/src/species/crow/regions.js +0 -50
  137. package/vendor/procedural-animals/src/species/crow/rig.js +0 -83
  138. package/vendor/procedural-animals/src/species/crow/sculpt.js +0 -118
  139. package/vendor/procedural-animals/src/species/deer/behaviour.js +0 -513
  140. package/vendor/procedural-animals/src/species/deer/coat.js +0 -391
  141. package/vendor/procedural-animals/src/species/deer/index.js +0 -106
  142. package/vendor/procedural-animals/src/species/deer/motion.js +0 -97
  143. package/vendor/procedural-animals/src/species/deer/regions.js +0 -60
  144. package/vendor/procedural-animals/src/species/deer/rig.js +0 -124
  145. package/vendor/procedural-animals/src/species/deer/sculpt.js +0 -297
  146. package/vendor/procedural-animals/src/species/dog/behaviour.js +0 -521
  147. package/vendor/procedural-animals/src/species/dog/coat.js +0 -495
  148. package/vendor/procedural-animals/src/species/dog/index.js +0 -144
  149. package/vendor/procedural-animals/src/species/dog/motion.js +0 -118
  150. package/vendor/procedural-animals/src/species/dog/regions.js +0 -61
  151. package/vendor/procedural-animals/src/species/dog/rig.js +0 -129
  152. package/vendor/procedural-animals/src/species/dog/sculpt.js +0 -246
  153. package/vendor/procedural-animals/src/species/eagle/coat.js +0 -250
  154. package/vendor/procedural-animals/src/species/eagle/index.js +0 -76
  155. package/vendor/procedural-animals/src/species/eagle/joints.js +0 -3
  156. package/vendor/procedural-animals/src/species/eagle/motion.js +0 -137
  157. package/vendor/procedural-animals/src/species/eagle/regions.js +0 -57
  158. package/vendor/procedural-animals/src/species/eagle/rig.js +0 -107
  159. package/vendor/procedural-animals/src/species/eagle/sculpt.js +0 -137
  160. package/vendor/procedural-animals/src/species/fish/coat.js +0 -271
  161. package/vendor/procedural-animals/src/species/fish/index.js +0 -88
  162. package/vendor/procedural-animals/src/species/fish/motion.js +0 -92
  163. package/vendor/procedural-animals/src/species/fish/regions.js +0 -27
  164. package/vendor/procedural-animals/src/species/fish/rig.js +0 -143
  165. package/vendor/procedural-animals/src/species/fish/sculpt.js +0 -214
  166. package/vendor/procedural-animals/src/species/fish/variants.js +0 -126
  167. package/vendor/procedural-animals/src/species/fox/behaviour.js +0 -314
  168. package/vendor/procedural-animals/src/species/fox/coat.js +0 -444
  169. package/vendor/procedural-animals/src/species/fox/index.js +0 -120
  170. package/vendor/procedural-animals/src/species/fox/motion.js +0 -81
  171. package/vendor/procedural-animals/src/species/fox/regions.js +0 -59
  172. package/vendor/procedural-animals/src/species/fox/rig.js +0 -91
  173. package/vendor/procedural-animals/src/species/fox/sculpt.js +0 -202
  174. package/vendor/procedural-animals/src/species/frog/behaviour.js +0 -590
  175. package/vendor/procedural-animals/src/species/frog/coat.js +0 -305
  176. package/vendor/procedural-animals/src/species/frog/index.js +0 -97
  177. package/vendor/procedural-animals/src/species/frog/motion.js +0 -69
  178. package/vendor/procedural-animals/src/species/frog/regions.js +0 -46
  179. package/vendor/procedural-animals/src/species/frog/rig.js +0 -156
  180. package/vendor/procedural-animals/src/species/frog/sculpt.js +0 -240
  181. package/vendor/procedural-animals/src/species/goat/behaviour.js +0 -509
  182. package/vendor/procedural-animals/src/species/goat/coat.js +0 -590
  183. package/vendor/procedural-animals/src/species/goat/index.js +0 -149
  184. package/vendor/procedural-animals/src/species/goat/motion.js +0 -95
  185. package/vendor/procedural-animals/src/species/goat/regions.js +0 -98
  186. package/vendor/procedural-animals/src/species/goat/rig.js +0 -181
  187. package/vendor/procedural-animals/src/species/goat/sculpt.js +0 -547
  188. package/vendor/procedural-animals/src/species/horse/coat.js +0 -361
  189. package/vendor/procedural-animals/src/species/horse/coatSeam.js +0 -122
  190. package/vendor/procedural-animals/src/species/horse/index.js +0 -80
  191. package/vendor/procedural-animals/src/species/horse/motion.js +0 -245
  192. package/vendor/procedural-animals/src/species/horse/regions.js +0 -60
  193. package/vendor/procedural-animals/src/species/horse/rig.js +0 -117
  194. package/vendor/procedural-animals/src/species/horse/sculpt.js +0 -316
  195. package/vendor/procedural-animals/src/species/horse/seamWeights.js +0 -272
  196. package/vendor/procedural-animals/src/species/lion/behaviour.js +0 -509
  197. package/vendor/procedural-animals/src/species/lion/coat.js +0 -1016
  198. package/vendor/procedural-animals/src/species/lion/index.js +0 -111
  199. package/vendor/procedural-animals/src/species/lion/motion.js +0 -87
  200. package/vendor/procedural-animals/src/species/lion/regions.js +0 -106
  201. package/vendor/procedural-animals/src/species/lion/rig.js +0 -110
  202. package/vendor/procedural-animals/src/species/lion/sculpt.js +0 -384
  203. package/vendor/procedural-animals/src/species/lion/whiskers.js +0 -132
  204. package/vendor/procedural-animals/src/species/pig/behaviour.js +0 -575
  205. package/vendor/procedural-animals/src/species/pig/coat.js +0 -730
  206. package/vendor/procedural-animals/src/species/pig/ears.js +0 -242
  207. package/vendor/procedural-animals/src/species/pig/index.js +0 -161
  208. package/vendor/procedural-animals/src/species/pig/motion.js +0 -105
  209. package/vendor/procedural-animals/src/species/pig/regions.js +0 -100
  210. package/vendor/procedural-animals/src/species/pig/rig.js +0 -152
  211. package/vendor/procedural-animals/src/species/pig/sculpt.js +0 -382
  212. package/vendor/procedural-animals/src/species/rabbit/behaviour.js +0 -605
  213. package/vendor/procedural-animals/src/species/rabbit/coat.js +0 -285
  214. package/vendor/procedural-animals/src/species/rabbit/index.js +0 -85
  215. package/vendor/procedural-animals/src/species/rabbit/motion.js +0 -85
  216. package/vendor/procedural-animals/src/species/rabbit/regions.js +0 -48
  217. package/vendor/procedural-animals/src/species/rabbit/rig.js +0 -99
  218. package/vendor/procedural-animals/src/species/rabbit/sculpt.js +0 -148
  219. package/vendor/procedural-animals/src/species/rat/behaviour.js +0 -539
  220. package/vendor/procedural-animals/src/species/rat/coat.js +0 -341
  221. package/vendor/procedural-animals/src/species/rat/index.js +0 -111
  222. package/vendor/procedural-animals/src/species/rat/motion.js +0 -90
  223. package/vendor/procedural-animals/src/species/rat/regions.js +0 -92
  224. package/vendor/procedural-animals/src/species/rat/rig.js +0 -112
  225. package/vendor/procedural-animals/src/species/rat/sculpt.js +0 -163
  226. package/vendor/procedural-animals/src/species/rat/whiskers.js +0 -119
  227. package/vendor/procedural-animals/src/species/shark/coat.js +0 -383
  228. package/vendor/procedural-animals/src/species/shark/index.js +0 -104
  229. package/vendor/procedural-animals/src/species/shark/motion.js +0 -69
  230. package/vendor/procedural-animals/src/species/shark/regions.js +0 -34
  231. package/vendor/procedural-animals/src/species/shark/rig.js +0 -194
  232. package/vendor/procedural-animals/src/species/shark/sculpt.js +0 -343
  233. package/vendor/procedural-animals/src/species/shark/variants.js +0 -105
  234. package/vendor/procedural-animals/src/species/sheep/behaviour.js +0 -522
  235. package/vendor/procedural-animals/src/species/sheep/coat.js +0 -529
  236. package/vendor/procedural-animals/src/species/sheep/index.js +0 -152
  237. package/vendor/procedural-animals/src/species/sheep/motion.js +0 -86
  238. package/vendor/procedural-animals/src/species/sheep/neck.js +0 -41
  239. package/vendor/procedural-animals/src/species/sheep/regions.js +0 -62
  240. package/vendor/procedural-animals/src/species/sheep/rig.js +0 -163
  241. package/vendor/procedural-animals/src/species/sheep/sculpt.js +0 -542
  242. package/vendor/procedural-animals/src/species/snake/coat.js +0 -315
  243. package/vendor/procedural-animals/src/species/snake/index.js +0 -73
  244. package/vendor/procedural-animals/src/species/snake/motion.js +0 -51
  245. package/vendor/procedural-animals/src/species/snake/regions.js +0 -51
  246. package/vendor/procedural-animals/src/species/snake/rig.js +0 -108
  247. package/vendor/procedural-animals/src/species/snake/sculpt.js +0 -122
  248. package/vendor/procedural-animals/src/species/spider/coat.js +0 -279
  249. package/vendor/procedural-animals/src/species/spider/index.js +0 -78
  250. package/vendor/procedural-animals/src/species/spider/motion.js +0 -72
  251. package/vendor/procedural-animals/src/species/spider/regions.js +0 -87
  252. package/vendor/procedural-animals/src/species/spider/rig.js +0 -118
  253. package/vendor/procedural-animals/src/species/spider/sculpt.js +0 -182
  254. package/vendor/procedural-animals/src/species/wolf/behaviour.js +0 -160
  255. package/vendor/procedural-animals/src/species/wolf/coat.js +0 -749
  256. package/vendor/procedural-animals/src/species/wolf/index.js +0 -107
  257. package/vendor/procedural-animals/src/species/wolf/motion.js +0 -80
  258. package/vendor/procedural-animals/src/species/wolf/regions.js +0 -57
  259. package/vendor/procedural-animals/src/species/wolf/rig.js +0 -87
  260. package/vendor/procedural-animals/src/species/wolf/sculpt.js +0 -339
  261. package/vendor/procedural-animals/src/worker.js +0 -29
@@ -1,245 +0,0 @@
1
- // Horse motion data for the quadruped engine (schema: src/core/motion/quadruped.js).
2
- // Numbers are for the reference individual (params.size = 1, 1.63 m at the withers); the engine
3
- // scales them by dynamic similarity for ponies, foals and big horses.
4
- //
5
- // Gaits: lateral-sequence 4-beat walk, 2-beat diagonal trot (hind lands
6
- // ~2 % before its diagonal fore), 3-beat canter (right lead: LH, then RH + LF, then RF) and 4-beat
7
- // transverse gallop (LH, RH, LF, RF, one gathered suspension). Rows sit so the table's crossover
8
- // speeds are the measured transitions: walk -> trot 2.1 m/s (Froude 0.35), trot -> canter ~5 m/s,
9
- // canter -> gallop ~8.8 m/s. Stride frequency rises only slowly in the gallop; stride length does
10
- // the work.
11
- import { HEAD_PITCH } from './rig.js';
12
- import { ONESHOTS, POSTURES } from '../../core/motion/actions.js';
13
- // the bind pose carries the head less flexed at the poll than the resting horse (the throat skin is
14
- // meshed at mid-range between grazing and an alert head): the carriage table adds the difference
15
- const DP = (55 * Math.PI) / 180 - HEAD_PITCH;
16
- const G = (name, v, f, D, off, o) => ({ name, v, f, D, off, ...o });
17
- const DEG = Math.PI / 180;
18
- const clamp = (x, a, b) => (x < a ? a : x > b ? b : x);
19
- const smooth = (a, b, x) => { const t = clamp((x - a) / (b - a), 0, 1); return t * t * (3 - 2 * t); };
20
- const mx = (P, k, v, w) => { P[k] += (v - P[k]) * w; };
21
-
22
- export const motion = {
23
- maxSpeed: 18,
24
- accel: [3.5, 6],
25
- decel: 6.5,
26
- // school figures: a trot circle of ~6-10 m, lean below ~15 deg (lateral acceleration ~2.8 m/s^2)
27
- turnRate: 1.0,
28
- latAccelMax: 2.8,
29
- gears: { walk: 1.5, trot: 3.6, canter: 6.2, gallop: 13 },
30
- gallopBlend: [5, 10],
31
- // (drop: the girdles carried 1-2 cm low from the fast walk up. A horse stands on nearly straight
32
- // forelegs: at the standing height the foreleg's forward reach is at the edge of its range, where
33
- // the reach grows as a square root, and a trot braking through that height moved the landing of a
34
- // swinging forefoot 8 cm in one frame. The top gallop row: 6 cm drop and 2.2 Hz (were 8 cm and
35
- // 2.35 Hz, which left 2-frame fore stances dragged in sprint turns and jerking elbows at the sprint)
36
- // name v f D [FL, FR, HL, HR]
37
- gaits: [
38
- G('walk', 0.0, 0.75, 0.72, [0.25, 0.75, 0.0, 0.5], { liftF: 0.08, liftH: 0.07, bobF: 0.03, bobH: 0.03, flex: 0, lat: 0.02, fold: 0.3, heel: 30, tail: 0, drop: 0 }),
39
- G('walk', 1.7, 0.98, 0.63, [0.25, 0.75, 0.0, 0.5], { liftF: 0.1, liftH: 0.085, bobF: 0.08, bobH: 0.08, flex: 0, lat: 0.025, fold: 0.42, heel: 40, tail: 0.1, drop: 0.01 }),
40
- G('trot', 2.5, 1.3, 0.5, [0.52, 0.02, 0.0, 0.5], { liftF: 0.15, liftH: 0.12, bobF: 0.07, bobH: 0.07, flex: 0.01, lat: 0.0, fold: 1.0, heel: 50, tail: 0.35, drop: 0.02 }),
41
- G('trot', 4.2, 1.5, 0.42, [0.52, 0.02, 0.0, 0.5], { liftF: 0.18, liftH: 0.15, bobF: 0.08, bobH: 0.08, flex: 0.015, lat: 0.0, fold: 1.1, heel: 55, tail: 0.45, drop: 0.02 }),
42
- G('canter', 5.8, 1.75, 0.45, [0.3, 0.55, 0.0, 0.27], { liftF: 0.2, liftH: 0.16, bobF: 0.035, bobH: 0.05, flex: 0.05, lat: 0, fold: 1.15, heel: 55, tail: 0.55, drop: 0.03 }),
43
- G('canter', 7.5, 1.9, 0.38, [0.3, 0.55, 0.0, 0.25], { liftF: 0.22, liftH: 0.18, bobF: 0.04, bobH: 0.055, flex: 0.07, lat: 0, fold: 1.2, heel: 45, tail: 0.65, drop: 0.035 }),
44
- G('gallop', 10, 2.1, 0.28, [0.38, 0.52, 0.0, 0.12], { liftF: 0.25, liftH: 0.21, bobF: 0.045, bobH: 0.06, flex: 0.1, lat: 0, fold: 1.3, heel: 40, tail: 0.8, drop: 0.06 }),
45
- G('gallop', 17, 2.2, 0.21, [0.4, 0.52, 0.0, 0.13], { liftF: 0.28, liftH: 0.24, bobF: 0.045, bobH: 0.065, flex: 0.13, lat: 0, fold: 1.4, heel: 40, tail: 1.0, drop: 0.06 }),
46
- ],
47
- feet: {
48
- // hoof: fetlock sinks under load (the suspensory apparatus), the hoof flips in swing,
49
- // breakover about the toe at push-off
50
- front: { type: 'unguligrade', contact: 0.95, curl: 70, flex: 4, sink: 20, hoofFlex: 25, swingBack: 0.25 },
51
- hind: { type: 'unguligrade', contact: 0.95, curl: 70, flex: 4, sink: 16, hoofFlex: 25, swingBack: 0.05 },
52
- },
53
- stance: { width: 1, gallopWidth: 0.8, sprawl: 0, crouch: 0, scuff: [14, 24, 0] },
54
- // torso cross-sections (bind pose, reference size): centre height, half height, half width
55
- body: {
56
- // (half heights include the legs folded under the chest and thighs when lying down)
57
- chest: { y: 1.25, hh: 0.45, hw: 0.31 },
58
- mid: { y: 1.24, hh: 0.37, hw: 0.3 },
59
- pelvis: { y: 1.32, hh: 0.5, hw: 0.38 }, // (hw: the thigh muscles a horse lying flat rests on)
60
- back: 0.15,
61
- },
62
- head: {
63
- // [speed, raise (m), reach (m), pitch (rad, + = nose down)]: the head goes down and forward
64
- // at the walk, is carried higher at the trot and stretched forward in the gallop
65
- carriage: [[0, 0, 0, DP], [1.5, -0.06, 0.06, 0.05 + DP], [3.5, -0.02, 0.04, 0.02 + DP], [6.5, -0.14, 0.12, 0.1 + DP], [14, -0.28, 0.2, 0.12 + DP]],
66
- // walk: the head nods (see hooks), trot: steady, canter / gallop: swings with the stride
67
- stab: [[0, 0], [1.5, 0.1], [3.5, 0.45], [6.5, 0.3], [14, 0.35]],
68
- neckBend: 50, neckPivot: 0.5, yaw: 0.55, pitchUp: 0.6, pitchDown: 0.9, mouth: 'jawTip',
69
- },
70
- tail: {
71
- // [speed, pitch per segment from horizontal (deg), dock -> hair tip]
72
- carriage: [
73
- [0.0, [-25, -50, -66, -76, -82, -86, -88, -89, -89, -89]],
74
- [1.5, [-20, -45, -62, -74, -80, -85, -87, -88, -88, -88]],
75
- [3.5, [-5, -26, -46, -60, -70, -76, -79, -81, -83, -84]],
76
- [6.5, [8, -10, -28, -42, -52, -58, -62, -64, -66, -68]],
77
- [14, [14, 0, -12, -22, -28, -30, -30, -30, -31, -32]],
78
- ],
79
- stiffness: 0.8, sway: 5, flick: 0, wag: 0, swish: 1, curl: 0, balance: 0,
80
- radius: [0.07, 0.09], // (dock, then the hair switch)
81
- },
82
- ears: { rest: [0, 0], mobility: 1.25, speedFlatten: 0.25, twitch: 1.2, prick: 0.45 },
83
- breath: { rate: 0.2, amp: 0.008, pant: false, pantRate: 1.2, pantAmp: 0.02, heatSpeed: 10 },
84
- actions: {
85
- attack: { style: 'kick', kick: 'double', kickReach: [0.6, 0.45] }, // play('attack', { kick: 'rear' }) rears and strikes
86
- // grazing / drinking: the long head hangs near vertical (the default pitch 1.3 curls a cat's head
87
- // under; a horse's head is already carried 55 deg nose-down in the bind pose)
88
- eat: { style: 'graze', dropF: 0, dropH: 0, pitch: DP + 0.7, ahead: 0.45 },
89
- drink: { dropF: 0, dropH: 0, pitch: DP + 0.7, ahead: 0.45 },
90
- // a 1 m jump (0.7 m flight from the canter) lands the forelegs in step with the canter; the landing
91
- // sink comes from the engine's landing springs, the crouch adds a little knee give
92
- jump: { height: 1.0, distance: 3.6, land: [0.15, 0.12] },
93
- sit: { dropH: 1.0 }, // (the hind cannons fold flat under the haunches and the rump rests on the ground)
94
- // kneels on the forelegs first, then lowers the hindquarters; gets up forelegs first
95
- lie: { down: 'front', up: 'front' },
96
- sleep: { style: 'lateral', down: 'front', up: 'front' },
97
- // lying sternal: forelegs folded under the chest (carpus flexed, cannons back along the ground)
98
- fold: { front: { z: -0.26, k: 1.5, beta: 0.9 } },
99
- },
100
- // tack: saddle seat on the back (T12-T14, ~0.30 m behind the withers, from the research),
101
- // rider's seat above it, stirrup treads, bit rings at the mouth corners
102
- attachments: {
103
- back: { bone: 'spine3', from: 'saddle' },
104
- seat: { bone: 'spine3', from: 'seat' },
105
- stirrupL: { bone: 'spine3', from: 'stirrupL' },
106
- stirrupR: { bone: 'spine3', from: 'stirrupR' },
107
- bitL: { bone: 'head', from: 'jawHinge', to: 'jawTip', t: 0.76, offset: [0.047, 0, 0] },
108
- bitR: { bone: 'head', from: 'jawHinge', to: 'jawTip', t: 0.76, offset: [-0.047, 0, 0] },
109
- },
110
- hooks: { update: horseBehaviour, actions: { attack: horseAttack(), lie: rising(POSTURES.lie), sleep: rising(POSTURES.sleep) } },
111
- };
112
-
113
- // Getting up (lie / sleep with tune.up): the core staged rise follows its front / hind weights with a
114
- // spring, which still held ~4 % of the lying drop when the posture's weight reached zero and the
115
- // posture ended, so the body stepped 2.5 cm up in the last frame (a 3.07 % S jitter at the hind
116
- // fetlocks). The staged weights are held under the posture weight as it fades out, so both reach
117
- // zero together.
118
- function rising(core) {
119
- return {
120
- ...core, kind: 'posture',
121
- apply(P, w, inst, L) {
122
- if (inst.target === 0 && inst.kF !== undefined) {
123
- const cap = smooth(0, 0.3, w);
124
- inst.kF = Math.min(inst.kF, cap); inst.kH = Math.min(inst.kH, cap);
125
- }
126
- core.apply.call(this, P, w, inst, L);
127
- },
128
- };
129
- }
130
-
131
- // Attack on the move: a horse does not kick out of a canter; it props to a halt (the stride runs
132
- // on while it brakes) and kicks from the stand. The core's kick holds the legs out of the gait
133
- // (legGait 0.4), so started at speed it dragged the planted forefeet ~1.9 leg lengths behind and
134
- // then snapped them forward (a 120 rad/s* forearm pop). Braking first keeps every stride stepped.
135
- function horseAttack() {
136
- const core = ONESHOTS.attack;
137
- const HALT = 0.7; // m/s x sk: kick below this speed
138
- return {
139
- ...core,
140
- start(inst, L) {
141
- const e = L.engine;
142
- inst.brake = e.speed > HALT * e.cfg.sk;
143
- inst.t0 = 0;
144
- core.start.call(this, inst, L);
145
- },
146
- update(inst, dt, L) {
147
- const e = L.engine;
148
- if (inst.brake) {
149
- if (e.speed <= HALT * e.cfg.sk || inst.t > 3) { inst.brake = false; inst.t0 = inst.t; core.start.call(this, inst, L); }
150
- return false;
151
- }
152
- const t = inst.t; inst.t = t - inst.t0;
153
- const r = core.update.call(this, inst, dt, L);
154
- inst.t = t;
155
- return r;
156
- },
157
- apply(P, w, inst, L) {
158
- // (held to a halt through the kick; the speed request comes back as the attack fades out)
159
- mx(P, 'speedScale', 0, w);
160
- if (inst.brake) { mx(P, 'earFlat', 1, w * smooth(0, 0.3, inst.t)); return; }
161
- const t = inst.t; inst.t = t - inst.t0;
162
- core.apply.call(this, P, w, inst, L);
163
- inst.t = t;
164
- },
165
- };
166
- }
167
-
168
- // Horse behaviour on top of the actions (see core/motion/actions.js):
169
- // * walk: the head and neck nod once per forelimb stance (twice per stride);
170
- // * idle: after a while the horse dozes on its feet (stay apparatus): one hind leg rested on the
171
- // toe of its hoof with that hip dropped, head lowered to withers level, lower lip slack, ears
172
- // sideways, eyes half closed; it swaps the resting leg now and then. Flies: tail swishes.
173
- function horseBehaviour(P, dt, layer) {
174
- const e = layer.engine, cfg = e.cfg, s = cfg.s, u = 1 / cfg.unit; // (posture lengths are in cheetah units: x cfg.k)
175
- const st = layer.horse || (layer.horse = { idleT: 0, doze: 0, dozeOn: false, dozeT: 10 + e.rand() * 6, restLeg: 2, swishT: 3, swish: 0, swishAge: 9 });
176
- const vn = e.speed / cfg.sq, g = e.gait;
177
- // ---- walk head nod
178
- const walkW = smooth(0.15, 0.7, vn) * (1 - smooth(1.9, 2.4, vn)) * P.gaitW;
179
- if (walkW > 0.001) {
180
- const ph = e.phase - g.off[0];
181
- const c = 0.5 + 0.5 * Math.cos(4 * Math.PI * (ph - 0.12));
182
- P.headRaise -= 0.07 * u * walkW * c;
183
- P.headPitch += 0.06 * walkW * (c - 0.5);
184
- }
185
- // ---- idle: dozing on its feet
186
- const idleW = layer.idle.w;
187
- if (idleW > 0.9 && !layer.postures.length) st.idleT += dt; else { st.idleT = 0; st.dozeOn = false; }
188
- if (st.idleT > 0) {
189
- st.dozeT -= dt;
190
- if (st.dozeT <= 0) {
191
- st.dozeOn = !st.dozeOn;
192
- st.dozeT = st.dozeOn ? 14 + e.rand() * 14 : 5 + e.rand() * 6;
193
- if (st.dozeOn) st.restLeg = e.rand() < 0.5 ? 2 : 3;
194
- }
195
- }
196
- st.doze = clamp(st.doze + (st.dozeOn ? dt * 0.35 : -dt * 0.8), 0, 1);
197
- const dz = smooth(0, 1, st.doze) * idleW;
198
- if (dz > 0.001) {
199
- layer.idle.stepT = Math.max(layer.idle.stepT, 1); // no re-steps while dozing
200
- const leg = e.legs[st.restLeg], L = leg.def, pl = P.legs[st.restLeg];
201
- const side = L.s;
202
- // resting hind hoof tipped on its toe a little forward and under the body
203
- const tgt = e.bodyToWorld(L.cx * side * 0.85, 0, L.cz + 0.1 * s, e.heading, e.pos, pl.target);
204
- tgt.y = e.terrainH(tgt.x, tgt.z);
205
- const w = smooth(0, 0.6, dz);
206
- pl.reach += (1 - pl.reach) * w;
207
- mx(P, 'roll', 0.035 * side * -1, dz); // that hip drops
208
- mx(P, 'dropH', 0.05, dz); mx(P, 'side', -0.012 * u * side, dz);
209
- mx(P, 'headRaise', -0.3 * u, dz); mx(P, 'headPitch', 0.18, dz); mx(P, 'neckReach', 0.06 * u, dz);
210
- mx(P, 'eyelid', 0.6, dz); mx(P, 'jaw', 0.05, dz);
211
- mx(P, 'earFlat', 0.35, dz); mx(P, 'earSwivel', 0.5, dz); mx(P, 'earTwitch', 0.25, dz);
212
- mx(P, 'lookW', 0, dz); mx(P, 'breathRate', 0.75, dz); mx(P, 'tailIdle', 0.5, dz);
213
- }
214
- // ---- grazing / drinking: the trunk stays level on straight forelegs and the long neck does the
215
- // reaching (the engine would otherwise lower the forehand); one fore hoof is advanced
216
- let graze = 0;
217
- for (const o of layer.oneshots) if (o.name === 'eat' || o.name === 'drink') graze = Math.max(graze, o.w * o.w * (3 - 2 * o.w));
218
- if (graze > 0.001) {
219
- P.headReach *= 1 - graze;
220
- mx(P, 'dropF', 0.055, graze); mx(P, 'dropH', 0, graze); // (the withers give ~4 cm: saddle < 2 cm, < 2.5 deg)
221
- layer.idle.stepT = Math.max(layer.idle.stepT, 1);
222
- }
223
- if (graze > 0.5) e.legs[0].idleOff.set(0, 0, 0.22 * s); // (released: the idle layer relaxes it back)
224
- // ---- flat out (lateral sleep, death): the long head lies on its cheek, the ears laid back along
225
- // the neck instead of sticking into the ground
226
- for (const p of layer.postures) {
227
- if (p.name !== 'sleep' && p.name !== 'death') continue;
228
- const w = p.w * p.w * (3 - 2 * p.w) * (p.name === 'sleep' ? smooth(1.0, 3.0, p.t) : smooth(0.35, 1.0, p.t));
229
- P.headPos.y += 0.14 * s * w;
230
- P.headPitch += 0.5 * w; // (nose tucked: the throat is not stretched open)
231
- mx(P, 'earFlat', 1, w); mx(P, 'earTwitch', 0.1, w);
232
- // the forelegs held a little out from the ground, straight (the side pose presses the hooves to
233
- // the ground and the long cannon sagged into a bump on uneven ground, 35 mm at the knee)
234
- for (let i = 0; i < 2; i++) { const pl = P.legs[i]; pl.tuck += (1 - pl.tuck) * 0.12 * w; pl.extend = 1; }
235
- }
236
- // ---- fly swish: short bursts of tail lashing while standing
237
- if (idleW > 0.5) {
238
- st.swishT -= dt;
239
- if (st.swishT <= 0) { st.swishT = 4 + e.rand() * 8; st.swishAge = 0; }
240
- }
241
- st.swishAge += dt;
242
- const sw = Math.sin(Math.PI * clamp(st.swishAge / 1.6, 0, 1)) * idleW;
243
- if (sw > 0.001) P.tailWag = Math.max(P.tailWag, 0.55 * sw);
244
- void DEG;
245
- }
@@ -1,60 +0,0 @@
1
- // Meshing plan: body at 10.7 mm (0.66 % of the withers height), head at 5.1 mm overlapping the body
2
- // across the upper neck and cross-faded, eyelid patches at 1.6 mm, and the lower lip / chin as its
3
- // own rigid surface so the mouth can open.
4
- import { EYE } from './sculpt.js';
5
- import { HEAD_O, horseJoints } from './rig.js';
6
- import { eyeFrameOf } from '../../core/sdf/eyeSocket.js';
7
- import { norm, smoothstep } from '../../core/math/vec.js';
8
-
9
- const J = horseJoints();
10
- // the head hangs steeply from the neck: cut just behind the poll - throat latch line
11
- export const NECK_CUT = { c: [0, 1.7, J.occiput[2] - 0.045], d: norm([0, 0.25, 1]), band: 0.024 };
12
- export const neckS = (x, y, z) => (x - NECK_CUT.c[0]) * NECK_CUT.d[0] + (y - NECK_CUT.c[1]) * NECK_CUT.d[1] + (z - NECK_CUT.c[2]) * NECK_CUT.d[2];
13
-
14
- export const EYE_PATCH = { R: 0.042, B: 0.007, h: 0.0016, centres: [1, -1].map((s) => eyeFrameOf(EYE, HEAD_O, s).c) };
15
- export function eyePatchWeight(x, y, z) {
16
- let dmin = 1e9;
17
- for (const c of EYE_PATCH.centres) dmin = Math.min(dmin, Math.hypot(x - c[0], y - c[1], z - c[2]));
18
- return 1 - smoothstep(EYE_PATCH.R - EYE_PATCH.B, EYE_PATCH.R + EYE_PATCH.B, dmin);
19
- }
20
-
21
- // Cell sizes (x Q.res): body and head. The head / body cross-fade band B widens with the body's cell
22
- // at the coarse tiers (at least one body cell), and the two surfaces overlap by OV: across the middle
23
- // of the band both are drawn (fade > 0.5), so the fur does not thin where two half-faded shell stacks
24
- // meet (a dark seam over the under-shell base) and no crack opens between them.
25
- export const H_BODY = 0.0111, H_HEAD = 0.0051;
26
- export function neckBand(r) {
27
- const B = Math.max(NECK_CUT.band, 1.1 * H_BODY * r), OV = 0.5 * B;
28
- // Each surface runs on 2-3 of its own cells past the band, where it is hidden (fade 0): its ragged
29
- // clip edge stays out of view, and its band vertices are not biased by the edge (the axial skin
30
- // coordinate is relaxed over each surface separately, so near an edge it drifts by about a cell)
31
- return { B, OV, clipBody: B + OV + 3 * H_BODY * r, clipHead: B + OV + 2 * H_HEAD * r };
32
- }
33
- export const neckFade = (sN, name, r) => {
34
- const { B, OV } = neckBand(r);
35
- return name === 'body' ? 1 - smoothstep(-B, B, sN - OV) : smoothstep(-B, B, sN + OV);
36
- };
37
-
38
- export function horseRegions(rig, params, Q) {
39
- const r = Q.res, { B, OV, clipBody, clipHead } = neckBand(r);
40
- const patches = Q.eyePatches ? EYE_PATCH.centres.map((c) => ({ c, R: EYE_PATCH.R, B: EYE_PATCH.B, h: EYE_PATCH.h * Math.max(1, r) })) : [];
41
- return {
42
- jobs: [
43
- [{ name: 'body', part: 'body', bmin: [-0.46, -0.01, -1.12], bmax: [0.46, 2.2, 1.3], h: H_BODY * r, F: 4, clip: (x, y, z) => neckS(x, y, z) < clipBody }],
44
- [
45
- { name: 'head', part: 'body', bmin: [-0.2, 1.25, 0.88], bmax: [0.2, 2.3, 1.72], h: H_HEAD * r, F: 6, clip: (x, y, z) => neckS(x, y, z) > -clipHead, patches },
46
- { name: 'jaw', part: 'jaw', bmin: [-0.08, 1.3, 1.2], bmax: [0.08, 1.72, 1.72], h: H_HEAD * r, F: 6, rigidBone: 'jaw' },
47
- ],
48
- ],
49
- fade(x, y, z, name, patch) {
50
- const sN = neckS(x, y, z);
51
- if (name === 'body') return 1 - smoothstep(-B, B, sN - OV);
52
- if (name === 'head') {
53
- let f = smoothstep(-B, B, sN + OV);
54
- if (patches.length) { const ew = eyePatchWeight(x, y, z); f *= patch ? ew : 1 - ew; }
55
- return f;
56
- }
57
- return 1;
58
- },
59
- };
60
- }
@@ -1,117 +0,0 @@
1
- // Horse skeleton in bind pose (metres). Forward = +Z, up = +Y, the animal's left = +X.
2
- // Reference individual: a 16 hh (1.63 m at the withers) warmblood / sport horse, ~560 kg.
3
- // Landmarks measured on the side reference (side1.jpg, 1 px = 2.63 mm at 4x) and equine osteology
4
- //: point of shoulder 1.14 m, elbow 0.90, carpus 0.50, fetlock 0.17, stifle 0.90,
5
- // hock 0.55 (point of hock 0.62), body length (point of shoulder -> point of buttock) 1.70 m.
6
- //
7
- // Hooves: the standard quadruped bones plus a hoof bone per leg. fpaw / hpaw are the pasterns
8
- // (fetlock -> coffin joint) and fhoof / hhoof the hooves (coffin joint -> toe), so the engine can
9
- // keep the hoof flat on the ground while the fetlock sinks under load.
10
- import { buildRig } from '../../core/rig/rig.js';
11
- import { quadrupedBones, quadrupedLimbs, tailChain } from '../../core/rig/quadruped.js';
12
-
13
- export const TAIL_SEGS = 10; // 6 dock bones + 4 segments of free-hanging tail hair
14
- export const DOCK_SEGS = 6;
15
-
16
- // Head frame: the head is modelled along its own axis (poll -> muzzle), pitched 55 degrees nose
17
- // down in the bind pose. Head-local coordinates: x lateral, y dorsal (forehead side), z along the
18
- // nasal line toward the muzzle; origin on the axis 0.20 m in front of the poll (level with the eyes).
19
- // (the bind pose holds the head at 37 deg, less flexed at the poll than at rest (55 deg, restored by the
20
- // head carriage), so the throat skin is meshed at mid-range between grazing and an alert head)
21
- export const HEAD_PITCH = (37 * Math.PI) / 180;
22
- export const HZ = [0, -Math.sin(HEAD_PITCH), Math.cos(HEAD_PITCH)];
23
- export const HY = [0, Math.cos(HEAD_PITCH), Math.sin(HEAD_PITCH)];
24
- // poll ~0.30 x withers height above the withers (side1.jpg), the neck arched and carried high
25
- const POLL = [0, 2.05, 1.2]; // top of the poll (skin), bind
26
- export const HEAD_O = [0, POLL[1] + 0.2 * HZ[1], POLL[2] + 0.2 * HZ[2]];
27
- export const hl = (v) => [HEAD_O[0] + v[0], HEAD_O[1] + v[1] * HY[1] + v[2] * HZ[1], HEAD_O[2] + v[1] * HY[2] + v[2] * HZ[2]];
28
-
29
- export function horseJoints() {
30
- const J = {
31
- nose: hl([0, 0.0, 0.4]),
32
- occiput: hl([0, -0.06, -0.19]),
33
- neckMid: [0, 1.63, 0.97],
34
- neckBase: [0, 1.19, 0.74], // cervicothoracic junction: the neck hinges low, at about the point of shoulder // cervicothoracic junction, deep at the base of the neck
35
- chestMid: [0, 1.4, 0.4],
36
- thoraxRear: [0, 1.43, 0.02],
37
- lumbarMid: [0, 1.46, -0.24],
38
- lumbosacral: [0, 1.47, -0.44],
39
- tailBase: [0, 1.46, -0.8],
40
- // fore: scapula slopes ~50 deg, humerus down and back, radius and cannon vertical,
41
- // pastern ~55 deg to the ground
42
- scapTopL: [0.1, 1.47, 0.5],
43
- shoulderL: [0.165, 1.14, 0.77],
44
- elbowL: [0.16, 0.9, 0.6],
45
- wristL: [0.13, 0.5, 0.63],
46
- mcpL: [0.125, 0.17, 0.64],
47
- fcoffinL: [0.125, 0.066, 0.713],
48
- ftoeL: [0.125, 0.004, 0.8],
49
- // hind: hip joint, stifle, hock, fetlock, coffin joint, toe
50
- hipL: [0.155, 1.23, -0.62],
51
- kneeL: [0.185, 0.94, -0.36],
52
- hockL: [0.13, 0.55, -0.61],
53
- mtpL: [0.12, 0.175, -0.585],
54
- hcoffinL: [0.12, 0.068, -0.515],
55
- htoeL: [0.12, 0.004, -0.435],
56
- // tack (not bones: attachment landmarks carried by the variation warps like the skin): saddle
57
- // base on the skin of the back over T12-T14 (~0.3 m behind the withers point; measured on the
58
- // sculpt's surface at x 0, z 0.21), rider's seat 0.12 m above it, stirrup treads ~10 cm outside
59
- // the barrel at ~1.0 m
60
- saddle: [0, 1.625, 0.21],
61
- seat: [0, 1.745, 0.19],
62
- stirrupL: [0.3, 1.02, 0.24],
63
- jawHinge: hl([0, -0.04, -0.1]),
64
- jawTip: hl([0, -0.1, 0.39]),
65
- earBaseL: hl([0.058, 0.06, -0.185]),
66
- earTipL: hl([0.085, 0.205, -0.225]),
67
- };
68
- // dock droops from the croup, the hair hangs to the hocks
69
- tailChain(J, 'tailBase', [-25, -50, -66, -76, -82, -86, -88, -89, -89, -89], [0.085, 0.08, 0.075, 0.07, 0.065, 0.06, 0.12, 0.12, 0.12, 0.12]);
70
- return J;
71
- }
72
-
73
- export function horseBones() {
74
- const b = quadrupedBones({ tailSegs: TAIL_SEGS, ears: true, jaw: true });
75
- for (const d of b) {
76
- if (d[0] === 'fpaw{S}') { d[2] = 'fcoffin{S}'; d[4] = { region: 'limb', group: 'F{S}' }; }
77
- if (d[0] === 'hpaw{S}') { d[2] = 'hcoffin{S}'; d[4] = { region: 'limb', group: 'H{S}' }; }
78
- }
79
- b.push(
80
- ['fhoof{S}', 'fcoffin{S}', 'ftoe{S}', 'fpaw{S}', { region: 'foot', group: 'F{S}' }],
81
- ['hhoof{S}', 'hcoffin{S}', 'htoe{S}', 'hpaw{S}', { region: 'foot', group: 'H{S}' }],
82
- );
83
- return b;
84
- }
85
-
86
- export function horseRig(J = horseJoints()) {
87
- const limbs = quadrupedLimbs({
88
- front: { tCore: 0.55, aCore: 0.07, aBody: -0.13, midX: 0.0 },
89
- hind: { tCore: 0.5, aCore: 0.022, aBody: -0.08, midX: 0.008 },
90
- });
91
- for (const L of Object.values(limbs)) { L.bones.push((L.front ? 'fhoof' : 'hhoof') + L.S); L.distal.push((L.front ? 'fhoof' : 'hhoof') + L.S); }
92
- return buildRig({
93
- joints: J,
94
- unit: 2.14,
95
- headOrigin: HEAD_O,
96
- bones: horseBones(),
97
- axial: {
98
- points: ['nose', 'occiput', 'neckMid', 'neckBase', 'chestMid', 'thoraxRear', 'lumbarMid', 'lumbosacral', 'tailBase', ...Array.from({ length: TAIL_SEGS }, (_, i) => 'tail' + (i + 1))],
99
- bones: ['head', 'neck2', 'neck1', 'chest', 'spine3', 'spine2', 'spine1', 'pelvis', ...Array.from({ length: TAIL_SEGS }, (_, i) => 'tail' + i)],
100
- // the skull's influence reaches back into the throat latch and nape (3rd value: the blend widens
101
- // with the skin's depth under the axis: the throat under the jaw). The occiput blend must end
102
- // before the neckMid joint (0.418 m on) for every throat vertex (depth <= 0.22 m): the core
103
- // applies only the blends at the two ends of a segment, so a blend reaching past neckMid was cut
104
- // off there and the head weight under the throat jumped from 0.45 to 0 (the head and body copies
105
- // of the throat then took weights 0.3-0.45 apart and parted when the head moved). Now the
106
- // throat latch is half head, the crest hands over from the head 5-30 cm behind the poll.
107
- blend: { 1: [-0.004, 0.139, 0.5], 3: [-0.12, 0.12, 2] },
108
- bodyTail: 0, // the dock hangs behind the buttocks: their skin blends into it only at the tail base
109
- },
110
- limbs,
111
- appendages: [
112
- { group: 'earL', bone: 'earL', blend: [-0.003, 0.005] },
113
- { group: 'earR', bone: 'earR', blend: [-0.003, 0.005] },
114
- ],
115
- webTags: ['flankfold', 'thighfront', 'scapmuscle', 'pectoral', 'forearmweb'],
116
- });
117
- }