| 328 | } |
| 329 | |
| 330 | class Initializer_AlphaRandom extends ModuleBase { |
| 331 | private readonly min: number; |
| 332 | private readonly max: number; |
| 333 | private readonly randomExponent: number; |
| 334 | |
| 335 | constructor(elem: DMX.DMXElement) { |
| 336 | super(elem); |
| 337 | this.min = getAttribValue(elem, `alpha_min`, DMX.DMXAttributeType.Int, 0xFF) / 0xFF; |
| 338 | this.max = getAttribValue(elem, `alpha_max`, DMX.DMXAttributeType.Int, 0xFF) / 0xFF; |
| 339 | this.randomExponent = getAttribValue(elem, `alpha_random_exponent`, DMX.DMXAttributeType.Float, 1); |
| 340 | } |
| 341 | |
| 342 | public override streamWrite(): StreamMask { |
| 343 | return StreamMask.Alpha; |
| 344 | } |
| 345 | |
| 346 | public init(system: ParticleSystemInstance, p: number): void { |
| 347 | if (!system.hasStream(StreamMask.Alpha)) |
| 348 | return; |
| 349 | |
| 350 | const alpha = randRangeExp(system, this.min, this.max, this.randomExponent); |
| 351 | |
| 352 | const data = system.particleDataF32; |
| 353 | data[system.getStreamOffs(StreamMask.Alpha, p)] = alpha; |
| 354 | } |
| 355 | } |
| 356 | |
| 357 | class Initializer_ColorRandom extends ModuleBase { |
| 358 | private readonly color1: Readonly<Color>; |
nothing calls this directly
no outgoing calls
no test coverage detected