@silentstatestudio/perseon 0.0.0-stage → 0.1.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/CHANGELOG.md +192 -0
- package/LICENSE.md +30 -0
- package/README.md +848 -2
- package/dist/authoring/index.cjs +213 -0
- package/dist/authoring/index.d.cts +866 -0
- package/dist/authoring/index.d.ts +866 -0
- package/dist/authoring/index.js +214 -0
- package/dist/authoring/index.js.map +1 -0
- package/dist/chunk-GDXCMDJ6.js +5462 -0
- package/dist/chunk-GDXCMDJ6.js.map +1 -0
- package/dist/chunk-ON4JV4BI.js +8432 -0
- package/dist/chunk-ON4JV4BI.js.map +1 -0
- package/dist/chunk-PT7F7TTB.cjs +8431 -0
- package/dist/chunk-Q2HLLGJ7.cjs +5461 -0
- package/dist/chunk-SVI6WUOB.js +1 -0
- package/dist/chunk-SVI6WUOB.js.map +1 -0
- package/dist/chunk-ZIMCQTYK.cjs +1 -0
- package/dist/colors-CUEeQ78V.d.cts +2247 -0
- package/dist/colors-pshUJaKB.d.ts +2247 -0
- package/dist/core/index.cjs +29 -0
- package/dist/core/index.d.cts +39 -0
- package/dist/core/index.d.ts +39 -0
- package/dist/core/index.js +30 -0
- package/dist/core/index.js.map +1 -0
- package/dist/index.cjs +29 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/pixi-v7/index.cjs +513 -0
- package/dist/pixi-v7/index.d.cts +372 -0
- package/dist/pixi-v7/index.d.ts +372 -0
- package/dist/pixi-v7/index.js +514 -0
- package/dist/pixi-v7/index.js.map +1 -0
- package/dist/pixi-v8/index.cjs +608 -0
- package/dist/pixi-v8/index.d.cts +380 -0
- package/dist/pixi-v8/index.d.ts +380 -0
- package/dist/pixi-v8/index.js +609 -0
- package/dist/pixi-v8/index.js.map +1 -0
- package/dist/rendering-DeUo1BsK.d.cts +237 -0
- package/dist/rendering-DeUo1BsK.d.ts +237 -0
- package/dist/testing/index.cjs +159 -0
- package/dist/testing/index.d.cts +85 -0
- package/dist/testing/index.d.ts +85 -0
- package/dist/testing/index.js +160 -0
- package/dist/testing/index.js.map +1 -0
- package/package.json +148 -6
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
var _chunkQ2HLLGJ7cjs = require('../chunk-Q2HLLGJ7.cjs');
|
|
41
|
+
|
|
42
|
+
// src/core/parameters/probabilityCurvePresets.ts
|
|
43
|
+
var DEFAULT_PROBABILITY_CURVE_PRESET_ID = "uniform";
|
|
44
|
+
var PROBABILITY_CURVE_PRESETS = [
|
|
45
|
+
{
|
|
46
|
+
id: "uniform",
|
|
47
|
+
label: "Uniform",
|
|
48
|
+
description: "Equal probability across the full range.",
|
|
49
|
+
iconKey: "line-horizontal",
|
|
50
|
+
curve: {
|
|
51
|
+
points: [
|
|
52
|
+
{ x: 0, y: 1 },
|
|
53
|
+
{ x: 1, y: 1 }
|
|
54
|
+
],
|
|
55
|
+
segmentBends: [0]
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: "lowBias",
|
|
60
|
+
label: "Low Bias",
|
|
61
|
+
description: "Higher probability near the minimum side.",
|
|
62
|
+
iconKey: "slope-down",
|
|
63
|
+
curve: {
|
|
64
|
+
points: [
|
|
65
|
+
{ x: 0, y: 1 },
|
|
66
|
+
{ x: 1, y: 0.15 }
|
|
67
|
+
],
|
|
68
|
+
segmentBends: [0]
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: "highBias",
|
|
73
|
+
label: "High Bias",
|
|
74
|
+
description: "Higher probability near the maximum side.",
|
|
75
|
+
iconKey: "slope-up",
|
|
76
|
+
curve: {
|
|
77
|
+
points: [
|
|
78
|
+
{ x: 0, y: 0.15 },
|
|
79
|
+
{ x: 1, y: 1 }
|
|
80
|
+
],
|
|
81
|
+
segmentBends: [0]
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: "centerBias",
|
|
86
|
+
label: "Center Bias",
|
|
87
|
+
description: "Smooth preference for the middle of the range.",
|
|
88
|
+
iconKey: "peak-center",
|
|
89
|
+
curve: {
|
|
90
|
+
points: [
|
|
91
|
+
{ x: 0, y: 0.12 },
|
|
92
|
+
{ x: 0.5, y: 1 },
|
|
93
|
+
{ x: 1, y: 0.12 }
|
|
94
|
+
],
|
|
95
|
+
segmentBends: [0.25, 0.25]
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: "edgeBias",
|
|
100
|
+
label: "Edge Bias",
|
|
101
|
+
description: "Higher probability near both edges.",
|
|
102
|
+
iconKey: "peak-edges",
|
|
103
|
+
curve: {
|
|
104
|
+
points: [
|
|
105
|
+
{ x: 0, y: 1 },
|
|
106
|
+
{ x: 0.5, y: 0.12 },
|
|
107
|
+
{ x: 1, y: 1 }
|
|
108
|
+
],
|
|
109
|
+
segmentBends: [-0.25, -0.25]
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
id: "bell",
|
|
114
|
+
label: "Bell",
|
|
115
|
+
description: "Gaussian-like central bell curve.",
|
|
116
|
+
iconKey: "bell",
|
|
117
|
+
curve: {
|
|
118
|
+
points: [
|
|
119
|
+
{ x: 0, y: 0.04 },
|
|
120
|
+
{ x: 0.25, y: 0.42 },
|
|
121
|
+
{ x: 0.5, y: 1 },
|
|
122
|
+
{ x: 0.75, y: 0.42 },
|
|
123
|
+
{ x: 1, y: 0.04 }
|
|
124
|
+
],
|
|
125
|
+
segmentBends: [-0.45, 0.35, 0.35, -0.45]
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
id: "doublePeak",
|
|
130
|
+
label: "Double Peak",
|
|
131
|
+
description: "Two smooth internal probability peaks.",
|
|
132
|
+
iconKey: "double-peak",
|
|
133
|
+
curve: {
|
|
134
|
+
points: [
|
|
135
|
+
{ x: 0, y: 0.12 },
|
|
136
|
+
{ x: 0.25, y: 1 },
|
|
137
|
+
{ x: 0.5, y: 0.18 },
|
|
138
|
+
{ x: 0.75, y: 1 },
|
|
139
|
+
{ x: 1, y: 0.12 }
|
|
140
|
+
],
|
|
141
|
+
segmentBends: [0.22, 0.18, 0.18, 0.22]
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
];
|
|
145
|
+
var PROBABILITY_CURVE_PRESET_OPTIONS = PROBABILITY_CURVE_PRESETS.map((preset) => ({
|
|
146
|
+
value: preset.id,
|
|
147
|
+
label: preset.label,
|
|
148
|
+
description: preset.description
|
|
149
|
+
}));
|
|
150
|
+
var cloneCurveDefinition = (curve) => ({
|
|
151
|
+
points: curve.points.map((point) => ({ ...point })),
|
|
152
|
+
segmentBends: [...curve.segmentBends]
|
|
153
|
+
});
|
|
154
|
+
var scaleCurveToDomain = (curve, xDomain) => {
|
|
155
|
+
const span = xDomain.max - xDomain.min;
|
|
156
|
+
return {
|
|
157
|
+
points: curve.points.map((point) => ({
|
|
158
|
+
...point,
|
|
159
|
+
x: xDomain.min + point.x * span
|
|
160
|
+
})),
|
|
161
|
+
segmentBends: [...curve.segmentBends]
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
var getProbabilityCurvePreset = (presetId) => _nullishCoalesce(PROBABILITY_CURVE_PRESETS.find((preset) => preset.id === presetId), () => ( PROBABILITY_CURVE_PRESETS[0]));
|
|
165
|
+
var createProbabilityCurveFromPreset = (presetId = DEFAULT_PROBABILITY_CURVE_PRESET_ID, xDomain) => {
|
|
166
|
+
const presetCurve = getProbabilityCurvePreset(presetId).curve;
|
|
167
|
+
return xDomain ? scaleCurveToDomain(presetCurve, xDomain) : cloneCurveDefinition(presetCurve);
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
exports.ANIMATION_FORMAT_VERSION = _chunkQ2HLLGJ7cjs.ANIMATION_FORMAT_VERSION; exports.BLEND_MODE_CATALOG = _chunkQ2HLLGJ7cjs.BLEND_MODE_CATALOG; exports.COLOR_DOMAIN = _chunkQ2HLLGJ7cjs.COLOR_DOMAIN; exports.COMMON_NUMERIC_DOMAINS = _chunkQ2HLLGJ7cjs.COMMON_NUMERIC_DOMAINS; exports.CUSTOM_PARAMETER_DOMAINS = _chunkQ2HLLGJ7cjs.CUSTOM_PARAMETER_DOMAINS; exports.DEFAULT_BLEND_MODE = _chunkQ2HLLGJ7cjs.DEFAULT_BLEND_MODE; exports.DEFAULT_PROBABILITY_CURVE_PRESET_ID = DEFAULT_PROBABILITY_CURVE_PRESET_ID; exports.EMITTER_EVENT_TRIGGERS = _chunkQ2HLLGJ7cjs.EMITTER_EVENT_TRIGGERS; exports.EMITTER_OPTION_DOMAINS = _chunkQ2HLLGJ7cjs.EMITTER_OPTION_DOMAINS; exports.EMITTER_PARAMETER_DOMAINS = _chunkQ2HLLGJ7cjs.EMITTER_PARAMETER_DOMAINS; exports.LINKED_SOURCE_CATALOG = _chunkQ2HLLGJ7cjs.LINKED_SOURCE_CATALOG; exports.MAX_PARAMETER_VALUE = _chunkQ2HLLGJ7cjs.MAX_PARAMETER_VALUE; exports.MIN_PARAMETER_VALUE = _chunkQ2HLLGJ7cjs.MIN_PARAMETER_VALUE; exports.MODIFIER_DOMAINS = _chunkQ2HLLGJ7cjs.MODIFIER_DOMAINS; exports.MODULATOR_DOMAINS = _chunkQ2HLLGJ7cjs.MODULATOR_DOMAINS; exports.MODULATOR_TIME_ELAPSED_SOURCE = _chunkQ2HLLGJ7cjs.MODULATOR_TIME_ELAPSED_SOURCE; exports.NAME_MAX_LENGTH = _chunkQ2HLLGJ7cjs.NAME_MAX_LENGTH; exports.OPTION_PATH_CATALOG = _chunkQ2HLLGJ7cjs.OPTION_PATH_CATALOG; exports.PARAMETER_OPTION_DOMAINS = _chunkQ2HLLGJ7cjs.PARAMETER_OPTION_DOMAINS; exports.PARTICLE_EVENT_TRIGGERS = _chunkQ2HLLGJ7cjs.PARTICLE_EVENT_TRIGGERS; exports.PARTICLE_OPTION_DOMAINS = _chunkQ2HLLGJ7cjs.PARTICLE_OPTION_DOMAINS; exports.PARTICLE_PARAMETER_DOMAINS = _chunkQ2HLLGJ7cjs.PARTICLE_PARAMETER_DOMAINS; exports.POINT_FORCE_DOMAINS = _chunkQ2HLLGJ7cjs.POINT_FORCE_DOMAINS; exports.PROBABILITY_CURVE_PRESETS = PROBABILITY_CURVE_PRESETS; exports.PROBABILITY_CURVE_PRESET_OPTIONS = PROBABILITY_CURVE_PRESET_OPTIONS; exports.ParameterTypeChecker = _chunkQ2HLLGJ7cjs.ParameterTypeChecker; exports.SPRITE_ANIMATION_DOMAINS = _chunkQ2HLLGJ7cjs.SPRITE_ANIMATION_DOMAINS; exports.TEXT_DOMAINS = _chunkQ2HLLGJ7cjs.TEXT_DOMAINS; exports.WARM_UP_MIN_STEP_SECONDS = _chunkQ2HLLGJ7cjs.WARM_UP_MIN_STEP_SECONDS; exports.collectLayerTextureSources = _chunkQ2HLLGJ7cjs.collectLayerTextureSources; exports.collectTextureSources = _chunkQ2HLLGJ7cjs.collectTextureSources; exports.collectTextureSourcesByLayer = _chunkQ2HLLGJ7cjs.collectTextureSourcesByLayer; exports.compileCurveSegments = _chunkQ2HLLGJ7cjs.compileCurveSegments; exports.createProbabilityCurveFromPreset = createProbabilityCurveFromPreset; exports.findMissingTextureSources = _chunkQ2HLLGJ7cjs.findMissingTextureSources; exports.findOptionPathEntry = _chunkQ2HLLGJ7cjs.findOptionPathEntry; exports.getProbabilityCurvePreset = getProbabilityCurvePreset; exports.isEmitterEventTrigger = _chunkQ2HLLGJ7cjs.isEmitterEventTrigger; exports.isEventTrigger = _chunkQ2HLLGJ7cjs.isEventTrigger; exports.isParticleBlendMode = _chunkQ2HLLGJ7cjs.isParticleBlendMode; exports.isParticleEventTrigger = _chunkQ2HLLGJ7cjs.isParticleEventTrigger; exports.isValidEventName = _chunkQ2HLLGJ7cjs.isValidEventName; exports.sanitizeName = _chunkQ2HLLGJ7cjs.sanitizeName;
|