|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.geom.particle.ColorRampFunction
public class ColorRampFunction
Apply a colour change over time to the particle.
Particle effects, like fire, like to change the colour of the emitted particles over their lifetime. For example at t=0, the particle starts red but fades to yellow, then transparent over its age. The time values are in seconds and the interpolation is assumed to be in HSV space, although the colors are provided as RGB values.
Internationalisation Resource Names
Constructor Summary | |
---|---|
ColorRampFunction()
Create a disabled, default color ramp function with no values defined. |
|
ColorRampFunction(float[] times,
float[] ramp,
boolean hasAlpha)
Create a new colour ramp generator that uses the given times and 3 component colour values for that time for the interpolation. |
|
ColorRampFunction(float[] times,
float[] ramp,
int numColors,
boolean hasAlpha)
Create a new colour ramp generator that uses the given times and 3 component colour values for that time for the interpolation. |
Method Summary | |
---|---|
boolean |
apply(Particle particle)
Apply this function to the given particle right now. |
boolean |
isEnabled()
Check to see if this function has been enabled or not currently. |
boolean |
newFrame(int deltaT)
Notification that the system is about to do an update of the particles and to do any system-level initialisation. |
void |
setColorRamp(float[] times,
float[] ramp,
boolean hasAlpha)
Set the color data for the ramp to the new 3 component values. |
void |
setColorRamp(float[] times,
float[] ramp,
int numColors,
boolean hasAlpha)
Set the color data for the ramp to the new 3 component values. |
void |
setEnabled(boolean state)
Set the enabled state of this function. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ColorRampFunction()
public ColorRampFunction(float[] times, float[] ramp, boolean hasAlpha)
times
- The array of times for each colorramp
- The color values at each timehasAlpha
- True if there is 4 component color, false for 3
java.lang.IllegalArgumentException
- The two arrays have differet lengthpublic ColorRampFunction(float[] times, float[] ramp, int numColors, boolean hasAlpha)
times
- The array of times for each colorramp
- The color values at each timehasAlpha
- True if there is 4 component color, false for 3numColors
- The number of valid items in the array
java.lang.IllegalArgumentException
- The two arrays have differet lengthMethod Detail |
---|
public boolean isEnabled()
isEnabled
in interface ParticleFunction
public void setEnabled(boolean state)
setEnabled
in interface ParticleFunction
state
- The new enabled state to set it topublic boolean newFrame(int deltaT)
newFrame
in interface ParticleFunction
deltaT
- The elapsed time in milliseconds since the last frame
public boolean apply(Particle particle)
apply
in interface ParticleFunction
particle
- The particle to apply the function to
public void setColorRamp(float[] times, float[] ramp, boolean hasAlpha)
times
- The array of times for each colorramp
- The color values at each timehasAlpha
- true if this is 4-component colour, 3 otherwise
java.lang.IllegalArgumentException
- The two arrays have differet lengthpublic void setColorRamp(float[] times, float[] ramp, int numColors, boolean hasAlpha)
times
- The array of times for each colorramp
- The color values at each timenumColors
- The number of valid color values in the arrayhasAlpha
- True if there is 4 component color, false for 3
java.lang.IllegalArgumentException
- The two arrays have differet length
|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |