@Override public void init () { renderData.modelInstanceChannel = controller.particles.getChannel(ParticleChannels.ModelInstance); renderData.colorChannel = controller.particles.getChannel(ParticleChannels.Color); renderData.scaleChannel = controller.particles.getChannel(ParticleChannels.Scale); renderData.rotationChannel = controller.particles.getChannel(ParticleChannels.Rotation3D); hasColor = renderData.colorChannel != null; hasScale = renderData.scaleChannel != null; hasRotation = renderData.rotationChannel != null; }
@Override public void init () { renderData.modelInstanceChannel = controller.particles.getChannel(ParticleChannels.ModelInstance); renderData.colorChannel = controller.particles.getChannel(ParticleChannels.Color); renderData.scaleChannel = controller.particles.getChannel(ParticleChannels.Scale); renderData.rotationChannel = controller.particles.getChannel(ParticleChannels.Rotation3D); hasColor = renderData.colorChannel != null; hasScale = renderData.scaleChannel != null; hasRotation = renderData.rotationChannel != null; }
@Override public void init () { controllerChannel = controller.particles.getChannel(ParticleChannels.ParticleController); if (controllerChannel == null) throw new GdxRuntimeException( "ParticleController channel not found, specify an influencer which will allocate it please."); scaleChannel = controller.particles.getChannel(ParticleChannels.Scale); rotationChannel = controller.particles.getChannel(ParticleChannels.Rotation3D); hasScale = scaleChannel != null; hasRotation = rotationChannel != null; }
@Override public void init () { controllerChannel = controller.particles.getChannel(ParticleChannels.ParticleController); if (controllerChannel == null) throw new GdxRuntimeException( "ParticleController channel not found, specify an influencer which will allocate it please."); scaleChannel = controller.particles.getChannel(ParticleChannels.Scale); rotationChannel = controller.particles.getChannel(ParticleChannels.Rotation3D); hasScale = scaleChannel != null; hasRotation = rotationChannel != null; }
@Override public void init () { controllerChannel = controller.particles.getChannel(ParticleChannels.ParticleController); if (controllerChannel == null) throw new GdxRuntimeException( "ParticleController channel not found, specify an influencer which will allocate it please."); }
@Override public void init () { controllerChannel = controller.particles.getChannel(ParticleChannels.ParticleController); if (controllerChannel == null) throw new GdxRuntimeException( "ParticleController channel not found, specify an influencer which will allocate it please."); }
/** Updates the bounding box using the position channel. */ protected void calculateBoundingBox () { boundingBox.clr(); FloatChannel positionChannel = particles.getChannel(ParticleChannels.Position); for (int pos = 0, c = positionChannel.strideSize * particles.size; pos < c; pos += positionChannel.strideSize) { boundingBox.ext(positionChannel.data[pos + ParticleChannels.XOffset], positionChannel.data[pos + ParticleChannels.YOffset], positionChannel.data[pos + ParticleChannels.ZOffset]); } }
/** Updates the bounding box using the position channel. */ protected void calculateBoundingBox () { boundingBox.clr(); FloatChannel positionChannel = particles.getChannel(ParticleChannels.Position); for (int pos = 0, c = positionChannel.strideSize * particles.size; pos < c; pos += positionChannel.strideSize) { boundingBox.ext(positionChannel.data[pos + ParticleChannels.XOffset], positionChannel.data[pos + ParticleChannels.YOffset], positionChannel.data[pos + ParticleChannels.ZOffset]); } }
@Override public void allocateChannels () { for (int k = 0; k < velocities.size; ++k) { velocities.items[k].allocateChannels(); } // Hack, shouldn't be done but after all the modifiers allocated their channels // it's possible to check if we need to allocate previous position channel accellerationChannel = controller.particles.getChannel(ParticleChannels.Acceleration); hasAcceleration = accellerationChannel != null; if (hasAcceleration) { positionChannel = controller.particles.addChannel(ParticleChannels.Position); previousPositionChannel = controller.particles.addChannel(ParticleChannels.PreviousPosition); } // Angular velocity check angularVelocityChannel = controller.particles.getChannel(ParticleChannels.AngularVelocity2D); has2dAngularVelocity = angularVelocityChannel != null; if (has2dAngularVelocity) { rotationChannel = controller.particles.addChannel(ParticleChannels.Rotation2D); has3dAngularVelocity = false; } else { angularVelocityChannel = controller.particles.getChannel(ParticleChannels.AngularVelocity3D); has3dAngularVelocity = angularVelocityChannel != null; if (has3dAngularVelocity) rotationChannel = controller.particles.addChannel(ParticleChannels.Rotation3D); } }
@Override public void allocateChannels () { for (int k = 0; k < velocities.size; ++k) { velocities.items[k].allocateChannels(); } // Hack, shouldn't be done but after all the modifiers allocated their channels // it's possible to check if we need to allocate previous position channel accellerationChannel = controller.particles.getChannel(ParticleChannels.Acceleration); hasAcceleration = accellerationChannel != null; if (hasAcceleration) { positionChannel = controller.particles.addChannel(ParticleChannels.Position); previousPositionChannel = controller.particles.addChannel(ParticleChannels.PreviousPosition); } // Angular velocity check angularVelocityChannel = controller.particles.getChannel(ParticleChannels.AngularVelocity2D); has2dAngularVelocity = angularVelocityChannel != null; if (has2dAngularVelocity) { rotationChannel = controller.particles.addChannel(ParticleChannels.Rotation2D); has3dAngularVelocity = false; } else { angularVelocityChannel = controller.particles.getChannel(ParticleChannels.AngularVelocity3D); has3dAngularVelocity = angularVelocityChannel != null; if (has3dAngularVelocity) rotationChannel = controller.particles.addChannel(ParticleChannels.Rotation3D); } }
/** 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. Otherwise a new channel is allocated and initialized with the * initializer. */ public <T extends Channel> T addChannel (ChannelDescriptor channelDescriptor, ChannelInitializer<T> initializer) { T channel = getChannel(channelDescriptor); if (channel == null) { channel = allocateChannel(channelDescriptor); if (initializer != null) initializer.init(channel); arrays.add(channel); } return channel; }
/** 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. Otherwise a new channel is allocated and initialized with the * initializer. */ public <T extends Channel> T addChannel (ChannelDescriptor channelDescriptor, ChannelInitializer<T> initializer) { T channel = getChannel(channelDescriptor); if (channel == null) { channel = allocateChannel(channelDescriptor); if (initializer != null) initializer.init(channel); arrays.add(channel); } return channel; }
@Override public void init () { renderData.modelInstanceChannel = controller.particles.getChannel(ParticleChannels.ModelInstance); renderData.colorChannel = controller.particles.getChannel(ParticleChannels.Color); renderData.scaleChannel = controller.particles.getChannel(ParticleChannels.Scale); renderData.rotationChannel = controller.particles.getChannel(ParticleChannels.Rotation3D); hasColor = renderData.colorChannel != null; hasScale = renderData.scaleChannel != null; hasRotation = renderData.rotationChannel != null; }
@Override public void init () { controllerChannel = controller.particles.getChannel(ParticleChannels.ParticleController); if (controllerChannel == null) throw new GdxRuntimeException( "ParticleController channel not found, specify an influencer which will allocate it please."); scaleChannel = controller.particles.getChannel(ParticleChannels.Scale); rotationChannel = controller.particles.getChannel(ParticleChannels.Rotation3D); hasScale = scaleChannel != null; hasRotation = rotationChannel != null; }
@Override public void init () { controllerChannel = controller.particles.getChannel(ParticleChannels.ParticleController); if (controllerChannel == null) throw new GdxRuntimeException( "ParticleController channel not found, specify an influencer which will allocate it please."); }
/** Updates the bounding box using the position channel. */ protected void calculateBoundingBox () { boundingBox.clr(); FloatChannel positionChannel = particles.getChannel(ParticleChannels.Position); for (int pos = 0, c = positionChannel.strideSize * particles.size; pos < c; pos += positionChannel.strideSize) { boundingBox.ext(positionChannel.data[pos + ParticleChannels.XOffset], positionChannel.data[pos + ParticleChannels.YOffset], positionChannel.data[pos + ParticleChannels.ZOffset]); } }
@Override public void allocateChannels () { for (int k = 0; k < velocities.size; ++k) { velocities.items[k].allocateChannels(); } // Hack, shouldn't be done but after all the modifiers allocated their channels // it's possible to check if we need to allocate previous position channel accellerationChannel = controller.particles.getChannel(ParticleChannels.Acceleration); hasAcceleration = accellerationChannel != null; if (hasAcceleration) { positionChannel = controller.particles.addChannel(ParticleChannels.Position); previousPositionChannel = controller.particles.addChannel(ParticleChannels.PreviousPosition); } // Angular velocity check angularVelocityChannel = controller.particles.getChannel(ParticleChannels.AngularVelocity2D); has2dAngularVelocity = angularVelocityChannel != null; if (has2dAngularVelocity) { rotationChannel = controller.particles.addChannel(ParticleChannels.Rotation2D); has3dAngularVelocity = false; } else { angularVelocityChannel = controller.particles.getChannel(ParticleChannels.AngularVelocity3D); has3dAngularVelocity = angularVelocityChannel != null; if (has3dAngularVelocity) rotationChannel = controller.particles.addChannel(ParticleChannels.Rotation3D); } }
/** 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. Otherwise a new channel is allocated and initialized with the * initializer. */ public <T extends Channel> T addChannel (ChannelDescriptor channelDescriptor, ChannelInitializer<T> initializer) { T channel = getChannel(channelDescriptor); if (channel == null) { channel = allocateChannel(channelDescriptor); if (initializer != null) initializer.init(channel); arrays.add(channel); } return channel; }