@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,111 +0,0 @@
1
- // Lion (Panthera leo). A heavy, deep-chested digitigrade cat: massive head and forequarters, short
2
- // legs relative to its bulk; the male's mane, the lioness, and woolly spotted cubs.
3
- import { lionRig, HEAD_O } from './rig.js';
4
- import { sculptLion, EYE } from './sculpt.js';
5
- import { lionRegions, EYE_CENTRES } from './regions.js';
6
- import { lionCoat } from './coat.js';
7
- import { motion } from './motion.js';
8
- import { lionWhiskers } from './whiskers.js';
9
-
10
- export default {
11
- id: 'lion',
12
- name: 'Lion',
13
- latin: 'Panthera leo',
14
- group: 'paws',
15
- plan: 'quadruped',
16
- covering: 'fur',
17
- variants: ['tawny', 'white'],
18
-
19
- // Seeded individual. Males ~1.075 x the reference size (withers
20
- // ~1.15 m), a bigger, broader head and a mane whose extent grows with age (young / "maneless"
21
- // Tsavo-type males carry a short ruff) and whose colour runs from blond to black-fringed; lionesses
22
- // ~0.935 (withers ~1.0 m), no mane, a flatter head. Cubs (age 'juvenile', ~4-6 months): ~0.42 size,
23
- // big head, ears and paws, short legs, woolly greyer coat with faint rosettes, grey-amber eyes.
24
- // Individuals vary in leg length, body length, head size, coat warmth / lightness, nose freckling
25
- // (age), faint leg spots. Rare leucistic "white lion" (variant 'white', ~3 %).
26
- variation(R, o) {
27
- const sex = o.sex || (R() < 0.5 ? 'male' : 'female');
28
- const age = o.age || 'adult';
29
- const juv = age === 'juvenile' ? 1 : 0;
30
- const male = sex === 'male' && !juv;
31
- const g = () => R() + R() - 1; // [-1, 1], triangular
32
- let variant = o.variant;
33
- if (!variant) variant = R() < 0.03 ? 'white' : 'tawny'; else R();
34
- const prime = R(); // 0 young adult .. 1 prime / old (mane extent and darkness, nose freckling)
35
- const maneless = R() < 0.08;
36
- const mane = male ? (maneless ? 0.12 : Math.min(1, 0.3 + 0.75 * prime * (0.8 + 0.2 * R()))) : 0;
37
- const maneDark = male ? Math.min(1, Math.max(0, 0.1 + 0.65 * prime + 0.3 * g())) : 0;
38
- const size = (male ? 1.075 : 0.935) * (1 + 0.06 * g()) * (juv ? 0.42 : 1);
39
- const legs = 1 + 0.045 * g() - 0.08 * juv;
40
- const head = (male ? 1.12 : 1.07) * (1 + 0.04 * g()) * (juv ? 1.28 : 1);
41
- return {
42
- sex, age, size, variant, juv,
43
- mane, maneDark,
44
- noseDark: juv ? 0 : Math.min(1, Math.max(0, 0.15 + 0.6 * prime + 0.15 * g())),
45
- legSpots: juv ? 1 : Math.max(0, 0.15 + 0.2 * g()),
46
- coatWarmth: 1.1 * g(),
47
- coatLightness: 0.25 * g(), // (+-0.16 read as a pride of clones)
48
- coatSeed: Math.floor(R() * 1e6),
49
- minThick: 0.005,
50
- warps: [
51
- // cubs (research 1, cub_lying1): a short muzzle (the face in front of the eyes 22 % shorter) and eyes 15 %
52
- // bigger, in reference space before the other warps (the adult's muzzle scaled down)
53
- ...(juv ? [{ type: 'length', k: 0.7, z0: 0.878, z1: 1.03 }, ...EYE_CENTRES.map((c) => ({ type: 'scaleAbout', c, k: 1.15, r0: 0.026, r1: 0.05 }))] : []),
54
- { type: 'legs', k: legs, top: 0.55 },
55
- { type: 'length', k: 1 + 0.07 * g() - 0.05 * juv, z0: -0.55, z1: 0.4 },
56
- { type: 'scaleAbout', c: HEAD_O, k: head, r0: 0.14, r1: 0.32 },
57
- // (cub paws: sculpt.js, longer and deeper; a warp about them also made them wider, and they lay in the ground)
58
- ],
59
- // (drawn after everything above, so a seed keeps its sex, mane, size and coat)
60
- earDark: 0.55 + 0.45 * R(), // ear backs from sooty brown to black
61
- belly: 0.6 + 0.8 * R(), // the loose belly fold (primordial pouch), small .. heavy
62
- };
63
- },
64
- rig: () => lionRig(),
65
- sculpt: (m, rig, params) => sculptLion(m, rig, params),
66
- regions: lionRegions,
67
- coat: lionCoat,
68
- eyeSpecs: (params) => [1, -1].map((side) => ({ side, spec: params.juv ? CUB_EYE_SPEC : EYE, headOrigin: HEAD_O, bone: 'head', look: params.juv ? CUB_EYE : EYE_LOOK })),
69
- motion,
70
- surfaces: lionWhiskers, // the whiskers (strands on a bone per side)
71
- render: {
72
- markColor: [0.012, 0.009, 0.007],
73
- strandDensity: 560,
74
- // silhouette fins on the mane, the tufts and the fringes only (hair >= 24 mm): on the face, the cheeks and a cub's
75
- // soft head their dark roots drew a dark outline wherever the head turns side-on, a hood round a cub's face; the core option finMinLen (default 5.8 mm)
76
- finMinLen: 0.024,
77
- // the shells' strands cross-faded between two hashing planes near a switch of the plane (the core option
78
- // strandBlend, default off): the broad forehead tilted ~45 deg drew a rectangle where the plane switched
79
- // (0.35: at 0.12 the bridge, sloping ~45 deg and convex, still drew two or three horizontal bands of
80
- // stretched strands across it and one across the top of the forehead, stitches or creases from the front)
81
- strandBlend: 0.35,
82
- clumpDensity: 0.85,
83
- leatherTint: 1, // nose leather in its tint: pink-brown to mottled black by age (coat.js), pink in the white lion
84
- },
85
- };
86
-
87
- // Round pupil (constricts to a small circle), amber iris (#b8802f, darker limbal ring), no visible
88
- // sclera, black lid margins.
89
- export const EYE_LOOK = {
90
- pupil: 'round',
91
- lids: 'mammal',
92
- // (amber-gold: face_male1 amber, face_female1 paler gold; a saturated orange read as a cartoon eye, a
93
- // grey-gold hazel as a washed-out yellow in sunlight)
94
- iris: { inner: [0.3, 0.16, 0.035], mid: [0.5, 0.3, 0.075], hi: [0.7, 0.47, 0.15], outer: [0.13, 0.07, 0.018] },
95
- sclera: { color: [0.2, 0.15, 0.11], visible: false },
96
- lidColor: [0.015, 0.012, 0.01],
97
- pupilSize: [0.2, 0.55], // (about 0.25-0.3 of the iris in daylight, the photos; ~0.5 measured in the harness light)
98
- };
99
- // cubs (4-6 months): amber-brown, duller than an adult's (blue-grey until ~3 months, amber by the end of the first year;
100
- // cub_lying1: amber-brown; a grey-blue iris read as a doll's eye)
101
- // (a cub's iris fills more of its opening, cub_Alert_cub_*, cub_Krueger_lion_cub: the dark eyeball round a
102
- // small iris read as dark bluish rings, eye make-up or bruises, in the showcase's sky light)
103
- const CUB_EYE_SPEC = { ...EYE, irisR: EYE.irisR * 1.14 };
104
- export const CUB_EYE = {
105
- ...EYE_LOOK,
106
- sclera: { color: [0.26, 0.17, 0.1], visible: false },
107
- // (the upper lid that covers the iris's top in a cub's bigger opening: tawny furred skin with the dark margin at its edge; black, it
108
- // reflected the sky as a dark blue band over the iris)
109
- lidColor: [0.18, 0.1, 0.045],
110
- iris: { inner: [0.22, 0.13, 0.05], mid: [0.38, 0.24, 0.09], hi: [0.52, 0.36, 0.16], outer: [0.1, 0.06, 0.025] },
111
- };
@@ -1,87 +0,0 @@
1
- // Lion motion data for the quadruped engine (schema: src/core/motion/quadruped.js).
2
- // Numbers are for the reference individual (params.size = 1, withers ~1.07 m); the engine scales them
3
- // by dynamic similarity for cubs and big males.
4
- //
5
- // Gaits: a slow, heavy lateral-sequence walk (0.8-1.6 m/s, 0.6-0.8 Hz,
6
- // duty 0.72-0.64, [LF .27, RF .77, LH 0, RH .5]), head carried low; a trot that lions rarely use
7
- // (2-4 m/s, 1.3-1.7 Hz, duty 0.46-0.4: a narrow band between walk and gallop); the transverse gallop
8
- // (4.5-8 m/s, 1.8-2.2 Hz, duty 0.36-0.3) and the rotary gallop of the charge (8-16 m/s, 2.2-2.6 Hz,
9
- // duty 0.3-0.22, LH-RH-RF-LF); top speed ~14-16 m/s in bursts (98th percentile 13.9 m/s, Wilson et
10
- // al. 2018), hard acceleration and even harder braking.
11
- import { lionHooks } 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: lionHooks,
17
- maxSpeed: 16,
18
- accel: [6, 9.5],
19
- decel: 13,
20
- // a heavy cat turns slowly and wide: ~50 deg/s at the walk, ~0.7 rad/s at a 7 m/s gallop (10 m radius,
21
- // a ~23 deg lean at speed),
22
- // wider at the charge (88 deg/s at the walk and a 5 m gallop radius read as a swinging rod)
23
- turnRate: 1.1,
24
- latAccelMax: 5,
25
- gears: { walk: 1.2, trot: 2.9, gallop: 7, sprint: 14 },
26
- gallopBlend: [4.2, 8],
27
- gaits: [
28
- G('walk', 0.0, 0.62, 0.72, [0.27, 0.77, 0.0, 0.5], { liftF: 0.075, liftH: 0.06, bobF: 0.008, bobH: 0.008, flex: 0.0, lat: 0.05, fold: 1.0, heel: 35, tail: 0, drop: 0.0, width: 0.95 }),
29
- G('walk', 1.5, 0.82, 0.64, [0.27, 0.77, 0.0, 0.5], { liftF: 0.1, liftH: 0.075, bobF: 0.014, bobH: 0.012, flex: 0.0, lat: 0.05, fold: 1.2, heel: 42, tail: 0.1, drop: 0.0, width: 0.9 }),
30
- G('trot', 2.1, 1.35, 0.46, [0.5, 0.02, 0.0, 0.5], { liftF: 0.13, liftH: 0.11, bobF: 0.025, bobH: 0.025, flex: 0.02, lat: 0.015, fold: 1.45, heel: 50, tail: 0.3, drop: 0.01, width: 0.95 }),
31
- G('trot', 3.6, 1.6, 0.4, [0.5, 0.02, 0.0, 0.5], { liftF: 0.15, liftH: 0.13, bobF: 0.03, bobH: 0.03, flex: 0.03, lat: 0.01, fold: 1.55, heel: 56, tail: 0.4, drop: 0.015, width: 0.95 }),
32
- G('gallop', 4.8, 1.85, 0.36, [0.46, 0.58, 0.0, 0.12], { liftF: 0.2, liftH: 0.18, bobF: 0.03, bobH: 0.045, flex: 0.22, lat: 0, fold: 1.75, heel: 62, tail: 0.6, drop: 0.03, width: 0.9 }),
33
- // (transverse up to 7.5 m/s, rotary from 9.5: in between the leads swap, and the 7 m/s gear read both
34
- // forefeet landing together, a half-bound)
35
- G('gallop', 7.5, 2.1, 0.32, [0.46, 0.58, 0.0, 0.12], { liftF: 0.235, liftH: 0.215, bobF: 0.033, bobH: 0.055, flex: 0.3, lat: 0, fold: 1.85, heel: 66, tail: 0.75, drop: 0.035, width: 0.95 }),
36
- G('gallop', 9.5, 2.25, 0.29, [0.58, 0.46, 0.0, 0.12], { liftF: 0.25, liftH: 0.23, bobF: 0.035, bobH: 0.06, flex: 0.34, lat: 0, fold: 1.9, heel: 68, tail: 0.8, drop: 0.04, width: 1 }),
37
- G('gallop', 16, 2.6, 0.23, [0.58, 0.46, 0.0, 0.12], { liftF: 0.3, liftH: 0.28, bobF: 0.04, bobH: 0.07, flex: 0.44, lat: 0, fold: 2.0, heel: 72, tail: 0.95, drop: 0.07, width: 1 }),
38
- ],
39
- feet: {
40
- front: { type: 'digitigrade', curl: 55 },
41
- hind: { type: 'digitigrade', curl: 65 },
42
- },
43
- stance: { width: 1, gallopWidth: 0.6, sprawl: 0, crouch: 0.03 }, // (a tall walk on straight legs: 0.15 walked crouched)
44
- // torso cross-sections (bind, reference size): centre height, half height, half width (from the mesh)
45
- body: {
46
- chest: { y: 0.745, hh: 0.28, hw: 0.185 },
47
- pelvis: { y: 0.79, hh: 0.25, hw: 0.18 }, // incl. the thigh muscles a lion lying on its side rests on
48
- rump: { z: -0.765, y: 0.81, hh: 0.17, hw: 0.165 },
49
- back: 0.13,
50
- },
51
- head: {
52
- // [speed, raise (m), reach (m), pitch (rad, + = nose down)]: standing head at about withers
53
- // height; the relaxed walk carries it low (crown below the withers, nose ~30 deg down) and the
54
- // charge stretches it forward in line with the spine
55
- carriage: [[0, 0.02, 0.0, -0.06], [1.0, -0.075, 0.04, 0.27], [2.4, -0.08, 0.05, 0.24], [4.5, -0.085, 0.07, 0.2], [9, -0.1, 0.09, 0.16]],
56
- stab: [[0, 0], [0.9, 0.25], [1.8, 0.3], [4.5, 0.34], [9, 0.6]],
57
- neckBend: 30, neckPivot: 0.4, yaw: 0.85, pitchUp: 0.45, pitchDown: 0.6,
58
- },
59
- tail: {
60
- // [speed, pitch per segment from horizontal (deg), base -> tip]: J-hang with the tuft curled up at
61
- // rest and in the walk; lifted into a shallow curve in the gallop
62
- carriage: [
63
- [0.0, [-40, -62, -74, -80, -82, -80, -72, -54, -24, 12]],
64
- [1.2, [-36, -58, -71, -77, -79, -76, -66, -46, -16, 16]],
65
- [3.0, [-24, -38, -46, -50, -50, -46, -38, -24, -6, 12]],
66
- [6.0, [-16, -20, -20, -18, -14, -9, -3, 4, 10, 16]],
67
- [12, [-10, -10, -8, -6, -3, 0, 3, 6, 9, 12]],
68
- ],
69
- stiffness: 0.9, sway: 6, flick: 1, wag: 0, swish: 0, curl: 0,
70
- balance: 0.6, // counterweight in turns and speed changes: the tuft lags and overshoots
71
- radius: [0.055, 0.045], // (coat and the tuft included)
72
- },
73
- ears: { rest: [0, 0], mobility: 0.6, speedFlatten: 0.45, twitch: 1, prick: 0.3 },
74
- breath: { rate: 0.25, amp: 0.012, pant: true, pantRate: 2.2, pantAmp: 0.045, heatSpeed: 7 },
75
- actions: {
76
- attack: { style: 'pounce' }, // replaced by the species action (stalk, charge, pounce, neck bite): behaviour.js
77
- eat: { style: 'tear', dropF: 0.45, dropH: 0.5, ahead: 0.75, pitch: 0.85 }, // (the lion's own eat lies down: behaviour.js)
78
- drink: { dropF: 0.72, dropH: 0.35, ahead: 0.7, pitch: 0.9 }, // crouched at the edge, elbows out, lapping
79
- jump: { height: 1.2, distance: 3.6 },
80
- sit: {},
81
- lie: { dropF: 0.93, dropH: 0.97 },
82
- // sphinx: forelegs stretched forward along the ground (paws ~0.7 leg lengths ahead of the shoulder;
83
- // the thick forearm lies on the ground instead of folding into it)
84
- fold: { front: { z: 0.03, k: -1.45, beta: 0 } },
85
- sleep: { style: 'lateral' }, // flat on one flank, legs out
86
- },
87
- };
@@ -1,106 +0,0 @@
1
- // Meshing plan: body at 8.1 mm (the cheetah's 5.4 mm scaled to the lion's size), head at 4.2 mm
2
- // (overlapping across the upper neck and cross-faded), eyelid patches at 1.5 mm, and the lower jaw
3
- // as its own surface so the mouth can open.
4
- import { lionJoints, HEAD_O, fe } from './rig.js';
5
- import { EYE } from './sculpt.js';
6
- import { eyeFrameOf } from '../../core/sdf/eyeSocket.js';
7
- import { lerp, norm, sub, smoothstep } from '../../core/math/vec.js';
8
-
9
- // the neck cut is fixed in reference space (joints of the reference individual)
10
- const J0 = lionJoints();
11
- export const NECK_CUT = (() => {
12
- const d = norm(sub(J0.occiput, J0.neckMid));
13
- const c = lerp(J0.neckMid, J0.occiput, 0.95);
14
- return { c, d, band: 0.018 };
15
- })();
16
- 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];
17
-
18
- // A maned head: the head surface is the part in front of the neck cut AND inside a flattened ellipsoid
19
- // round the face, or round an ear: the outer mane ruff stays on the (coarser) body surface, so the cut
20
- // between the two surfaces never runs through the long hair far from the neck axis, where a bent neck
21
- // opened it. The ellipsoid term is a pseudo-distance (the scaled radius divided by its gradient), so the
22
- // cross-fade band is as wide in metres all round it (its gradient was up to 1.5: the band shrank to 12 mm
23
- // on the sides, less than a coarse cell, and the cut came out on the visible side of the fade).
24
- // A maneless head (lioness, cub) is cut at the neck alone: the ellipsoid crossed the nape at a grazing
25
- // angle (a 28 cm crack at the crowd tier) and cut the ears off the head surface.
26
- const HC = [HEAD_O[0], HEAD_O[1] + 0.01, HEAD_O[2] + 0.03], HR = 0.29;
27
- function faceEll(x, y, z) {
28
- const sx = 1.5, sy = y < HC[1] ? 1.45 : 1, sz = z < HC[2] ? 1.3 : 1;
29
- const dx = (x - HC[0]) * sx, dy = (y - HC[1]) * sy, dz = (z - HC[2]) * sz;
30
- const r = Math.hypot(dx, dy, dz) || 1e-9;
31
- return ((HR - r) * r) / (Math.hypot(dx * sx, dy * sy, dz * sz) || 1e-9);
32
- }
33
- // the ears (a capsule round the pinna standing out of the mane, from above its buried base to beyond the
34
- // tip) are head surface in a mane too; kept tight so the fine head mesh does not spread over the mane skin
35
- // round the ears, which folds when the neck bends
36
- const EAR_R = 0.05, EAR_T0 = 0.3;
37
- const EARS = [1, -1].map((s) => {
38
- const a = [J0.earBaseL[0] * s, J0.earBaseL[1], J0.earBaseL[2]], t = [J0.earTipL[0] * s, J0.earTipL[1], J0.earTipL[2]];
39
- return { a, d: sub(t, a) };
40
- });
41
- function earS(x, y, z) {
42
- let best = -1e9;
43
- for (const { a, d } of EARS) {
44
- const px = x - a[0], py = y - a[1], pz = z - a[2];
45
- const t = Math.max(EAR_T0, Math.min(1.15, (px * d[0] + py * d[1] + pz * d[2]) / (d[0] * d[0] + d[1] * d[1] + d[2] * d[2])));
46
- best = Math.max(best, EAR_R - Math.hypot(px - d[0] * t, py - d[1] * t, pz - d[2] * t));
47
- }
48
- return best;
49
- }
50
- const splitMane = (x, y, z) => Math.min(neckS(x, y, z), Math.max(faceEll(x, y, z), earS(x, y, z)));
51
- // the split for an individual (> 0 head surface, < 0 body)
52
- export const splitFor = (params) => ((params && params.mane > 0) ? splitMane : neckS);
53
-
54
- export const EYE_CENTRES = [1, -1].map((s) => eyeFrameOf(EYE, HEAD_O, s).c);
55
- const PATCH = { R: 0.039, B: 0.006, h: 0.0015 }; // (R - B holds the aperture rim at the skin, 31.6 mm)
56
- // the nose leather (its edge, the comma nostrils) meshed finer as well: at the medium tier's 8.4 mm face
57
- // cells its lower edge and the nostrils were jagged dark notches
58
- // (the whole leather, its outline and the short fur round it inside the patch's core, R - B: with the leather's top corners in
59
- // the cross-fade band the coarse face mesh's colours showed through there as ragged dark-red patches)
60
- export const NOSE_PATCH = { c: fe(0, -0.98, 1.03), R: 0.072, B: 0.008, h: 0.0022 };
61
- export function eyePatchWeight(x, y, z) {
62
- let w = 0;
63
- for (const c of EYE_CENTRES) w = Math.max(w, 1 - smoothstep(PATCH.R - PATCH.B, PATCH.R + PATCH.B, Math.hypot(x - c[0], y - c[1], z - c[2])));
64
- const n = NOSE_PATCH;
65
- return Math.max(w, 1 - smoothstep(n.R - n.B, n.R + n.B, Math.hypot(x - n.c[0], y - n.c[1], z - n.c[2])));
66
- }
67
-
68
- export function lionRegions(rig, params, Q) {
69
- // (the medium tier's body 5 % coarser: its eyelid and nose patches take ~2k of its 32k vertices)
70
- // (a maned body 5 % coarser at a full mane: the mane's locks add surface; a lioness's cells unchanged)
71
- const r = Q.res, hBody = 0.0081 * r * (Math.abs(r - 2) < 0.01 ? 1.05 : 1) * (1 + 0.05 * (params.mane || 0));
72
- const splitS = splitFor(params);
73
- // The mesher keeps whole cells by their centre, so a cut's boundary vertices lie up to ~0.85 of a
74
- // cell either side of it: the band must be over a body cell wide (1.2 cells), or at the medium and low tiers
75
- // the body's cut came out where its fade still shows (open edges on the visible side).
76
- const B = Math.max(NECK_CUT.band, 1.2 * hBody);
77
- // Without fur shells (crowd tier) the coarse body surface and the head surface do not coincide in
78
- // the overlap band: each surface stays visible past the cut by D there (see the cheetah).
79
- const D = Q.shells > 0 ? 0 : 0.6 * 0.0076 * r;
80
- // (patches at medium too: Safari on a Mac and phones show medium; the eyes' lid margins and the nose)
81
- const patches = r <= 2.01 ? [...EYE_CENTRES.map((c) => ({ c, R: PATCH.R, B: PATCH.B, h: PATCH.h * Math.max(1, r) })), { ...NOSE_PATCH, h: NOSE_PATCH.h * Math.max(1, r) }] : [];
82
- const zN = rig.J.nose[2] + 0.04;
83
- return {
84
- jobs: [
85
- [{ name: 'body', part: 'body', bmin: [-0.36, -0.03, -1.5], bmax: [0.36, 1.3, 0.95], h: hBody, F: 4, clip: (x, y, z) => splitS(x, y, z) < B + D }],
86
- [
87
- { name: 'head', part: 'body', bmin: [-0.3, 0.6, 0.45], bmax: [0.3, 1.27, zN], h: 0.0042 * r, F: 6, clip: (x, y, z) => splitS(x, y, z) > -B - D, patches },
88
- // (the jaw is small and sits under the overhanging upper lip, where its dark lip band meets the white
89
- // chin: at 8 mm cells that edge was a black-and-white saw-tooth, a grimace)
90
- { name: 'jaw', part: 'jaw', bmin: [-0.12, 0.77, 0.69], bmax: [0.12, 0.94, zN], h: 0.004 * (r <= 2.01 ? Math.min(r, 1.5) : 0.75 * r), F: 6, rigidBone: 'jaw' },
91
- // the upper canines (up to the medium tier: at low and crowd nobody sees into a mouth)
92
- ...(r <= 2.01 ? [{ name: 'canine', part: 'canine', bmin: [-0.07, 0.785, 0.9], bmax: [0.07, 0.875, 0.98], h: 0.0019 * Math.pow(r, 0.8), F: 6, rigidBone: 'head' }] : []),
93
- ],
94
- ],
95
- fade(x, y, z, name, patch) {
96
- const sN = splitS(x, y, z);
97
- if (name === 'body') return 1 - smoothstep(-B, B, sN - D);
98
- if (name === 'head') {
99
- let f = smoothstep(-B, B, sN + D);
100
- if (patches.length) { const ew = eyePatchWeight(x, y, z); f *= patch ? ew : 1 - ew; }
101
- return f;
102
- }
103
- return 1;
104
- },
105
- };
106
- }
@@ -1,110 +0,0 @@
1
- // Lion skeleton in bind pose (metres). Forward = +Z, up = +Y, the animal's left = +X.
2
- //
3
- // Reference individual: an average adult between the sexes: withers ~1.07 m over the
4
- // coat, head-body ~1.8 m along the curve, tail ~0.85 m (plus the tuft), skull ~0.32 m.
5
- // Limb segments (museum long bones, x ~0.95 for the reference individual):
6
- // scapula 0.29, humerus 0.32, radius 0.28, metacarpus 0.10, fore digits 0.075; femur 0.37,
7
- // tibia 0.32, tarsus + metatarsus 0.17, hind digits 0.075. Standing angles from side photos
8
- // (side_walk_male3, side_male1): scapula ~60 deg, elbow close under the front of the chest, radius
9
- // near vertical, hock ~0.2 x withers height, metatarsus nearly vertical. Compared with the cheetah the
10
- // lion is shorter in the leg (elbow ~0.39 x withers height vs 0.46), deeper in the chest (brisket at
11
- // ~0.42 x withers height), shorter in the back relative to its height and much heavier in the head.
12
- // The head is modelled level in its own frame (HEAD_O); its carriage comes from the motion data.
13
- import { buildRig } from '../../core/rig/rig.js';
14
- import { quadrupedBones, quadrupedLimbs, tailChain } from '../../core/rig/quadruped.js';
15
- import { WHISKER_BASE_F, WHISKER_TIP_F } from './whiskers.js';
16
-
17
- export const TAIL_SEGS = 10;
18
- export const SH = 1.07; // reference withers height (top of the coat)
19
- export const HEAD_O = [0, 0.95, 0.8]; // head-local origin (mid cranium, between eyes and ears)
20
- export const HS = 1.15; // head-local scale: landmarks below are for a 0.3 m head (x1.15: ~0.35 m over the skin)
21
- export const hl = (v) => [HEAD_O[0] + v[0] * HS, HEAD_O[1] + v[1] * HS, HEAD_O[2] + v[2] * HS];
22
- // Face units (sculpt, rig and coat share them): landmarks measured on the photos are given in units of
23
- // the eye separation E (0.112 head units = 0.129 m on the reference head) from the eye midpoint, in the
24
- // head frame (gaze +Z); X is in units of 0.1 head units times the head width hw (1.12 for a lioness:
25
- // X = 0.5 is the eye), so a male's broader face widens with hw.
26
- export const FACE = { E: 0.112, X: 0.1, EY: 0.047, EZ: 0.05 };
27
- export const fe = (X, Y, Z, hw = 1.12) => hl([X * FACE.X * hw, FACE.EY + Y * FACE.E, FACE.EZ + Z * FACE.E]);
28
- // head-local (x already divided by hw) -> face units
29
- export const toFace = (h) => [h[0] / FACE.X, (h[1] - FACE.EY) / FACE.E, (h[2] - FACE.EZ) / FACE.E];
30
-
31
- export function lionJoints() {
32
- const J = {
33
- nose: fe(0, -1.0, 1.2),
34
- occiput: hl([0, 0.02, -0.135]),
35
- neckMid: [0, 0.949, 0.575],
36
- neckBase: [0, 0.915, 0.4],
37
- chestMid: [0, 0.895, 0.22],
38
- thoraxRear: [0, 0.915, -0.03],
39
- lumbarMid: [0, 0.925, -0.28],
40
- lumbosacral: [0, 0.915, -0.52],
41
- tailBase: [0, 0.915, -0.765], // (high on the croup: the croup curves into the tail, side_walk_male3)
42
- scapTopL: [0.065, 0.93, 0.29],
43
- // (elbow ~0.43 x withers, brisket ~0.44: the legs read short for the chest with the elbow at 0.39;
44
- // the humerus keeps its length, the forearm is longer)
45
- shoulderL: [0.105, 0.7, 0.43],
46
- elbowL: [0.1, 0.46, 0.225],
47
- wristL: [0.08, 0.14, 0.27],
48
- mcpL: [0.078, 0.05, 0.315],
49
- ftoeL: [0.078, 0.024, 0.39],
50
- hipL: [0.09, 0.8, -0.6],
51
- kneeL: [0.11, 0.46, -0.45],
52
- hockL: [0.09, 0.215, -0.66],
53
- mtpL: [0.086, 0.05, -0.62],
54
- htoeL: [0.086, 0.024, -0.548],
55
- jawHinge: hl([0, -0.062, -0.04]),
56
- jawTip: fe(0, -1.42, 0.78),
57
- // (set out on the side of the crown, so the pinna's outer edge carries on the head's outline down to ~0.3 E above the
58
- // eye line (face_female1); further in, the ears stood on top of the dome with a notch below them)
59
- // (the tip ~1.05-1.15 E out and ~1.2 E above the eye line, face_female1 / face_male1: at 1.3-1.4 E out the ears stood on
60
- // the corners of the head like a mouse's)
61
- earBaseL: hl([0.106, 0.1, -0.068]),
62
- // (lower, ~0.25 E: the pinnae stood 1.4 E above the eye line against the photos' 1.1-1.15 with their fur
63
- // (ffront_*, fprof_*, f34_*), tall round ears on a dome, a plush toy's)
64
- earTipL: hl([0.152, 0.192, -0.095]), // (the pinna ~9 cm above the skull's side, a little lower than wide at the base)
65
- // the whisker fan's bone (whiskers.js): from the middle of the pad out to the side
66
- whiskerBaseL: fe(...WHISKER_BASE_F),
67
- whiskerTipL: fe(...WHISKER_TIP_F),
68
- // the upper lip's lower edge from the canine back to the corner of the mouth: drawn back and up with the gape
69
- // (behaviour.js pose hook), so a roaring or yawning lion bares its upper canines
70
- lipBaseL: fe(0.42, -1.4, 0.3),
71
- lipTipL: fe(0.52, -1.4, -0.1),
72
- };
73
- // bind tail held out behind and down (clear of the thighs and buttocks so the SDF does not merge
74
- // them); the relaxed J-hang with the tuft curled up comes from the motion data
75
- tailChain(J, 'tailBase', [-22, -34, -44, -51, -56, -58, -58, -55, -48, -38], [0.088, 0.088, 0.087, 0.086, 0.085, 0.084, 0.083, 0.082, 0.081, 0.08]);
76
- return J;
77
- }
78
-
79
- export function lionRig() {
80
- const J = lionJoints();
81
- return buildRig({
82
- joints: J,
83
- unit: SH / 0.76,
84
- headOrigin: HEAD_O,
85
- // (+ a whisker bone per side: the whisker fans ride on it, whiskers.js)
86
- bones: quadrupedBones({ tailSegs: TAIL_SEGS, ears: true, jaw: true, extra: [['whisker{S}', 'whiskerBase{S}', 'whiskerTip{S}', 'head', { region: 'head', group: 'whisk{S}' }], ['lip{S}', 'lipBase{S}', 'lipTip{S}', 'head', { region: 'head', group: 'lip{S}' }]] }),
87
- axial: {
88
- points: ['nose', 'occiput', 'neckMid', 'neckBase', 'chestMid', 'thoraxRear', 'lumbarMid', 'lumbosacral', 'tailBase', ...Array.from({ length: TAIL_SEGS }, (_, i) => 'tail' + (i + 1))],
89
- bones: ['head', 'neck2', 'neck1', 'chest', 'spine3', 'spine2', 'spine1', 'pelvis', ...Array.from({ length: TAIL_SEGS }, (_, i) => 'tail' + i)],
90
- // the skull's influence reaches back into the nape, the mane and the throat (3rd value: wider
91
- // with the skin's distance from the axis under the throat)
92
- blend: { 1: [-0.09, 0.2, 2.6] },
93
- bodyTail: 0, // the tail hangs behind the buttocks: their skin blends into it only at the root
94
- },
95
- limbs: quadrupedLimbs({
96
- front: { tCore: 0.55, aCore: 0.05, aBody: -0.12, midX: 0.0 },
97
- hind: { tCore: 0.52, aCore: 0.035, aBody: -0.11, midX: 0.008 },
98
- }),
99
- appendages: [
100
- // (a wide hand-over from the pinna to the skull: the broad ear base stretched > 3x round its rim
101
- // when the ear flattened or swivelled)
102
- { group: 'earL', bone: 'earL', blend: [-0.008, 0.022] },
103
- { group: 'earR', bone: 'earR', blend: [-0.008, 0.022] },
104
- // the upper lip's edge (sculpt.js 'lipedge', inside the lip): full weight within ~6 mm of it, none beyond ~3 cm
105
- { group: 'lipL', bone: 'lipL', blend: [-0.0213, -0.0043] },
106
- { group: 'lipR', bone: 'lipR', blend: [-0.0213, -0.0043] },
107
- ],
108
- webTags: ['flankfold', 'thighfront', 'scapmuscle', 'elbowtuft'],
109
- });
110
- }