public Single () { colorValue = new GradientColorValue(); alphaValue = new ScaledNumericValue(); alphaValue.setHigh(1); }
public RegularEmitter () { delayValue = new RangedNumericValue(); durationValue = new RangedNumericValue(); lifeOffsetValue = new ScaledNumericValue(); lifeValue = new ScaledNumericValue(); emissionValue = new ScaledNumericValue(); durationValue.setActive(true); emissionValue.setActive(true); lifeValue.setActive(true); continuous = true; emissionMode = EmissionMode.Enabled; }
@Override public void activateParticles (int startIndex, int count) { for (int i = startIndex * colorChannel.strideSize, a = startIndex * alphaInterpolationChannel.strideSize, l = startIndex * lifeChannel.strideSize + ParticleChannels.LifePercentOffset, c = i + count * colorChannel.strideSize; i < c; i += colorChannel.strideSize, a += alphaInterpolationChannel.strideSize, l += lifeChannel.strideSize) { float alphaStart = alphaValue.newLowValue(); float alphaDiff = alphaValue.newHighValue() - alphaStart; colorValue.getColor(0, colorChannel.data, i); colorChannel.data[i + ParticleChannels.AlphaOffset] = alphaStart + alphaDiff * alphaValue.getScale(lifeChannel.data[l]); alphaInterpolationChannel.data[a + ParticleChannels.InterpolationStartOffset] = alphaStart; alphaInterpolationChannel.data[a + ParticleChannels.InterpolationDiffOffset] = alphaDiff; } }
public final Vector3 spawn (Vector3 vector, float percent) { spawnAux(vector, percent); if (xOffsetValue.active) vector.x += xOffsetValue.newLowValue(); if (yOffsetValue.active) vector.y += yOffsetValue.newLowValue(); if (zOffsetValue.active) vector.z += zOffsetValue.newLowValue(); return vector; }
@Override public void update () { for (int i = 0, a = 0, l = ParticleChannels.LifePercentOffset, c = i + controller.particles.size * colorChannel.strideSize; i < c; i += colorChannel.strideSize, a += alphaInterpolationChannel.strideSize, l += lifeChannel.strideSize) { float lifePercent = lifeChannel.data[l]; colorValue.getColor(lifePercent, colorChannel.data, i); colorChannel.data[i + ParticleChannels.AlphaOffset] = alphaInterpolationChannel.data[a + ParticleChannels.InterpolationStartOffset] + alphaInterpolationChannel.data[a + ParticleChannels.InterpolationDiffOffset] * alphaValue.getScale(lifePercent); } }
public RegularEmitter () { delayValue = new RangedNumericValue(); durationValue = new RangedNumericValue(); lifeOffsetValue = new ScaledNumericValue(); lifeValue = new ScaledNumericValue(); emissionValue = new ScaledNumericValue(); durationValue.setActive(true); emissionValue.setActive(true); lifeValue.setActive(true); continuous = true; emissionMode = EmissionMode.Enabled; }
public Single () { colorValue = new GradientColorValue(); alphaValue = new ScaledNumericValue(); alphaValue.setHigh(1); }
@Override public void activateParticles (int startIndex, int count) { for (int i = startIndex * colorChannel.strideSize, a = startIndex * alphaInterpolationChannel.strideSize, l = startIndex * lifeChannel.strideSize + ParticleChannels.LifePercentOffset, c = i + count * colorChannel.strideSize; i < c; i += colorChannel.strideSize, a += alphaInterpolationChannel.strideSize, l += lifeChannel.strideSize) { float alphaStart = alphaValue.newLowValue(); float alphaDiff = alphaValue.newHighValue() - alphaStart; colorValue.getColor(0, colorChannel.data, i); colorChannel.data[i + ParticleChannels.AlphaOffset] = alphaStart + alphaDiff * alphaValue.getScale(lifeChannel.data[l]); alphaInterpolationChannel.data[a + ParticleChannels.InterpolationStartOffset] = alphaStart; alphaInterpolationChannel.data[a + ParticleChannels.InterpolationDiffOffset] = alphaDiff; } }
public final Vector3 spawn (Vector3 vector, float percent) { spawnAux(vector, percent); if (xOffsetValue.active) vector.x += xOffsetValue.newLowValue(); if (yOffsetValue.active) vector.y += yOffsetValue.newLowValue(); if (zOffsetValue.active) vector.z += zOffsetValue.newLowValue(); return vector; }
@Override public void update () { for (int i = 0, a = 0, l = ParticleChannels.LifePercentOffset, c = i + controller.particles.size * colorChannel.strideSize; i < c; i += colorChannel.strideSize, a += alphaInterpolationChannel.strideSize, l += lifeChannel.strideSize) { float lifePercent = lifeChannel.data[l]; colorValue.getColor(lifePercent, colorChannel.data, i); colorChannel.data[i + ParticleChannels.AlphaOffset] = alphaInterpolationChannel.data[a + ParticleChannels.InterpolationStartOffset] + alphaInterpolationChannel.data[a + ParticleChannels.InterpolationDiffOffset] * alphaValue.getScale(lifePercent); } }