@needle-tools/three-mesh-effects 0.1.0-alpha → 0.1.0-alpha.0

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 (86) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +94 -88
  3. package/build/deformation-runtime.js.map +1 -1
  4. package/build/impostor-runtime-needle-engine.js.map +1 -1
  5. package/build/impostor-runtime.js.map +1 -1
  6. package/build/internal/deformation/cloth-surface.js.map +1 -1
  7. package/build/internal/deformation/fur-surface.js.map +1 -1
  8. package/build/internal/deformation/ik-constraints.js.map +1 -1
  9. package/build/internal/deformation/joints-json.js.map +1 -1
  10. package/build/internal/deformation/limits.js.map +1 -1
  11. package/build/internal/deformation/motion-settings.js.map +1 -1
  12. package/build/internal/deformation/pin-cloth.js.map +1 -1
  13. package/build/internal/deformation/pin-ik.js.map +1 -1
  14. package/build/internal/deformation/pin-types.js.map +1 -1
  15. package/build/internal/deformation/pin-wiggle.js.map +1 -1
  16. package/build/internal/deformation/pose-slots.js.map +1 -1
  17. package/build/internal/deformation/pose-timeline.js.map +1 -1
  18. package/build/internal/deformation/rig-drivers.js.map +1 -1
  19. package/build/internal/deformation/rig-extension.js.map +1 -1
  20. package/build/internal/deformation/rig-runtime.js.map +1 -1
  21. package/build/internal/deformation/wind.js.map +1 -1
  22. package/build/internal/impostor/impostor-metadata.js.map +1 -1
  23. package/build/internal/impostor/impostor-node-material.js.map +1 -1
  24. package/build/internal/impostor/impostor-runtime-support.js.map +1 -1
  25. package/build/internal/impostor/octahedral.js.map +1 -1
  26. package/build/internal/pixel-impostor/pixel-impostor-display.js.map +1 -1
  27. package/build/internal/pixel-impostor/pixel-impostor-metadata.js.map +1 -1
  28. package/build/internal/pixel-impostor/pixel-impostor-runtime.js.map +1 -1
  29. package/build/internal/rendering/skin-projection.js +52 -52
  30. package/build/internal/rendering/skin-projection.js.map +2 -2
  31. package/build/internal/rendering/surface-query.js +52 -52
  32. package/build/internal/rendering/surface-query.js.map +2 -2
  33. package/build/internal/rendering/wireframe.js.map +1 -1
  34. package/build/internal/rendering/wrap-preview-settings.js.map +1 -1
  35. package/build/internal/rendering/wrap-preview.js +52 -52
  36. package/build/internal/rendering/wrap-preview.js.map +2 -2
  37. package/build/internal/rendering/wrap-skin.js +52 -52
  38. package/build/internal/rendering/wrap-skin.js.map +2 -2
  39. package/build/pixel-impostor-runtime.js.map +1 -1
  40. package/build/wrap-effects.js +52 -52
  41. package/build/wrap-effects.js.map +2 -2
  42. package/package.json +107 -94
  43. package/src/deformation/cloth-surface.ts +223 -223
  44. package/src/deformation/fur-surface.ts +129 -129
  45. package/src/deformation/ik-constraints.ts +37 -37
  46. package/src/deformation/joints-json.ts +94 -94
  47. package/src/deformation/limits.ts +25 -25
  48. package/src/deformation/motion-settings.ts +9 -9
  49. package/src/deformation/pin-cloth.ts +149 -149
  50. package/src/deformation/pin-ik.ts +582 -582
  51. package/src/deformation/pin-types.ts +22 -22
  52. package/src/deformation/pin-wiggle.ts +119 -119
  53. package/src/deformation/pose-slots.ts +106 -106
  54. package/src/deformation/pose-timeline.ts +242 -242
  55. package/src/deformation/rig-drivers.ts +32 -32
  56. package/src/deformation/rig-extension.ts +87 -87
  57. package/src/deformation/rig-runtime.ts +416 -416
  58. package/src/deformation/wind.ts +36 -36
  59. package/src/impostor/impostor-metadata.js +137 -137
  60. package/src/impostor/impostor-node-material.js +1581 -1581
  61. package/src/impostor/impostor-runtime-support.js +139 -139
  62. package/src/impostor/octahedral.js +280 -280
  63. package/src/pixel-impostor/pixel-impostor-display.js +794 -794
  64. package/src/pixel-impostor/pixel-impostor-metadata.js +74 -74
  65. package/src/pixel-impostor/pixel-impostor-runtime.js +78 -78
  66. package/src/public/deformation-runtime.ts +3 -3
  67. package/src/public/impostor-runtime-needle-engine.js +56 -56
  68. package/src/public/impostor-runtime.js +21 -21
  69. package/src/public/pixel-impostor-runtime.js +5 -5
  70. package/src/public/wrap-effects.js +21 -21
  71. package/src/rendering/skin-projection.js +113 -113
  72. package/src/rendering/surface-query.js +88 -88
  73. package/src/rendering/wireframe.js +115 -115
  74. package/src/rendering/wrap-preview-settings.js +123 -123
  75. package/src/rendering/wrap-preview.js +645 -645
  76. package/src/rendering/wrap-skin.js +109 -109
  77. package/build/internal/public/deformation-runtime.js +0 -2143
  78. package/build/internal/public/deformation-runtime.js.map +0 -7
  79. package/build/internal/public/impostor-runtime-needle-engine.js +0 -42
  80. package/build/internal/public/impostor-runtime-needle-engine.js.map +0 -7
  81. package/build/internal/public/impostor-runtime.js +0 -1333
  82. package/build/internal/public/impostor-runtime.js.map +0 -7
  83. package/build/internal/public/pixel-impostor-runtime.js +0 -876
  84. package/build/internal/public/pixel-impostor-runtime.js.map +0 -7
  85. package/build/internal/public/wrap-effects.js +0 -5640
  86. package/build/internal/public/wrap-effects.js.map +0 -7
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/deformation/wind.ts"],
4
- "sourcesContent": ["import { Vector3 } from 'three';\r\n\r\nexport const MAX_WIND_STRENGTH = 4;\r\n\r\n/** A single weather control drives pin motion and surface pressure. Sparse pin\r\n * loads stay bounded; fabric pressure has room to grow through a storm. */\r\nexport function windProfile(strength: number) {\r\n const level = Math.max(0, Math.min(MAX_WIND_STRENGTH, strength));\r\n const label = level === 0 ? 'Off' : level < .75 ? 'Breeze' : level < 1.5 ? 'Windy' : level < 2.5 ? 'Strong wind' : level < 3.3 ? 'Gale' : 'Storm';\r\n return {\r\n label,\r\n load: 30 * level * level / (.8 + level * level),\r\n surfaceLoad: 4 * level * level,\r\n gust: .14 + .12 * level,\r\n crosswind: .05 + .07 * level,\r\n gustRate: .42 + .12 * level,\r\n };\r\n}\r\n\r\n/** Deterministic scene-local prevailing wind with slow gusts and spatially\r\n * varying eddies. Force is an acceleration scaled to the model's size, so a\r\n * tiny prop and a large character respond comparably at the same setting. */\r\nexport function windAcceleration(seconds: number, strength: number, scale: number, position: readonly number[]) {\r\n if (strength <= 0) return new Vector3();\r\n const size = Math.max(1e-4, scale);\r\n const profile = windProfile(strength);\r\n // Advect the gust bands along +X. Nearby controls see related wind, while\r\n // their phase delay keeps a large sheet or branch hierarchy from moving as\r\n // one perfectly synchronized rigid object.\r\n const along = position[0] / size, lateral = (position[1] * .67 + position[2] * .33) / size;\r\n const slow = seconds * profile.gustRate - along * .55;\r\n const fast = seconds * (profile.gustRate * 2.7) - along * 1.4 + lateral * .4;\r\n const gust = Math.max(.2, 1 + profile.gust * (.7 * Math.sin(slow) + .3 * Math.sin(fast + 1.3)));\r\n const cross = profile.crosswind * (.65 * Math.sin(fast + lateral) + .35 * Math.sin(slow * .73 - lateral * .6));\r\n return new Vector3(1, cross * .35, cross).normalize().multiplyScalar(profile.load * size * gust);\r\n}\r\n"],
4
+ "sourcesContent": ["import { Vector3 } from 'three';\n\nexport const MAX_WIND_STRENGTH = 4;\n\n/** A single weather control drives pin motion and surface pressure. Sparse pin\n * loads stay bounded; fabric pressure has room to grow through a storm. */\nexport function windProfile(strength: number) {\n const level = Math.max(0, Math.min(MAX_WIND_STRENGTH, strength));\n const label = level === 0 ? 'Off' : level < .75 ? 'Breeze' : level < 1.5 ? 'Windy' : level < 2.5 ? 'Strong wind' : level < 3.3 ? 'Gale' : 'Storm';\n return {\n label,\n load: 30 * level * level / (.8 + level * level),\n surfaceLoad: 4 * level * level,\n gust: .14 + .12 * level,\n crosswind: .05 + .07 * level,\n gustRate: .42 + .12 * level,\n };\n}\n\n/** Deterministic scene-local prevailing wind with slow gusts and spatially\n * varying eddies. Force is an acceleration scaled to the model's size, so a\n * tiny prop and a large character respond comparably at the same setting. */\nexport function windAcceleration(seconds: number, strength: number, scale: number, position: readonly number[]) {\n if (strength <= 0) return new Vector3();\n const size = Math.max(1e-4, scale);\n const profile = windProfile(strength);\n // Advect the gust bands along +X. Nearby controls see related wind, while\n // their phase delay keeps a large sheet or branch hierarchy from moving as\n // one perfectly synchronized rigid object.\n const along = position[0] / size, lateral = (position[1] * .67 + position[2] * .33) / size;\n const slow = seconds * profile.gustRate - along * .55;\n const fast = seconds * (profile.gustRate * 2.7) - along * 1.4 + lateral * .4;\n const gust = Math.max(.2, 1 + profile.gust * (.7 * Math.sin(slow) + .3 * Math.sin(fast + 1.3)));\n const cross = profile.crosswind * (.65 * Math.sin(fast + lateral) + .35 * Math.sin(slow * .73 - lateral * .6));\n return new Vector3(1, cross * .35, cross).normalize().multiplyScalar(profile.load * size * gust);\n}\n"],
5
5
  "mappings": ";;;AAAA,SAAS,eAAe;AAEjB,IAAM,oBAAoB;AAI1B,SAAS,YAAY,UAAkB;AAC5C,QAAM,QAAQ,KAAK,IAAI,GAAG,KAAK,IAAI,mBAAmB,QAAQ,CAAC;AAC/D,QAAM,QAAQ,UAAU,IAAI,QAAQ,QAAQ,OAAM,WAAW,QAAQ,MAAM,UAAU,QAAQ,MAAM,gBAAgB,QAAQ,MAAM,SAAS;AAC1I,SAAO;AAAA,IACL;AAAA,IACA,MAAM,KAAK,QAAQ,SAAS,MAAK,QAAQ;AAAA,IACzC,aAAa,IAAI,QAAQ;AAAA,IACzB,MAAM,OAAM,OAAM;AAAA,IAClB,WAAW,OAAM,OAAM;AAAA,IACvB,UAAU,OAAM,OAAM;AAAA,EACxB;AACF;AAKO,SAAS,iBAAiB,SAAiB,UAAkB,OAAe,UAA6B;AAC9G,MAAI,YAAY,EAAG,QAAO,IAAI,QAAQ;AACtC,QAAM,OAAO,KAAK,IAAI,MAAM,KAAK;AACjC,QAAM,UAAU,YAAY,QAAQ;AAIpC,QAAM,QAAQ,SAAS,CAAC,IAAI,MAAM,WAAW,SAAS,CAAC,IAAI,OAAM,SAAS,CAAC,IAAI,QAAO;AACtF,QAAM,OAAO,UAAU,QAAQ,WAAW,QAAQ;AAClD,QAAM,OAAO,WAAW,QAAQ,WAAW,OAAO,QAAQ,MAAM,UAAU;AAC1E,QAAM,OAAO,KAAK,IAAI,KAAI,IAAI,QAAQ,QAAQ,MAAK,KAAK,IAAI,IAAI,IAAI,MAAK,KAAK,IAAI,OAAO,GAAG,EAAE;AAC9F,QAAM,QAAQ,QAAQ,aAAa,OAAM,KAAK,IAAI,OAAO,OAAO,IAAI,OAAM,KAAK,IAAI,OAAO,OAAM,UAAU,GAAE;AAC5G,SAAO,IAAI,QAAQ,GAAG,QAAQ,MAAK,KAAK,EAAE,UAAU,EAAE,eAAe,QAAQ,OAAO,OAAO,IAAI;AACjG;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/impostor/impostor-metadata.js"],
4
- "sourcesContent": ["// @ts-check\r\n\r\n/** Primitive extension declaring an explicitly-bound Needle mesh impostor. */\r\nexport const NEEDLE_MESH_IMPOSTOR = 'NEEDLE_mesh_impostor';\r\n\r\n/**\r\n * @typedef {object} ImpostorDescriptor\r\n * @property {1} version\r\n * @property {'hemisphere' | 'full' | 'single'} mapping\r\n * @property {number} frames\r\n * @property {readonly [number, number, number]=} captureDirection\r\n * @property {number} frameResolution\r\n * @property {number} padding\r\n * @property {number} radius\r\n * @property {readonly [number, number, number]} boundsMin\r\n * @property {readonly [number, number, number]} boundsMax\r\n * @property {readonly [number, number, number]} center\r\n * @property {readonly number[]} viewBounds\r\n * @property {'captured-alpha+sdf-material' | 'sdf-base-alpha'} coverageEncoding\r\n * @property {number} captureAlphaCutoff\r\n * @property {number} alphaCutoff\r\n * @property {number} blendZone\r\n * @property {number} parallaxSteps\r\n * @property {boolean} depthDerivedWeights\r\n * @property {boolean} castShadow\r\n * @property {boolean} receiveShadow\r\n * @property {{occlusion: number, roughness: number, metalness: number}} material\r\n * @property {{version: 4, layout: 'compact-atlas-v4', depthEncoding: 'lossless-geometry10-rgba', materialFrameResolution: number, emissive: boolean}=} compression\r\n */\r\n\r\n/** @param {unknown} value @returns {ImpostorDescriptor | null} */\r\nexport function parseImpostorDescriptor(value) {\r\n if (!value || typeof value !== 'object') return null;\r\n const descriptor = /** @type {Partial<ImpostorDescriptor>} */ (value);\r\n if (\r\n descriptor.version !== 1\r\n || (descriptor.mapping !== 'hemisphere' && descriptor.mapping !== 'full' && descriptor.mapping !== 'single')\r\n || !isPositiveInteger(descriptor.frames)\r\n || (descriptor.mapping === 'single'\r\n ? (descriptor.frames !== 1 || !isUnitVec3(descriptor.captureDirection))\r\n : false)\r\n || !isPositiveInteger(descriptor.frameResolution)\r\n || !isNonNegativeInteger(descriptor.padding)\r\n || !isPositiveFinite(descriptor.radius)\r\n || (descriptor.compression !== undefined && (\r\n descriptor.compression.version !== 4\r\n || descriptor.compression.layout !== 'compact-atlas-v4'\r\n || descriptor.compression.depthEncoding !== 'lossless-geometry10-rgba'\r\n || !isPositiveInteger(descriptor.compression.materialFrameResolution)\r\n || typeof descriptor.compression.emissive !== 'boolean'\r\n ))\r\n || !isFiniteVec3(descriptor.boundsMin)\r\n || !isFiniteVec3(descriptor.boundsMax)\r\n || !isFiniteVec3(descriptor.center)\r\n || !Array.isArray(descriptor.viewBounds)\r\n || descriptor.viewBounds.length !== (descriptor.frames ?? 0) * (descriptor.frames ?? 0) * 4\r\n || !descriptor.viewBounds.every(Number.isFinite)\r\n || (descriptor.coverageEncoding !== 'captured-alpha+sdf-material'\r\n && descriptor.coverageEncoding !== 'sdf-base-alpha')\r\n || !isUnitInterval(descriptor.captureAlphaCutoff)\r\n || !isUnitInterval(descriptor.alphaCutoff)\r\n || !isBlendZone(descriptor.blendZone)\r\n || !isNonNegativeInteger(descriptor.parallaxSteps)\r\n || typeof descriptor.depthDerivedWeights !== 'boolean'\r\n || typeof descriptor.castShadow !== 'boolean'\r\n || typeof descriptor.receiveShadow !== 'boolean'\r\n || !descriptor.material\r\n || !isUnitInterval(descriptor.material.occlusion)\r\n || !isUnitInterval(descriptor.material.roughness)\r\n || !isUnitInterval(descriptor.material.metalness)\r\n ) return null;\r\n const valid = /** @type {ImpostorDescriptor} */ (descriptor);\r\n return {\r\n version: 1,\r\n mapping: valid.mapping,\r\n frames: valid.frames,\r\n ...(valid.mapping === 'single' ? { captureDirection: valid.captureDirection } : {}),\r\n frameResolution: valid.frameResolution,\r\n padding: valid.padding,\r\n radius: valid.radius,\r\n boundsMin: valid.boundsMin,\r\n boundsMax: valid.boundsMax,\r\n center: valid.center,\r\n viewBounds: valid.viewBounds,\r\n coverageEncoding: valid.coverageEncoding,\r\n captureAlphaCutoff: valid.captureAlphaCutoff,\r\n alphaCutoff: valid.alphaCutoff,\r\n blendZone: valid.blendZone,\r\n parallaxSteps: valid.parallaxSteps,\r\n depthDerivedWeights: valid.depthDerivedWeights,\r\n castShadow: valid.castShadow,\r\n receiveShadow: valid.receiveShadow,\r\n material: valid.material,\r\n ...(valid.compression ? { compression: valid.compression } : {}),\r\n };\r\n}\r\n\r\n/** @param {unknown} value */\r\nfunction isFiniteVec3(value) {\r\n return Array.isArray(value) && value.length === 3 && value.every(Number.isFinite);\r\n}\r\n\r\n/** @param {unknown} value */\r\nfunction isUnitVec3(value) {\r\n if (!isFiniteVec3(value)) return false;\r\n const vector = /** @type {number[]} */ (value);\r\n return Math.abs(Math.hypot(vector[0], vector[1], vector[2]) - 1) < 1e-4;\r\n}\r\n\r\n/** @param {unknown} value */\r\nfunction isPositiveInteger(value) {\r\n return Number.isInteger(value) && /** @type {number} */ (value) > 0;\r\n}\r\n\r\n/** @param {unknown} value */\r\nfunction isNonNegativeInteger(value) {\r\n return Number.isInteger(value) && /** @type {number} */ (value) >= 0;\r\n}\r\n\r\n/** @param {unknown} value */\r\nfunction isPositiveFinite(value) {\r\n return Number.isFinite(value) && /** @type {number} */ (value) > 0;\r\n}\r\n\r\n/** @param {unknown} value */\r\nfunction isUnitInterval(value) {\r\n return Number.isFinite(value)\r\n && /** @type {number} */ (value) >= 0\r\n && /** @type {number} */ (value) <= 1;\r\n}\r\n\r\n/** @param {unknown} value */\r\nfunction isBlendZone(value) {\r\n return Number.isFinite(value)\r\n && /** @type {number} */ (value) >= 0.35\r\n && /** @type {number} */ (value) <= 1;\r\n}\r\n"],
4
+ "sourcesContent": ["// @ts-check\n\n/** Primitive extension declaring an explicitly-bound Needle mesh impostor. */\nexport const NEEDLE_MESH_IMPOSTOR = 'NEEDLE_mesh_impostor';\n\n/**\n * @typedef {object} ImpostorDescriptor\n * @property {1} version\n * @property {'hemisphere' | 'full' | 'single'} mapping\n * @property {number} frames\n * @property {readonly [number, number, number]=} captureDirection\n * @property {number} frameResolution\n * @property {number} padding\n * @property {number} radius\n * @property {readonly [number, number, number]} boundsMin\n * @property {readonly [number, number, number]} boundsMax\n * @property {readonly [number, number, number]} center\n * @property {readonly number[]} viewBounds\n * @property {'captured-alpha+sdf-material' | 'sdf-base-alpha'} coverageEncoding\n * @property {number} captureAlphaCutoff\n * @property {number} alphaCutoff\n * @property {number} blendZone\n * @property {number} parallaxSteps\n * @property {boolean} depthDerivedWeights\n * @property {boolean} castShadow\n * @property {boolean} receiveShadow\n * @property {{occlusion: number, roughness: number, metalness: number}} material\n * @property {{version: 4, layout: 'compact-atlas-v4', depthEncoding: 'lossless-geometry10-rgba', materialFrameResolution: number, emissive: boolean}=} compression\n */\n\n/** @param {unknown} value @returns {ImpostorDescriptor | null} */\nexport function parseImpostorDescriptor(value) {\n if (!value || typeof value !== 'object') return null;\n const descriptor = /** @type {Partial<ImpostorDescriptor>} */ (value);\n if (\n descriptor.version !== 1\n || (descriptor.mapping !== 'hemisphere' && descriptor.mapping !== 'full' && descriptor.mapping !== 'single')\n || !isPositiveInteger(descriptor.frames)\n || (descriptor.mapping === 'single'\n ? (descriptor.frames !== 1 || !isUnitVec3(descriptor.captureDirection))\n : false)\n || !isPositiveInteger(descriptor.frameResolution)\n || !isNonNegativeInteger(descriptor.padding)\n || !isPositiveFinite(descriptor.radius)\n || (descriptor.compression !== undefined && (\n descriptor.compression.version !== 4\n || descriptor.compression.layout !== 'compact-atlas-v4'\n || descriptor.compression.depthEncoding !== 'lossless-geometry10-rgba'\n || !isPositiveInteger(descriptor.compression.materialFrameResolution)\n || typeof descriptor.compression.emissive !== 'boolean'\n ))\n || !isFiniteVec3(descriptor.boundsMin)\n || !isFiniteVec3(descriptor.boundsMax)\n || !isFiniteVec3(descriptor.center)\n || !Array.isArray(descriptor.viewBounds)\n || descriptor.viewBounds.length !== (descriptor.frames ?? 0) * (descriptor.frames ?? 0) * 4\n || !descriptor.viewBounds.every(Number.isFinite)\n || (descriptor.coverageEncoding !== 'captured-alpha+sdf-material'\n && descriptor.coverageEncoding !== 'sdf-base-alpha')\n || !isUnitInterval(descriptor.captureAlphaCutoff)\n || !isUnitInterval(descriptor.alphaCutoff)\n || !isBlendZone(descriptor.blendZone)\n || !isNonNegativeInteger(descriptor.parallaxSteps)\n || typeof descriptor.depthDerivedWeights !== 'boolean'\n || typeof descriptor.castShadow !== 'boolean'\n || typeof descriptor.receiveShadow !== 'boolean'\n || !descriptor.material\n || !isUnitInterval(descriptor.material.occlusion)\n || !isUnitInterval(descriptor.material.roughness)\n || !isUnitInterval(descriptor.material.metalness)\n ) return null;\n const valid = /** @type {ImpostorDescriptor} */ (descriptor);\n return {\n version: 1,\n mapping: valid.mapping,\n frames: valid.frames,\n ...(valid.mapping === 'single' ? { captureDirection: valid.captureDirection } : {}),\n frameResolution: valid.frameResolution,\n padding: valid.padding,\n radius: valid.radius,\n boundsMin: valid.boundsMin,\n boundsMax: valid.boundsMax,\n center: valid.center,\n viewBounds: valid.viewBounds,\n coverageEncoding: valid.coverageEncoding,\n captureAlphaCutoff: valid.captureAlphaCutoff,\n alphaCutoff: valid.alphaCutoff,\n blendZone: valid.blendZone,\n parallaxSteps: valid.parallaxSteps,\n depthDerivedWeights: valid.depthDerivedWeights,\n castShadow: valid.castShadow,\n receiveShadow: valid.receiveShadow,\n material: valid.material,\n ...(valid.compression ? { compression: valid.compression } : {}),\n };\n}\n\n/** @param {unknown} value */\nfunction isFiniteVec3(value) {\n return Array.isArray(value) && value.length === 3 && value.every(Number.isFinite);\n}\n\n/** @param {unknown} value */\nfunction isUnitVec3(value) {\n if (!isFiniteVec3(value)) return false;\n const vector = /** @type {number[]} */ (value);\n return Math.abs(Math.hypot(vector[0], vector[1], vector[2]) - 1) < 1e-4;\n}\n\n/** @param {unknown} value */\nfunction isPositiveInteger(value) {\n return Number.isInteger(value) && /** @type {number} */ (value) > 0;\n}\n\n/** @param {unknown} value */\nfunction isNonNegativeInteger(value) {\n return Number.isInteger(value) && /** @type {number} */ (value) >= 0;\n}\n\n/** @param {unknown} value */\nfunction isPositiveFinite(value) {\n return Number.isFinite(value) && /** @type {number} */ (value) > 0;\n}\n\n/** @param {unknown} value */\nfunction isUnitInterval(value) {\n return Number.isFinite(value)\n && /** @type {number} */ (value) >= 0\n && /** @type {number} */ (value) <= 1;\n}\n\n/** @param {unknown} value */\nfunction isBlendZone(value) {\n return Number.isFinite(value)\n && /** @type {number} */ (value) >= 0.35\n && /** @type {number} */ (value) <= 1;\n}\n"],
5
5
  "mappings": ";;;AAGO,IAAM,uBAAuB;AA4B7B,SAAS,wBAAwB,OAAO;AAC7C,MAAI,CAAC,SAAS,OAAO,UAAU,SAAU,QAAO;AAChD,QAAM;AAAA;AAAA,IAAyD;AAAA;AAC/D,MACE,WAAW,YAAY,KACnB,WAAW,YAAY,gBAAgB,WAAW,YAAY,UAAU,WAAW,YAAY,YAChG,CAAC,kBAAkB,WAAW,MAAM,MACnC,WAAW,YAAY,WACtB,WAAW,WAAW,KAAK,CAAC,WAAW,WAAW,gBAAgB,IACnE,UACD,CAAC,kBAAkB,WAAW,eAAe,KAC7C,CAAC,qBAAqB,WAAW,OAAO,KACxC,CAAC,iBAAiB,WAAW,MAAM,KAClC,WAAW,gBAAgB,WAC7B,WAAW,YAAY,YAAY,KAChC,WAAW,YAAY,WAAW,sBAClC,WAAW,YAAY,kBAAkB,8BACzC,CAAC,kBAAkB,WAAW,YAAY,uBAAuB,KACjE,OAAO,WAAW,YAAY,aAAa,cAE7C,CAAC,aAAa,WAAW,SAAS,KAClC,CAAC,aAAa,WAAW,SAAS,KAClC,CAAC,aAAa,WAAW,MAAM,KA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