| 415 | } |
| 416 | |
| 417 | class Initializer_TrailLengthRandom extends ModuleBase { |
| 418 | private readonly min: number; |
| 419 | private readonly max: number; |
| 420 | private readonly randomExponent: number; |
| 421 | |
| 422 | constructor(elem: DMX.DMXElement) { |
| 423 | super(elem); |
| 424 | this.min = getAttribValue(elem, `length_min`, DMX.DMXAttributeType.Float, 0.1); |
| 425 | this.max = getAttribValue(elem, `length_max`, DMX.DMXAttributeType.Float, 0.1); |
| 426 | this.randomExponent = getAttribValue(elem, `length_random_exponent`, DMX.DMXAttributeType.Float, 1.0); |
| 427 | } |
| 428 | |
| 429 | public override streamWrite(): StreamMask { |
| 430 | return StreamMask.TrailLength; |
| 431 | } |
| 432 | |
| 433 | public init(system: ParticleSystemInstance, p: number): void { |
| 434 | if (!system.hasStream(StreamMask.TrailLength)) |
| 435 | return; |
| 436 | |
| 437 | const trailLength = randRangeExp(system, this.min, this.max, this.randomExponent); |
| 438 | |
| 439 | const data = system.particleDataF32; |
| 440 | data[system.getStreamOffs(StreamMask.TrailLength, p)] = trailLength; |
| 441 | } |
| 442 | } |
| 443 | |
| 444 | class Initializer_PositionModifyOffsetRandom extends ModuleBase { |
| 445 | private readonly min: ReadonlyVec3; |
nothing calls this directly
no outgoing calls
no test coverage detected