@zylem/behaviors 0.2.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.
- package/README.md +26 -0
- package/dist/behavior-system-DYbx-x_-.d.ts +307 -0
- package/dist/chunk-2C3Z5GE7.js +176 -0
- package/dist/chunk-2C3Z5GE7.js.map +1 -0
- package/dist/chunk-2CLT36VB.js +241 -0
- package/dist/chunk-2CLT36VB.js.map +1 -0
- package/dist/chunk-3PYGRHAL.js +35 -0
- package/dist/chunk-3PYGRHAL.js.map +1 -0
- package/dist/chunk-4I6E6DGV.js +212 -0
- package/dist/chunk-4I6E6DGV.js.map +1 -0
- package/dist/chunk-4URF65BR.js +44 -0
- package/dist/chunk-4URF65BR.js.map +1 -0
- package/dist/chunk-6C6NXNEW.js +38 -0
- package/dist/chunk-6C6NXNEW.js.map +1 -0
- package/dist/chunk-ARJWUNRE.js +431 -0
- package/dist/chunk-ARJWUNRE.js.map +1 -0
- package/dist/chunk-BXP4K7RF.js +1205 -0
- package/dist/chunk-BXP4K7RF.js.map +1 -0
- package/dist/chunk-DYLH6K7B.js +44 -0
- package/dist/chunk-DYLH6K7B.js.map +1 -0
- package/dist/chunk-EIWQM6U3.js +27 -0
- package/dist/chunk-EIWQM6U3.js.map +1 -0
- package/dist/chunk-EZNCCO4L.js +14 -0
- package/dist/chunk-EZNCCO4L.js.map +1 -0
- package/dist/chunk-F3KRX2V4.js +457 -0
- package/dist/chunk-F3KRX2V4.js.map +1 -0
- package/dist/chunk-FPTWVCPN.js +53 -0
- package/dist/chunk-FPTWVCPN.js.map +1 -0
- package/dist/chunk-GCNRXAKH.js +37 -0
- package/dist/chunk-GCNRXAKH.js.map +1 -0
- package/dist/chunk-GYURWCIQ.js +1985 -0
- package/dist/chunk-GYURWCIQ.js.map +1 -0
- package/dist/chunk-HZMY3TT4.js +244 -0
- package/dist/chunk-HZMY3TT4.js.map +1 -0
- package/dist/chunk-ID5QJYF5.js +50 -0
- package/dist/chunk-ID5QJYF5.js.map +1 -0
- package/dist/chunk-JAN34G6S.js +552 -0
- package/dist/chunk-JAN34G6S.js.map +1 -0
- package/dist/chunk-K3UNLQ7W.js +118 -0
- package/dist/chunk-K3UNLQ7W.js.map +1 -0
- package/dist/chunk-KDY5N6J4.js +82 -0
- package/dist/chunk-KDY5N6J4.js.map +1 -0
- package/dist/chunk-KOZUNIIE.js +413 -0
- package/dist/chunk-KOZUNIIE.js.map +1 -0
- package/dist/chunk-KS72RZHX.js +30 -0
- package/dist/chunk-KS72RZHX.js.map +1 -0
- package/dist/chunk-LD5SMIB3.js +32 -0
- package/dist/chunk-LD5SMIB3.js.map +1 -0
- package/dist/chunk-OHCPV2NT.js +86 -0
- package/dist/chunk-OHCPV2NT.js.map +1 -0
- package/dist/chunk-OYWFPIHF.js +115 -0
- package/dist/chunk-OYWFPIHF.js.map +1 -0
- package/dist/chunk-POZER3MQ.js +407 -0
- package/dist/chunk-POZER3MQ.js.map +1 -0
- package/dist/chunk-RTRVBEIB.js +56 -0
- package/dist/chunk-RTRVBEIB.js.map +1 -0
- package/dist/chunk-RTVRUNYR.js +29 -0
- package/dist/chunk-RTVRUNYR.js.map +1 -0
- package/dist/chunk-SS7ELMJ7.js +406 -0
- package/dist/chunk-SS7ELMJ7.js.map +1 -0
- package/dist/chunk-STCCNLPC.js +160 -0
- package/dist/chunk-STCCNLPC.js.map +1 -0
- package/dist/chunk-SVLNF434.js +261 -0
- package/dist/chunk-SVLNF434.js.map +1 -0
- package/dist/chunk-UYFOLI2X.js +24 -0
- package/dist/chunk-UYFOLI2X.js.map +1 -0
- package/dist/chunk-VAN4WW3F.js +67 -0
- package/dist/chunk-VAN4WW3F.js.map +1 -0
- package/dist/chunk-WOMHL23C.js +369 -0
- package/dist/chunk-WOMHL23C.js.map +1 -0
- package/dist/chunk-WWVD5DR5.js +120 -0
- package/dist/chunk-WWVD5DR5.js.map +1 -0
- package/dist/chunk-XG2YMCJW.js +201 -0
- package/dist/chunk-XG2YMCJW.js.map +1 -0
- package/dist/chunk-XIJNE67Y.js +210 -0
- package/dist/chunk-XIJNE67Y.js.map +1 -0
- package/dist/chunk-Y6UJOUE5.js +44 -0
- package/dist/chunk-Y6UJOUE5.js.map +1 -0
- package/dist/chunk-YUO6SKJD.js +348 -0
- package/dist/chunk-YUO6SKJD.js.map +1 -0
- package/dist/components--hjBMTnz.d.ts +120 -0
- package/dist/components-B29WHGQN.d.ts +39 -0
- package/dist/components-BWG1GkZA.d.ts +20 -0
- package/dist/components-XCpL6IYt.d.ts +18 -0
- package/dist/components-qWwOsvwh.d.ts +43 -0
- package/dist/cooldown.d.ts +116 -0
- package/dist/cooldown.js +20 -0
- package/dist/cooldown.js.map +1 -0
- package/dist/coordinators/boundary-ricochet-3d.d.ts +19 -0
- package/dist/coordinators/boundary-ricochet-3d.js +8 -0
- package/dist/coordinators/boundary-ricochet-3d.js.map +1 -0
- package/dist/coordinators/boundary-ricochet.d.ts +34 -0
- package/dist/coordinators/boundary-ricochet.js +8 -0
- package/dist/coordinators/boundary-ricochet.js.map +1 -0
- package/dist/coordinators/first-person-shooter.d.ts +35 -0
- package/dist/coordinators/first-person-shooter.js +9 -0
- package/dist/coordinators/first-person-shooter.js.map +1 -0
- package/dist/coordinators/multidirectional-space-shooter.d.ts +27 -0
- package/dist/coordinators/multidirectional-space-shooter.js +10 -0
- package/dist/coordinators/multidirectional-space-shooter.js.map +1 -0
- package/dist/coordinators/top-down-shooter.d.ts +27 -0
- package/dist/coordinators/top-down-shooter.js +10 -0
- package/dist/coordinators/top-down-shooter.js.map +1 -0
- package/dist/core.d.ts +25 -0
- package/dist/core.js +327 -0
- package/dist/core.js.map +1 -0
- package/dist/destructible-3d.d.ts +42 -0
- package/dist/destructible-3d.js +13 -0
- package/dist/destructible-3d.js.map +1 -0
- package/dist/destructible-prebake.d.ts +28 -0
- package/dist/destructible-prebake.js +23 -0
- package/dist/destructible-prebake.js.map +1 -0
- package/dist/entity-types-CmtQ-IBp.d.ts +15 -0
- package/dist/first-person-perspective-C9Mptl0-.d.ts +23 -0
- package/dist/first-person.d.ts +204 -0
- package/dist/first-person.js +27 -0
- package/dist/first-person.js.map +1 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +263 -0
- package/dist/index.js.map +1 -0
- package/dist/jumper-2d.d.ts +113 -0
- package/dist/jumper-2d.js +27 -0
- package/dist/jumper-2d.js.map +1 -0
- package/dist/jumper-3d.d.ts +164 -0
- package/dist/jumper-3d.js +29 -0
- package/dist/jumper-3d.js.map +1 -0
- package/dist/moveable-BCRpjAQb.d.ts +176 -0
- package/dist/particle-emitter/presets.d.ts +46 -0
- package/dist/particle-emitter/presets.js +15 -0
- package/dist/particle-emitter/presets.js.map +1 -0
- package/dist/particle-emitter.d.ts +78 -0
- package/dist/particle-emitter.js +15 -0
- package/dist/particle-emitter.js.map +1 -0
- package/dist/payload-BQzu-oY_.d.ts +89 -0
- package/dist/platformer-3d.d.ts +347 -0
- package/dist/platformer-3d.js +23 -0
- package/dist/platformer-3d.js.map +1 -0
- package/dist/ricochet-2d.d.ts +274 -0
- package/dist/ricochet-2d.js +16 -0
- package/dist/ricochet-2d.js.map +1 -0
- package/dist/ricochet-3d.d.ts +116 -0
- package/dist/ricochet-3d.js +16 -0
- package/dist/ricochet-3d.js.map +1 -0
- package/dist/runtime-2d.d.ts +2 -0
- package/dist/runtime-2d.js +32 -0
- package/dist/runtime-2d.js.map +1 -0
- package/dist/runtime-pong.d.ts +92 -0
- package/dist/runtime-pong.js +38 -0
- package/dist/runtime-pong.js.map +1 -0
- package/dist/screen-visibility.d.ts +74 -0
- package/dist/screen-visibility.js +10 -0
- package/dist/screen-visibility.js.map +1 -0
- package/dist/screen-wrap.d.ts +86 -0
- package/dist/screen-wrap.js +16 -0
- package/dist/screen-wrap.js.map +1 -0
- package/dist/shooter-2d.d.ts +77 -0
- package/dist/shooter-2d.js +12 -0
- package/dist/shooter-2d.js.map +1 -0
- package/dist/spark-DDlIg1nM.d.ts +148 -0
- package/dist/sync-state-machine-CZyspBpj.d.ts +16 -0
- package/dist/thruster.d.ts +132 -0
- package/dist/thruster.js +26 -0
- package/dist/thruster.js.map +1 -0
- package/dist/top-down-movement.d.ts +40 -0
- package/dist/top-down-movement.js +20 -0
- package/dist/top-down-movement.js.map +1 -0
- package/dist/use-behavior-D_82jAL3.d.ts +13 -0
- package/dist/vector-Bm65-FOG.d.ts +45 -0
- package/dist/world-boundary-2d.d.ts +141 -0
- package/dist/world-boundary-2d.js +21 -0
- package/dist/world-boundary-2d.js.map +1 -0
- package/dist/world-boundary-3d.d.ts +75 -0
- package/dist/world-boundary-3d.js +21 -0
- package/dist/world-boundary-3d.js.map +1 -0
- package/package.json +161 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/behaviors/particle-emitter/presets/electricity/arc.ts","../src/lib/behaviors/particle-emitter/preset-builder.ts","../src/lib/behaviors/particle-emitter/presets/electricity/pulse.ts","../src/lib/behaviors/particle-emitter/presets/electricity/spark.ts","../src/lib/behaviors/particle-emitter/presets/electricity/storm.ts","../src/lib/behaviors/particle-emitter/presets/electricity/surge.ts","../src/lib/behaviors/particle-emitter/presets/electricity/index.ts","../src/lib/behaviors/particle-emitter/presets/fire/blaze.ts","../src/lib/behaviors/particle-emitter/presets/fire/ember.ts","../src/lib/behaviors/particle-emitter/presets/fire/flamelet.ts","../src/lib/behaviors/particle-emitter/presets/fire/smolder.ts","../src/lib/behaviors/particle-emitter/presets/fire/spark.ts","../src/lib/behaviors/particle-emitter/presets/fire/index.ts","../src/lib/behaviors/particle-emitter/presets/gas/haze.ts","../src/lib/behaviors/particle-emitter/presets/gas/miasma.ts","../src/lib/behaviors/particle-emitter/presets/gas/plume.ts","../src/lib/behaviors/particle-emitter/presets/gas/smoke.ts","../src/lib/behaviors/particle-emitter/presets/gas/vapor.ts","../src/lib/behaviors/particle-emitter/presets/gas/index.ts","../src/lib/behaviors/particle-emitter/presets/magic/arcane.ts","../src/lib/behaviors/particle-emitter/presets/magic/corrupted.ts","../src/lib/behaviors/particle-emitter/presets/magic/holy.ts","../src/lib/behaviors/particle-emitter/presets/magic/nature.ts","../src/lib/behaviors/particle-emitter/presets/magic/psychic.ts","../src/lib/behaviors/particle-emitter/presets/magic/void.ts","../src/lib/behaviors/particle-emitter/presets/magic/index.ts","../src/lib/behaviors/particle-emitter/presets/water/drizzle.ts","../src/lib/behaviors/particle-emitter/presets/water/mist.ts","../src/lib/behaviors/particle-emitter/presets/water/splash.ts","../src/lib/behaviors/particle-emitter/presets/water/spray.ts","../src/lib/behaviors/particle-emitter/presets/water/torrent.ts","../src/lib/behaviors/particle-emitter/presets/water/index.ts"],"sourcesContent":["import { RenderMode } from 'three.quarks';\n\nimport {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const electricityArcPreset = defineSemanticParticlePreset({\n\tfamily: 'electricity',\n\tvariant: 'arc',\n\tdescription: 'directed snapping bridge of charge',\n\taxes: {\n\t\t'continuity vs discontinuity': 'semi-continuous',\n\t\t'branching tendency': 'medium',\n\t\t'snap/crackle quality': 'high',\n\t\t'seeking behavior': 'medium',\n\t\t'charge buildup': 'medium',\n\t\t'rhythmic pulsing': 'low',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 0.7,\n\t\t\tlooping: true,\n\t\t\tcolor: '#60a5fa',\n\t\t\tlife: [0.12, 0.26],\n\t\t\tsize: [0.06, 0.14],\n\t\t\tspeed: [2.4, 4],\n\t\t\trotation: [-0.3, 0.3],\n\t\t\topacity: 0.96,\n\t\t\trenderMode: RenderMode.StretchedBillBoard,\n\t\t},\n\t\temission: { type: 'rate', rate: 28 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.06,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.05,\n\t\t\tspeed: [1.2, 2.4],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#ffffff', 0],\n\t\t\t\t\t['#7dd3fc', 0.3],\n\t\t\t\t\t['#2563eb', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.2, 0],\n\t\t\t\t\t[1, 0.05],\n\t\t\t\t\t[0.46, 0.5],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.7, 0.96, 0.82, 0.26],\n\t\t\tspeedOverLife: [1.08, 0.94, 0.7, 0.38],\n\t\t\tnoise: {\n\t\t\t\tfrequency: [2.4, 4.8],\n\t\t\t\tpower: [0.05, 0.12],\n\t\t\t\tpositionAmount: [0.14, 0.28],\n\t\t\t\trotationAmount: [0.04, 0.12],\n\t\t\t},\n\t\t},\n\t\trendererEmitterSettings: {\n\t\t\tspeedFactor: 0.62,\n\t\t\tlengthFactor: 1.16,\n\t\t},\n\t},\n});\n\nexport function arc(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(electricityArcPreset, options);\n}\n","import {\n\tAdditiveBlending,\n\tColor,\n\tMeshBasicMaterial,\n\ttype Blending,\n\ttype ColorRepresentation,\n\ttype MeshBasicMaterialParameters,\n\ttype Texture,\n} from 'three';\nimport {\n\tBezier,\n\tColorOverLife,\n\tConeEmitter,\n\tConstantColor,\n\tConstantValue,\n\tForceOverLife,\n\tGradient,\n\tIntervalValue,\n\tNoise,\n\tOrbitOverLife,\n\tParticleSystem,\n\tPiecewiseBezier,\n\tPointEmitter,\n\tRenderMode,\n\tRotationOverLife,\n\tSizeOverLife,\n\tSpeedOverLife,\n\tSphereEmitter,\n\tVector3,\n\tVector4,\n\ttype Behavior,\n\ttype RendererEmitterSettings,\n} from 'three.quarks';\n\nexport interface ParticleEffectDefinition {\n\tcreate(): ParticleSystem;\n}\n\nexport interface ParticlePresetMaterialOptions {\n\ttexture?: Texture;\n\topacity?: number;\n\tdepthWrite?: boolean;\n\talphaTest?: number;\n\tblending?: Blending;\n\tuTileCount?: number;\n\tvTileCount?: number;\n\tblendTiles?: boolean;\n}\n\nexport type NumericRange = number | readonly [number, number];\nexport type CurvePoints = readonly [number, number, number, number];\nexport type ColorStop = readonly [ColorRepresentation, number];\nexport type AlphaStop = readonly [number, number];\n\nexport interface ParticleColorOverLifeConfig {\n\tcolors: readonly ColorStop[];\n\talpha: readonly AlphaStop[];\n}\n\nexport interface ParticleForceOverLifeConfig {\n\tx?: NumericRange;\n\ty?: NumericRange;\n\tz?: NumericRange;\n}\n\nexport interface ParticleNoiseConfig {\n\tfrequency: NumericRange;\n\tpower: NumericRange;\n\tpositionAmount?: NumericRange;\n\trotationAmount?: NumericRange;\n}\n\nexport interface ParticleOrbitConfig {\n\tspeed: NumericRange;\n\taxis?: readonly [number, number, number];\n}\n\nexport interface ParticleBehaviorConfig {\n\tcolorOverLife?: ParticleColorOverLifeConfig;\n\tsizeOverLife?: CurvePoints;\n\tspeedOverLife?: CurvePoints;\n\trotationOverLife?: NumericRange;\n\tforceOverLife?: ParticleForceOverLifeConfig;\n\tnoise?: ParticleNoiseConfig;\n\torbitOverLife?: ParticleOrbitConfig;\n}\n\nexport interface ParticleBehaviorOverrides {\n\tcolorOverLife?: ParticleColorOverLifeConfig | null;\n\tsizeOverLife?: CurvePoints | null;\n\tspeedOverLife?: CurvePoints | null;\n\trotationOverLife?: NumericRange | null;\n\tforceOverLife?: Partial<ParticleForceOverLifeConfig> | null;\n\tnoise?: Partial<ParticleNoiseConfig> | null;\n\torbitOverLife?: Partial<ParticleOrbitConfig> | null;\n}\n\nexport type ParticleShapeConfig =\n\t| { type: 'point' }\n\t| {\n\t\t\ttype: 'cone';\n\t\t\tradius?: number;\n\t\t\tthickness?: number;\n\t\t\tangle?: number;\n\t\t\tspeed?: NumericRange;\n\t }\n\t| {\n\t\t\ttype: 'sphere';\n\t\t\tradius?: number;\n\t\t\tthickness?: number;\n\t\t\tspeed?: NumericRange;\n\t };\n\ntype ParticleEmissionConfig =\n\t| {\n\t\t\ttype: 'burst';\n\t\t\tcount: number;\n\t }\n\t| {\n\t\t\ttype: 'rate';\n\t\t\trate: number;\n\t };\n\ninterface SemanticParticleSystemConfig {\n\tdefaults: {\n\t\tduration: number;\n\t\tlooping?: boolean;\n\t\tworldSpace?: boolean;\n\t\tcolor: ColorRepresentation;\n\t\tlife: NumericRange;\n\t\tsize: NumericRange;\n\t\tspeed: NumericRange;\n\t\trotation?: NumericRange;\n\t\topacity?: number;\n\t\trenderMode?: RenderMode;\n\t};\n\temission: ParticleEmissionConfig;\n\tshape?: ParticleShapeConfig;\n\tbehaviors?: ParticleBehaviorConfig;\n\trendererEmitterSettings?: RendererEmitterSettings;\n}\n\nexport interface SemanticParticlePresetDefinition<\n\tFamily extends string = string,\n\tVariant extends string = string,\n> {\n\tfamily: Family;\n\tvariant: Variant;\n\tdescription: string;\n\taxes: Readonly<Record<string, string>>;\n\tsystem: SemanticParticleSystemConfig;\n}\n\nexport type ParticleMagicAlignment =\n\t| 'arcane'\n\t| 'holy'\n\t| 'corrupted'\n\t| 'nature'\n\t| 'void'\n\t| 'psychic';\n\nexport type ParticleMagicTemperament =\n\t| 'calm'\n\t| 'ominous'\n\t| 'playful'\n\t| 'regal'\n\t| 'predatory';\n\nexport type ParticleMagicAgency =\n\t| 'passive'\n\t| 'reactive'\n\t| 'seeking'\n\t| 'sentient-feeling';\n\nexport type ParticleMagicOrder = 'geometric' | 'organic' | 'chaotic';\n\nexport type ParticleMagicRealityEffect =\n\t| 'warping'\n\t| 'illuminating'\n\t| 'binding'\n\t| 'decaying'\n\t| 'healing';\n\nexport interface ParticleMagicModifierOptions {\n\talignment: ParticleMagicAlignment;\n\ttemperament?: ParticleMagicTemperament;\n\tagency?: ParticleMagicAgency;\n\torder?: ParticleMagicOrder;\n\trealityEffect?: ParticleMagicRealityEffect;\n\tintensity?: number;\n}\n\nexport type ParticleMagicModifierInput =\n\t| ParticleMagicAlignment\n\t| ParticleMagicModifierOptions;\n\nexport interface SemanticParticlePresetOptions\n\textends ParticlePresetMaterialOptions {\n\tbehaviors?: ParticleBehaviorOverrides;\n\tcolor?: ColorRepresentation;\n\tcount?: number;\n\tduration?: number;\n\temissionRate?: number;\n\tlife?: NumericRange;\n\tlooping?: boolean;\n\tmagic?: ParticleMagicModifierInput;\n\trenderMode?: RenderMode;\n\trendererEmitterSettings?: Partial<RendererEmitterSettings>;\n\trotation?: NumericRange;\n\tshape?: ParticleShapeConfig;\n\tsize?: NumericRange;\n\tspeed?: NumericRange;\n\tworldSpace?: boolean;\n}\n\ninterface MagicPalette {\n\tstart: ColorRepresentation;\n\tmid: ColorRepresentation;\n\tend: ColorRepresentation;\n}\n\nconst DEFAULT_MAGIC_BEHAVIOR_BY_ALIGNMENT: Record<\n\tParticleMagicAlignment,\n\tOmit<ParticleMagicModifierOptions, 'alignment'>\n> = {\n\tarcane: {\n\t\ttemperament: 'regal',\n\t\tagency: 'reactive',\n\t\torder: 'geometric',\n\t\trealityEffect: 'warping',\n\t\tintensity: 1,\n\t},\n\tholy: {\n\t\ttemperament: 'calm',\n\t\tagency: 'passive',\n\t\torder: 'geometric',\n\t\trealityEffect: 'illuminating',\n\t\tintensity: 1,\n\t},\n\tcorrupted: {\n\t\ttemperament: 'ominous',\n\t\tagency: 'seeking',\n\t\torder: 'chaotic',\n\t\trealityEffect: 'decaying',\n\t\tintensity: 1.05,\n\t},\n\tnature: {\n\t\ttemperament: 'calm',\n\t\tagency: 'reactive',\n\t\torder: 'organic',\n\t\trealityEffect: 'healing',\n\t\tintensity: 0.9,\n\t},\n\tvoid: {\n\t\ttemperament: 'ominous',\n\t\tagency: 'seeking',\n\t\torder: 'chaotic',\n\t\trealityEffect: 'warping',\n\t\tintensity: 1.15,\n\t},\n\tpsychic: {\n\t\ttemperament: 'predatory',\n\t\tagency: 'sentient-feeling',\n\t\torder: 'organic',\n\t\trealityEffect: 'binding',\n\t\tintensity: 1,\n\t},\n};\n\nconst MAGIC_PALETTES: Record<ParticleMagicAlignment, MagicPalette> = {\n\tarcane: {\n\t\tstart: '#dbeafe',\n\t\tmid: '#60a5fa',\n\t\tend: '#1d4ed8',\n\t},\n\tholy: {\n\t\tstart: '#fff7d1',\n\t\tmid: '#fde68a',\n\t\tend: '#f59e0b',\n\t},\n\tcorrupted: {\n\t\tstart: '#bef264',\n\t\tmid: '#84cc16',\n\t\tend: '#4d7c0f',\n\t},\n\tnature: {\n\t\tstart: '#dcfce7',\n\t\tmid: '#4ade80',\n\t\tend: '#15803d',\n\t},\n\tvoid: {\n\t\tstart: '#c4b5fd',\n\t\tmid: '#475569',\n\t\tend: '#0f172a',\n\t},\n\tpsychic: {\n\t\tstart: '#fce7f3',\n\t\tmid: '#f472b6',\n\t\tend: '#db2777',\n\t},\n};\n\nexport function particleEffect(\n\tcreate: () => ParticleSystem,\n): ParticleEffectDefinition {\n\treturn { create };\n}\n\nexport function defineSemanticParticlePreset<\n\tT extends SemanticParticlePresetDefinition,\n>(preset: T): T {\n\treturn preset;\n}\n\nexport function createMagicModifier(\n\talignment: ParticleMagicAlignment,\n\toverrides: Omit<ParticleMagicModifierOptions, 'alignment'> = {},\n): ParticleMagicModifierOptions {\n\treturn {\n\t\talignment,\n\t\t...DEFAULT_MAGIC_BEHAVIOR_BY_ALIGNMENT[alignment],\n\t\t...overrides,\n\t};\n}\n\nexport function createRangeValue(\n\tvalue: NumericRange,\n\tdefaultValue: readonly [number, number],\n) {\n\tif (Array.isArray(value)) {\n\t\tconst min = value[0] ?? defaultValue[0];\n\t\tconst max = value[1] ?? defaultValue[1];\n\t\treturn min === max ? new ConstantValue(min) : new IntervalValue(min, max);\n\t}\n\n\treturn new ConstantValue(value as number);\n}\n\nexport function toColorVector(color: ColorRepresentation): Vector4 {\n\tconst parsed = new Color(color);\n\treturn new Vector4(parsed.r, parsed.g, parsed.b, 1);\n}\n\nexport function createParticleMaterial(\n\tcolor: ColorRepresentation,\n\toptions: ParticlePresetMaterialOptions,\n\tdefaultOpacity?: number,\n) {\n\tconst materialOptions: MeshBasicMaterialParameters = {\n\t\tcolor,\n\t\ttransparent: true,\n\t};\n\n\tif (options.texture) {\n\t\tmaterialOptions.map = options.texture;\n\t\tmaterialOptions.depthWrite = options.depthWrite ?? false;\n\t\tmaterialOptions.alphaTest = options.alphaTest ?? 0.01;\n\t} else {\n\t\tif (options.depthWrite !== undefined) {\n\t\t\tmaterialOptions.depthWrite = options.depthWrite;\n\t\t}\n\n\t\tif (options.alphaTest !== undefined) {\n\t\t\tmaterialOptions.alphaTest = options.alphaTest;\n\t\t}\n\t}\n\n\tconst opacity = options.opacity ?? defaultOpacity;\n\tif (opacity !== undefined) {\n\t\tmaterialOptions.opacity = opacity;\n\t}\n\n\tif (options.blending !== undefined) {\n\t\tmaterialOptions.blending = options.blending;\n\t}\n\n\treturn new MeshBasicMaterial(materialOptions);\n}\n\nexport function createTextureSystemOptions(options: ParticlePresetMaterialOptions) {\n\tconst systemOptions: {\n\t\tuTileCount?: number;\n\t\tvTileCount?: number;\n\t\tblendTiles?: boolean;\n\t} = {};\n\n\tif (options.uTileCount !== undefined) {\n\t\tsystemOptions.uTileCount = options.uTileCount;\n\t}\n\n\tif (options.vTileCount !== undefined) {\n\t\tsystemOptions.vTileCount = options.vTileCount;\n\t}\n\n\tif (options.blendTiles !== undefined) {\n\t\tsystemOptions.blendTiles = options.blendTiles;\n\t}\n\n\treturn systemOptions;\n}\n\nexport function createSemanticParticleEffect(\n\tpreset: SemanticParticlePresetDefinition,\n\toptions: SemanticParticlePresetOptions = {},\n): ParticleEffectDefinition {\n\treturn particleEffect(() => {\n\t\tconst magic = normalizeMagicModifier(options.magic);\n\t\tconst resolvedShape = mergeShapeConfig(preset.system.shape, options.shape);\n\t\tconst baseBehaviors = mergeBehaviorConfig(\n\t\t\tpreset.system.behaviors,\n\t\t\toptions.behaviors,\n\t\t);\n\t\tconst baseColor = options.color ?? preset.system.defaults.color;\n\t\tconst resolvedColor = magic\n\t\t\t? mixColors(baseColor, MAGIC_PALETTES[magic.alignment].start, 0.2)\n\t\t\t: baseColor;\n\t\tconst resolvedBehaviors = magic\n\t\t\t? applyMagicBehaviors(baseBehaviors, resolvedColor, magic)\n\t\t\t: baseBehaviors;\n\t\tconst resolvedBlending =\n\t\t\toptions.blending ?? (magic ? AdditiveBlending : undefined);\n\t\tconst materialOptions: ParticlePresetMaterialOptions = {\n\t\t\t...options,\n\t\t\tblending: resolvedBlending,\n\t\t};\n\t\tconst resolvedRendererEmitterSettings = {\n\t\t\t...preset.system.rendererEmitterSettings,\n\t\t\t...options.rendererEmitterSettings,\n\t\t};\n\n\t\treturn new ParticleSystem({\n\t\t\tduration: options.duration ?? preset.system.defaults.duration,\n\t\t\tlooping:\n\t\t\t\toptions.looping\n\t\t\t\t?? preset.system.defaults.looping\n\t\t\t\t?? preset.system.emission.type === 'rate',\n\t\t\tworldSpace: options.worldSpace ?? preset.system.defaults.worldSpace ?? false,\n\t\t\tstartLife: createRangeValue(\n\t\t\t\toptions.life ?? preset.system.defaults.life,\n\t\t\t\ttoRange(preset.system.defaults.life),\n\t\t\t),\n\t\t\tstartSpeed: createRangeValue(\n\t\t\t\toptions.speed ?? preset.system.defaults.speed,\n\t\t\t\ttoRange(preset.system.defaults.speed),\n\t\t\t),\n\t\t\tstartSize: createRangeValue(\n\t\t\t\toptions.size ?? preset.system.defaults.size,\n\t\t\t\ttoRange(preset.system.defaults.size),\n\t\t\t),\n\t\t\tstartRotation:\n\t\t\t\toptions.rotation !== undefined\n\t\t\t\t|| preset.system.defaults.rotation !== undefined\n\t\t\t\t\t? createRangeValue(\n\t\t\t\t\t\t\toptions.rotation ?? preset.system.defaults.rotation ?? 0,\n\t\t\t\t\t\t\ttoRange(preset.system.defaults.rotation ?? 0),\n\t\t\t\t\t\t)\n\t\t\t\t\t: undefined,\n\t\t\tstartColor: new ConstantColor(toColorVector(resolvedColor)),\n\t\t\temissionOverTime:\n\t\t\t\tpreset.system.emission.type === 'rate'\n\t\t\t\t\t? new ConstantValue(\n\t\t\t\t\t\t\toptions.emissionRate ?? preset.system.emission.rate,\n\t\t\t\t\t\t)\n\t\t\t\t\t: new ConstantValue(0),\n\t\t\temissionBursts:\n\t\t\t\tpreset.system.emission.type === 'burst'\n\t\t\t\t\t? [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttime: 0,\n\t\t\t\t\t\t\t\tcount: new ConstantValue(\n\t\t\t\t\t\t\t\t\toptions.count ?? preset.system.emission.count,\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tcycle: 1,\n\t\t\t\t\t\t\t\tinterval: 0,\n\t\t\t\t\t\t\t\tprobability: 1,\n\t\t\t\t\t},\n\t\t\t\t\t\t]\n\t\t\t\t\t: undefined,\n\t\t\tshape: createEmitterShape(resolvedShape),\n\t\t\tmaterial: createParticleMaterial(\n\t\t\t\tresolvedColor,\n\t\t\t\tmaterialOptions,\n\t\t\t\tpreset.system.defaults.opacity,\n\t\t\t),\n\t\t\tbehaviors: createBehaviors(resolvedBehaviors),\n\t\t\t...createTextureSystemOptions(materialOptions),\n\t\t\trenderMode:\n\t\t\t\toptions.renderMode\n\t\t\t\t?? (magic && magic.agency === 'seeking'\n\t\t\t\t\t? RenderMode.StretchedBillBoard\n\t\t\t\t\t: undefined)\n\t\t\t\t?? preset.system.defaults.renderMode\n\t\t\t\t?? RenderMode.BillBoard,\n\t\t\trendererEmitterSettings: resolvedRendererEmitterSettings,\n\t\t});\n\t});\n}\n\nfunction normalizeMagicModifier(\n\tinput?: ParticleMagicModifierInput,\n): ParticleMagicModifierOptions | null {\n\tif (!input) {\n\t\treturn null;\n\t}\n\n\tif (typeof input === 'string') {\n\t\treturn createMagicModifier(input);\n\t}\n\n\treturn createMagicModifier(input.alignment, input);\n}\n\nfunction applyMagicBehaviors(\n\tbase: ParticleBehaviorConfig | undefined,\n\tbaseColor: ColorRepresentation,\n\tmagic: ParticleMagicModifierOptions,\n): ParticleBehaviorConfig {\n\tconst intensity = clamp(magic.intensity ?? 1, 0.25, 1.5);\n\tconst palette = MAGIC_PALETTES[magic.alignment];\n\n\treturn {\n\t\t...base,\n\t\tcolorOverLife: tintColorOverLife(\n\t\t\tbase?.colorOverLife,\n\t\t\tbaseColor,\n\t\t\tpalette,\n\t\t\tintensity,\n\t\t),\n\t\trotationOverLife: addRanges(\n\t\t\tbase?.rotationOverLife,\n\t\t\tresolveMagicRotation(magic, intensity),\n\t\t),\n\t\tforceOverLife: mergeForce(\n\t\t\tbase?.forceOverLife,\n\t\t\tresolveMagicForce(magic, intensity),\n\t\t),\n\t\tnoise: mergeNoise(base?.noise, resolveMagicNoise(magic, intensity)),\n\t\torbitOverLife:\n\t\t\tresolveMagicOrbit(magic, intensity) ?? base?.orbitOverLife,\n\t};\n}\n\nfunction resolveMagicRotation(\n\tmagic: ParticleMagicModifierOptions,\n\tintensity: number,\n): NumericRange | undefined {\n\tconst amount = 0.7 + intensity * 1.4;\n\n\tswitch (magic.order) {\n\t\tcase 'geometric':\n\t\t\treturn [amount * 0.45, amount];\n\t\tcase 'organic':\n\t\t\treturn [-amount * 0.55, amount * 0.55];\n\t\tcase 'chaotic':\n\t\t\treturn [-amount * 2.4, amount * 2.4];\n\t\tdefault:\n\t\t\treturn undefined;\n\t}\n}\n\nfunction resolveMagicForce(\n\tmagic: ParticleMagicModifierOptions,\n\tintensity: number,\n): ParticleForceOverLifeConfig | undefined {\n\tconst amount = 0.2 + intensity * 0.55;\n\n\tswitch (magic.realityEffect) {\n\t\tcase 'illuminating':\n\t\tcase 'healing':\n\t\t\treturn { y: [amount * 0.6, amount] };\n\t\tcase 'decaying':\n\t\t\treturn { y: [-amount, -amount * 0.5] };\n\t\tcase 'binding':\n\t\t\treturn { y: [-amount * 0.35, amount * 0.15] };\n\t\tcase 'warping':\n\t\t\treturn { x: [-amount * 0.35, amount * 0.35], z: [-amount * 0.35, amount * 0.35] };\n\t\tdefault:\n\t\t\treturn undefined;\n\t}\n}\n\nfunction resolveMagicNoise(\n\tmagic: ParticleMagicModifierOptions,\n\tintensity: number,\n): ParticleNoiseConfig {\n\tconst calmMultiplier = magic.temperament === 'calm' ? 0.6 : 1;\n\tconst ominousBoost = magic.temperament === 'ominous' ? 1.25 : 1;\n\tconst basePower =\n\t\t(0.08 + intensity * 0.1) * calmMultiplier * ominousBoost;\n\n\tswitch (magic.order) {\n\t\tcase 'geometric':\n\t\t\treturn {\n\t\t\t\tfrequency: [1.5, 3.5],\n\t\t\t\tpower: [basePower * 0.4, basePower * 0.8],\n\t\t\t\tpositionAmount: [0.08, 0.2],\n\t\t\t\trotationAmount: [0.1, 0.2],\n\t\t\t};\n\t\tcase 'organic':\n\t\t\treturn {\n\t\t\t\tfrequency: [2.5, 5.5],\n\t\t\t\tpower: [basePower * 0.7, basePower * 1.2],\n\t\t\t\tpositionAmount: [0.12, 0.3],\n\t\t\t\trotationAmount: [0.14, 0.26],\n\t\t\t};\n\t\tcase 'chaotic':\n\t\tdefault:\n\t\t\treturn {\n\t\t\t\tfrequency: [4, 8],\n\t\t\t\tpower: [basePower, basePower * 1.7],\n\t\t\t\tpositionAmount: [0.18, 0.38],\n\t\t\t\trotationAmount: [0.18, 0.34],\n\t\t\t};\n\t}\n}\n\nfunction resolveMagicOrbit(\n\tmagic: ParticleMagicModifierOptions,\n\tintensity: number,\n): ParticleOrbitConfig | undefined {\n\tif (magic.order === 'geometric') {\n\t\treturn {\n\t\t\tspeed: [3 + intensity * 2, 6 + intensity * 3],\n\t\t\taxis: [0, 1, 0],\n\t\t};\n\t}\n\n\tif (magic.agency === 'sentient-feeling') {\n\t\treturn {\n\t\t\tspeed: [1 + intensity, 2.5 + intensity * 1.2],\n\t\t\taxis: [0, 1, 0],\n\t\t};\n\t}\n\n\treturn undefined;\n}\n\nfunction tintColorOverLife(\n\tbase: ParticleColorOverLifeConfig | undefined,\n\tbaseColor: ColorRepresentation,\n\tpalette: MagicPalette,\n\tintensity: number,\n): ParticleColorOverLifeConfig {\n\tif (!base) {\n\t\treturn {\n\t\t\tcolors: [\n\t\t\t\t[mixColors(baseColor, palette.start, 0.25), 0],\n\t\t\t\t[mixColors(baseColor, palette.mid, 0.55), 0.45],\n\t\t\t\t[mixColors(baseColor, palette.end, 0.75), 1],\n\t\t\t],\n\t\t\talpha: [\n\t\t\t\t[0.22, 0],\n\t\t\t\t[1, 0.12],\n\t\t\t\t[0.52 + intensity * 0.08, 0.64],\n\t\t\t\t[0, 1],\n\t\t\t],\n\t\t};\n\t}\n\n\treturn {\n\t\tcolors: base.colors.map(([color, stop], index) => {\n\t\t\tconst target =\n\t\t\t\tindex === 0\n\t\t\t\t\t? palette.start\n\t\t\t\t\t: index === base.colors.length - 1\n\t\t\t\t\t\t? palette.end\n\t\t\t\t\t\t: palette.mid;\n\t\t\tconst amount = index === 0 ? 0.18 : 0.3 + intensity * 0.15;\n\t\t\treturn [mixColors(color, target, amount), stop] as const;\n\t\t}),\n\t\talpha: base.alpha,\n\t};\n}\n\nfunction mergeNoise(\n\tbase: ParticleNoiseConfig | undefined,\n\toverlay: ParticleNoiseConfig | undefined,\n): ParticleNoiseConfig | undefined {\n\tif (!base) {\n\t\treturn overlay;\n\t}\n\n\tif (!overlay) {\n\t\treturn base;\n\t}\n\n\treturn {\n\t\tfrequency: addRanges(base.frequency, overlay.frequency) ?? base.frequency,\n\t\tpower: addRanges(base.power, overlay.power) ?? base.power,\n\t\tpositionAmount: addRanges(base.positionAmount, overlay.positionAmount),\n\t\trotationAmount: addRanges(base.rotationAmount, overlay.rotationAmount),\n\t};\n}\n\nfunction mergeForce(\n\tbase: ParticleForceOverLifeConfig | undefined,\n\toverlay: ParticleForceOverLifeConfig | undefined,\n): ParticleForceOverLifeConfig | undefined {\n\tif (!base) {\n\t\treturn overlay;\n\t}\n\n\tif (!overlay) {\n\t\treturn base;\n\t}\n\n\treturn {\n\t\tx: addRanges(base.x, overlay.x),\n\t\ty: addRanges(base.y, overlay.y),\n\t\tz: addRanges(base.z, overlay.z),\n\t};\n}\n\nfunction mergeBehaviorConfig(\n\tbase: ParticleBehaviorConfig | undefined,\n\toverrides: ParticleBehaviorOverrides | undefined,\n): ParticleBehaviorConfig | undefined {\n\tif (!base && !overrides) {\n\t\treturn undefined;\n\t}\n\n\tconst merged: ParticleBehaviorConfig = {};\n\n\tassignIfDefined(\n\t\tmerged,\n\t\t'colorOverLife',\n\t\tresolveOverrideValue(base?.colorOverLife, overrides?.colorOverLife),\n\t);\n\tassignIfDefined(\n\t\tmerged,\n\t\t'sizeOverLife',\n\t\tresolveOverrideValue(base?.sizeOverLife, overrides?.sizeOverLife),\n\t);\n\tassignIfDefined(\n\t\tmerged,\n\t\t'speedOverLife',\n\t\tresolveOverrideValue(base?.speedOverLife, overrides?.speedOverLife),\n\t);\n\tassignIfDefined(\n\t\tmerged,\n\t\t'rotationOverLife',\n\t\tresolveOverrideValue(base?.rotationOverLife, overrides?.rotationOverLife),\n\t);\n\tassignIfDefined(\n\t\tmerged,\n\t\t'forceOverLife',\n\t\tresolvePartialOverride(base?.forceOverLife, overrides?.forceOverLife),\n\t);\n\tassignIfDefined(\n\t\tmerged,\n\t\t'noise',\n\t\tresolveNoiseOverride(base?.noise, overrides?.noise),\n\t);\n\tassignIfDefined(\n\t\tmerged,\n\t\t'orbitOverLife',\n\t\tresolveOrbitOverride(base?.orbitOverLife, overrides?.orbitOverLife),\n\t);\n\n\treturn Object.keys(merged).length > 0 ? merged : undefined;\n}\n\nfunction mergeShapeConfig(\n\tbase: ParticleShapeConfig | undefined,\n\toverride: ParticleShapeConfig | undefined,\n): ParticleShapeConfig | undefined {\n\tif (!override) {\n\t\treturn base;\n\t}\n\n\tif (!base || override.type !== base.type) {\n\t\treturn override;\n\t}\n\n\tif (override.type === 'point') {\n\t\treturn override;\n\t}\n\n\tif (override.type === 'cone' && base.type === 'cone') {\n\t\treturn {\n\t\t\t...base,\n\t\t\t...override,\n\t\t};\n\t}\n\n\tif (override.type === 'sphere' && base.type === 'sphere') {\n\t\treturn {\n\t\t\t...base,\n\t\t\t...override,\n\t\t};\n\t}\n\n\treturn override;\n}\n\nfunction addRanges(\n\tbase: NumericRange | undefined,\n\toverlay: NumericRange | undefined,\n): NumericRange | undefined {\n\tif (base === undefined) {\n\t\treturn overlay;\n\t}\n\n\tif (overlay === undefined) {\n\t\treturn base;\n\t}\n\n\tconst [baseMin, baseMax] = toRange(base);\n\tconst [overlayMin, overlayMax] = toRange(overlay);\n\treturn [baseMin + overlayMin, baseMax + overlayMax];\n}\n\nfunction resolveOverrideValue<T>(\n\tbase: T | undefined,\n\toverride: T | null | undefined,\n): T | undefined {\n\tif (override === null) {\n\t\treturn undefined;\n\t}\n\n\treturn override ?? base;\n}\n\nfunction resolvePartialOverride<T extends object>(\n\tbase: T | undefined,\n\toverride: Partial<T> | null | undefined,\n): T | undefined {\n\tif (override === null) {\n\t\treturn undefined;\n\t}\n\n\tif (!override) {\n\t\treturn base;\n\t}\n\n\tconst resolved = {\n\t\t...base,\n\t\t...override,\n\t};\n\n\treturn Object.keys(resolved).length > 0 ? (resolved as T) : undefined;\n}\n\nfunction resolveNoiseOverride(\n\tbase: ParticleNoiseConfig | undefined,\n\toverride: Partial<ParticleNoiseConfig> | null | undefined,\n): ParticleNoiseConfig | undefined {\n\tif (override === null) {\n\t\treturn undefined;\n\t}\n\n\tif (!override) {\n\t\treturn base;\n\t}\n\n\tconst frequency = override.frequency ?? base?.frequency;\n\tconst power = override.power ?? base?.power;\n\tif (frequency === undefined || power === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn {\n\t\t...base,\n\t\t...override,\n\t\tfrequency,\n\t\tpower,\n\t};\n}\n\nfunction resolveOrbitOverride(\n\tbase: ParticleOrbitConfig | undefined,\n\toverride: Partial<ParticleOrbitConfig> | null | undefined,\n): ParticleOrbitConfig | undefined {\n\tif (override === null) {\n\t\treturn undefined;\n\t}\n\n\tif (!override) {\n\t\treturn base;\n\t}\n\n\tconst speed = override.speed ?? base?.speed;\n\tif (speed === undefined) {\n\t\treturn undefined;\n\t}\n\n\treturn {\n\t\t...base,\n\t\t...override,\n\t\tspeed,\n\t};\n}\n\nfunction assignIfDefined<\n\tT extends object,\n\tK extends keyof T,\n>(target: T, key: K, value: T[K] | undefined) {\n\tif (value !== undefined) {\n\t\ttarget[key] = value;\n\t}\n}\n\nfunction createBehaviors(\n\tconfig?: ParticleBehaviorConfig,\n): Behavior[] | undefined {\n\tif (!config) {\n\t\treturn undefined;\n\t}\n\n\tconst behaviors: Behavior[] = [];\n\n\tif (config.colorOverLife) {\n\t\tbehaviors.push(\n\t\t\tnew ColorOverLife(\n\t\t\t\tnew Gradient(\n\t\t\t\t\tconfig.colorOverLife.colors.map(\n\t\t\t\t\t\t([color, stop]) =>\n\t\t\t\t\t\t\t[toColorVector3(color), stop] as [Vector3, number],\n\t\t\t\t\t),\n\t\t\t\t\tconfig.colorOverLife.alpha.map(\n\t\t\t\t\t\t([value, stop]) => [value, stop] as [number, number],\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t}\n\n\tif (config.sizeOverLife) {\n\t\tbehaviors.push(new SizeOverLife(createCurve(config.sizeOverLife)));\n\t}\n\n\tif (config.speedOverLife) {\n\t\tbehaviors.push(new SpeedOverLife(createCurve(config.speedOverLife)));\n\t}\n\n\tif (config.rotationOverLife !== undefined) {\n\t\tbehaviors.push(\n\t\t\tnew RotationOverLife(\n\t\t\t\tcreateRangeValue(config.rotationOverLife, toRange(config.rotationOverLife)),\n\t\t\t),\n\t\t);\n\t}\n\n\tif (config.forceOverLife) {\n\t\tbehaviors.push(\n\t\t\tnew ForceOverLife(\n\t\t\t\tcreateRangeValue(config.forceOverLife.x ?? 0, toRange(config.forceOverLife.x ?? 0)),\n\t\t\t\tcreateRangeValue(config.forceOverLife.y ?? 0, toRange(config.forceOverLife.y ?? 0)),\n\t\t\t\tcreateRangeValue(config.forceOverLife.z ?? 0, toRange(config.forceOverLife.z ?? 0)),\n\t\t\t),\n\t\t);\n\t}\n\n\tif (config.noise) {\n\t\tbehaviors.push(\n\t\t\tnew Noise(\n\t\t\t\tcreateRangeValue(config.noise.frequency, toRange(config.noise.frequency)),\n\t\t\t\tcreateRangeValue(config.noise.power, toRange(config.noise.power)),\n\t\t\t\tcreateRangeValue(\n\t\t\t\t\tconfig.noise.positionAmount ?? 0,\n\t\t\t\t\ttoRange(config.noise.positionAmount ?? 0),\n\t\t\t\t),\n\t\t\t\tcreateRangeValue(\n\t\t\t\t\tconfig.noise.rotationAmount ?? 0,\n\t\t\t\t\ttoRange(config.noise.rotationAmount ?? 0),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t}\n\n\tif (config.orbitOverLife) {\n\t\tconst axis = config.orbitOverLife.axis ?? [0, 1, 0];\n\t\tbehaviors.push(\n\t\t\tnew OrbitOverLife(\n\t\t\t\tcreateRangeValue(\n\t\t\t\t\tconfig.orbitOverLife.speed,\n\t\t\t\t\ttoRange(config.orbitOverLife.speed),\n\t\t\t\t),\n\t\t\t\tnew Vector3(axis[0], axis[1], axis[2]),\n\t\t\t),\n\t\t);\n\t}\n\n\treturn behaviors.length > 0 ? behaviors : undefined;\n}\n\nfunction createEmitterShape(shape?: ParticleShapeConfig) {\n\tif (!shape || shape.type === 'point') {\n\t\treturn new PointEmitter();\n\t}\n\n\tif (shape.type === 'cone') {\n\t\treturn new ConeEmitter({\n\t\t\tradius: shape.radius,\n\t\t\tthickness: shape.thickness,\n\t\t\tangle: shape.angle,\n\t\t\tspeed:\n\t\t\t\tshape.speed !== undefined\n\t\t\t\t\t? createRangeValue(shape.speed, toRange(shape.speed))\n\t\t\t\t\t: undefined,\n\t\t});\n\t}\n\n\treturn new SphereEmitter({\n\t\tradius: shape.radius,\n\t\tthickness: shape.thickness,\n\t\tspeed:\n\t\t\tshape.speed !== undefined\n\t\t\t\t? createRangeValue(shape.speed, toRange(shape.speed))\n\t\t\t\t: undefined,\n\t});\n}\n\nfunction createCurve(points: CurvePoints) {\n\treturn new PiecewiseBezier([[new Bezier(...points), 0]]);\n}\n\nfunction toColorVector3(color: ColorRepresentation): Vector3 {\n\tconst parsed = new Color(color);\n\treturn new Vector3(parsed.r, parsed.g, parsed.b);\n}\n\nfunction toRange(value: NumericRange): readonly [number, number] {\n\tif (Array.isArray(value)) {\n\t\treturn [value[0] ?? 0, value[1] ?? value[0] ?? 0];\n\t}\n\n\treturn [value as number, value as number];\n}\n\nfunction mixColors(\n\tbase: ColorRepresentation,\n\toverlay: ColorRepresentation,\n\tamount: number,\n): string {\n\tconst color = new Color(base);\n\tcolor.lerp(new Color(overlay), clamp(amount, 0, 1));\n\treturn `#${color.getHexString()}`;\n}\n\nfunction clamp(value: number, min: number, max: number): number {\n\treturn Math.min(Math.max(value, min), max);\n}\n","import {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const electricityPulsePreset = defineSemanticParticlePreset({\n\tfamily: 'electricity',\n\tvariant: 'pulse',\n\tdescription: 'rhythmic swelling packet of charge',\n\taxes: {\n\t\t'continuity vs discontinuity': 'discrete rhythmic',\n\t\t'branching tendency': 'low',\n\t\t'snap/crackle quality': 'medium',\n\t\t'seeking behavior': 'low',\n\t\t'charge buildup': 'medium',\n\t\t'rhythmic pulsing': 'high',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 0.28,\n\t\t\tcolor: '#a5f3fc',\n\t\t\tlife: [0.14, 0.3],\n\t\t\tsize: [0.18, 0.34],\n\t\t\tspeed: [0.18, 0.42],\n\t\t\topacity: 0.88,\n\t\t},\n\t\temission: { type: 'burst', count: 10 },\n\t\tshape: {\n\t\t\ttype: 'sphere',\n\t\t\tradius: 0.04,\n\t\t\tthickness: 0.5,\n\t\t\tspeed: [0.02, 0.08],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#ffffff', 0],\n\t\t\t\t\t['#a5f3fc', 0.4],\n\t\t\t\t\t['#0891b2', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.14, 0],\n\t\t\t\t\t[0.92, 0.08],\n\t\t\t\t\t[0.42, 0.54],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.2, 0.92, 1.26, 0.18],\n\t\t},\n\t},\n});\n\nexport function pulse(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(electricityPulsePreset, options);\n}\n","import { RenderMode } from 'three.quarks';\n\nimport {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const electricitySparkPreset = defineSemanticParticlePreset({\n\tfamily: 'electricity',\n\tvariant: 'spark',\n\tdescription: 'tiny discontinuous discharge',\n\taxes: {\n\t\t'continuity vs discontinuity': 'highly discontinuous',\n\t\t'branching tendency': 'low',\n\t\t'snap/crackle quality': 'high',\n\t\t'seeking behavior': 'low',\n\t\t'charge buildup': 'low',\n\t\t'rhythmic pulsing': 'low',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 0.2,\n\t\t\tcolor: '#7dd3fc',\n\t\t\tlife: [0.08, 0.18],\n\t\t\tsize: [0.08, 0.16],\n\t\t\tspeed: [2.2, 4.2],\n\t\t\trotation: [-Math.PI, Math.PI],\n\t\t\topacity: 0.92,\n\t\t\trenderMode: RenderMode.StretchedBillBoard,\n\t\t},\n\t\temission: { type: 'burst', count: 12 },\n\t\tshape: {\n\t\t\ttype: 'sphere',\n\t\t\tradius: 0.06,\n\t\t\tthickness: 0.95,\n\t\t\tspeed: [0.8, 1.6],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#ffffff', 0],\n\t\t\t\t\t['#bae6fd', 0.3],\n\t\t\t\t\t['#38bdf8', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.22, 0],\n\t\t\t\t\t[1, 0.06],\n\t\t\t\t\t[0.48, 0.4],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.44, 0.98, 0.7, 0.04],\n\t\t\tspeedOverLife: [1.24, 0.9, 0.36, 0.04],\n\t\t},\n\t\trendererEmitterSettings: {\n\t\t\tspeedFactor: 0.46,\n\t\t\tlengthFactor: 1.02,\n\t\t},\n\t},\n});\n\nexport function spark(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(electricitySparkPreset, options);\n}\n","import { RenderMode } from 'three.quarks';\n\nimport {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const electricityStormPreset = defineSemanticParticlePreset({\n\tfamily: 'electricity',\n\tvariant: 'storm',\n\tdescription: 'restless volume of crackling atmospheric charge',\n\taxes: {\n\t\t'continuity vs discontinuity': 'mixed',\n\t\t'branching tendency': 'high',\n\t\t'snap/crackle quality': 'high',\n\t\t'seeking behavior': 'medium-high',\n\t\t'charge buildup': 'high',\n\t\t'rhythmic pulsing': 'medium',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 1.2,\n\t\t\tlooping: true,\n\t\t\tcolor: '#38bdf8',\n\t\t\tlife: [0.32, 0.82],\n\t\t\tsize: [0.08, 0.2],\n\t\t\tspeed: [2.2, 4.8],\n\t\t\trotation: [-Math.PI, Math.PI],\n\t\t\topacity: 0.94,\n\t\t\trenderMode: RenderMode.StretchedBillBoard,\n\t\t},\n\t\temission: { type: 'rate', rate: 34 },\n\t\tshape: {\n\t\t\ttype: 'sphere',\n\t\t\tradius: 0.16,\n\t\t\tthickness: 0.98,\n\t\t\tspeed: [1, 2],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#ffffff', 0],\n\t\t\t\t\t['#67e8f9', 0.25],\n\t\t\t\t\t['#2563eb', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.18, 0],\n\t\t\t\t\t[0.98, 0.06],\n\t\t\t\t\t[0.5, 0.5],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.62, 0.96, 0.84, 0.26],\n\t\t\tspeedOverLife: [1.18, 0.94, 0.66, 0.32],\n\t\t\tnoise: {\n\t\t\t\tfrequency: [4.8, 8.4],\n\t\t\t\tpower: [0.08, 0.18],\n\t\t\t\tpositionAmount: [0.18, 0.38],\n\t\t\t\trotationAmount: [0.08, 0.18],\n\t\t\t},\n\t\t},\n\t\trendererEmitterSettings: {\n\t\t\tspeedFactor: 0.66,\n\t\t\tlengthFactor: 1.18,\n\t\t},\n\t},\n});\n\nexport function storm(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(electricityStormPreset, options);\n}\n","import { RenderMode } from 'three.quarks';\n\nimport {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const electricitySurgePreset = defineSemanticParticlePreset({\n\tfamily: 'electricity',\n\tvariant: 'surge',\n\tdescription: 'charge-rich spike that overwhelms the space',\n\taxes: {\n\t\t'continuity vs discontinuity': 'bursting',\n\t\t'branching tendency': 'medium',\n\t\t'snap/crackle quality': 'high',\n\t\t'seeking behavior': 'medium',\n\t\t'charge buildup': 'high',\n\t\t'rhythmic pulsing': 'medium',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 0.34,\n\t\t\tcolor: '#38bdf8',\n\t\t\tlife: [0.18, 0.36],\n\t\t\tsize: [0.12, 0.26],\n\t\t\tspeed: [2.8, 5.2],\n\t\t\trotation: [-Math.PI, Math.PI],\n\t\t\topacity: 0.98,\n\t\t\trenderMode: RenderMode.StretchedBillBoard,\n\t\t},\n\t\temission: { type: 'burst', count: 24 },\n\t\tshape: {\n\t\t\ttype: 'sphere',\n\t\t\tradius: 0.08,\n\t\t\tthickness: 0.98,\n\t\t\tspeed: [1.1, 2.2],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#ffffff', 0],\n\t\t\t\t\t['#67e8f9', 0.22],\n\t\t\t\t\t['#0ea5e9', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.22, 0],\n\t\t\t\t\t[1, 0.04],\n\t\t\t\t\t[0.52, 0.44],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.32, 0.9, 0.84, 0.08],\n\t\t\tspeedOverLife: [1.22, 0.88, 0.42, 0.06],\n\t\t\tnoise: {\n\t\t\t\tfrequency: [4.5, 8],\n\t\t\t\tpower: [0.08, 0.18],\n\t\t\t\tpositionAmount: [0.22, 0.42],\n\t\t\t\trotationAmount: [0.08, 0.16],\n\t\t\t},\n\t\t},\n\t\trendererEmitterSettings: {\n\t\t\tspeedFactor: 0.68,\n\t\t\tlengthFactor: 1.2,\n\t\t},\n\t},\n});\n\nexport function surge(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(electricitySurgePreset, options);\n}\n","export { arc, electricityArcPreset } from './arc';\nexport { pulse, electricityPulsePreset } from './pulse';\nexport { spark, electricitySparkPreset } from './spark';\nexport { storm, electricityStormPreset } from './storm';\nexport { surge, electricitySurgePreset } from './surge';\n\nimport { arc } from './arc';\nimport { pulse } from './pulse';\nimport { spark } from './spark';\nimport { storm } from './storm';\nimport { surge } from './surge';\n\nexport const electricityPresets = {\n\tspark,\n\tarc,\n\tsurge,\n\tpulse,\n\tstorm,\n} as const;\n","import { RenderMode } from 'three.quarks';\n\nimport {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const fireBlazePreset = defineSemanticParticlePreset({\n\tfamily: 'fire',\n\tvariant: 'blaze',\n\tdescription: 'sustained, strong open burning',\n\taxes: {\n\t\t'heat feel': 'intense',\n\t\t'hunger/spread tendency': 'high',\n\t\t'smoke affinity': 'medium',\n\t\tturbulence: 'high',\n\t\tresiduality: 'medium',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 1.8,\n\t\t\tlooping: true,\n\t\t\tcolor: '#f97316',\n\t\t\tlife: [0.55, 1.1],\n\t\t\tsize: [0.32, 0.62],\n\t\t\tspeed: [0.55, 1.4],\n\t\t\trotation: [-0.24, 0.24],\n\t\t\topacity: 0.96,\n\t\t\trenderMode: RenderMode.VerticalBillBoard,\n\t\t},\n\t\temission: { type: 'rate', rate: 42 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.18,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.28,\n\t\t\tspeed: [0.35, 0.95],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#ffffff', 0],\n\t\t\t\t\t['#fde68a', 0.18],\n\t\t\t\t\t['#fb923c', 0.5],\n\t\t\t\t\t['#ef4444', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.18, 0],\n\t\t\t\t\t[1, 0.08],\n\t\t\t\t\t[0.56, 0.54],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.45, 0.92, 1.14, 0.22],\n\t\t\tspeedOverLife: [1.08, 0.96, 0.62, 0.16],\n\t\t\tforceOverLife: {\n\t\t\t\ty: [0.38, 0.72],\n\t\t\t},\n\t\t\tnoise: {\n\t\t\t\tfrequency: [4.5, 6.5],\n\t\t\t\tpower: [0.1, 0.18],\n\t\t\t\tpositionAmount: [0.32, 0.55],\n\t\t\t\trotationAmount: [0.18, 0.3],\n\t\t\t},\n\t\t},\n\t},\n});\n\nexport function blaze(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(fireBlazePreset, options);\n}\n","import {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const fireEmberPreset = defineSemanticParticlePreset({\n\tfamily: 'fire',\n\tvariant: 'ember',\n\tdescription: 'lingering, warm, residual, drifting',\n\taxes: {\n\t\t'heat feel': 'warm',\n\t\t'hunger/spread tendency': 'low',\n\t\t'smoke affinity': 'medium',\n\t\tturbulence: 'low',\n\t\tresiduality: 'high',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 2.2,\n\t\t\tlooping: true,\n\t\t\tcolor: '#fb923c',\n\t\t\tlife: [1.1, 2.2],\n\t\t\tsize: [0.05, 0.14],\n\t\t\tspeed: [0.08, 0.32],\n\t\t\trotation: [-0.45, 0.45],\n\t\t\topacity: 0.9,\n\t\t},\n\t\temission: { type: 'rate', rate: 8 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.12,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.22,\n\t\t\tspeed: [0.08, 0.26],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#fff7d1', 0],\n\t\t\t\t\t['#fb923c', 0.35],\n\t\t\t\t\t['#b45309', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.12, 0],\n\t\t\t\t\t[0.9, 0.12],\n\t\t\t\t\t[0.42, 0.7],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.42, 0.9, 0.72, 0.18],\n\t\t\tforceOverLife: {\n\t\t\t\ty: [0.18, 0.42],\n\t\t\t},\n\t\t\tnoise: {\n\t\t\t\tfrequency: [1.2, 2.6],\n\t\t\t\tpower: [0.02, 0.08],\n\t\t\t\tpositionAmount: [0.06, 0.14],\n\t\t\t\trotationAmount: [0.04, 0.1],\n\t\t\t},\n\t\t},\n\t},\n});\n\nexport function ember(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(fireEmberPreset, options);\n}\n","import { RenderMode } from 'three.quarks';\n\nimport {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const fireFlameletPreset = defineSemanticParticlePreset({\n\tfamily: 'fire',\n\tvariant: 'flamelet',\n\tdescription: 'small coherent tongue of flame',\n\taxes: {\n\t\t'heat feel': 'hot',\n\t\t'hunger/spread tendency': 'medium',\n\t\t'smoke affinity': 'low',\n\t\tturbulence: 'medium',\n\t\tresiduality: 'low',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 1.2,\n\t\t\tlooping: true,\n\t\t\tcolor: '#fb923c',\n\t\t\tlife: [0.48, 0.9],\n\t\t\tsize: [0.2, 0.38],\n\t\t\tspeed: [0.35, 0.9],\n\t\t\trotation: [-0.18, 0.18],\n\t\t\topacity: 0.94,\n\t\t\trenderMode: RenderMode.VerticalBillBoard,\n\t\t},\n\t\temission: { type: 'rate', rate: 22 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.1,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.18,\n\t\t\tspeed: [0.3, 0.72],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#fff7d1', 0],\n\t\t\t\t\t['#fbbf24', 0.24],\n\t\t\t\t\t['#fb923c', 0.62],\n\t\t\t\t\t['#ef4444', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.16, 0],\n\t\t\t\t\t[0.94, 0.1],\n\t\t\t\t\t[0.48, 0.58],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.44, 0.92, 1.08, 0.16],\n\t\t\tspeedOverLife: [1.08, 0.95, 0.62, 0.18],\n\t\t\tforceOverLife: {\n\t\t\t\ty: [0.3, 0.55],\n\t\t\t},\n\t\t\tnoise: {\n\t\t\t\tfrequency: [3, 5],\n\t\t\t\tpower: [0.08, 0.14],\n\t\t\t\tpositionAmount: [0.24, 0.42],\n\t\t\t\trotationAmount: [0.16, 0.24],\n\t\t\t},\n\t\t},\n\t},\n});\n\nexport function flamelet(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(fireFlameletPreset, options);\n}\n","import {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const fireSmolderPreset = defineSemanticParticlePreset({\n\tfamily: 'fire',\n\tvariant: 'smolder',\n\tdescription: 'low-oxygen, persistent, smoky heat',\n\taxes: {\n\t\t'heat feel': 'buried-hot',\n\t\t'hunger/spread tendency': 'low',\n\t\t'smoke affinity': 'high',\n\t\tturbulence: 'low',\n\t\tresiduality: 'high',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 2.6,\n\t\t\tlooping: true,\n\t\t\tcolor: '#c2410c',\n\t\t\tlife: [1.4, 2.8],\n\t\t\tsize: [0.28, 0.58],\n\t\t\tspeed: [0.06, 0.22],\n\t\t\trotation: [-0.35, 0.35],\n\t\t\topacity: 0.76,\n\t\t},\n\t\temission: { type: 'rate', rate: 14 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.16,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.12,\n\t\t\tspeed: [0.04, 0.16],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#fed7aa', 0],\n\t\t\t\t\t['#c2410c', 0.28],\n\t\t\t\t\t['#525252', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.14, 0],\n\t\t\t\t\t[0.76, 0.12],\n\t\t\t\t\t[0.4, 0.68],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.34, 0.86, 1.08, 0.46],\n\t\t\tforceOverLife: {\n\t\t\t\ty: [0.08, 0.2],\n\t\t\t},\n\t\t\tnoise: {\n\t\t\t\tfrequency: [1.6, 3.1],\n\t\t\t\tpower: [0.04, 0.12],\n\t\t\t\tpositionAmount: [0.12, 0.26],\n\t\t\t\trotationAmount: [0.06, 0.14],\n\t\t\t},\n\t\t},\n\t},\n});\n\nexport function smolder(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(fireSmolderPreset, options);\n}\n","import { RenderMode } from 'three.quarks';\n\nimport {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const fireSparkPreset = defineSemanticParticlePreset({\n\tfamily: 'fire',\n\tvariant: 'spark',\n\tdescription: 'tiny, sudden, energetic, fleeting',\n\taxes: {\n\t\t'heat feel': 'sharp-hot',\n\t\t'hunger/spread tendency': 'low',\n\t\t'smoke affinity': 'low',\n\t\tturbulence: 'high',\n\t\tresiduality: 'low',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 0.24,\n\t\t\tcolor: '#ffd166',\n\t\t\tlife: [0.12, 0.24],\n\t\t\tsize: [0.08, 0.16],\n\t\t\tspeed: [1.8, 4.6],\n\t\t\trotation: [-Math.PI, Math.PI],\n\t\t\trenderMode: RenderMode.StretchedBillBoard,\n\t\t},\n\t\temission: { type: 'burst', count: 10 },\n\t\tshape: {\n\t\t\ttype: 'sphere',\n\t\t\tradius: 0.05,\n\t\t\tthickness: 0.92,\n\t\t\tspeed: [0.45, 1.2],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#ffffff', 0],\n\t\t\t\t\t['#fde68a', 0.2],\n\t\t\t\t\t['#fb923c', 0.62],\n\t\t\t\t\t['#ef4444', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.18, 0],\n\t\t\t\t\t[1, 0.08],\n\t\t\t\t\t[0.52, 0.5],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.48, 1.08, 0.88, 0.06],\n\t\t\tspeedOverLife: [1.18, 0.88, 0.42, 0.04],\n\t\t},\n\t\trendererEmitterSettings: {\n\t\t\tspeedFactor: 0.55,\n\t\t\tlengthFactor: 1.08,\n\t\t},\n\t},\n});\n\nexport function spark(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(fireSparkPreset, options);\n}\n","export { blaze, fireBlazePreset } from './blaze';\nexport { ember, fireEmberPreset } from './ember';\nexport { flamelet, fireFlameletPreset } from './flamelet';\nexport { smolder, fireSmolderPreset } from './smolder';\nexport { spark, fireSparkPreset } from './spark';\n\nimport { blaze } from './blaze';\nimport { ember } from './ember';\nimport { flamelet } from './flamelet';\nimport { smolder } from './smolder';\nimport { spark } from './spark';\n\nexport const firePresets = {\n\tspark,\n\tember,\n\tflamelet,\n\tblaze,\n\tsmolder,\n} as const;\n","import {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const gasHazePreset = defineSemanticParticlePreset({\n\tfamily: 'gas',\n\tvariant: 'haze',\n\tdescription: 'broad, thin atmospheric contamination',\n\taxes: {\n\t\t'opacity feel': 'low',\n\t\ttoxicity: 'low-medium',\n\t\tbuoyancy: 'neutral',\n\t\t'spread tendency': 'high',\n\t\tthickness: 'thin',\n\t\t'staining / contaminating character': 'low',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 4.4,\n\t\t\tlooping: true,\n\t\t\tcolor: '#cbd5e1',\n\t\t\tlife: [3.4, 5.4],\n\t\t\tsize: [0.9, 1.7],\n\t\t\tspeed: [0.02, 0.08],\n\t\t\trotation: [-Math.PI, Math.PI],\n\t\t\topacity: 0.18,\n\t\t},\n\t\temission: { type: 'rate', rate: 10 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.64,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.5,\n\t\t\tspeed: [0.01, 0.04],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#f8fafc', 0],\n\t\t\t\t\t['#cbd5e1', 0.4],\n\t\t\t\t\t['#94a3b8', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.04, 0],\n\t\t\t\t\t[0.2, 0.24],\n\t\t\t\t\t[0.08, 0.88],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.88, 1.08, 1.28, 1.42],\n\t\t\tnoise: {\n\t\t\t\tfrequency: [0.6, 1.4],\n\t\t\t\tpower: [0.02, 0.06],\n\t\t\t\tpositionAmount: [0.08, 0.16],\n\t\t\t\trotationAmount: [0.06, 0.1],\n\t\t\t},\n\t\t},\n\t},\n});\n\nexport function haze(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(gasHazePreset, options);\n}\n","import {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const gasMiasmaPreset = defineSemanticParticlePreset({\n\tfamily: 'gas',\n\tvariant: 'miasma',\n\tdescription: 'thick, toxic, contaminating exhalation',\n\taxes: {\n\t\t'opacity feel': 'medium',\n\t\ttoxicity: 'high',\n\t\tbuoyancy: 'low-medium',\n\t\t'spread tendency': 'high',\n\t\tthickness: 'sticky',\n\t\t'staining / contaminating character': 'high',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 3.8,\n\t\t\tlooping: true,\n\t\t\tcolor: '#84cc16',\n\t\t\tlife: [2.8, 4.6],\n\t\t\tsize: [0.52, 1.08],\n\t\t\tspeed: [0.03, 0.16],\n\t\t\trotation: [-Math.PI, Math.PI],\n\t\t\topacity: 0.5,\n\t\t},\n\t\temission: { type: 'rate', rate: 16 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.3,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.3,\n\t\t\tspeed: [0.02, 0.08],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#ecfccb', 0],\n\t\t\t\t\t['#84cc16', 0.4],\n\t\t\t\t\t['#3f6212', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.08, 0],\n\t\t\t\t\t[0.58, 0.14],\n\t\t\t\t\t[0.24, 0.8],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.4, 0.92, 1.3, 1.9],\n\t\t\tnoise: {\n\t\t\t\tfrequency: [1.8, 3.8],\n\t\t\t\tpower: [0.08, 0.18],\n\t\t\t\tpositionAmount: [0.16, 0.34],\n\t\t\t\trotationAmount: [0.08, 0.18],\n\t\t\t},\n\t\t},\n\t},\n});\n\nexport function miasma(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(gasMiasmaPreset, options);\n}\n","import {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const gasPlumePreset = defineSemanticParticlePreset({\n\tfamily: 'gas',\n\tvariant: 'plume',\n\tdescription: 'columnar rising release with strong lift',\n\taxes: {\n\t\t'opacity feel': 'medium',\n\t\ttoxicity: 'medium',\n\t\tbuoyancy: 'very-high',\n\t\t'spread tendency': 'medium',\n\t\tthickness: 'medium',\n\t\t'staining / contaminating character': 'medium',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 2.8,\n\t\t\tlooping: true,\n\t\t\tcolor: '#94a3b8',\n\t\t\tlife: [1.8, 3.2],\n\t\t\tsize: [0.32, 0.72],\n\t\t\tspeed: [0.16, 0.52],\n\t\t\trotation: [-Math.PI, Math.PI],\n\t\t\topacity: 0.48,\n\t\t},\n\t\temission: { type: 'rate', rate: 22 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.18,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.18,\n\t\t\tspeed: [0.08, 0.24],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#e2e8f0', 0],\n\t\t\t\t\t['#94a3b8', 0.36],\n\t\t\t\t\t['#475569', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.06, 0],\n\t\t\t\t\t[0.54, 0.14],\n\t\t\t\t\t[0.2, 0.84],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.42, 0.92, 1.36, 1.84],\n\t\t\tforceOverLife: {\n\t\t\t\ty: [0.28, 0.6],\n\t\t\t},\n\t\t\tnoise: {\n\t\t\t\tfrequency: [1.6, 3.4],\n\t\t\t\tpower: [0.08, 0.14],\n\t\t\t\tpositionAmount: [0.14, 0.28],\n\t\t\t\trotationAmount: [0.08, 0.16],\n\t\t\t},\n\t\t},\n\t},\n});\n\nexport function plume(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(gasPlumePreset, options);\n}\n","import {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const gasSmokePreset = defineSemanticParticlePreset({\n\tfamily: 'gas',\n\tvariant: 'smoke',\n\tdescription: 'opaque, buoyant, lingering combustion residue',\n\taxes: {\n\t\t'opacity feel': 'medium-high',\n\t\ttoxicity: 'medium',\n\t\tbuoyancy: 'high',\n\t\t'spread tendency': 'medium',\n\t\tthickness: 'medium',\n\t\t'staining / contaminating character': 'medium',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 3.2,\n\t\t\tlooping: true,\n\t\t\tcolor: '#737373',\n\t\t\tlife: [2.4, 4.2],\n\t\t\tsize: [0.45, 0.92],\n\t\t\tspeed: [0.08, 0.3],\n\t\t\trotation: [-Math.PI, Math.PI],\n\t\t\topacity: 0.58,\n\t\t},\n\t\temission: { type: 'rate', rate: 14 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.24,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.28,\n\t\t\tspeed: [0.04, 0.14],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#d4d4d8', 0],\n\t\t\t\t\t['#737373', 0.4],\n\t\t\t\t\t['#404040', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.08, 0],\n\t\t\t\t\t[0.68, 0.14],\n\t\t\t\t\t[0.24, 0.84],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.38, 0.88, 1.4, 2.08],\n\t\t\tforceOverLife: {\n\t\t\t\ty: [0.12, 0.28],\n\t\t\t},\n\t\t\tnoise: {\n\t\t\t\tfrequency: [1.2, 2.8],\n\t\t\t\tpower: [0.08, 0.16],\n\t\t\t\tpositionAmount: [0.12, 0.26],\n\t\t\t\trotationAmount: [0.08, 0.18],\n\t\t\t},\n\t\t},\n\t},\n});\n\nexport function smoke(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(gasSmokePreset, options);\n}\n","import {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const gasVaporPreset = defineSemanticParticlePreset({\n\tfamily: 'gas',\n\tvariant: 'vapor',\n\tdescription: 'visible gaseous release with light buoyancy',\n\taxes: {\n\t\t'opacity feel': 'light',\n\t\ttoxicity: 'neutral',\n\t\tbuoyancy: 'high',\n\t\t'spread tendency': 'medium',\n\t\tthickness: 'thin',\n\t\t'staining / contaminating character': 'low',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 3,\n\t\t\tlooping: true,\n\t\t\tcolor: '#e2e8f0',\n\t\t\tlife: [2.2, 3.6],\n\t\t\tsize: [0.38, 0.78],\n\t\t\tspeed: [0.04, 0.18],\n\t\t\trotation: [-Math.PI, Math.PI],\n\t\t\topacity: 0.28,\n\t\t},\n\t\temission: { type: 'rate', rate: 18 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.28,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.36,\n\t\t\tspeed: [0.02, 0.08],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#f8fafc', 0],\n\t\t\t\t\t['#e2e8f0', 0.36],\n\t\t\t\t\t['#cbd5e1', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.06, 0],\n\t\t\t\t\t[0.34, 0.22],\n\t\t\t\t\t[0.12, 0.84],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.42, 0.9, 1.38, 1.98],\n\t\t\tforceOverLife: {\n\t\t\t\ty: [0.06, 0.18],\n\t\t\t},\n\t\t\tnoise: {\n\t\t\t\tfrequency: [1, 2],\n\t\t\t\tpower: [0.04, 0.08],\n\t\t\t\tpositionAmount: [0.1, 0.2],\n\t\t\t\trotationAmount: [0.08, 0.14],\n\t\t\t},\n\t\t},\n\t},\n});\n\nexport function vapor(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(gasVaporPreset, options);\n}\n","export { haze, gasHazePreset } from './haze';\nexport { miasma, gasMiasmaPreset } from './miasma';\nexport { plume, gasPlumePreset } from './plume';\nexport { smoke, gasSmokePreset } from './smoke';\nexport { vapor, gasVaporPreset } from './vapor';\n\nimport { haze } from './haze';\nimport { miasma } from './miasma';\nimport { plume } from './plume';\nimport { smoke } from './smoke';\nimport { vapor } from './vapor';\n\nexport const gasPresets = {\n\tvapor,\n\tsmoke,\n\thaze,\n\tplume,\n\tmiasma,\n} as const;\n","import {\n\tcreateMagicModifier,\n\ttype ParticleMagicModifierOptions,\n} from '../../preset-builder';\n\nexport function arcane(\n\toptions: Omit<ParticleMagicModifierOptions, 'alignment'> = {},\n) {\n\treturn createMagicModifier('arcane', options);\n}\n","import {\n\tcreateMagicModifier,\n\ttype ParticleMagicModifierOptions,\n} from '../../preset-builder';\n\nexport function corrupted(\n\toptions: Omit<ParticleMagicModifierOptions, 'alignment'> = {},\n) {\n\treturn createMagicModifier('corrupted', options);\n}\n","import {\n\tcreateMagicModifier,\n\ttype ParticleMagicModifierOptions,\n} from '../../preset-builder';\n\nexport function holy(\n\toptions: Omit<ParticleMagicModifierOptions, 'alignment'> = {},\n) {\n\treturn createMagicModifier('holy', options);\n}\n","import {\n\tcreateMagicModifier,\n\ttype ParticleMagicModifierOptions,\n} from '../../preset-builder';\n\nexport function nature(\n\toptions: Omit<ParticleMagicModifierOptions, 'alignment'> = {},\n) {\n\treturn createMagicModifier('nature', options);\n}\n","import {\n\tcreateMagicModifier,\n\ttype ParticleMagicModifierOptions,\n} from '../../preset-builder';\n\nexport function psychic(\n\toptions: Omit<ParticleMagicModifierOptions, 'alignment'> = {},\n) {\n\treturn createMagicModifier('psychic', options);\n}\n","import {\n\tcreateMagicModifier,\n\ttype ParticleMagicModifierOptions,\n} from '../../preset-builder';\n\nexport function voidMagic(\n\toptions: Omit<ParticleMagicModifierOptions, 'alignment'> = {},\n) {\n\treturn createMagicModifier('void', options);\n}\n","export { arcane } from './arcane';\nexport { corrupted } from './corrupted';\nexport { holy } from './holy';\nexport { nature } from './nature';\nexport { psychic } from './psychic';\nexport { voidMagic } from './void';\n\nimport { arcane } from './arcane';\nimport { corrupted } from './corrupted';\nimport { holy } from './holy';\nimport { nature } from './nature';\nimport { psychic } from './psychic';\nimport { voidMagic } from './void';\n\nexport const magicPresets = {\n\tarcane,\n\tholy,\n\tcorrupted,\n\tnature,\n\tvoid: voidMagic,\n\tpsychic,\n} as const;\n","import { RenderMode } from 'three.quarks';\n\nimport {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const waterDrizzlePreset = defineSemanticParticlePreset({\n\tfamily: 'water',\n\tvariant: 'drizzle',\n\tdescription: 'soft, continuous, light fall',\n\taxes: {\n\t\tpressure: 'low',\n\t\t'surface tension feel': 'light',\n\t\taeration: 'low',\n\t\tcoherence: 'discrete',\n\t\t'gravitational obedience': 'very-high',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 1.4,\n\t\t\tlooping: true,\n\t\t\tcolor: '#e0f2fe',\n\t\t\tlife: [0.6, 1.05],\n\t\t\tsize: [0.05, 0.1],\n\t\t\tspeed: [2.8, 4.4],\n\t\t\topacity: 0.62,\n\t\t\trenderMode: RenderMode.StretchedBillBoard,\n\t\t},\n\t\temission: { type: 'rate', rate: 26 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.46,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.04,\n\t\t\tspeed: [1.8, 2.6],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#f8fafc', 0],\n\t\t\t\t\t['#e0f2fe', 0.45],\n\t\t\t\t\t['#7dd3fc', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.12, 0],\n\t\t\t\t\t[0.78, 0.08],\n\t\t\t\t\t[0.52, 0.58],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tspeedOverLife: [1.02, 1, 0.94, 0.88],\n\t\t\tforceOverLife: {\n\t\t\t\ty: [-8.2, -6.4],\n\t\t\t},\n\t\t},\n\t\trendererEmitterSettings: {\n\t\t\tspeedFactor: 0.42,\n\t\t\tlengthFactor: 1.24,\n\t\t},\n\t},\n});\n\nexport function drizzle(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(waterDrizzlePreset, options);\n}\n","import {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const waterMistPreset = defineSemanticParticlePreset({\n\tfamily: 'water',\n\tvariant: 'mist',\n\tdescription: 'diffuse suspended moisture',\n\taxes: {\n\t\tpressure: 'low',\n\t\t'surface tension feel': 'soft',\n\t\taeration: 'low',\n\t\tcoherence: 'diffuse',\n\t\t'gravitational obedience': 'low',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 3.2,\n\t\t\tlooping: true,\n\t\t\tcolor: '#dbeafe',\n\t\t\tlife: [2.4, 3.8],\n\t\t\tsize: [0.4, 0.82],\n\t\t\tspeed: [0.05, 0.2],\n\t\t\trotation: [-Math.PI, Math.PI],\n\t\t\topacity: 0.36,\n\t\t},\n\t\temission: { type: 'rate', rate: 16 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.32,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.42,\n\t\t\tspeed: [0.02, 0.08],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#f8fafc', 0],\n\t\t\t\t\t['#dbeafe', 0.35],\n\t\t\t\t\t['#bfdbfe', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.08, 0],\n\t\t\t\t\t[0.44, 0.2],\n\t\t\t\t\t[0.18, 0.82],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.38, 0.86, 1.42, 2.02],\n\t\t\tforceOverLife: {\n\t\t\t\ty: [0.02, 0.12],\n\t\t\t},\n\t\t\tnoise: {\n\t\t\t\tfrequency: [0.8, 1.8],\n\t\t\t\tpower: [0.04, 0.1],\n\t\t\t\tpositionAmount: [0.1, 0.18],\n\t\t\t\trotationAmount: [0.08, 0.14],\n\t\t\t},\n\t\t},\n\t},\n});\n\nexport function mist(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(waterMistPreset, options);\n}\n","import { RenderMode } from 'three.quarks';\n\nimport {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const waterSplashPreset = defineSemanticParticlePreset({\n\tfamily: 'water',\n\tvariant: 'splash',\n\tdescription: 'sudden impact-driven burst',\n\taxes: {\n\t\tpressure: 'impact-driven',\n\t\t'surface tension feel': 'beaded',\n\t\taeration: 'medium',\n\t\tcoherence: 'shattering',\n\t\t'gravitational obedience': 'high',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 0.34,\n\t\t\tcolor: '#7dd3fc',\n\t\t\tlife: [0.26, 0.55],\n\t\t\tsize: [0.1, 0.22],\n\t\t\tspeed: [1.4, 3.1],\n\t\t\trotation: [-Math.PI, Math.PI],\n\t\t\topacity: 0.82,\n\t\t\trenderMode: RenderMode.StretchedBillBoard,\n\t\t},\n\t\temission: { type: 'burst', count: 18 },\n\t\tshape: {\n\t\t\ttype: 'sphere',\n\t\t\tradius: 0.08,\n\t\t\tthickness: 0.96,\n\t\t\tspeed: [0.7, 1.4],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#ffffff', 0],\n\t\t\t\t\t['#bae6fd', 0.4],\n\t\t\t\t\t['#38bdf8', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.18, 0],\n\t\t\t\t\t[0.88, 0.08],\n\t\t\t\t\t[0.42, 0.54],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.32, 0.86, 0.92, 0.08],\n\t\t\tspeedOverLife: [1.12, 0.88, 0.46, 0.08],\n\t\t\tforceOverLife: {\n\t\t\t\ty: [-4.4, -2.6],\n\t\t\t},\n\t\t},\n\t\trendererEmitterSettings: {\n\t\t\tspeedFactor: 0.36,\n\t\t\tlengthFactor: 0.88,\n\t\t},\n\t},\n});\n\nexport function splash(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(waterSplashPreset, options);\n}\n","import { RenderMode } from 'three.quarks';\n\nimport {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const waterSprayPreset = defineSemanticParticlePreset({\n\tfamily: 'water',\n\tvariant: 'spray',\n\tdescription: 'fine ejected droplets',\n\taxes: {\n\t\tpressure: 'medium-high',\n\t\t'surface tension feel': 'light',\n\t\taeration: 'medium',\n\t\tcoherence: 'broken',\n\t\t'gravitational obedience': 'high',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 1,\n\t\t\tlooping: true,\n\t\t\tcolor: '#93c5fd',\n\t\t\tlife: [0.45, 0.9],\n\t\t\tsize: [0.08, 0.16],\n\t\t\tspeed: [1.1, 2.3],\n\t\t\trotation: [-Math.PI, Math.PI],\n\t\t\topacity: 0.72,\n\t\t\trenderMode: RenderMode.StretchedBillBoard,\n\t\t},\n\t\temission: { type: 'rate', rate: 38 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.12,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.24,\n\t\t\tspeed: [0.85, 1.8],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#eff6ff', 0],\n\t\t\t\t\t['#93c5fd', 0.45],\n\t\t\t\t\t['#60a5fa', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.16, 0],\n\t\t\t\t\t[0.82, 0.08],\n\t\t\t\t\t[0.52, 0.58],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.72, 0.96, 0.82, 0.28],\n\t\t\tspeedOverLife: [1.04, 0.92, 0.68, 0.38],\n\t\t\tforceOverLife: {\n\t\t\t\ty: [-5.8, -3.8],\n\t\t\t},\n\t\t\tnoise: {\n\t\t\t\tfrequency: [1.2, 2.2],\n\t\t\t\tpower: [0.04, 0.08],\n\t\t\t\tpositionAmount: [0.08, 0.16],\n\t\t\t\trotationAmount: [0.04, 0.08],\n\t\t\t},\n\t\t},\n\t\trendererEmitterSettings: {\n\t\t\tspeedFactor: 0.5,\n\t\t\tlengthFactor: 0.95,\n\t\t},\n\t},\n});\n\nexport function spray(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(waterSprayPreset, options);\n}\n","import { RenderMode } from 'three.quarks';\n\nimport {\n\tcreateSemanticParticleEffect,\n\tdefineSemanticParticlePreset,\n\ttype SemanticParticlePresetOptions,\n} from '../../preset-builder';\n\nexport const waterTorrentPreset = defineSemanticParticlePreset({\n\tfamily: 'water',\n\tvariant: 'torrent',\n\tdescription: 'strong, forceful, dense flow',\n\taxes: {\n\t\tpressure: 'high',\n\t\t'surface tension feel': 'driven',\n\t\taeration: 'medium',\n\t\tcoherence: 'strong',\n\t\t'gravitational obedience': 'high',\n\t},\n\tsystem: {\n\t\tdefaults: {\n\t\t\tduration: 1,\n\t\t\tlooping: true,\n\t\t\tcolor: '#38bdf8',\n\t\t\tlife: [0.35, 0.75],\n\t\t\tsize: [0.1, 0.22],\n\t\t\tspeed: [2.6, 4.9],\n\t\t\trotation: [-0.3, 0.3],\n\t\t\topacity: 0.84,\n\t\t\trenderMode: RenderMode.StretchedBillBoard,\n\t\t},\n\t\temission: { type: 'rate', rate: 60 },\n\t\tshape: {\n\t\t\ttype: 'cone',\n\t\t\tradius: 0.18,\n\t\t\tthickness: 1,\n\t\t\tangle: 0.12,\n\t\t\tspeed: [1.8, 3.1],\n\t\t},\n\t\tbehaviors: {\n\t\t\tcolorOverLife: {\n\t\t\t\tcolors: [\n\t\t\t\t\t['#f0f9ff', 0],\n\t\t\t\t\t['#7dd3fc', 0.35],\n\t\t\t\t\t['#0ea5e9', 1],\n\t\t\t\t],\n\t\t\t\talpha: [\n\t\t\t\t\t[0.18, 0],\n\t\t\t\t\t[0.92, 0.08],\n\t\t\t\t\t[0.56, 0.52],\n\t\t\t\t\t[0, 1],\n\t\t\t\t],\n\t\t\t},\n\t\t\tsizeOverLife: [0.72, 0.94, 0.84, 0.28],\n\t\t\tspeedOverLife: [1.04, 0.92, 0.68, 0.34],\n\t\t\tforceOverLife: {\n\t\t\t\ty: [-6.8, -4.8],\n\t\t\t},\n\t\t\tnoise: {\n\t\t\t\tfrequency: [1.4, 2.6],\n\t\t\t\tpower: [0.04, 0.09],\n\t\t\t\tpositionAmount: [0.08, 0.14],\n\t\t\t\trotationAmount: [0.06, 0.1],\n\t\t\t},\n\t\t},\n\t\trendererEmitterSettings: {\n\t\t\tspeedFactor: 0.56,\n\t\t\tlengthFactor: 1.08,\n\t\t},\n\t},\n});\n\nexport function torrent(\n\toptions: SemanticParticlePresetOptions = {},\n) {\n\treturn createSemanticParticleEffect(waterTorrentPreset, options);\n}\n","export { drizzle, waterDrizzlePreset } from './drizzle';\nexport { mist, waterMistPreset } from './mist';\nexport { splash, waterSplashPreset } from './splash';\nexport { spray, waterSprayPreset } from './spray';\nexport { torrent, waterTorrentPreset } from './torrent';\n\nimport { drizzle } from './drizzle';\nimport { mist } from './mist';\nimport { splash } from './splash';\nimport { spray } from './spray';\nimport { torrent } from './torrent';\n\nexport const waterPresets = {\n\tmist,\n\tspray,\n\tsplash,\n\tdrizzle,\n\ttorrent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ACpB,OAAO,CAAC,MAAM,IAAI;AAAA,QAClB,gBAAgB,CAAC,MAAM,IAAI;AAAA,QAC3B,gBAAgB,CAAC,MAAM,GAAG;AAAA,MAC3B;AAAA,IACD;AAAA,IACA,yBAAyB;AAAA,MACxB,aAAa;AAAA,MACb,cAAc;AAAA,IACf;AAAA,EACD;AACD,CAAC;AAEM,SAAS,QACf,UAAyC,CAAC,GACzC;AACD,SAAO,6BAA6B,oBAAoB,OAAO;AAChE;;;AChEO,IAAM,eAAe;AAAA,EAC3B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;","names":["RenderMode","RenderMode","RenderMode","RenderMode","RenderMode","RenderMode","RenderMode","RenderMode","RenderMode","RenderMode","RenderMode","RenderMode","RenderMode","RenderMode","spark","spark","RenderMode","RenderMode","RenderMode","RenderMode","RenderMode","RenderMode","RenderMode","RenderMode"]}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
// src/lib/destructible-prebake/source-geometry.ts
|
|
2
|
+
import {
|
|
3
|
+
BufferAttribute,
|
|
4
|
+
Matrix4
|
|
5
|
+
} from "three";
|
|
6
|
+
function cloneAttributeAsFloat32(attribute) {
|
|
7
|
+
const values = new Float32Array(attribute.count * attribute.itemSize);
|
|
8
|
+
let offset = 0;
|
|
9
|
+
for (let index = 0; index < attribute.count; index += 1) {
|
|
10
|
+
for (let component = 0; component < attribute.itemSize; component += 1) {
|
|
11
|
+
values[offset] = attribute.getComponent(index, component);
|
|
12
|
+
offset += 1;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return new BufferAttribute(values, attribute.itemSize);
|
|
16
|
+
}
|
|
17
|
+
function normalizeFractureSourceGeometry(sourceGeometry) {
|
|
18
|
+
const geometry = sourceGeometry.clone();
|
|
19
|
+
for (const [name, attribute] of Object.entries(geometry.attributes)) {
|
|
20
|
+
geometry.setAttribute(name, cloneAttributeAsFloat32(attribute));
|
|
21
|
+
}
|
|
22
|
+
const index = geometry.getIndex();
|
|
23
|
+
if (!index) {
|
|
24
|
+
return geometry;
|
|
25
|
+
}
|
|
26
|
+
const indices = new Uint32Array(index.count);
|
|
27
|
+
for (let cursor = 0; cursor < index.count; cursor += 1) {
|
|
28
|
+
indices[cursor] = index.getX(cursor);
|
|
29
|
+
}
|
|
30
|
+
geometry.setIndex(new BufferAttribute(indices, 1));
|
|
31
|
+
return geometry.toNonIndexed();
|
|
32
|
+
}
|
|
33
|
+
function buildNormalizedFractureSourceGeometry(mesh, root) {
|
|
34
|
+
const geometry = normalizeFractureSourceGeometry(mesh.geometry);
|
|
35
|
+
root.updateMatrixWorld(true);
|
|
36
|
+
mesh.updateMatrixWorld(true);
|
|
37
|
+
const relativeMatrix = new Matrix4().copy(root.matrixWorld).invert().multiply(mesh.matrixWorld);
|
|
38
|
+
geometry.applyMatrix4(relativeMatrix);
|
|
39
|
+
geometry.computeBoundingBox();
|
|
40
|
+
geometry.computeBoundingSphere();
|
|
41
|
+
return geometry;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// src/lib/destructible-prebake/cache-key.ts
|
|
45
|
+
function vector2ToTuple(value) {
|
|
46
|
+
if (!value) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
return [value.x, value.y];
|
|
50
|
+
}
|
|
51
|
+
function vector3ToTuple(value) {
|
|
52
|
+
if (!value) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
return [value.x, value.y, value.z];
|
|
56
|
+
}
|
|
57
|
+
function buildFractureGeometryCacheKey(options) {
|
|
58
|
+
return JSON.stringify({
|
|
59
|
+
fractureMethod: options.fractureMethod,
|
|
60
|
+
fragmentCount: options.fragmentCount,
|
|
61
|
+
fracturePlanes: {
|
|
62
|
+
x: options.fracturePlanes?.x ?? true,
|
|
63
|
+
y: options.fracturePlanes?.y ?? true,
|
|
64
|
+
z: options.fracturePlanes?.z ?? true
|
|
65
|
+
},
|
|
66
|
+
textureScale: vector2ToTuple(options.textureScale),
|
|
67
|
+
textureOffset: vector2ToTuple(options.textureOffset),
|
|
68
|
+
seed: options.seed ?? null,
|
|
69
|
+
voronoiOptions: options.voronoiOptions ? {
|
|
70
|
+
mode: options.voronoiOptions.mode,
|
|
71
|
+
seedPoints: options.voronoiOptions.seedPoints?.map((point) => vector3ToTuple(point)),
|
|
72
|
+
projectionAxis: options.voronoiOptions.projectionAxis ?? null,
|
|
73
|
+
projectionNormal: vector3ToTuple(options.voronoiOptions.projectionNormal),
|
|
74
|
+
useApproximation: options.voronoiOptions.useApproximation ?? false,
|
|
75
|
+
approximationNeighborCount: options.voronoiOptions.approximationNeighborCount ?? 12
|
|
76
|
+
} : null
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// src/lib/destructible-prebake/payload.ts
|
|
81
|
+
import { FractureOptions } from "@dgreenheck/three-pinata";
|
|
82
|
+
import {
|
|
83
|
+
BufferAttribute as BufferAttribute2,
|
|
84
|
+
BufferGeometry as BufferGeometry2,
|
|
85
|
+
Quaternion,
|
|
86
|
+
Vector2,
|
|
87
|
+
Vector3
|
|
88
|
+
} from "three";
|
|
89
|
+
function bufferGeometryToPlain(geometry) {
|
|
90
|
+
const attributes = {};
|
|
91
|
+
const transferables = [];
|
|
92
|
+
for (const name of Object.keys(geometry.attributes)) {
|
|
93
|
+
const attr = geometry.getAttribute(name);
|
|
94
|
+
if (!attr || !(attr instanceof BufferAttribute2)) {
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
const view = attr.array;
|
|
98
|
+
const buffer = view.buffer.slice(
|
|
99
|
+
view.byteOffset,
|
|
100
|
+
view.byteOffset + view.byteLength
|
|
101
|
+
);
|
|
102
|
+
transferables.push(buffer);
|
|
103
|
+
attributes[name] = {
|
|
104
|
+
array: buffer,
|
|
105
|
+
itemSize: attr.itemSize,
|
|
106
|
+
normalized: attr.normalized
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
return { payload: { attributes }, transferables };
|
|
110
|
+
}
|
|
111
|
+
function plainToBufferGeometry(payload) {
|
|
112
|
+
const geometry = new BufferGeometry2();
|
|
113
|
+
for (const [name, spec] of Object.entries(payload.attributes)) {
|
|
114
|
+
const array = new Float32Array(spec.array);
|
|
115
|
+
geometry.setAttribute(
|
|
116
|
+
name,
|
|
117
|
+
new BufferAttribute2(array, spec.itemSize, spec.normalized)
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
return geometry;
|
|
121
|
+
}
|
|
122
|
+
function pinataFractureOptionsToPlain(options) {
|
|
123
|
+
const voronoi = options.voronoiOptions;
|
|
124
|
+
return {
|
|
125
|
+
fractureMethod: options.fractureMethod,
|
|
126
|
+
fragmentCount: options.fragmentCount,
|
|
127
|
+
fracturePlanes: {
|
|
128
|
+
x: options.fracturePlanes.x,
|
|
129
|
+
y: options.fracturePlanes.y,
|
|
130
|
+
z: options.fracturePlanes.z
|
|
131
|
+
},
|
|
132
|
+
textureScale: [options.textureScale.x, options.textureScale.y],
|
|
133
|
+
textureOffset: [options.textureOffset.x, options.textureOffset.y],
|
|
134
|
+
seed: options.seed,
|
|
135
|
+
voronoiOptions: voronoi ? {
|
|
136
|
+
mode: voronoi.mode,
|
|
137
|
+
seedPoints: voronoi.seedPoints?.map((p) => [p.x, p.y, p.z]),
|
|
138
|
+
impactPoint: voronoi.impactPoint ? [voronoi.impactPoint.x, voronoi.impactPoint.y, voronoi.impactPoint.z] : void 0,
|
|
139
|
+
impactRadius: voronoi.impactRadius,
|
|
140
|
+
projectionAxis: voronoi.projectionAxis ?? null,
|
|
141
|
+
projectionNormal: voronoi.projectionNormal ? [
|
|
142
|
+
voronoi.projectionNormal.x,
|
|
143
|
+
voronoi.projectionNormal.y,
|
|
144
|
+
voronoi.projectionNormal.z
|
|
145
|
+
] : void 0,
|
|
146
|
+
useApproximation: voronoi.useApproximation ?? false,
|
|
147
|
+
approximationNeighborCount: voronoi.approximationNeighborCount ?? 12
|
|
148
|
+
} : void 0
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
function plainFractureOptionsToPinata(plain) {
|
|
152
|
+
return new FractureOptions({
|
|
153
|
+
fractureMethod: plain.fractureMethod,
|
|
154
|
+
fragmentCount: plain.fragmentCount,
|
|
155
|
+
fracturePlanes: plain.fracturePlanes,
|
|
156
|
+
textureScale: new Vector2(plain.textureScale[0], plain.textureScale[1]),
|
|
157
|
+
textureOffset: new Vector2(plain.textureOffset[0], plain.textureOffset[1]),
|
|
158
|
+
seed: plain.seed,
|
|
159
|
+
voronoiOptions: plain.voronoiOptions ? {
|
|
160
|
+
mode: plain.voronoiOptions.mode,
|
|
161
|
+
seedPoints: plain.voronoiOptions.seedPoints?.map(
|
|
162
|
+
([x, y, z]) => new Vector3(x, y, z)
|
|
163
|
+
),
|
|
164
|
+
impactPoint: plain.voronoiOptions.impactPoint ? new Vector3(
|
|
165
|
+
plain.voronoiOptions.impactPoint[0],
|
|
166
|
+
plain.voronoiOptions.impactPoint[1],
|
|
167
|
+
plain.voronoiOptions.impactPoint[2]
|
|
168
|
+
) : void 0,
|
|
169
|
+
impactRadius: plain.voronoiOptions.impactRadius,
|
|
170
|
+
projectionAxis: plain.voronoiOptions.projectionAxis === null ? void 0 : plain.voronoiOptions.projectionAxis ?? void 0,
|
|
171
|
+
projectionNormal: plain.voronoiOptions.projectionNormal ? new Vector3(
|
|
172
|
+
plain.voronoiOptions.projectionNormal[0],
|
|
173
|
+
plain.voronoiOptions.projectionNormal[1],
|
|
174
|
+
plain.voronoiOptions.projectionNormal[2]
|
|
175
|
+
) : void 0,
|
|
176
|
+
useApproximation: plain.voronoiOptions.useApproximation,
|
|
177
|
+
approximationNeighborCount: plain.voronoiOptions.approximationNeighborCount
|
|
178
|
+
} : void 0
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
function plainWorkerResultToTemplateParts(response) {
|
|
182
|
+
return response.fragments.map((fragment) => {
|
|
183
|
+
const geometry = plainToBufferGeometry({ attributes: fragment.attributes });
|
|
184
|
+
geometry.computeBoundingBox();
|
|
185
|
+
geometry.computeBoundingSphere();
|
|
186
|
+
return {
|
|
187
|
+
geometry,
|
|
188
|
+
position: new Vector3(
|
|
189
|
+
fragment.position[0],
|
|
190
|
+
fragment.position[1],
|
|
191
|
+
fragment.position[2]
|
|
192
|
+
),
|
|
193
|
+
quaternion: new Quaternion(
|
|
194
|
+
fragment.quaternion[0],
|
|
195
|
+
fragment.quaternion[1],
|
|
196
|
+
fragment.quaternion[2],
|
|
197
|
+
fragment.quaternion[3]
|
|
198
|
+
),
|
|
199
|
+
scale: new Vector3(
|
|
200
|
+
fragment.scale[0],
|
|
201
|
+
fragment.scale[1],
|
|
202
|
+
fragment.scale[2]
|
|
203
|
+
)
|
|
204
|
+
};
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
function destructibleFragmentsToPlainResponse(fragments) {
|
|
208
|
+
const out = [];
|
|
209
|
+
const transferables = [];
|
|
210
|
+
for (const fragment of fragments) {
|
|
211
|
+
const { payload, transferables: geoTransfer } = bufferGeometryToPlain(
|
|
212
|
+
fragment.geometry
|
|
213
|
+
);
|
|
214
|
+
for (const buffer of geoTransfer) {
|
|
215
|
+
transferables.push(buffer);
|
|
216
|
+
}
|
|
217
|
+
out.push({
|
|
218
|
+
attributes: payload.attributes,
|
|
219
|
+
position: [fragment.position.x, fragment.position.y, fragment.position.z],
|
|
220
|
+
quaternion: [
|
|
221
|
+
fragment.quaternion.x,
|
|
222
|
+
fragment.quaternion.y,
|
|
223
|
+
fragment.quaternion.z,
|
|
224
|
+
fragment.quaternion.w
|
|
225
|
+
],
|
|
226
|
+
scale: [fragment.scale.x, fragment.scale.y, fragment.scale.z]
|
|
227
|
+
});
|
|
228
|
+
fragment.geometry.dispose();
|
|
229
|
+
}
|
|
230
|
+
return { response: { fragments: out }, transferables };
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export {
|
|
234
|
+
normalizeFractureSourceGeometry,
|
|
235
|
+
buildNormalizedFractureSourceGeometry,
|
|
236
|
+
buildFractureGeometryCacheKey,
|
|
237
|
+
bufferGeometryToPlain,
|
|
238
|
+
plainToBufferGeometry,
|
|
239
|
+
pinataFractureOptionsToPlain,
|
|
240
|
+
plainFractureOptionsToPinata,
|
|
241
|
+
plainWorkerResultToTemplateParts,
|
|
242
|
+
destructibleFragmentsToPlainResponse
|
|
243
|
+
};
|
|
244
|
+
//# sourceMappingURL=chunk-HZMY3TT4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/destructible-prebake/source-geometry.ts","../src/lib/destructible-prebake/cache-key.ts","../src/lib/destructible-prebake/payload.ts"],"sourcesContent":["/**\n * Normalizes source mesh geometry for Voronoi prebake / fracture so runtime and\n * CLI tooling share one code path (float attributes, non-indexed, root-relative transform).\n */\n\nimport {\n\tBufferAttribute,\n\tBufferGeometry,\n\tMatrix4,\n\ttype Group,\n\ttype Mesh,\n} from 'three';\n\ntype ReadableGeometryAttribute = Pick<\n\tBufferAttribute,\n\t'count' | 'itemSize' | 'getComponent'\n>;\n\nfunction cloneAttributeAsFloat32(\n\tattribute: ReadableGeometryAttribute,\n): BufferAttribute {\n\tconst values = new Float32Array(attribute.count * attribute.itemSize);\n\tlet offset = 0;\n\tfor (let index = 0; index < attribute.count; index += 1) {\n\t\tfor (let component = 0; component < attribute.itemSize; component += 1) {\n\t\t\tvalues[offset] = attribute.getComponent(index, component);\n\t\t\toffset += 1;\n\t\t}\n\t}\n\n\treturn new BufferAttribute(values, attribute.itemSize);\n}\n\n/**\n * Clones geometry with float32 attributes and expands indexed meshes to non-indexed.\n */\nexport function normalizeFractureSourceGeometry(\n\tsourceGeometry: BufferGeometry,\n): BufferGeometry {\n\tconst geometry = sourceGeometry.clone();\n\tfor (const [name, attribute] of Object.entries(geometry.attributes)) {\n\t\tgeometry.setAttribute(name, cloneAttributeAsFloat32(attribute));\n\t}\n\n\tconst index = geometry.getIndex();\n\tif (!index) {\n\t\treturn geometry;\n\t}\n\n\tconst indices = new Uint32Array(index.count);\n\tfor (let cursor = 0; cursor < index.count; cursor += 1) {\n\t\tindices[cursor] = index.getX(cursor);\n\t}\n\n\tgeometry.setIndex(new BufferAttribute(indices, 1));\n\treturn geometry.toNonIndexed();\n}\n\n/**\n * Produces fracture-space geometry: normalized mesh vertices in root-local space.\n */\nexport function buildNormalizedFractureSourceGeometry(\n\tmesh: Mesh,\n\troot: Group,\n): BufferGeometry {\n\tconst geometry = normalizeFractureSourceGeometry(mesh.geometry);\n\troot.updateMatrixWorld(true);\n\tmesh.updateMatrixWorld(true);\n\n\tconst relativeMatrix = new Matrix4()\n\t\t.copy(root.matrixWorld)\n\t\t.invert()\n\t\t.multiply(mesh.matrixWorld);\n\n\tgeometry.applyMatrix4(relativeMatrix);\n\tgeometry.computeBoundingBox();\n\tgeometry.computeBoundingSphere();\n\treturn geometry;\n}\n","/**\n * Stable JSON key for matching prebaked fragment templates to fracture options.\n */\n\nimport type { FractureOptions as PinataFractureOptions } from '@dgreenheck/three-pinata';\nimport { Vector2, Vector3 } from 'three';\n\nfunction vector2ToTuple(value?: Vector2): [number, number] | null {\n\tif (!value) {\n\t\treturn null;\n\t}\n\n\treturn [value.x, value.y];\n}\n\nfunction vector3ToTuple(value?: Vector3): [number, number, number] | null {\n\tif (!value) {\n\t\treturn null;\n\t}\n\n\treturn [value.x, value.y, value.z];\n}\n\n/**\n * Serializes fracture options for prebake cache identity (mesh not included).\n */\nexport function buildFractureGeometryCacheKey(\n\toptions: PinataFractureOptions,\n): string {\n\treturn JSON.stringify({\n\t\tfractureMethod: options.fractureMethod,\n\t\tfragmentCount: options.fragmentCount,\n\t\tfracturePlanes: {\n\t\t\tx: options.fracturePlanes?.x ?? true,\n\t\t\ty: options.fracturePlanes?.y ?? true,\n\t\t\tz: options.fracturePlanes?.z ?? true,\n\t\t},\n\t\ttextureScale: vector2ToTuple(options.textureScale),\n\t\ttextureOffset: vector2ToTuple(options.textureOffset),\n\t\tseed: options.seed ?? null,\n\t\tvoronoiOptions: options.voronoiOptions\n\t\t\t? {\n\t\t\t\tmode: options.voronoiOptions.mode,\n\t\t\t\tseedPoints:\n\t\t\t\t\toptions.voronoiOptions.seedPoints?.map((point) => vector3ToTuple(point)),\n\t\t\t\tprojectionAxis: options.voronoiOptions.projectionAxis ?? null,\n\t\t\t\tprojectionNormal: vector3ToTuple(options.voronoiOptions.projectionNormal),\n\t\t\t\tuseApproximation: options.voronoiOptions.useApproximation ?? false,\n\t\t\t\tapproximationNeighborCount:\n\t\t\t\t\toptions.voronoiOptions.approximationNeighborCount ?? 12,\n\t\t\t}\n\t\t\t: null,\n\t});\n}\n","/**\n * Serializable payloads for destructible Voronoi prebake in a Web Worker.\n */\n\nimport { FractureOptions, type DestructibleMesh } from '@dgreenheck/three-pinata';\nimport {\n\tBufferAttribute,\n\tBufferGeometry,\n\tQuaternion,\n\tVector2,\n\tVector3,\n} from 'three';\n\nexport interface PlainBufferGeometryPayload {\n\tattributes: Record<\n\t\tstring,\n\t\t{\n\t\t\tarray: ArrayBuffer;\n\t\t\titemSize: number;\n\t\t\tnormalized?: boolean;\n\t\t}\n\t>;\n}\n\nexport type PlainFractureOptions = {\n\tfractureMethod: 'voronoi' | 'simple';\n\tfragmentCount: number;\n\tfracturePlanes: { x: boolean; y: boolean; z: boolean };\n\ttextureScale: [number, number];\n\ttextureOffset: [number, number];\n\tseed?: number;\n\tvoronoiOptions?: {\n\t\tmode: '3D' | '2.5D';\n\t\tseedPoints?: [number, number, number][];\n\t\timpactPoint?: [number, number, number];\n\t\timpactRadius?: number;\n\t\tprojectionAxis?: 'x' | 'y' | 'z' | 'auto' | null;\n\t\tprojectionNormal?: [number, number, number];\n\t\tuseApproximation: boolean;\n\t\tapproximationNeighborCount: number;\n\t};\n};\n\nexport type PlainWorkerFragmentPayload = {\n\tattributes: PlainBufferGeometryPayload['attributes'];\n\tposition: [number, number, number];\n\tquaternion: [number, number, number, number];\n\tscale: [number, number, number];\n};\n\nexport type PrebakeWorkerRequest = {\n\tgeometry: PlainBufferGeometryPayload;\n\toptions: PlainFractureOptions;\n};\n\nexport type PrebakeWorkerResponse = {\n\tfragments: PlainWorkerFragmentPayload[];\n};\n\nexport interface DestructiblePrebakeWorkerAPI {\n\tprebake(request: PrebakeWorkerRequest): Promise<PrebakeWorkerResponse>;\n}\n\n/**\n * Copies a buffer geometry into detached ArrayBuffers suitable for postMessage transfer.\n */\nexport function bufferGeometryToPlain(geometry: BufferGeometry): {\n\tpayload: PlainBufferGeometryPayload;\n\ttransferables: ArrayBuffer[];\n} {\n\tconst attributes: PlainBufferGeometryPayload['attributes'] = {};\n\tconst transferables: ArrayBuffer[] = [];\n\n\tfor (const name of Object.keys(geometry.attributes)) {\n\t\tconst attr = geometry.getAttribute(name);\n\t\tif (!attr || !(attr instanceof BufferAttribute)) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst view = attr.array as ArrayBufferView;\n\t\tconst buffer = view.buffer.slice(\n\t\t\tview.byteOffset,\n\t\t\tview.byteOffset + view.byteLength,\n\t\t);\n\t\ttransferables.push(buffer);\n\t\tattributes[name] = {\n\t\t\tarray: buffer,\n\t\t\titemSize: attr.itemSize,\n\t\t\tnormalized: attr.normalized,\n\t\t};\n\t}\n\n\treturn { payload: { attributes }, transferables };\n}\n\n/**\n * Rebuilds a BufferGeometry from a plain payload (e.g. in a worker).\n */\nexport function plainToBufferGeometry(\n\tpayload: PlainBufferGeometryPayload,\n): BufferGeometry {\n\tconst geometry = new BufferGeometry();\n\n\tfor (const [name, spec] of Object.entries(payload.attributes)) {\n\t\tconst array = new Float32Array(spec.array);\n\t\tgeometry.setAttribute(\n\t\t\tname,\n\t\t\tnew BufferAttribute(array, spec.itemSize, spec.normalized),\n\t\t);\n\t}\n\n\treturn geometry;\n}\n\n/**\n * Serializes {@link FractureOptions} for structured clone / worker transfer.\n */\nexport function pinataFractureOptionsToPlain(\n\toptions: FractureOptions,\n): PlainFractureOptions {\n\tconst voronoi = options.voronoiOptions;\n\treturn {\n\t\tfractureMethod: options.fractureMethod,\n\t\tfragmentCount: options.fragmentCount,\n\t\tfracturePlanes: {\n\t\t\tx: options.fracturePlanes.x,\n\t\t\ty: options.fracturePlanes.y,\n\t\t\tz: options.fracturePlanes.z,\n\t\t},\n\t\ttextureScale: [options.textureScale.x, options.textureScale.y],\n\t\ttextureOffset: [options.textureOffset.x, options.textureOffset.y],\n\t\tseed: options.seed,\n\t\tvoronoiOptions: voronoi\n\t\t\t? {\n\t\t\t\tmode: voronoi.mode,\n\t\t\t\tseedPoints: voronoi.seedPoints?.map((p) => [p.x, p.y, p.z]),\n\t\t\t\timpactPoint: voronoi.impactPoint\n\t\t\t\t\t? [voronoi.impactPoint.x, voronoi.impactPoint.y, voronoi.impactPoint.z]\n\t\t\t\t\t: undefined,\n\t\t\t\timpactRadius: voronoi.impactRadius,\n\t\t\t\tprojectionAxis: voronoi.projectionAxis ?? null,\n\t\t\t\tprojectionNormal: voronoi.projectionNormal\n\t\t\t\t\t? [\n\t\t\t\t\t\tvoronoi.projectionNormal.x,\n\t\t\t\t\t\tvoronoi.projectionNormal.y,\n\t\t\t\t\t\tvoronoi.projectionNormal.z,\n\t\t\t\t\t]\n\t\t\t\t\t: undefined,\n\t\t\t\tuseApproximation: voronoi.useApproximation ?? false,\n\t\t\t\tapproximationNeighborCount:\n\t\t\t\t\tvoronoi.approximationNeighborCount ?? 12,\n\t\t\t}\n\t\t\t: undefined,\n\t};\n}\n\n/**\n * Reconstructs {@link FractureOptions} from a plain payload.\n */\nexport function plainFractureOptionsToPinata(\n\tplain: PlainFractureOptions,\n): FractureOptions {\n\treturn new FractureOptions({\n\t\tfractureMethod: plain.fractureMethod,\n\t\tfragmentCount: plain.fragmentCount,\n\t\tfracturePlanes: plain.fracturePlanes,\n\t\ttextureScale: new Vector2(plain.textureScale[0], plain.textureScale[1]),\n\t\ttextureOffset: new Vector2(plain.textureOffset[0], plain.textureOffset[1]),\n\t\tseed: plain.seed,\n\t\tvoronoiOptions: plain.voronoiOptions\n\t\t\t? {\n\t\t\t\tmode: plain.voronoiOptions.mode,\n\t\t\t\tseedPoints: plain.voronoiOptions.seedPoints?.map(\n\t\t\t\t\t([x, y, z]) => new Vector3(x, y, z),\n\t\t\t\t),\n\t\t\t\timpactPoint: plain.voronoiOptions.impactPoint\n\t\t\t\t\t? new Vector3(\n\t\t\t\t\t\tplain.voronoiOptions.impactPoint[0],\n\t\t\t\t\t\tplain.voronoiOptions.impactPoint[1],\n\t\t\t\t\t\tplain.voronoiOptions.impactPoint[2],\n\t\t\t\t\t)\n\t\t\t\t\t: undefined,\n\t\t\t\timpactRadius: plain.voronoiOptions.impactRadius,\n\t\t\t\tprojectionAxis:\n\t\t\t\t\tplain.voronoiOptions.projectionAxis === null\n\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t: plain.voronoiOptions.projectionAxis ?? undefined,\n\t\t\t\tprojectionNormal: plain.voronoiOptions.projectionNormal\n\t\t\t\t\t? new Vector3(\n\t\t\t\t\t\tplain.voronoiOptions.projectionNormal[0],\n\t\t\t\t\t\tplain.voronoiOptions.projectionNormal[1],\n\t\t\t\t\t\tplain.voronoiOptions.projectionNormal[2],\n\t\t\t\t\t)\n\t\t\t\t\t: undefined,\n\t\t\t\tuseApproximation: plain.voronoiOptions.useApproximation,\n\t\t\t\tapproximationNeighborCount:\n\t\t\t\t\tplain.voronoiOptions.approximationNeighborCount,\n\t\t\t}\n\t\t\t: undefined,\n\t});\n}\n\n/**\n * Converts worker response fragments into template parts for the main-thread cache.\n */\nexport function plainWorkerResultToTemplateParts(response: PrebakeWorkerResponse): Array<{\n\tgeometry: BufferGeometry;\n\tposition: Vector3;\n\tquaternion: Quaternion;\n\tscale: Vector3;\n}> {\n\treturn response.fragments.map((fragment) => {\n\t\tconst geometry = plainToBufferGeometry({ attributes: fragment.attributes });\n\t\tgeometry.computeBoundingBox();\n\t\tgeometry.computeBoundingSphere();\n\t\treturn {\n\t\t\tgeometry,\n\t\t\tposition: new Vector3(\n\t\t\t\tfragment.position[0],\n\t\t\t\tfragment.position[1],\n\t\t\t\tfragment.position[2],\n\t\t\t),\n\t\t\tquaternion: new Quaternion(\n\t\t\t\tfragment.quaternion[0],\n\t\t\t\tfragment.quaternion[1],\n\t\t\t\tfragment.quaternion[2],\n\t\t\t\tfragment.quaternion[3],\n\t\t\t),\n\t\t\tscale: new Vector3(\n\t\t\t\tfragment.scale[0],\n\t\t\t\tfragment.scale[1],\n\t\t\t\tfragment.scale[2],\n\t\t\t),\n\t\t};\n\t});\n}\n\n/**\n * Serializes fracture fragments for Comlink.transfer (used in the worker).\n */\nexport function destructibleFragmentsToPlainResponse(\n\tfragments: readonly DestructibleMesh[],\n): {\n\tresponse: PrebakeWorkerResponse;\n\ttransferables: ArrayBuffer[];\n} {\n\tconst out: PlainWorkerFragmentPayload[] = [];\n\tconst transferables: ArrayBuffer[] = [];\n\n\tfor (const fragment of fragments) {\n\t\tconst { payload, transferables: geoTransfer } = bufferGeometryToPlain(\n\t\t\tfragment.geometry,\n\t\t);\n\t\tfor (const buffer of geoTransfer) {\n\t\t\ttransferables.push(buffer);\n\t\t}\n\t\tout.push({\n\t\t\tattributes: payload.attributes,\n\t\t\tposition: [fragment.position.x, fragment.position.y, fragment.position.z],\n\t\t\tquaternion: [\n\t\t\t\tfragment.quaternion.x,\n\t\t\t\tfragment.quaternion.y,\n\t\t\t\tfragment.quaternion.z,\n\t\t\t\tfragment.quaternion.w,\n\t\t\t],\n\t\t\tscale: [fragment.scale.x, fragment.scale.y, fragment.scale.z],\n\t\t});\n\t\tfragment.geometry.dispose();\n\t}\n\n\treturn { response: { fragments: out }, transferables };\n}\n"],"mappings":";AAKA;AAAA,EACC;AAAA,EAEA;AAAA,OAGM;AAOP,SAAS,wBACR,WACkB;AAClB,QAAM,SAAS,IAAI,aAAa,UAAU,QAAQ,UAAU,QAAQ;AACpE,MAAI,SAAS;AACb,WAAS,QAAQ,GAAG,QAAQ,UAAU,OAAO,SAAS,GAAG;AACxD,aAAS,YAAY,GAAG,YAAY,UAAU,UAAU,aAAa,G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0 +1,50 @@
|
|
|
1
|
+
// src/lib/behaviors/shared/direction-2d.ts
|
|
2
|
+
var DIRECTION_EPSILON = 1e-6;
|
|
3
|
+
function normalizeDirection2D(x, y) {
|
|
4
|
+
const length = Math.hypot(x, y);
|
|
5
|
+
if (length <= DIRECTION_EPSILON) {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
return {
|
|
9
|
+
x: x / length,
|
|
10
|
+
y: y / length
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function angleFromDirection2D(direction) {
|
|
14
|
+
return Math.atan2(-direction.x, direction.y);
|
|
15
|
+
}
|
|
16
|
+
function directionFromAngle2D(angle) {
|
|
17
|
+
return {
|
|
18
|
+
x: Math.sin(-angle),
|
|
19
|
+
y: Math.cos(-angle)
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function rightFromAngle2D(angle) {
|
|
23
|
+
return {
|
|
24
|
+
x: Math.cos(angle),
|
|
25
|
+
y: Math.sin(angle)
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function rotateLocalOffset2D(offset, angle) {
|
|
29
|
+
const right = rightFromAngle2D(angle);
|
|
30
|
+
const forward = directionFromAngle2D(angle);
|
|
31
|
+
return {
|
|
32
|
+
x: right.x * offset.x + forward.x * offset.y,
|
|
33
|
+
y: right.y * offset.x + forward.y * offset.y
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function getRotationAngle2D(rotation) {
|
|
37
|
+
return Math.atan2(
|
|
38
|
+
2 * (rotation.w * rotation.z + rotation.x * rotation.y),
|
|
39
|
+
1 - 2 * (rotation.y * rotation.y + rotation.z * rotation.z)
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
normalizeDirection2D,
|
|
45
|
+
angleFromDirection2D,
|
|
46
|
+
directionFromAngle2D,
|
|
47
|
+
rotateLocalOffset2D,
|
|
48
|
+
getRotationAngle2D
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=chunk-ID5QJYF5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/behaviors/shared/direction-2d.ts"],"sourcesContent":["export interface Direction2D {\n\tx: number;\n\ty: number;\n}\n\nconst DIRECTION_EPSILON = 1e-6;\n\nexport function normalizeDirection2D(x: number, y: number): Direction2D | null {\n\tconst length = Math.hypot(x, y);\n\tif (length <= DIRECTION_EPSILON) {\n\t\treturn null;\n\t}\n\n\treturn {\n\t\tx: x / length,\n\t\ty: y / length,\n\t};\n}\n\nexport function angleFromDirection2D(direction: Direction2D): number {\n\treturn Math.atan2(-direction.x, direction.y);\n}\n\nexport function directionFromAngle2D(angle: number): Direction2D {\n\treturn {\n\t\tx: Math.sin(-angle),\n\t\ty: Math.cos(-angle),\n\t};\n}\n\nexport function rightFromAngle2D(angle: number): Direction2D {\n\treturn {\n\t\tx: Math.cos(angle),\n\t\ty: Math.sin(angle),\n\t};\n}\n\nexport function rotateLocalOffset2D(\n\toffset: Direction2D,\n\tangle: number,\n): Direction2D {\n\tconst right = rightFromAngle2D(angle);\n\tconst forward = directionFromAngle2D(angle);\n\treturn {\n\t\tx: right.x * offset.x + forward.x * offset.y,\n\t\ty: right.y * offset.x + forward.y * offset.y,\n\t};\n}\n\nexport function getRotationAngle2D(\n\trotation: { x: number; y: number; z: number; w: number },\n): number {\n\treturn Math.atan2(\n\t\t2 * (rotation.w * rotation.z + rotation.x * rotation.y),\n\t\t1 - 2 * (rotation.y * rotation.y + rotation.z * rotation.z),\n\t);\n}\n"],"mappings":";AAKA,IAAM,oBAAoB;AAEnB,SAAS,qBAAqB,GAAW,GAA+B;AAC9E,QAAM,SAAS,KAAK,MAAM,GAAG,CAAC;AAC9B,MAAI,UAAU,mBAAmB;AAChC,WAAO;AAAA,EACR;AAEA,SAAO;AAAA,IACN,GAAG,IAAI;AAAA,IACP,GAAG,IAAI;AAAA,EACR;AACD;AAEO,SAAS,qBAAqB,WAAgC;AACpE,SAAO,KAAK,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC;AAC5C;AAEO,SAAS,qBAAqB,OAA4B;AAChE,SAAO;AAAA,IACN,GAAG,KAAK,IAAI,CAAC,KAAK;AAAA,IAClB,GAAG,KAAK,IAAI,CAAC,KAAK;AAAA,EACnB;AACD;AAEO,SAAS,iBAAiB,OAA4B;AAC5D,SAAO;AAAA,IACN,GAAG,KAAK,IAAI,KAAK;AAAA,IACjB,GAAG,KAAK,IAAI,KAAK;AAAA,EAClB;AACD;AAEO,SAAS,oBACf,QACA,OACc;AACd,QAAM,QAAQ,iBAAiB,KAAK;AACpC,QAAM,UAAU,qBAAqB,KAAK;AAC1C,SAAO;AAAA,IACN,GAAG,MAAM,IAAI,OAAO,IAAI,QAAQ,IAAI,OAAO;AAAA,IAC3C,GAAG,MAAM,IAAI,OAAO,IAAI,QAAQ,IAAI,OAAO;AAAA,EAC5C;AACD;AAEO,SAAS,mBACf,UACS;AACT,SAAO,KAAK;AAAA,IACX,KAAK,SAAS,IAAI,SAAS,IAAI,SAAS,IAAI,SAAS;AAAA,IACrD,IAAI,KAAK,SAAS,IAAI,SAAS,IAAI,SAAS,IAAI,SAAS;AAAA,EAC1D;AACD;","names":[]}
|