@bitefoundry/retrieviewer 0.0.3 → 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 (254) 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 +6 -1
  6. package/PLUGIN.md +13 -10
  7. package/PREREQUISITES.md +95 -0
  8. package/PUPPY-MEMORY.md +102 -1
  9. package/README.ko.md +110 -0
  10. package/README.md +117 -59
  11. package/RELEASING.md +23 -12
  12. package/THIRD-PARTY-NOTICES.md +5 -3
  13. package/braille.mjs +35 -9
  14. package/examples/live.mjs +2 -2
  15. package/integrations/linux-overlay/overlay.py +2 -2
  16. package/integrations/macos-overlay/overlay.jxa +8 -6
  17. package/integrations/opencode/runtime.mjs +4 -4
  18. package/integrations/opencode/tui.tsx +1 -1
  19. package/integrations/windows-overlay/Overlay.cs +4 -4
  20. package/integrations/windows-overlay/protocol.mjs +11 -7
  21. package/package.json +34 -13
  22. package/puppy-comfort-sprites.mjs +25 -0
  23. package/puppy-companion-comfort-q5.bin.gz +0 -0
  24. package/puppy-companion-comfort.json +77 -0
  25. package/puppy-companion-life.mjs +49 -16
  26. package/puppy-companion-objects.mjs +12 -0
  27. package/puppy-frame-predictive.mjs +15 -9
  28. package/puppy-frame-store.mjs +2 -2
  29. package/puppy-paper-world.mjs +14 -0
  30. package/puppy-paper.mjs +65 -14
  31. package/retrieviewer-plugin.d.mts +1 -1
  32. package/retrieviewer-plugin.mjs +1 -1
  33. package/retrieviewer.d.mts +10 -4
  34. package/retrieviewer.mjs +20 -14
  35. package/locomotion-core.mjs +0 -21
  36. package/locomotion-puppy.animal +0 -0
  37. package/vendor/procedural-animals/package.json +0 -40
  38. package/vendor/procedural-animals/src/animal.js +0 -146
  39. package/vendor/procedural-animals/src/bake.js +0 -51
  40. package/vendor/procedural-animals/src/build.js +0 -81
  41. package/vendor/procedural-animals/src/core/build/coatKit.js +0 -121
  42. package/vendor/procedural-animals/src/core/build/featherCards.js +0 -189
  43. package/vendor/procedural-animals/src/core/build/finEdges.js +0 -85
  44. package/vendor/procedural-animals/src/core/build/furSlope.js +0 -115
  45. package/vendor/procedural-animals/src/core/build/mesh.js +0 -67
  46. package/vendor/procedural-animals/src/core/build/pipeline.js +0 -272
  47. package/vendor/procedural-animals/src/core/build/seams.js +0 -183
  48. package/vendor/procedural-animals/src/core/build/warp.js +0 -112
  49. package/vendor/procedural-animals/src/core/build/weights.js +0 -393
  50. package/vendor/procedural-animals/src/core/math/vec.js +0 -81
  51. package/vendor/procedural-animals/src/core/motion/actions.js +0 -800
  52. package/vendor/procedural-animals/src/core/motion/bird.js +0 -3063
  53. package/vendor/procedural-animals/src/core/motion/birdActions.js +0 -1059
  54. package/vendor/procedural-animals/src/core/motion/common.js +0 -158
  55. package/vendor/procedural-animals/src/core/motion/index.js +0 -22
  56. package/vendor/procedural-animals/src/core/motion/quadruped.js +0 -2875
  57. package/vendor/procedural-animals/src/core/motion/snake.js +0 -1594
  58. package/vendor/procedural-animals/src/core/motion/spider.js +0 -1810
  59. package/vendor/procedural-animals/src/core/motion/swimmer.js +0 -1047
  60. package/vendor/procedural-animals/src/core/motion/swimmerActions.js +0 -613
  61. package/vendor/procedural-animals/src/core/render/animalObject.js +0 -262
  62. package/vendor/procedural-animals/src/core/render/coatMaterial.js +0 -1301
  63. package/vendor/procedural-animals/src/core/render/dqs.js +0 -159
  64. package/vendor/procedural-animals/src/core/render/eyes.js +0 -676
  65. package/vendor/procedural-animals/src/core/render/membranes.js +0 -77
  66. package/vendor/procedural-animals/src/core/render/skeleton.js +0 -41
  67. package/vendor/procedural-animals/src/core/rig/bird.js +0 -327
  68. package/vendor/procedural-animals/src/core/rig/quadruped.js +0 -76
  69. package/vendor/procedural-animals/src/core/rig/rig.js +0 -79
  70. package/vendor/procedural-animals/src/core/rig/snake.js +0 -76
  71. package/vendor/procedural-animals/src/core/rig/spider.js +0 -110
  72. package/vendor/procedural-animals/src/core/rig/swimmer.js +0 -181
  73. package/vendor/procedural-animals/src/core/sdf/eyeSocket.js +0 -53
  74. package/vendor/procedural-animals/src/core/sdf/mesher.js +0 -238
  75. package/vendor/procedural-animals/src/core/sdf/sdf.js +0 -263
  76. package/vendor/procedural-animals/src/index.d.ts +0 -98
  77. package/vendor/procedural-animals/src/index.js +0 -29
  78. package/vendor/procedural-animals/src/registry.js +0 -48
  79. package/vendor/procedural-animals/src/species/bear/behaviour.js +0 -463
  80. package/vendor/procedural-animals/src/species/bear/claws.js +0 -147
  81. package/vendor/procedural-animals/src/species/bear/coat.js +0 -726
  82. package/vendor/procedural-animals/src/species/bear/index.js +0 -139
  83. package/vendor/procedural-animals/src/species/bear/motion.js +0 -112
  84. package/vendor/procedural-animals/src/species/bear/regions.js +0 -78
  85. package/vendor/procedural-animals/src/species/bear/rig.js +0 -112
  86. package/vendor/procedural-animals/src/species/bear/sculpt.js +0 -272
  87. package/vendor/procedural-animals/src/species/boar/behaviour.js +0 -335
  88. package/vendor/procedural-animals/src/species/boar/coat.js +0 -372
  89. package/vendor/procedural-animals/src/species/boar/index.js +0 -110
  90. package/vendor/procedural-animals/src/species/boar/motion.js +0 -85
  91. package/vendor/procedural-animals/src/species/boar/regions.js +0 -88
  92. package/vendor/procedural-animals/src/species/boar/rig.js +0 -111
  93. package/vendor/procedural-animals/src/species/boar/sculpt.js +0 -285
  94. package/vendor/procedural-animals/src/species/cat/behaviour.js +0 -559
  95. package/vendor/procedural-animals/src/species/cat/coat.js +0 -841
  96. package/vendor/procedural-animals/src/species/cat/index.js +0 -211
  97. package/vendor/procedural-animals/src/species/cat/motion.js +0 -101
  98. package/vendor/procedural-animals/src/species/cat/regions.js +0 -82
  99. package/vendor/procedural-animals/src/species/cat/rig.js +0 -100
  100. package/vendor/procedural-animals/src/species/cat/sculpt.js +0 -266
  101. package/vendor/procedural-animals/src/species/cat/whiskers.js +0 -110
  102. package/vendor/procedural-animals/src/species/cheetah/coat.js +0 -427
  103. package/vendor/procedural-animals/src/species/cheetah/index.js +0 -51
  104. package/vendor/procedural-animals/src/species/cheetah/joints.js +0 -3
  105. package/vendor/procedural-animals/src/species/cheetah/motion.js +0 -77
  106. package/vendor/procedural-animals/src/species/cheetah/regions.js +0 -95
  107. package/vendor/procedural-animals/src/species/cheetah/rig.js +0 -66
  108. package/vendor/procedural-animals/src/species/cheetah/sculpt.js +0 -158
  109. package/vendor/procedural-animals/src/species/chicken/coat.js +0 -313
  110. package/vendor/procedural-animals/src/species/chicken/coverts.js +0 -320
  111. package/vendor/procedural-animals/src/species/chicken/index.js +0 -110
  112. package/vendor/procedural-animals/src/species/chicken/motion.js +0 -177
  113. package/vendor/procedural-animals/src/species/chicken/regions.js +0 -66
  114. package/vendor/procedural-animals/src/species/chicken/rig.js +0 -144
  115. package/vendor/procedural-animals/src/species/chicken/sculpt.js +0 -389
  116. package/vendor/procedural-animals/src/species/chicken/wingLook.js +0 -66
  117. package/vendor/procedural-animals/src/species/chicken/wingStack.js +0 -124
  118. package/vendor/procedural-animals/src/species/cow/behaviour.js +0 -521
  119. package/vendor/procedural-animals/src/species/cow/coat.js +0 -465
  120. package/vendor/procedural-animals/src/species/cow/index.js +0 -118
  121. package/vendor/procedural-animals/src/species/cow/motion.js +0 -81
  122. package/vendor/procedural-animals/src/species/cow/regions.js +0 -98
  123. package/vendor/procedural-animals/src/species/cow/rig.js +0 -116
  124. package/vendor/procedural-animals/src/species/cow/sculpt.js +0 -339
  125. package/vendor/procedural-animals/src/species/crow/coat.js +0 -145
  126. package/vendor/procedural-animals/src/species/crow/index.js +0 -70
  127. package/vendor/procedural-animals/src/species/crow/joints.js +0 -3
  128. package/vendor/procedural-animals/src/species/crow/motion.js +0 -101
  129. package/vendor/procedural-animals/src/species/crow/regions.js +0 -50
  130. package/vendor/procedural-animals/src/species/crow/rig.js +0 -83
  131. package/vendor/procedural-animals/src/species/crow/sculpt.js +0 -118
  132. package/vendor/procedural-animals/src/species/deer/behaviour.js +0 -513
  133. package/vendor/procedural-animals/src/species/deer/coat.js +0 -391
  134. package/vendor/procedural-animals/src/species/deer/index.js +0 -106
  135. package/vendor/procedural-animals/src/species/deer/motion.js +0 -97
  136. package/vendor/procedural-animals/src/species/deer/regions.js +0 -60
  137. package/vendor/procedural-animals/src/species/deer/rig.js +0 -124
  138. package/vendor/procedural-animals/src/species/deer/sculpt.js +0 -297
  139. package/vendor/procedural-animals/src/species/dog/behaviour.js +0 -521
  140. package/vendor/procedural-animals/src/species/dog/coat.js +0 -495
  141. package/vendor/procedural-animals/src/species/dog/index.js +0 -144
  142. package/vendor/procedural-animals/src/species/dog/motion.js +0 -118
  143. package/vendor/procedural-animals/src/species/dog/regions.js +0 -61
  144. package/vendor/procedural-animals/src/species/dog/rig.js +0 -129
  145. package/vendor/procedural-animals/src/species/dog/sculpt.js +0 -246
  146. package/vendor/procedural-animals/src/species/eagle/coat.js +0 -250
  147. package/vendor/procedural-animals/src/species/eagle/index.js +0 -76
  148. package/vendor/procedural-animals/src/species/eagle/joints.js +0 -3
  149. package/vendor/procedural-animals/src/species/eagle/motion.js +0 -137
  150. package/vendor/procedural-animals/src/species/eagle/regions.js +0 -57
  151. package/vendor/procedural-animals/src/species/eagle/rig.js +0 -107
  152. package/vendor/procedural-animals/src/species/eagle/sculpt.js +0 -137
  153. package/vendor/procedural-animals/src/species/fish/coat.js +0 -271
  154. package/vendor/procedural-animals/src/species/fish/index.js +0 -88
  155. package/vendor/procedural-animals/src/species/fish/motion.js +0 -92
  156. package/vendor/procedural-animals/src/species/fish/regions.js +0 -27
  157. package/vendor/procedural-animals/src/species/fish/rig.js +0 -143
  158. package/vendor/procedural-animals/src/species/fish/sculpt.js +0 -214
  159. package/vendor/procedural-animals/src/species/fish/variants.js +0 -126
  160. package/vendor/procedural-animals/src/species/fox/behaviour.js +0 -314
  161. package/vendor/procedural-animals/src/species/fox/coat.js +0 -444
  162. package/vendor/procedural-animals/src/species/fox/index.js +0 -120
  163. package/vendor/procedural-animals/src/species/fox/motion.js +0 -81
  164. package/vendor/procedural-animals/src/species/fox/regions.js +0 -59
  165. package/vendor/procedural-animals/src/species/fox/rig.js +0 -91
  166. package/vendor/procedural-animals/src/species/fox/sculpt.js +0 -202
  167. package/vendor/procedural-animals/src/species/frog/behaviour.js +0 -590
  168. package/vendor/procedural-animals/src/species/frog/coat.js +0 -305
  169. package/vendor/procedural-animals/src/species/frog/index.js +0 -97
  170. package/vendor/procedural-animals/src/species/frog/motion.js +0 -69
  171. package/vendor/procedural-animals/src/species/frog/regions.js +0 -46
  172. package/vendor/procedural-animals/src/species/frog/rig.js +0 -156
  173. package/vendor/procedural-animals/src/species/frog/sculpt.js +0 -240
  174. package/vendor/procedural-animals/src/species/goat/behaviour.js +0 -509
  175. package/vendor/procedural-animals/src/species/goat/coat.js +0 -590
  176. package/vendor/procedural-animals/src/species/goat/index.js +0 -149
  177. package/vendor/procedural-animals/src/species/goat/motion.js +0 -95
  178. package/vendor/procedural-animals/src/species/goat/regions.js +0 -98
  179. package/vendor/procedural-animals/src/species/goat/rig.js +0 -181
  180. package/vendor/procedural-animals/src/species/goat/sculpt.js +0 -547
  181. package/vendor/procedural-animals/src/species/horse/coat.js +0 -361
  182. package/vendor/procedural-animals/src/species/horse/coatSeam.js +0 -122
  183. package/vendor/procedural-animals/src/species/horse/index.js +0 -80
  184. package/vendor/procedural-animals/src/species/horse/motion.js +0 -245
  185. package/vendor/procedural-animals/src/species/horse/regions.js +0 -60
  186. package/vendor/procedural-animals/src/species/horse/rig.js +0 -117
  187. package/vendor/procedural-animals/src/species/horse/sculpt.js +0 -316
  188. package/vendor/procedural-animals/src/species/horse/seamWeights.js +0 -272
  189. package/vendor/procedural-animals/src/species/lion/behaviour.js +0 -509
  190. package/vendor/procedural-animals/src/species/lion/coat.js +0 -1016
  191. package/vendor/procedural-animals/src/species/lion/index.js +0 -111
  192. package/vendor/procedural-animals/src/species/lion/motion.js +0 -87
  193. package/vendor/procedural-animals/src/species/lion/regions.js +0 -106
  194. package/vendor/procedural-animals/src/species/lion/rig.js +0 -110
  195. package/vendor/procedural-animals/src/species/lion/sculpt.js +0 -384
  196. package/vendor/procedural-animals/src/species/lion/whiskers.js +0 -132
  197. package/vendor/procedural-animals/src/species/pig/behaviour.js +0 -575
  198. package/vendor/procedural-animals/src/species/pig/coat.js +0 -730
  199. package/vendor/procedural-animals/src/species/pig/ears.js +0 -242
  200. package/vendor/procedural-animals/src/species/pig/index.js +0 -161
  201. package/vendor/procedural-animals/src/species/pig/motion.js +0 -105
  202. package/vendor/procedural-animals/src/species/pig/regions.js +0 -100
  203. package/vendor/procedural-animals/src/species/pig/rig.js +0 -152
  204. package/vendor/procedural-animals/src/species/pig/sculpt.js +0 -382
  205. package/vendor/procedural-animals/src/species/rabbit/behaviour.js +0 -605
  206. package/vendor/procedural-animals/src/species/rabbit/coat.js +0 -285
  207. package/vendor/procedural-animals/src/species/rabbit/index.js +0 -85
  208. package/vendor/procedural-animals/src/species/rabbit/motion.js +0 -85
  209. package/vendor/procedural-animals/src/species/rabbit/regions.js +0 -48
  210. package/vendor/procedural-animals/src/species/rabbit/rig.js +0 -99
  211. package/vendor/procedural-animals/src/species/rabbit/sculpt.js +0 -148
  212. package/vendor/procedural-animals/src/species/rat/behaviour.js +0 -539
  213. package/vendor/procedural-animals/src/species/rat/coat.js +0 -341
  214. package/vendor/procedural-animals/src/species/rat/index.js +0 -111
  215. package/vendor/procedural-animals/src/species/rat/motion.js +0 -90
  216. package/vendor/procedural-animals/src/species/rat/regions.js +0 -92
  217. package/vendor/procedural-animals/src/species/rat/rig.js +0 -112
  218. package/vendor/procedural-animals/src/species/rat/sculpt.js +0 -163
  219. package/vendor/procedural-animals/src/species/rat/whiskers.js +0 -119
  220. package/vendor/procedural-animals/src/species/shark/coat.js +0 -383
  221. package/vendor/procedural-animals/src/species/shark/index.js +0 -104
  222. package/vendor/procedural-animals/src/species/shark/motion.js +0 -69
  223. package/vendor/procedural-animals/src/species/shark/regions.js +0 -34
  224. package/vendor/procedural-animals/src/species/shark/rig.js +0 -194
  225. package/vendor/procedural-animals/src/species/shark/sculpt.js +0 -343
  226. package/vendor/procedural-animals/src/species/shark/variants.js +0 -105
  227. package/vendor/procedural-animals/src/species/sheep/behaviour.js +0 -522
  228. package/vendor/procedural-animals/src/species/sheep/coat.js +0 -529
  229. package/vendor/procedural-animals/src/species/sheep/index.js +0 -152
  230. package/vendor/procedural-animals/src/species/sheep/motion.js +0 -86
  231. package/vendor/procedural-animals/src/species/sheep/neck.js +0 -41
  232. package/vendor/procedural-animals/src/species/sheep/regions.js +0 -62
  233. package/vendor/procedural-animals/src/species/sheep/rig.js +0 -163
  234. package/vendor/procedural-animals/src/species/sheep/sculpt.js +0 -542
  235. package/vendor/procedural-animals/src/species/snake/coat.js +0 -315
  236. package/vendor/procedural-animals/src/species/snake/index.js +0 -73
  237. package/vendor/procedural-animals/src/species/snake/motion.js +0 -51
  238. package/vendor/procedural-animals/src/species/snake/regions.js +0 -51
  239. package/vendor/procedural-animals/src/species/snake/rig.js +0 -108
  240. package/vendor/procedural-animals/src/species/snake/sculpt.js +0 -122
  241. package/vendor/procedural-animals/src/species/spider/coat.js +0 -279
  242. package/vendor/procedural-animals/src/species/spider/index.js +0 -78
  243. package/vendor/procedural-animals/src/species/spider/motion.js +0 -72
  244. package/vendor/procedural-animals/src/species/spider/regions.js +0 -87
  245. package/vendor/procedural-animals/src/species/spider/rig.js +0 -118
  246. package/vendor/procedural-animals/src/species/spider/sculpt.js +0 -182
  247. package/vendor/procedural-animals/src/species/wolf/behaviour.js +0 -160
  248. package/vendor/procedural-animals/src/species/wolf/coat.js +0 -749
  249. package/vendor/procedural-animals/src/species/wolf/index.js +0 -107
  250. package/vendor/procedural-animals/src/species/wolf/motion.js +0 -80
  251. package/vendor/procedural-animals/src/species/wolf/regions.js +0 -57
  252. package/vendor/procedural-animals/src/species/wolf/rig.js +0 -87
  253. package/vendor/procedural-animals/src/species/wolf/sculpt.js +0 -339
  254. package/vendor/procedural-animals/src/worker.js +0 -29
@@ -1,211 +0,0 @@
1
- // Domestic cat (Felis catus). Digitigrade quadruped on the cheetah template: a small, stocky cat with
2
- // a big round head, huge eyes with vertical slit pupils, tall ears and a long expressive tail.
3
- // Coats are variants (createAnimal('cat', { variant: 'tuxedo' })) or come from the seed; longhair is a
4
- // seeded option (or overrides: { longhair: true }); kittens with { age: 'juvenile' }.
5
- import { catRig, HEAD_O, hl } from './rig.js';
6
- import { sculptCat, eyeOf } from './sculpt.js';
7
- import { catRegions } from './regions.js';
8
- import { catCoat, catLidColor } from './coat.js';
9
- import { motion } from './motion.js';
10
- import { catWhiskers } from './whiskers.js';
11
- import { srgb } from '../../core/build/coatKit.js';
12
- import { rng } from '../../core/math/vec.js';
13
-
14
- // [id, name, share of the seeded population]
15
- const VARIANTS = [
16
- ['mackerel', 'Mackerel tabby', 0.22],
17
- ['classic', 'Classic tabby', 0.12],
18
- ['ginger', 'Ginger tabby', 0.14],
19
- ['black', 'Black', 0.14],
20
- ['tuxedo', 'Tuxedo', 0.14],
21
- ['calico', 'Calico / tortie', 0.11],
22
- ['grey', 'Grey (blue)', 0.13],
23
- ];
24
- const pick = (x, table) => {
25
- let acc = 0;
26
- for (const [k, , w] of table) { acc += w; if (x < acc) return k; }
27
- return table[table.length - 1][0];
28
- };
29
-
30
- // iris colours (linear rgb: inner, mid, hi, outer), from reference photos
31
- const IRIS = {
32
- // (cats' irises are bright and fairly even: a paler, often yellower ring round the pupil, a thin darker
33
- // limbal edge; the shader darkens the rim and the zone under the upper lid itself)
34
- green: [0xa6a64c, 0x93bb70, 0xc9e29e, 0x5d7c46],
35
- hazel: [0xbfa044, 0xbcb956, 0xe2dd8c, 0x72702e],
36
- // (the gold and copper highlights darker and more saturated: near-cream, they lost the iris's hue first)
37
- gold: [0xd29c32, 0xd4a236, 0xe8c050, 0x9c7222],
38
- copper: [0xc2722c, 0xc8742e, 0xe0904a, 0x924c1e],
39
- blue: [0x6c9cca, 0x7cb0e2, 0xbad6f2, 0x3c5c88],
40
- kitten: [0x6c8498, 0x8aa2b6, 0xb6c6d4, 0x46586c],
41
- };
42
- const IRIS_NEAR = { green: ['hazel', 'aqua'], hazel: ['gold', 'green'], gold: ['copper', 'hazel'], copper: ['deepCopper', 'gold'] };
43
- IRIS.aqua = [0x94a468, 0x7fb09a, 0xb4dcc8, 0x4f7a64]; // a cool blue-green (face1)
44
- IRIS.deepCopper = [0xb0601e, 0xb8621e, 0xd07a36, 0x7a3a14];
45
- const EYE_BY_COAT = {
46
- mackerel: [['green', 0.45], ['hazel', 0.35], ['gold', 0.2]],
47
- classic: [['green', 0.4], ['hazel', 0.35], ['gold', 0.25]],
48
- ginger: [['gold', 0.55], ['copper', 0.3], ['hazel', 0.15]],
49
- black: [['gold', 0.45], ['copper', 0.3], ['green', 0.25]],
50
- tuxedo: [['gold', 0.4], ['green', 0.4], ['hazel', 0.2]],
51
- calico: [['gold', 0.45], ['green', 0.35], ['copper', 0.2]],
52
- grey: [['copper', 0.6], ['gold', 0.4]],
53
- };
54
-
55
- export default {
56
- id: 'cat',
57
- name: 'Domestic cat',
58
- latin: 'Felis catus',
59
- group: 'paws',
60
- plan: 'quadruped',
61
- covering: 'fur',
62
- variants: VARIANTS.map(([id, name]) => ({ id, name, latin: 'Felis catus' })),
63
-
64
- // Seeded individual: coat (variant), sex (ginger cats are ~80 % male, calicos female), size and
65
- // build (toms 10-25 % heavier with broad heads and jowls; the blue "British" type stockier), leg,
66
- // body, head, ear and tail proportions, stripe spacing, white spotting layout, eye colour, longhair
67
- // (~18 %). Kittens (8-10 weeks, age 'juvenile'): ~0.55 size, big head and ears, short legs and tail,
68
- // big paws, fluffy coat, blue-grey eyes.
69
- variation(R, o) {
70
- const g = () => (R() + R() + R() - 1.5) / 1.5; // ~[-1, 1], peaked
71
- let variant = o.variant && VARIANTS.some((v) => v[0] === o.variant) ? o.variant : null;
72
- // coat from its own hashed stream so consecutive seeds do not correlate
73
- const M = rng(Math.imul((o.seed ?? 1) + 0x2c1b3c6d, 0x297a2d39) ^ 0x1b873593);
74
- for (let i = 0; i < 3; i++) M();
75
- if (!variant) variant = pick(M(), VARIANTS); else M();
76
- const sexR = R();
77
- const sex = o.sex || (variant === 'calico' ? 'female' : variant === 'ginger' ? (sexR < 0.8 ? 'male' : 'female') : sexR < 0.5 ? 'male' : 'female');
78
- const age = o.age || 'adult';
79
- const juv = age === 'juvenile' ? 1 : 0;
80
- const male = sex === 'male' ? 1 : 0;
81
- const stocky = variant === 'grey' ? 1 : 0;
82
- const longhair = M() < 0.18;
83
- // individual traits from their own hashed stream (the other streams stay as they were: every seed keeps its
84
- // coat, sex, eye colour and markings)
85
- const V = rng(Math.imul((o.seed ?? 1) + 0x5bd1e995, 0x27d4eb2d) ^ 0x165667b1);
86
- for (let i = 0; i < 3; i++) V();
87
- const vv = Array.from({ length: 10 }, () => V());
88
- const solid = variant === 'black' || variant === 'grey' || variant === 'tuxedo';
89
- // the blue: most are the cobby British type (front_sit1: a broad chest, a big round head with full cheeks, small
90
- // ears, thick short legs, a shorter thick tail), about one in five the slim foreign type (side3)
91
- const cob = stocky ? (vv[0] < 0.2 ? 0.1 : 0.6 + 0.4 * vv[1]) : 0;
92
- const size = (male ? 1.04 : 0.955) * (1 + 0.07 * g()) * (1 + 0.035 * cob) * (juv ? 0.56 : 1);
93
- const head = (male ? 1.04 : 0.985) * (1 + 0.025 * g()) * (juv ? 1.28 : 1) * (1 + 0.12 * cob);
94
- const earK = (1 + 0.09 * g()) * (juv ? 1.12 : 1) * (1 - 0.3 * cob);
95
- const eyeT = EYE_BY_COAT[variant];
96
- let eye = eyeT[0][0];
97
- { let x = M(), acc = 0; for (const [k, w] of eyeT) { acc += w; if (x < acc) { eye = k; break; } } }
98
- const wR = M();
99
- const params = {
100
- sex, age, size, variant, juv, longhair, cob,
101
- jowl: (male ? 1.1 : 0.97) * (1 + 0.1 * cob) * (juv ? 0.92 : 1),
102
- tail: (1 + 0.05 * g()) * (juv ? 0.78 : 1) * (1 - 0.1 * cob),
103
- eye: juv ? 'kitten' : eye,
104
- // (the iris hue shifts toward a neighbouring colour: two gold-eyed cats are not the same gold)
105
- eyeTone: 2 * vv[2] - 1,
106
- coatWarmth: 0.8 * g(),
107
- // (solid coats and gingers vary more in tone, +-15 %, evenly: the peaked +-12 % left most solid cats alike)
108
- // (a black coat only lighter: rusty in the sun; darker it read as a flat silhouette)
109
- coatLightness: ((l) => (variant === 'black' || variant === 'tuxedo' ? 0.2 * vv[3] - 0.04 : solid || variant === 'ginger' ? 0.15 * (2 * vv[3] - 1) : l))(0.12 * g()),
110
- coatSeed: Math.floor(R() * 1e6),
111
- stripeP: 1 + 0.1 * g(),
112
- stripeW: 1 + 0.15 * g(),
113
- // stripe contrast (some tabbies boldly barred, some faint), the ghost tabby of a solid coat (faint on most
114
- // adults, clearer on some and on kittens), the locket's size, the legs' thickness (the cobby blue)
115
- stripeC: 0.8 + 0.4 * vv[4],
116
- ghost: juv ? 1.3 : vv[5] < 0.3 ? 0.9 + 0.4 * vv[6] : 0.25 + 0.4 * vv[6],
117
- locketSize: 0.85 + 0.6 * vv[7],
118
- limb: 1 + 0.12 * cob,
119
- classic: variant === 'ginger' && M() < 0.35,
120
- // white spotting (tuxedo, calico); a calico without white is a tortoiseshell
121
- white: variant === 'tuxedo' ? 0.3 + 0.3 * wR : variant === 'calico' ? (wR < 0.3 ? 0 : 0.35 + 0.3 * M()) : 0,
122
- // sock tops off the joints (a pattern edge on a joint stretches): the front at mid-forearm
123
- // (5.5-8 cm, the carpus bends most), the hind below the hock or over the lower shin
124
- sockF: 0.055 + 0.025 * M(),
125
- sockH: 0.02 + 0.045 * M(),
126
- blaze: M() < 0.4 ? 0.3 + 0.7 * M() : 0,
127
- pinkNose: M() < 0.5,
128
- tailTip: M() < 0.2,
129
- locket: (variant === 'black' || variant === 'grey') && M() < 0.35, // a small white locket on the chest
130
- minThick: 0.0011,
131
- warps: [
132
- // (legs +-5 % per individual; no extra shortening of the average adult)
133
- // (the cobby blue's legs only a little shorter: its thickness makes it cobby; shorter still, the skin at the
134
- // armpits and the stifles stretched > 3x in more poses)
135
- { type: 'legs', k: 1 + 0.05 * g() - 0.1 * juv - 0.02 * cob, top: 0.13 },
136
- { type: 'length', k: 0.97 + 0.03 * g() - 0.06 * juv, z0: -0.15, z1: 0.08 },
137
- { type: 'girth', k: 1 + 0.06 * g() + 0.18 * cob + 0.02 * male - 0.03 * juv, cy: 0.16, z0: -0.19, z1: 0.12, fade: 0.04 }, // (lean to heavy)
138
- // (a kitten's big head fades out over the neck: a short fade squeezed the skin round the face into a
139
- // steep ring that the fluffy coat stood up on, a bonnet round a flat face)
140
- { type: 'scaleAbout', c: HEAD_O, k: head, r0: 0.035, r1: juv ? 0.11 : 0.075 },
141
- // ears (about the middle of each pinna)
142
- ...[1, -1].map((s) => ({ type: 'scaleAbout', c: hl([0.037 * s, 0.041, -0.016]), k: earK, r0: 0.012, r1: 0.03 })),
143
- // kittens: big paws
144
- ...(juv ? [[0.027, 0.053], [-0.027, 0.053], [0.03, -0.161], [-0.03, -0.161]].map(([x, z]) => ({ type: 'scaleAbout', c: [x, 0.01, z], k: 1.15, r0: 0.012, r1: 0.028 })) : []),
145
- ],
146
- };
147
- return params;
148
- },
149
- rig: (params) => catRig(params),
150
- sculpt: (m, rig, params) => sculptCat(m, rig, params),
151
- regions: catRegions,
152
- coat: catCoat,
153
- surfaces: catWhiskers,
154
- eyeSpecs: (params) => [1, -1].map((side) => ({ side, spec: eyeOf(params), headOrigin: HEAD_O, bone: 'head', look: eyeLook(params) })),
155
- motion,
156
- render: (params = {}) => ({
157
- markColor: params.variant === 'ginger' ? [0.04, 0.016, 0.008] : params.variant === 'grey' ? [0.03, 0.028, 0.03] : [0.012, 0.009, 0.008],
158
- strandDensity: 1200,
159
- // (the cobby blue's plush coat in finer tufts, up to 2x: its 2 cm neck hair clumped like a longhair's ruff round a
160
- // velvet face; front_sit1's British blue is dense and fine all over)
161
- clumpDensity: params.longhair ? 0.8 : 1.1 * (1 + 1.0 * (params.cob || 0)),
162
- raiseLen: [0.006, 0.014],
163
- leatherTint: 1, // pink / brick / black nose leather and pads in their own colours (core/render/coatMaterial.js)
164
- leatherRelief: 0.25, // (a finer pebbling: the small nose read speckled in daylight, its sub-pixel bumps sparkling)
165
- finMask: true, // coat surf.y thins the silhouette fins: none on the head and jaw (coat.js)
166
- }),
167
- };
168
-
169
- // Vertical slit pupil (0.08 of the iris radius in bright sun, nearly round, ~0.85, in the dark or when
170
- // aroused); iris fills the fissure, no sclera; the closing lids in the face's fur colour (the shader
171
- // draws the dark lid margin, the "eyeliner", itself).
172
- export function eyeLook(params = {}) {
173
- const base = (IRIS[params.eye] || IRIS.green).map((h) => srgb(h));
174
- // (the individual's shade: toward the neighbouring colour, + the warmer / deeper one, - the paler / cooler one)
175
- const near = IRIS_NEAR[params.eye];
176
- const t = params.eyeTone || 0;
177
- const c = near ? base.map((col, i) => { const o = srgb(IRIS[near[t > 0 ? 0 : 1]][i]); return col.map((x, k) => x + (o[k] - x) * 0.45 * Math.abs(t)); }) : base;
178
- return {
179
- pupil: 'slit',
180
- lids: 'mammal',
181
- iris: { inner: c[0], mid: c[1], hi: c[2], outer: c[3] },
182
- sclera: { color: [0.25, 0.2, 0.16], visible: false },
183
- lidColor: catLidColor(params),
184
- pupilSize: [0.08, 0.86],
185
- // big, proud eyes in a flat face: the lids shade the eyeball less than a deep-set eye's (the rim and
186
- // the upper lid's shadow at about half the default), and a thin limbal ring
187
- shade: { rim: 0.25, lid: 0.45 },
188
- limbus: 0.45,
189
- // the closed lid is furred: no smooth sheen (a black cat's lids mirrored the sky: glossy open eyes)
190
- lidSpec: 0.03,
191
- // lit like the fur round it (no sky reflection on a furred lid), less base sheen over the open eye (the sky's
192
- // glaze washed the copper iris out to beige outdoors), and lids that shut along a curved seam
193
- lidFur: 1,
194
- glaze: 0.25,
195
- ambient: 1,
196
- lidHair: 1,
197
- lidArc: true,
198
- irisLight: 1,
199
- fill: 0.6,
200
- lidFlat: 0.8,
201
- lidSeam: 0.0005,
202
- lidClump: 1,
203
- lidFill: 1,
204
- // an even iris with fine fibres (face1, face2): the stroma's radial bundles and dark crypts at full contrast read
205
- // as the ticks of a clock face
206
- irisTexture: 0.4,
207
- // a shut cat eye is one dark curved line low in the fissure: the upper lid does most of the closing (meeting at 0.7
208
- // of the half-height, a band of lower lid between the seam and the rim read as a double eyeliner)
209
- lidMeet: 0.97,
210
- };
211
- }
@@ -1,101 +0,0 @@
1
- // Domestic cat motion data for the quadruped engine (schema: src/core/motion/quadruped.js).
2
- // Numbers are for the reference individual (params.size = 1, withers ~0.245 m); the engine scales them
3
- // by dynamic similarity for kittens and big toms.
4
- //
5
- // Gaits (force-plate and kinematic studies of cats: Goslow 1973, Halbertsma 1983,
6
- // Bishop 2008, Smith 1993, Muybridge 1887): lateral-sequence walk (diagonality ~25 %: LF lands at
7
- // ~0.27 of the stride after LH, not a pace; 0.8-1.5 Hz, duty 0.72 -> 0.58, direct register), trot
8
- // (1.0-2.3 m/s, 2-3 Hz, duty 0.45), half-bound (2.2-4.5 m/s), rotary gallop (LH -> RH -> RF -> LF, 3.3-4 Hz, duty 0.35 -> 0.22,
9
- // two flight phases, big lumbar flexion). Walk -> trot ~1.0 m/s (Froude 0.5), trot -> gallop ~2.2 m/s
10
- // (Heglund: 1.53 M^0.24 for 4 kg). Top speed ~12 m/s.
11
- import { hooks } from './behaviour.js';
12
-
13
- const G = (name, v, f, D, off, o) => ({ name, v, f, D, off, ...o });
14
-
15
- export const motion = {
16
- hooks,
17
- maxSpeed: 12,
18
- accel: [4, 7],
19
- decel: 10,
20
- turnRate: 2.4, // (a pivot ~1.3 rad/s: the forequarters walk round; 3.4 spun the body like a compass needle)
21
- latAccelMax: 4.5, // (~0.46 g: the engine leans the body by 0.85 atan(a / g), so ~21 deg in a fast turn; 7 leaned it 28-30 deg, a motorbike)
22
- gears: { walk: 0.6, trot: 1.6, bound: 3.2, gallop: 7 },
23
- gallopBlend: [2.2, 4.5],
24
- flexBlend: [1.8, 3.2], // (the half-bound flexes its back: [2.2, 4] halved the table's flexion at 3.3 m/s)
25
- // (walk and trot rows: an extra landing lead, so the forefoot lands as far ahead as the foreleg reaches (the foot's
26
- // default lead cap, 0.59 leg lengths, landed it 4-5 cm short and cut the fore stance to ~60 % of the hind's); the
27
- // foot's own cap stays, as it also sets how far the forelegs reach in a jump's flight, where more stretched the
28
- // armpits)
29
- gaits: [
30
- G('walk', 0.0, 1.0, 0.72, [0.27, 0.77, 0.0, 0.5], { liftF: 0.018, liftH: 0.016, bobF: 0.0018, bobH: 0.0018, flex: 0.0, lat: 0.05, fold: 1.1, heel: 58, tail: 0, drop: 0.0, width: 0.8, lead: 0.02 }),
31
- G('walk', 0.95, 1.75, 0.6, [0.26, 0.76, 0.0, 0.5], { liftF: 0.024, liftH: 0.02, bobF: 0.003, bobH: 0.003, flex: 0.0, lat: 0.05, fold: 1.3, heel: 62, tail: 0.12, drop: 0.0, width: 0.72, lead: 0.02 }),
32
- // (a cat's trot has no flight phase at ~1.7 m/s: duty ~0.5, falling toward 0.44 at the top of the band)
33
- G('trot', 1.2, 2.45, 0.53, [0.51, 0.02, 0.0, 0.5], { liftF: 0.032, liftH: 0.028, bobF: 0.006, bobH: 0.006, flex: 0.02, lat: 0.02, fold: 1.5, heel: 60, tail: 0.3, drop: 0.008, width: 0.7, lead: 0.03 }),
34
- G('trot', 2.1, 3.05, 0.44, [0.51, 0.02, 0.0, 0.5], { liftF: 0.038, liftH: 0.034, bobF: 0.008, bobH: 0.008, flex: 0.03, lat: 0.01, fold: 1.6, heel: 64, tail: 0.4, drop: 0.012, width: 0.7, lead: 0.03 }),
35
- // half-bound: the hind feet land almost together, the forefeet one after the other
36
- G('bound', 2.5, 3.2, 0.37, [0.6, 0.48, 0.0, 0.05], { liftF: 0.05, liftH: 0.045, bobF: 0.008, bobH: 0.012, flex: 0.32, lat: 0, fold: 1.8, heel: 64, tail: 0.65, drop: 0.008, width: 0.9 }),
37
- G('bound', 4.2, 3.45, 0.32, [0.6, 0.48, 0.0, 0.06], { liftF: 0.06, liftH: 0.055, bobF: 0.009, bobH: 0.014, flex: 0.38, lat: 0, fold: 1.9, heel: 68, tail: 0.8, drop: 0.01, width: 0.95 }),
38
- // rotary gallop (LH -> RH -> RF -> LF), two flight phases
39
- G('gallop', 5.2, 3.6, 0.29, [0.6, 0.47, 0.0, 0.12], { liftF: 0.07, liftH: 0.064, bobF: 0.01, bobH: 0.015, flex: 0.36, lat: 0, fold: 1.95, heel: 70, tail: 0.85, drop: 0.012, width: 1 }),
40
- G('gallop', 12, 4.1, 0.22, [0.6, 0.47, 0.0, 0.13], { liftF: 0.085, liftH: 0.078, bobF: 0.01, bobH: 0.018, flex: 0.44, lat: 0, fold: 2.05, heel: 76, tail: 1.0, drop: 0.02, width: 1 }),
41
- ],
42
- feet: {
43
- front: { type: 'digitigrade', curl: 55, elbowDown: 0.25 },
44
- hind: { type: 'digitigrade', curl: 65 },
45
- },
46
- stance: { width: 1, gallopWidth: 0.6, sprawl: 0, crouch: 0, scuff: [11, 18, 0] },
47
- // torso cross-sections (bind, reference size): centre height, half height, half width (incl. coat)
48
- body: {
49
- // (measured on the bind mesh: the lowest skin at each girdle, incl. the brisket and the low belly of the
50
- // primordial pouch just in front of the hips; the chest floor at the elbows since the trunk was made shallower)
51
- chest: { y: 0.171, hh: 0.07, hw: 0.056 }, // (+ the forearms folded under the chest when lying)
52
- mid: { y: 0.166, hh: 0.053, hw: 0.053 },
53
- pelvis: { y: 0.165, hh: 0.066, hw: 0.066 }, // incl. the folded thighs a lying cat rests on
54
- rump: { z: -0.182, y: 0.172, hh: 0.048, hw: 0.042 },
55
- back: 0.024,
56
- },
57
- head: {
58
- // [speed, raise (m), reach (m), pitch (rad, + = nose down)]: standing, the head is carried above
59
- // the withers with the nose a little down; walking at or just below the back line, level and
60
- // steady; galloping stretched forward, level with the back
61
- // (standing: raised 6 mm, nose 0.05 rad down; raised 12 mm and 0.1 down, the engine lifted neck1 16 deg against the head
62
- // and the throat skin folded over 2-4 cm under the chin (posed inverted skin 600 mm2 on the blue tom, seed 12; now 270): a
63
- // pale crescent ledge under the jaw from the front and below, the face's own outline round the chin; the occiput's skin
64
- // blend cannot reach past neckMid in the core, rig.js)
65
- carriage: [[0, 0.006, -0.003, 0.05], [0.6, -0.012, 0.006, 0.14], [1.6, -0.014, 0.01, 0.1], [4, -0.022, 0.016, 0.05], [9, -0.026, 0.02, 0.04]],
66
- stab: [[0, 0], [0.35, 0.3], [1, 0.35], [2.5, 0.4], [5, 0.62]],
67
- neckBend: 42, neckPivot: 0.55, yaw: 1.3, pitchUp: 0.6, pitchDown: 0.7,
68
- },
69
- tail: {
70
- // [speed, pitch per segment from horizontal (deg), base -> tip]: carried out behind and curving up
71
- // when standing (side1, threequarter1: the standing photos hold it level to raised, the tip up); the
72
- // walking "question mark" (shaft upright, tip hooked forward); raised at the trot, streaming straight
73
- // back at the gallop
74
- carriage: [
75
- [0.0, [2, 5, 7, 9, 11, 15, 21, 29, 39, 50]],
76
- [0.35, [32, 62, 80, 87, 90, 93, 102, 120, 145, 166]],
77
- [0.95, [30, 58, 76, 83, 86, 89, 97, 113, 136, 156]],
78
- [1.6, [18, 34, 44, 47, 48, 48, 50, 53, 58, 63]],
79
- [3.0, [6, 10, 12, 12, 12, 12, 13, 15, 17, 20]],
80
- [8, [0, 3, 5, 6, 6, 6, 7, 8, 9, 11]],
81
- ],
82
- stiffness: 1.1, sway: 6, flick: 1, wag: 0, swish: 0, curl: 0,
83
- balance: 0.25, // a cat's tail counter-swings in turns and speed changes (0.8 threw it up like a flag; 0.4 still swung an upright tail 49 deg out in a walking U-turn)
84
- radius: [0.022, 0.016], // (coat included)
85
- },
86
- ears: { rest: [0, 0], mobility: 0.78, speedFlatten: 0.35, flattenSpeeds: [4, 10], twitch: 1, prick: 0.55 }, // (mobility 0.78: ears laid back up to ~49 deg in the pounce, 63 stretched the crown between them > 3x)
87
- breath: { rate: 0.45, amp: 0.012, pant: false },
88
- actions: {
89
- attack: { style: 'pounce' },
90
- // (crouched to eat and drink, the hind legs folded and the hocks down)
91
- eat: { style: 'tear', dropF: 0.5, dropH: 0.62, ahead: 0.55 },
92
- drink: { dropF: 0.58, dropH: 0.66, ahead: 0.55, pitch: 1.2 },
93
- jump: { height: 1.0, distance: 1.4, land: [0.42, 0.32] },
94
- sit: { dropH: 1.0 },
95
- // lying sternal: the forepaws just in front of the chest, forearms folded under it (with the
96
- // cat's deep chest and short forelegs the default sphinx reach put the elbows in the ground)
97
- fold: { front: { z: 0.2, k: -1.45, beta: 0 } },
98
- lie: {},
99
- sleep: { style: 'curl' },
100
- },
101
- };
@@ -1,82 +0,0 @@
1
- // Meshing plan: body at 2 mm, head at 1 mm (overlapping across the upper neck and cross-faded),
2
- // eyelid patches at 0.4 mm, and the lower jaw as its own surface so the mouth can open. (The cheetah's
3
- // plan scaled to a cat: 0.7 % of the withers height for the body, the head at half that.)
4
- import { catJoints, HEAD_O } from './rig.js';
5
- import { eyeOf } from './sculpt.js';
6
- import { eyeFrameOf } from '../../core/sdf/eyeSocket.js';
7
- import { lerp, norm, sub, smoothstep } from '../../core/math/vec.js';
8
- import { harmonizeSeamWeights as harmonizeCore } from '../../core/build/seams.js';
9
-
10
- // the neck cut is fixed in reference space (joints of the reference individual)
11
- const J0 = catJoints();
12
- export const NECK_CUT = (() => {
13
- const d = norm(sub(J0.occiput, J0.neckMid));
14
- const c = lerp(J0.neckMid, J0.occiput, 0.8); // (close to the skull: the fine head mesh stays off the bending neck)
15
- return { c, d, band: 0.004 };
16
- })();
17
- 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];
18
-
19
- export const eyeCentres = (params) => [1, -1].map((s) => eyeFrameOf(eyeOf(params), HEAD_O, s).c);
20
- const PATCH = { R: 0.0165, B: 0.0025, h: 0.0004 }; // (inner radius 14 mm: the aperture rim at the skin lies at ~12.3 mm)
21
- function eyePatchWeight(centres, x, y, z) {
22
- let dmin = 1e9;
23
- for (const c of centres) dmin = Math.min(dmin, Math.hypot(x - c[0], y - c[1], z - c[2]));
24
- return 1 - smoothstep(PATCH.R - PATCH.B, PATCH.R + PATCH.B, dmin);
25
- }
26
-
27
- export const CELL = { body: 0.00205, head: 0.00102 };
28
-
29
- export function catRegions(rig, params, Q) {
30
- const B = NECK_CUT.band, r = Q.res;
31
- const centres = eyeCentres(params);
32
- // Without fur shells (crowd tier) the coarse body surface and the head surface do not coincide in
33
- // the overlap band: each stays visible past the cut by D (the depth test picks the outer one)
34
- // (the low tier's coarse body cells, 6 mm, leave the same gap at the sides of the neck: both surfaces are
35
- // drawn across an overlap there as well)
36
- // (a kitten's big head (x1.28, warped after meshing) spreads the two surfaces further apart in the band: more overlap;
37
- // so does a longhair's sculpted ruff round the neck: single open edges at the side of the neck at the low tier)
38
- const D = Q.shells > 0 && r < 2.5 ? 0 : (Q.shells > 0 ? 0.6 : 0.85) * CELL.body * r * (params.juv || params.longhair ? 1.6 : 1);
39
- // (medium too: Safari on a Mac and phones show medium, and its 2 mm face cells drew the lid margin in steps;
40
- // the two patches at 1 mm cost ~4.5k vertices of the tier's 32k)
41
- // (the head and body surfaces reach 3 body cells further across the cut, hidden by the fade, below the hero tier and on
42
- // kittens: the skin weights are smoothed over each mesh, one-sidedly near a region's edge, so the two surfaces' weights in
43
- // the band differed by 0.1-0.2 (the coarser the cells, the more; on a kitten, whose head / neck blend is shorter, rig.js,
44
- // also at hero) and they parted by up to 4.6 mm at the side of the neck when the head turned: red specks at the jowl's
45
- // outline in the 'holes' view at medium; seed 13: 4.6 -> 1.8 mm medium, 2.9 -> 1.5 high; vertices high <= 76.9k, medium
46
- // <= 30.2k over seeds 1-40. Hero, without: <= 1.6 mm, within its 130k)
47
- const M = (params.juv || r > 1.1 ? 3 : 0) * CELL.body * r;
48
- const patches = Q.eyePatches || (Q.shells > 0 && r <= 2) ? centres.map((c) => ({ c, R: PATCH.R, B: PATCH.B, h: PATCH.h * Math.max(1, r) * (Q.eyePatches ? 1 : 1.25) })) : [];
49
- const zTail = rig.J['tail' + (Object.keys(rig.J).filter((k) => /^tail\d+$/.test(k)).length - 1)][2];
50
- return {
51
- jobs: [
52
- [{ name: 'body', part: 'body', bmin: [-0.085, -0.012, Math.min(-0.5, zTail - 0.03)], bmax: [0.085, 0.3, 0.2], h: CELL.body * r, F: 4, clip: (x, y, z) => neckS(x, y, z) < B + D + M }],
53
- [
54
- { name: 'head', part: 'body', bmin: [-0.065, 0.17, 0.12], bmax: [0.065, 0.325, 0.262], h: CELL.head * r, F: 6, clip: (x, y, z) => neckS(x, y, z) > -B - D - M, patches },
55
- // (the box takes the whole mandible: its rounded rear ends reach z 0.168, and a cut there showed as an open edge
56
- // under a big head)
57
- { name: 'jaw', part: 'jaw', bmin: [-0.03, 0.195, 0.162], bmax: [0.03, 0.228, 0.25], h: CELL.head * r, F: 6, rigidBone: 'jaw' },
58
- ],
59
- ],
60
- fade(x, y, z, name, patch) {
61
- const sN = neckS(x, y, z);
62
- if (name === 'body') return 1 - smoothstep(-B, B, sN - D);
63
- if (name === 'head') {
64
- let f = smoothstep(-B, B, sN + D);
65
- if (patches.length) { const ew = eyePatchWeight(centres, x, y, z); f *= patch ? ew : 1 - ew; }
66
- return f;
67
- }
68
- return 1;
69
- },
70
- };
71
- }
72
-
73
- // The head and the body surfaces overlap across the neck cut, and the core smooths each surface's skin weights over its
74
- // own mesh (3 neighbour passes: ~1.5 mm on the 1 mm head cells, ~3 mm on the 2 mm body cells), so where the weights curve
75
- // (the occiput blend, the lips group behind the jowl) the two surfaces at one place took head / neck2 shares 0.05-0.07
76
- // apart. Posed, they part where the head bends far against the neck (2.8 mm, hero 3.5, on the side of the cheek of the
77
- // dead blue tom, seed 12; standing 0.2), and at the hand-over the fur rooted on the surface that lies under the other's
78
- // skin loses its roots: a crisp edge across the cheek, the head's fur dark and velvety on one side, the neck's coarse and
79
- // pale on the other, an unsmoothed seam between the parts. Here the body surface near the cut takes the head surface's
80
- // weights at the same place (the closest point on the finer head mesh, barycentric), in full across the cross-fade band
81
- // and fading back to its own over the next 8 mm on the body side.
82
- export function harmonizeSeamWeights(ctx) { return harmonizeCore(ctx, neckS, NECK_CUT.band); }
@@ -1,100 +0,0 @@
1
- // Domestic cat skeleton in bind pose (metres). Forward = +Z, up = +Y, the animal's left = +X.
2
- //
3
- // Reference individual: an average adult domestic shorthair (~4 kg), withers (skin) ~0.245 m, nose to
4
- // tail base ~0.46 m along the body, tail ~0.29 m. Limb segments scaled from cat osteometry:
5
- // scapula ~0.065, humerus ~0.08, radius ~0.083, metacarpus ~0.025 (joint centres), femur ~0.088,
6
- // tibia ~0.1, metatarsus ~0.048 m; the hind limb is ~20 % longer than the fore limb. A cat stands on
7
- // sprung, half-flexed legs: elbow at the chest floor (~0.12 m), heel ~0.058 m above the ground,
8
- // stifle tucked forward under the flank. The head is modelled level in its own frame (HEAD_O); its
9
- // carriage comes from the motion data.
10
- import { buildRig } from '../../core/rig/rig.js';
11
- import { quadrupedBones, quadrupedLimbs, tailChain } from '../../core/rig/quadruped.js';
12
- import { WHISKER_BASE, WHISKER_TIP } from './whiskers.js';
13
-
14
- export const TAIL_SEGS = 10;
15
- export const SH = 0.245; // reference withers height (skin)
16
- export const HEAD_O = [0, 0.238, 0.184]; // head-local origin: between the eyes, at eye level, just behind them
17
- export const hl = (v) => [HEAD_O[0] + v[0], HEAD_O[1] + v[1], HEAD_O[2] + v[2]];
18
-
19
- export function catJoints(params = {}) {
20
- const tk = params.tail || 1;
21
- const J = {
22
- nose: hl([0, -0.019, 0.046]),
23
- occiput: hl([0, -0.004, -0.038]),
24
- neckMid: [0, 0.21, 0.13],
25
- neckBase: [0, 0.186, 0.102],
26
- chestMid: [0, 0.19, 0.052],
27
- thoraxRear: [0, 0.194, -0.012],
28
- lumbarMid: [0, 0.197, -0.07],
29
- lumbosacral: [0, 0.195, -0.122],
30
- tailBase: [0, 0.188, -0.172],
31
- scapTopL: [0.021, 0.221, 0.074],
32
- shoulderL: [0.033, 0.166, 0.103],
33
- // (standing, the forearm is a vertical column under the elbow and the paw sits under the chest, ~5 cm behind
34
- // the shoulder joint (side1, side3; the paw 2.9 cm ahead of the elbow stood the forelegs like a sawhorse's);
35
- // the humerus 7.8 cm at ~54 deg from the vertical (research: 10 cm): the foreleg reaches far enough to carry
36
- // the walk's stance (with a 7.5 cm humerus the standing leg was nearly straight and swept ~17 of 27 cm; with the
37
- // elbow 0.5 cm further back still, the armpit skin stretched more in walking turns for no more stance)
38
- elbowL: [0.03, 0.12, 0.04],
39
- wristL: [0.027, 0.037, 0.043],
40
- mcpL: [0.027, 0.0125, 0.051],
41
- ftoeL: [0.027, 0.005, 0.068],
42
- hipL: [0.032, 0.176, -0.134],
43
- kneeL: [0.0396, 0.1062, -0.08], // (femur 8.9, tibia 10.2 cm: +5 %)
44
- hockL: [0.033, 0.058, -0.17],
45
- // (the cannon nearly vertical under the hock: side1)
46
- mtpL: [0.03, 0.0125, -0.165],
47
- htoeL: [0.03, 0.005, -0.148],
48
- jawHinge: hl([0, -0.019, -0.012]),
49
- jawTip: hl([0, -0.031, 0.03]),
50
- // the pinna sits on the upper corner of the skull: its base runs from beside the crown (~11 mm from
51
- // the midline, ~30 mm above the eyes) down to the side of the head (~45 mm out, ~12 mm up), the tip
52
- // ~44 mm above the middle of the base (the pinna 4.5-5 cm tall: research, face1 ~1.2 IPD), leaning out
53
- // ~27 deg (frontal photos: tips ~45 mm out, ~57 up)
54
- earBaseL: hl([0.0275, 0.022, -0.012]),
55
- earTipL: hl([0.047, 0.061, -0.0195]),
56
- whiskerBaseL: hl(WHISKER_BASE),
57
- whiskerTipL: hl(WHISKER_TIP),
58
- };
59
- // bind tail: carried out behind with a gentle droop and a slight lift at the tip, clear of the
60
- // hocks and the buttocks (the carriage tables pose it: question mark, low hang, wrapped round the feet)
61
- tailChain(J, 'tailBase', [-9, -18, -24, -27, -28, -26, -22, -15, -8, 0], [0.033, 0.032, 0.031, 0.03, 0.029, 0.029, 0.028, 0.027, 0.026, 0.025].map((l) => l * tk));
62
- return J;
63
- }
64
-
65
- export function catRig(params = {}) {
66
- const J = catJoints(params);
67
- return buildRig({
68
- joints: J,
69
- unit: SH / 0.76,
70
- headOrigin: HEAD_O,
71
- // (+ a whisker bone per side: the whisker fans ride on it, see whiskers.js)
72
- bones: quadrupedBones({ tailSegs: TAIL_SEGS, ears: true, jaw: true, extra: [['whisker{S}', 'whiskerBase{S}', 'whiskerTip{S}', 'head', { region: 'head', group: 'whisk{S}' }]] }),
73
- axial: {
74
- points: ['nose', 'occiput', 'neckMid', 'neckBase', 'chestMid', 'thoraxRear', 'lumbarMid', 'lumbosacral', 'tailBase', ...Array.from({ length: TAIL_SEGS }, (_, i) => 'tail' + (i + 1))],
75
- bones: ['head', 'neck2', 'neck1', 'chest', 'spine3', 'spine2', 'spine1', 'pelvis', ...Array.from({ length: TAIL_SEGS }, (_, i) => 'tail' + i)],
76
- // the big round skull's influence reaches back into the nape and the throat
77
- // (a kitten: a blend that ends at neckMid. The core applies a joint's blend only inside its two segments, so the
78
- // adult's lever-widened occiput blend stops at neckMid: the throat's head share drops from ~0.4 to 0 along the
79
- // neckMid line, and the kitten's big head on its short, S-carried neck folded the throat skin there, under the chin
80
- // in view (back faces in the 'holes' view). On adults the same fold lies under the jaw, out of view, and the wide
81
- // throat blend keeps the throat's stretch in sleep and death in budget.)
82
- blend: params.juv ? { 1: [-0.07, 0.085, 0], 2: [-0.035, 0.035, 0.3] } : { 1: [-0.1, 0.16, 4] },
83
- bodyTail: 0, // the tail hangs down behind the hocks: thigh skin blends into it only at the root
84
- },
85
- limbs: quadrupedLimbs({
86
- front: { tCore: 0.55, aCore: 0.07, aBody: -0.24, midX: 0.0 },
87
- hind: { tCore: 0.5, aCore: 0.05, aBody: -0.13, midX: 0.008 },
88
- }),
89
- appendages: [
90
- { group: 'earL', bone: 'earL', blend: [-0.005, 0.011] },
91
- { group: 'earR', bone: 'earR', blend: [-0.005, 0.011] },
92
- // (sculpt.js LIPS: the lips and jowls ride on the head with the jaw; blended over [-32, 19] mm x unit: with [-16, 10] the
93
- // head / neck2 shares behind the jowl changed by ~0.08 per 2 mm, the head and body surfaces' smoothed weights differed
94
- // there by 0.05-0.07, and in the death pose and sleep they parted by 2.8-3.6 mm at the hand-over (regions.js
95
- // harmonizeSeamWeights): a hard edge across the cheek)
96
- { group: 'lips', bone: 'head', blend: [-0.1, 0.06] },
97
- ],
98
- webTags: ['flankfold', 'thighfront', 'scapmuscle'],
99
- });
100
- }