|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpslib.VariantEmission
public class VariantEmission
VariantEmission Class
The VariantEmission class implements the PSEmission interface allowing the automated emission of random particles with variant properties from the emitter to which it is assigned.
Unlike the TemplateEmission class, particle properties are derived entirely from the specified template and percentage variance.
This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library. If not, see http://www.gnu.org/licenses/.
TemplateEmission
Field Summary |
---|
Fields inherited from interface pslib.PSConstants |
---|
CAM2D_LOOK, CAM2D_RIGHT, CAM2D_UP, CORNER, INVERSE, INVERSE_TRIANGULAR, LEADING, LINEAR, MIDPOINT, NONE, STATIC, TRAILING, TRIANGULAR |
Constructor Summary | |
---|---|
VariantEmission(DynamicParticle t,
int v,
int ep,
int mi,
int ma)
Create a new object instance with the specified variables |
|
VariantEmission(WeightedList<DynamicParticle> t,
int v,
int ep,
int mi,
int ma)
Create a new object instance with the specified variables |
Method Summary | |
---|---|
void |
addListener(ParticleListener p)
Attach a particle listener |
void |
clearListeners()
Clear all attached particle listeners |
boolean |
removeListener(ParticleListener p)
Remove a particle listener |
void |
setActive(boolean a)
Set the active state of the behaviour |
void |
setEmissionProbability(int ep)
Set the emission probability |
void |
setMaximumParticles(int p)
Set the maximum emitted particles |
void |
setMinimumParticles(int p)
Set the minimum emitted particles |
void |
setTemplate(DynamicParticle t)
Set the particle template |
void |
setTemplate(WeightedList<DynamicParticle> t)
Set the particle template list |
void |
setVariance(int v)
Set the particle parameter variance |
void |
update(DynamicParticle p)
Update the specified DynamicPartice (unused) |
void |
update(GenericEmitter e)
Update the specified GenericEmitter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VariantEmission(DynamicParticle t, int v, int ep, int mi, int ma)
t
- particle templatev
- percentage varianceep
- emission probabilitymi
- minimum particlesma
- maximum particlespublic VariantEmission(WeightedList<DynamicParticle> t, int v, int ep, int mi, int ma)
t
- particle template arrayv
- percentage varianceep
- emission probabilitymi
- minimum particlesma
- maximum particlesMethod Detail |
---|
public final void setTemplate(DynamicParticle t)
t
- particle templatepublic final void setTemplate(WeightedList<DynamicParticle> t)
t
- particle template listpublic final void setVariance(int v)
Particle variations inherit the parameters of the template, with the specified +/- variance being applied to particle decay, alpha and size. Particle mass preserves the ratio between size and mass variables within the template particle.
v
- percentage variancepublic final void setEmissionProbability(int ep)
Emission probability defines the likelihood of particle emission and takes the form 1:probability.
ep
- emission probabilitypublic final void setMinimumParticles(int p)
p
- minimum particlespublic final void setMaximumParticles(int p)
p
- maximum particlespublic final void setActive(boolean a)
A value of true will result in particle emission on the update routine of any emitters to which this behaviour is attached.
setActive
in interface PSEmission
a
- public void update(GenericEmitter e)
The update routine attaches random particles derived from the particle template to the specified emitter. References to created particles are sent to any attached listeners.
Default: true
update
in interface PSEmission
e
- GenericEmitterpublic void update(DynamicParticle p)
update
in interface PSBehaviour
p
- DynamicParticlepublic final void addListener(ParticleListener p)
Attached listeners will receive a reference to created particles upon emission. If this object is assigned as behaviour to multiple emitters, attached listeners will receive particles from each.
p
- particle listenerpublic final boolean removeListener(ParticleListener p)
p
- particle listener
public final void clearListeners()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |