@Override public void allocateChannels () { renderData.positionChannel = controller.particles.addChannel(ParticleChannels.Position); renderData.regionChannel = controller.particles.addChannel(ParticleChannels.TextureRegion, TextureRegionInitializer.get()); renderData.colorChannel = controller.particles.addChannel(ParticleChannels.Color, ColorInitializer.get()); renderData.scaleChannel = controller.particles.addChannel(ParticleChannels.Scale, ScaleInitializer.get()); renderData.rotationChannel = controller.particles.addChannel(ParticleChannels.Rotation2D, Rotation2dInitializer.get()); }
@SuppressWarnings({"unchecked", "rawtypes"}) private <T extends Channel> T allocateChannel (ChannelDescriptor channelDescriptor) { if (channelDescriptor.type == float.class) { return (T)new FloatChannel(channelDescriptor.id, channelDescriptor.count, capacity); } else if (channelDescriptor.type == int.class) { return (T)new IntChannel(channelDescriptor.id, channelDescriptor.count, capacity); } else { return (T)new ObjectChannel(channelDescriptor.id, channelDescriptor.count, capacity, channelDescriptor.type); } }
@Override public void allocateChannels () { valueChannel = controller.particles.addChannel(valueChannelDescriptor); ParticleChannels.Interpolation.id = controller.particleChannels.newId(); interpolationChannel = controller.particles.addChannel(ParticleChannels.Interpolation); lifeChannel = controller.particles.addChannel(ParticleChannels.Life); }
public void setSorter (ParticleSorter sorter) { this.sorter = sorter; sorter.setCamera(camera); sorter.ensureCapacity(currentCapacity); }
@Override public void killParticles (int startIndex, int count) { for (int i = startIndex, c = startIndex + count; i < c; ++i) { particleControllerChannel.data[i].end(); } }
@Override public void dispose () { if (controller != null) { for (int i = 0; i < controller.particles.size; ++i) { ParticleController controller = particleControllerChannel.data[i]; if (controller != null) { controller.dispose(); particleControllerChannel.data[i] = null; } } } }
/** Loads all the assets required by all the controllers inside this effect. */ public void load (AssetManager assetManager, ResourceData data) { int i = 0; for (ParticleController controller : controllers) { controller.load(assetManager, data); } } }
/** Adds and returns a channel described by the channel descriptor parameter. If a channel with the same id already exists, no * allocation is performed and that channel is returned. */ public <T extends Channel> T addChannel (ChannelDescriptor channelDescriptor) { return addChannel(channelDescriptor, null); }
/** Sets the capacity. Each contained channel will be resized to match the required capacity and the current data will be * preserved. */ public void setCapacity (int requiredCapacity) { if (capacity != requiredCapacity) { for (Channel channel : arrays) { channel.setCapacity(requiredCapacity); } capacity = requiredCapacity; } }
@Override public void allocateChannels () { renderData.positionChannel = controller.particles.addChannel(ParticleChannels.Position); renderData.regionChannel = controller.particles.addChannel(ParticleChannels.TextureRegion, TextureRegionInitializer.get()); renderData.colorChannel = controller.particles.addChannel(ParticleChannels.Color, ColorInitializer.get()); renderData.scaleChannel = controller.particles.addChannel(ParticleChannels.Scale, ScaleInitializer.get()); renderData.rotationChannel = controller.particles.addChannel(ParticleChannels.Rotation2D, Rotation2dInitializer.get()); }
@SuppressWarnings({"unchecked", "rawtypes"}) private <T extends Channel> T allocateChannel (ChannelDescriptor channelDescriptor) { if (channelDescriptor.type == float.class) { return (T)new FloatChannel(channelDescriptor.id, channelDescriptor.count, capacity); } else if (channelDescriptor.type == int.class) { return (T)new IntChannel(channelDescriptor.id, channelDescriptor.count, capacity); } else { return (T)new ObjectChannel(channelDescriptor.id, channelDescriptor.count, capacity, channelDescriptor.type); } }
@Override public void allocateChannels () { valueChannel = controller.particles.addChannel(valueChannelDescriptor); ParticleChannels.Interpolation.id = controller.particleChannels.newId(); interpolationChannel = controller.particles.addChannel(ParticleChannels.Interpolation); lifeChannel = controller.particles.addChannel(ParticleChannels.Life); }
public void setSorter (ParticleSorter sorter) { this.sorter = sorter; sorter.setCamera(camera); sorter.ensureCapacity(currentCapacity); }
@Override public void end () { for (int i = 0; i < controller.particles.size; ++i) { particleControllerChannel.data[i].end(); } }
/** Loads all the assets required by all the controllers inside this effect. */ public void load (AssetManager assetManager, ResourceData data) { int i = 0; for (ParticleController controller : controllers) { controller.load(assetManager, data); } } }
@Override public void allocateChannels () { renderData.positionChannel = controller.particles.addChannel(ParticleChannels.Position); renderData.regionChannel = controller.particles.addChannel(ParticleChannels.TextureRegion, TextureRegionInitializer.get()); renderData.colorChannel = controller.particles.addChannel(ParticleChannels.Color, ColorInitializer.get()); renderData.scaleChannel = controller.particles.addChannel(ParticleChannels.Scale, ScaleInitializer.get()); renderData.rotationChannel = controller.particles.addChannel(ParticleChannels.Rotation2D, Rotation2dInitializer.get()); }
@Override public void allocateChannels () { renderData.positionChannel = controller.particles.addChannel(ParticleChannels.Position); renderData.regionChannel = controller.particles.addChannel(ParticleChannels.TextureRegion, TextureRegionInitializer.get()); renderData.colorChannel = controller.particles.addChannel(ParticleChannels.Color, ColorInitializer.get()); renderData.scaleChannel = controller.particles.addChannel(ParticleChannels.Scale, ScaleInitializer.get()); renderData.rotationChannel = controller.particles.addChannel(ParticleChannels.Rotation2D, Rotation2dInitializer.get()); }