Package com.jme3.post.filters
Class FadeFilter
java.lang.Object
com.jme3.post.Filter
com.jme3.post.filters.FadeFilter
- All Implemented Interfaces:
com.jme3.export.Savable
public class FadeFilter
extends com.jme3.post.Filter
Fade Filter allows you to make an animated fade effect on a scene.
- Author:
- Rémy Bouquet aka Nehon implemented from boxjar implementation
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.jme3.post.Filter
com.jme3.post.Filter.Pass -
Field Summary
Fields inherited from class com.jme3.post.Filter
defaultPass, enabled, material, postRenderPasses, processor -
Constructor Summary
ConstructorsConstructorDescriptionCreates a FadeFilterFadeFilter(float duration) Creates a FadeFilter with the given duration -
Method Summary
Modifier and TypeMethodDescriptionvoidfadeIn()fades the scene in (black to scene)voidfadeOut()fades the scene out (scene to black)floatreturns the duration of the effectprotected com.jme3.material.MaterialfloatgetValue()Returns the current fade value.protected voidinitFilter(com.jme3.asset.AssetManager manager, com.jme3.renderer.RenderManager renderManager, com.jme3.renderer.ViewPort vp, int w, int h) voidpause()protected voidpreFrame(float tpf) voidread(com.jme3.export.JmeImporter im) voidsetDuration(float duration) Sets the duration of the filter default is 1 secondvoidsetValue(float value) Sets the fade value.voidwrite(com.jme3.export.JmeExporter ex) Methods inherited from class com.jme3.post.Filter
cleanup, cleanUpFilter, getDefaultPassDepthFormat, getDefaultPassTextureFormat, getName, getPostRenderPasses, getRenderedTexture, getRenderFrameBuffer, init, isEnabled, isRequiresBilinear, isRequiresDepthTexture, isRequiresSceneTexture, postFilter, postFrame, postQueue, setDepthTexture, setEnabled, setName, setProcessor, setRenderedTexture, setRenderFrameBuffer
-
Constructor Details
-
FadeFilter
public FadeFilter()Creates a FadeFilter -
FadeFilter
public FadeFilter(float duration) Creates a FadeFilter with the given duration- Parameters:
duration- the desired duration (in seconds, default=1)
-
-
Method Details
-
getMaterial
protected com.jme3.material.Material getMaterial()- Specified by:
getMaterialin classcom.jme3.post.Filter
-
initFilter
protected void initFilter(com.jme3.asset.AssetManager manager, com.jme3.renderer.RenderManager renderManager, com.jme3.renderer.ViewPort vp, int w, int h) - Specified by:
initFilterin classcom.jme3.post.Filter
-
preFrame
protected void preFrame(float tpf) - Overrides:
preFramein classcom.jme3.post.Filter
-
getDuration
public float getDuration()returns the duration of the effect- Returns:
- the duration (in seconds)
-
setDuration
public void setDuration(float duration) Sets the duration of the filter default is 1 second- Parameters:
duration- the desired duration (in seconds, default=1)
-
fadeIn
public void fadeIn()fades the scene in (black to scene) -
fadeOut
public void fadeOut()fades the scene out (scene to black) -
pause
public void pause() -
write
- Specified by:
writein interfacecom.jme3.export.Savable- Overrides:
writein classcom.jme3.post.Filter- Throws:
IOException
-
read
- Specified by:
readin interfacecom.jme3.export.Savable- Overrides:
readin classcom.jme3.post.Filter- Throws:
IOException
-
getValue
public float getValue()Returns the current fade value. Can be used to check whether fade is complete (e.g. value=1).- Returns:
- the fractional progress (≥0, ≤1)
-
setValue
public void setValue(float value) Sets the fade value. Can be used to force all black or all scene.- Parameters:
value- the desired value (default=1)
-