Class WaterFilter

java.lang.Object
com.jme3.post.Filter
com.jme3.water.WaterFilter
All Implemented Interfaces:
com.jme3.export.Savable, com.jme3.util.clone.JmeCloneable, Cloneable

public class WaterFilter extends com.jme3.post.Filter implements com.jme3.util.clone.JmeCloneable, Cloneable
The WaterFilter is a 2-D post process that simulates water. It renders water from both above and below the surface. See the jMonkeyEngine wiki for more info https://jmonkeyengine.github.io/wiki/jme3/advanced/post-processor_water.html.
Author:
Rémy Bouquet aka Nehon
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     

    Nested classes/interfaces inherited from class com.jme3.post.Filter

    com.jme3.post.Filter.Pass
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     
    static final String
     
    protected com.jme3.scene.Spatial
     
    protected com.jme3.renderer.ViewPort
     
    protected com.jme3.scene.Spatial
     

    Fields inherited from class com.jme3.post.Filter

    defaultPass, enabled, material, postRenderPasses, processor
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a Water Filter
    WaterFilter(com.jme3.scene.Node reflectionScene, com.jme3.math.Vector3f lightDirection)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    cleanUpFilter(com.jme3.renderer.Renderer r)
     
    void
    cloneFields(com.jme3.util.clone.Cloner cloner, Object original)
     
    float
    Gets the intensity of caustics underwater
    com.jme3.texture.Texture2D
    Gets the texture which is used to render caustics on the ground underwater.
    com.jme3.math.Vector3f
    returns the center of this effect
    com.jme3.math.Vector3f
    Returns the color extinction vector of the water
    com.jme3.math.ColorRGBA
    returns the deep water color
    com.jme3.math.Vector3f
    returns the foam existence vector
    float
    returns the foam hardness
    float
    returns the foam intensity
    com.jme3.texture.Texture2D
    Gets the foam texture.
    com.jme3.texture.Texture2D
    Gets the height texture.
    com.jme3.math.ColorRGBA
    returns the light color
    com.jme3.math.Vector3f
    gets the light direction
    protected com.jme3.material.Material
     
    float
    return the maximum wave amplitude
    float
    Returns the normal scales applied to the normal map
    com.jme3.texture.Texture2D
    Gets the normal texture.
    float
    returns the radius of this effect
    float
    returns the reflection displace see setReflectionDisplace(float)
    int
    returns the size of the reflection map
    com.jme3.scene.Spatial
    Gets the scene which is used to render in the reflection map.
    com.jme3.renderer.ViewPort
    Gets the view port used to render reflection scene.
    float
    returns the refraction constant
    float
    returns the refractionStrength
    returns the shape of the water area
    float
    return the shininess factor of the water
    float
    Return the shore hardness.
    float
    returns the speed of the waves
    float
    gets the scale of the sun
    float
    returns the distance of the fog when underwater
    com.jme3.math.ColorRGBA
    returns the color of the water
    float
    gets the height of the water plane
    float
    returns the waterTransparency value
    float
    Returns the scale factor of the waves' height map.
    com.jme3.math.Vector2f
    returns the wind direction
    protected void
    initFilter(com.jme3.asset.AssetManager manager, com.jme3.renderer.RenderManager renderManager, com.jme3.renderer.ViewPort vp, int w, int h)
     
    boolean
     
    protected boolean
     
    boolean
    Whether or not the camera is under the water level
    boolean
    Whether or not caustics are rendered
    boolean
    Whether or not the water uses foam
    boolean
    Whether or not the shader is set to use high-quality shoreline.
    boolean
    Whether or not the water uses the refraction
    boolean
    Whether or not the water uses ripples
    boolean
    Whether or not the water is using specular
     
    protected void
    preFrame(float tpf)
     
    void
    read(com.jme3.export.JmeImporter im)
     
    void
    setCausticsIntensity(float causticsIntensity)
    Sets the intensity of caustics underwater.
    void
    setCausticsTexture(com.jme3.texture.Texture2D causticsTexture)
    Sets the texture to use to render caustics on the ground underwater.
    void
    setCenter(com.jme3.math.Vector3f center)
    Set the center of the effect.
    void
    setColorExtinction(com.jme3.math.Vector3f colorExtinction)
    Return at what depth the refraction color extinct the first value is for red the second is for green the third is for blue Play with those parameters to "trouble" the water default is (5.0, 20.0, 30.0f);
    void
    setDeepWaterColor(com.jme3.math.ColorRGBA deepWaterColor)
    sets the deep water color see setWaterColor for general color default is (0.0039f, 0.00196f, 0.145f,1.0f) (very dark blue)
    void
    setFoamExistence(com.jme3.math.Vector3f foamExistence)
    Describes at what depth foam starts to fade out and at what it is completely invisible.
    void
    setFoamHardness(float foamHardness)
    Sets the foam hardness : How much the foam will blend with the shore to avoid hard edged water plane.
    void
    setFoamIntensity(float foamIntensity)
    sets the foam intensity default is 0.5f
    void
    setFoamTexture(com.jme3.texture.Texture2D foamTexture)
    Sets the foam texture.
    void
    setHeightTexture(com.jme3.texture.Texture2D heightTexture)
    Sets the height texture
    void
    setLightColor(com.jme3.math.ColorRGBA lightColor)
    Sets the light color to use default is white
    void
    setLightDirection(com.jme3.math.Vector3f lightDirection)
    Sets the light direction
    void
    setMaxAmplitude(float maxAmplitude)
    Sets the maximum waves amplitude default is 1.5
    void
    setNeedSaveReflectionScene(boolean needSaveReflectionScene)
    Sets the flag.
    void
    setNormalScale(float normalScale)
    Sets the normal scaling factors to apply to the normal map.
    void
    setNormalTexture(com.jme3.texture.Texture2D normalTexture)
    Sets the normal texture.
    void
    setRadius(float radius)
    Set the radius of the effect.
    void
    setReflectionDisplace(float reflectionDisplace)
    Sets the reflection displace.
    void
    setReflectionMapSize(int reflectionMapSize)
    Sets the size of the reflection map default is 512, the higher, the better quality, but the slower the effect.
    void
    setReflectionScene(com.jme3.scene.Spatial reflectionScene)
    Sets the scene to render in the reflection map.
    void
    setRefractionConstant(float refractionConstant)
    This is a constant related to the index of refraction (IOR) used to compute the fresnel term.
    void
    setRefractionStrength(float refractionStrength)
    This value modifies current fresnel term.
    void
    Set the shape of the water area (Circular (default) or Square).
    void
    setShininess(float shininess)
    Sets the shininess factor of the water default is 0.7f
    void
    setShoreHardness(float shoreHardness)
    The smaller this value is, the softer the transition between shore and water.
    void
    setSpeed(float speed)
    Set the speed of the waves (0.0 is still) default is 1.0
    void
    setSunScale(float sunScale)
    Sets the scale of the sun for specular effect
    void
    setUnderWaterFogDistance(float underWaterFogDistance)
    Sets the distance of the fog when underwater.
    void
    setUseCaustics(boolean useCaustics)
    set to true if you want caustics to be rendered on the ground underwater, false otherwise
    void
    setUseFoam(boolean useFoam)
    set to true to use foam with water default true
    void
    setUseHQShoreline(boolean useHQShoreline)
     
    void
    setUseRefraction(boolean useRefraction)
    set to true to use refraction (default is true)
    void
    setUseRipples(boolean useRipples)
    Set to true to use ripples
    void
    setUseSpecular(boolean useSpecular)
    Set to true to use specular lighting on the water
    void
    setWaterColor(com.jme3.math.ColorRGBA waterColor)
    Sets the color of the water see setDeepWaterColor for deep water color default is (0.0078f, 0.3176f, 0.5f,1.0f) (greenish blue)
    void
    setWaterHeight(float waterHeight)
    Sets the height of the water plane default is 0.0
    void
    setWaterTransparency(float waterTransparency)
    Sets how fast colours fade out.
    void
    setWaveScale(float waveScale)
    Sets the scale factor of the waves' height map.
    void
    setWindDirection(com.jme3.math.Vector2f windDirection)
    sets the wind direction the direction where the waves move default is (0.0f, -1.0f)
    protected boolean
     
    void
    write(com.jme3.export.JmeExporter ex)
     

    Methods inherited from class com.jme3.post.Filter

    cleanup, getDefaultPassDepthFormat, getDefaultPassTextureFormat, getName, getPostRenderPasses, getRenderedTexture, getRenderFrameBuffer, init, isEnabled, isRequiresBilinear, isRequiresSceneTexture, postFilter, postFrame, postQueue, setDepthTexture, setEnabled, setName, setProcessor, setRenderedTexture, setRenderFrameBuffer

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT_NORMAL_MAP

      public static final String DEFAULT_NORMAL_MAP
      See Also:
    • DEFAULT_FOAM

      public static final String DEFAULT_FOAM
      See Also:
    • DEFAULT_CAUSTICS

      public static final String DEFAULT_CAUSTICS
      See Also:
    • DEFAULT_HEIGHT_MAP

      public static final String DEFAULT_HEIGHT_MAP
      See Also:
    • reflectionScene

      protected com.jme3.scene.Spatial reflectionScene
    • rootScene

      protected com.jme3.scene.Spatial rootScene
    • reflectionView

      protected com.jme3.renderer.ViewPort reflectionView
  • Constructor Details

    • WaterFilter

      public WaterFilter()
      Create a Water Filter
    • WaterFilter

      public WaterFilter(com.jme3.scene.Node reflectionScene, com.jme3.math.Vector3f lightDirection)
  • Method Details

    • isRequiresDepthTexture

      protected boolean isRequiresDepthTexture()
      Overrides:
      isRequiresDepthTexture in class com.jme3.post.Filter
    • preFrame

      protected void preFrame(float tpf)
      Overrides:
      preFrame in class com.jme3.post.Filter
    • getMaterial

      protected com.jme3.material.Material getMaterial()
      Specified by:
      getMaterial in class com.jme3.post.Filter
    • useDirectionLightFromScene

      protected boolean useDirectionLightFromScene()
      Returns:
      true to try using directional light from a scene
    • 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:
      initFilter in class com.jme3.post.Filter
    • cleanUpFilter

      protected void cleanUpFilter(com.jme3.renderer.Renderer r)
      Overrides:
      cleanUpFilter in class com.jme3.post.Filter
    • write

      public void write(com.jme3.export.JmeExporter ex) throws IOException
      Specified by:
      write in interface com.jme3.export.Savable
      Overrides:
      write in class com.jme3.post.Filter
      Throws:
      IOException
    • read

      public void read(com.jme3.export.JmeImporter im) throws IOException
      Specified by:
      read in interface com.jme3.export.Savable
      Overrides:
      read in class com.jme3.post.Filter
      Throws:
      IOException
    • getWaterHeight

      public float getWaterHeight()
      gets the height of the water plane
      Returns:
      the height
    • setWaterHeight

      public void setWaterHeight(float waterHeight)
      Sets the height of the water plane default is 0.0
      Parameters:
      waterHeight - the desired height (default=0)
    • setReflectionScene

      public void setReflectionScene(com.jme3.scene.Spatial reflectionScene)
      Sets the scene to render in the reflection map.
      Parameters:
      reflectionScene - the refraction scene.
    • getReflectionScene

      public com.jme3.scene.Spatial getReflectionScene()
      Gets the scene which is used to render in the reflection map.
      Returns:
      the refraction scene.
    • getReflectionView

      public com.jme3.renderer.ViewPort getReflectionView()
      Gets the view port used to render reflection scene.
      Returns:
      the reflection view port.
    • getWaterTransparency

      public float getWaterTransparency()
      returns the waterTransparency value
      Returns:
      the transparency value
    • setWaterTransparency

      public void setWaterTransparency(float waterTransparency)
      Sets how fast colours fade out. You can also think about this as how clear water is. Therefore, use smaller values (e.g. 0.05) for crystal-clear water and bigger values for "muddy" water. default is 0.1f
      Parameters:
      waterTransparency - the desired muddiness (default=0.1)
    • getNormalScale

      public float getNormalScale()
      Returns the normal scales applied to the normal map
      Returns:
      the scale factor
    • setNormalScale

      public void setNormalScale(float normalScale)
      Sets the normal scaling factors to apply to the normal map. the higher the value the more small ripples will be visible on the waves. default is 3
      Parameters:
      normalScale - the scaling factor (default=3)
    • getRefractionConstant

      public float getRefractionConstant()
      returns the refraction constant
      Returns:
      the refraction constant
    • setRefractionConstant

      public void setRefractionConstant(float refractionConstant)
      This is a constant related to the index of refraction (IOR) used to compute the fresnel term. F = R0 + (1-R0)( 1 - N.V)^5 where F is the fresnel term, R0 the constant, N the normal vector and V the view vector. It depends on the substance you are looking through (here water). Default value is 0.5 In practice, the lowest the value and the less the reflection can be seen on water
      Parameters:
      refractionConstant - the desired R0 value (default=0.5)
    • getMaxAmplitude

      public float getMaxAmplitude()
      return the maximum wave amplitude
      Returns:
      the maximum amplitude
    • setMaxAmplitude

      public void setMaxAmplitude(float maxAmplitude)
      Sets the maximum waves amplitude default is 1.5
      Parameters:
      maxAmplitude - the desired maximum amplitude (default=1.5)
    • getLightDirection

      public com.jme3.math.Vector3f getLightDirection()
      gets the light direction
      Returns:
      the pre-existing vector
    • setLightDirection

      public void setLightDirection(com.jme3.math.Vector3f lightDirection)
      Sets the light direction
      Parameters:
      lightDirection - the direction vector to use (alias created, default=(0,-1,0))
    • getLightColor

      public com.jme3.math.ColorRGBA getLightColor()
      returns the light color
      Returns:
      the pre-existing instance
    • setLightColor

      public void setLightColor(com.jme3.math.ColorRGBA lightColor)
      Sets the light color to use default is white
      Parameters:
      lightColor - the color to use (alias created, default=(1,1,1,1))
    • getShoreHardness

      public float getShoreHardness()
      Return the shore hardness.
      Returns:
      the hardness value
    • setShoreHardness

      public void setShoreHardness(float shoreHardness)
      The smaller this value is, the softer the transition between shore and water. If you want hard edges use very big value. Default is 0.1f.
      Parameters:
      shoreHardness - the desired hardness (default=0.1)
    • getFoamHardness

      public float getFoamHardness()
      returns the foam hardness
      Returns:
      the hardness value
    • setFoamHardness

      public void setFoamHardness(float foamHardness)
      Sets the foam hardness : How much the foam will blend with the shore to avoid hard edged water plane. Default is 1.0
      Parameters:
      foamHardness - the desired hardness (default=1)
    • getRefractionStrength

      public float getRefractionStrength()
      returns the refractionStrength
      Returns:
      the strength value
    • setRefractionStrength

      public void setRefractionStrength(float refractionStrength)
      This value modifies current fresnel term. If you want to weaken reflections use bigger value. If you want to emphasize them use a value smaller than 0. Default is 0.
      Parameters:
      refractionStrength - the desired strength (default=0)
    • getWaveScale

      public float getWaveScale()
      Returns the scale factor of the waves' height map.
      Returns:
      the scale factor
    • setWaveScale

      public void setWaveScale(float waveScale)
      Sets the scale factor of the waves' height map. The smaller the value, the bigger the waves. Default is 0.005 .
      Parameters:
      waveScale - the desired scale factor (default=0.005)
    • getFoamExistence

      public com.jme3.math.Vector3f getFoamExistence()
      returns the foam existence vector
      Returns:
      the pre-existing vector
    • setFoamExistence

      public void setFoamExistence(com.jme3.math.Vector3f foamExistence)
      Describes at what depth foam starts to fade out and at what it is completely invisible. The third value is at what height foam for waves appear (+ waterHeight). default is (0.45, 4.35, 1.0);
      Parameters:
      foamExistence - the desired parameters (alias created)
    • getSunScale

      public float getSunScale()
      gets the scale of the sun
      Returns:
      the scale factor
    • setSunScale

      public void setSunScale(float sunScale)
      Sets the scale of the sun for specular effect
      Parameters:
      sunScale - the desired scale factor (default=3)
    • getColorExtinction

      public com.jme3.math.Vector3f getColorExtinction()
      Returns the color extinction vector of the water
      Returns:
      the pre-existing vector
    • setColorExtinction

      public void setColorExtinction(com.jme3.math.Vector3f colorExtinction)
      Return at what depth the refraction color extinct the first value is for red the second is for green the third is for blue Play with those parameters to "trouble" the water default is (5.0, 20.0, 30.0f);
      Parameters:
      colorExtinction - the desired depth for each color component (alias created, default=(5,20,30))
    • setFoamTexture

      public void setFoamTexture(com.jme3.texture.Texture2D foamTexture)
      Sets the foam texture.
      Parameters:
      foamTexture - the foam texture.
    • getFoamTexture

      public com.jme3.texture.Texture2D getFoamTexture()
      Gets the foam texture.
      Returns:
      the foam texture.
    • setHeightTexture

      public void setHeightTexture(com.jme3.texture.Texture2D heightTexture)
      Sets the height texture
      Parameters:
      heightTexture - the texture to use (alias created)
    • getHeightTexture

      public com.jme3.texture.Texture2D getHeightTexture()
      Gets the height texture.
      Returns:
      the height texture.
    • setNormalTexture

      public void setNormalTexture(com.jme3.texture.Texture2D normalTexture)
      Sets the normal texture.
      Parameters:
      normalTexture - the normal texture.
    • getNormalTexture

      public com.jme3.texture.Texture2D getNormalTexture()
      Gets the normal texture.
      Returns:
      the normal texture.
    • getShininess

      public float getShininess()
      return the shininess factor of the water
      Returns:
      the shininess factor
    • setShininess

      public void setShininess(float shininess)
      Sets the shininess factor of the water default is 0.7f
      Parameters:
      shininess - the desired factor (default=0.7)
    • getSpeed

      public float getSpeed()
      returns the speed of the waves
      Returns:
      the speed value
    • setSpeed

      public void setSpeed(float speed)
      Set the speed of the waves (0.0 is still) default is 1.0
      Parameters:
      speed - the desired speedup factor (default=1)
    • getWaterColor

      public com.jme3.math.ColorRGBA getWaterColor()
      returns the color of the water
      Returns:
      the pre-existing instance
    • setWaterColor

      public void setWaterColor(com.jme3.math.ColorRGBA waterColor)
      Sets the color of the water see setDeepWaterColor for deep water color default is (0.0078f, 0.3176f, 0.5f,1.0f) (greenish blue)
      Parameters:
      waterColor - the color to use (alias created, default=(0.0078,0.3176,0.5,1))
    • getDeepWaterColor

      public com.jme3.math.ColorRGBA getDeepWaterColor()
      returns the deep water color
      Returns:
      the pre-existing instance
    • setDeepWaterColor

      public void setDeepWaterColor(com.jme3.math.ColorRGBA deepWaterColor)
      sets the deep water color see setWaterColor for general color default is (0.0039f, 0.00196f, 0.145f,1.0f) (very dark blue)
      Parameters:
      deepWaterColor - the color to use (alias created, default=(0.0039,0.00196,0.145,1))
    • getWindDirection

      public com.jme3.math.Vector2f getWindDirection()
      returns the wind direction
      Returns:
      the pre-existing direction vector
    • setWindDirection

      public void setWindDirection(com.jme3.math.Vector2f windDirection)
      sets the wind direction the direction where the waves move default is (0.0f, -1.0f)
      Parameters:
      windDirection - the direction vector to use (alias created, default=(0,-1))
    • getReflectionMapSize

      public int getReflectionMapSize()
      returns the size of the reflection map
      Returns:
      the size (in pixels)
    • setReflectionMapSize

      public void setReflectionMapSize(int reflectionMapSize)
      Sets the size of the reflection map default is 512, the higher, the better quality, but the slower the effect.
      Parameters:
      reflectionMapSize - the desired size (in pixels per side, default=512)
    • isUseFoam

      public boolean isUseFoam()
      Whether or not the water uses foam
      Returns:
      true if the water uses foam
    • setUseFoam

      public void setUseFoam(boolean useFoam)
      set to true to use foam with water default true
      Parameters:
      useFoam - true for foam, false for no foam (default=true)
    • setCausticsTexture

      public void setCausticsTexture(com.jme3.texture.Texture2D causticsTexture)
      Sets the texture to use to render caustics on the ground underwater.
      Parameters:
      causticsTexture - the caustics texture.
    • getCausticsTexture

      public com.jme3.texture.Texture2D getCausticsTexture()
      Gets the texture which is used to render caustics on the ground underwater.
      Returns:
      the caustics texture.
    • isUseCaustics

      public boolean isUseCaustics()
      Whether or not caustics are rendered
      Returns:
      true if caustics are rendered
    • setUseCaustics

      public void setUseCaustics(boolean useCaustics)
      set to true if you want caustics to be rendered on the ground underwater, false otherwise
      Parameters:
      useCaustics - true to enable rendering fo caustics, false to disable it (default=true)
    • isUseHQShoreline

      public boolean isUseHQShoreline()
      Whether or not the shader is set to use high-quality shoreline.
      Returns:
      true if high-quality shoreline is enabled
    • setUseHQShoreline

      public void setUseHQShoreline(boolean useHQShoreline)
    • isUseRefraction

      public boolean isUseRefraction()
      Whether or not the water uses the refraction
      Returns:
      true if the water uses refraction
    • setUseRefraction

      public void setUseRefraction(boolean useRefraction)
      set to true to use refraction (default is true)
      Parameters:
      useRefraction - true to enable refraction, false to disable it (default=true)
    • isUseRipples

      public boolean isUseRipples()
      Whether or not the water uses ripples
      Returns:
      true if the water is set to use ripples
    • setUseRipples

      public void setUseRipples(boolean useRipples)
      Set to true to use ripples
      Parameters:
      useRipples - true to enable ripples, false to disable them (default=true)
    • isUseSpecular

      public boolean isUseSpecular()
      Whether or not the water is using specular
      Returns:
      true if the water is set to use specular
    • setUseSpecular

      public void setUseSpecular(boolean useSpecular)
      Set to true to use specular lighting on the water
      Parameters:
      useSpecular - true to enable the specular effect, false to disable it (default=true)
    • getFoamIntensity

      public float getFoamIntensity()
      returns the foam intensity
      Returns:
      the intensity value
    • setFoamIntensity

      public void setFoamIntensity(float foamIntensity)
      sets the foam intensity default is 0.5f
      Parameters:
      foamIntensity - the desired intensity (default=0.5)
    • getReflectionDisplace

      public float getReflectionDisplace()
      returns the reflection displace see setReflectionDisplace(float)
      Returns:
      the displacement value
    • setReflectionDisplace

      public void setReflectionDisplace(float reflectionDisplace)
      Sets the reflection displace. define how troubled will look the reflection in the water. default is 30
      Parameters:
      reflectionDisplace - the desired displacement (default=30)
    • isUnderWater

      public boolean isUnderWater()
      Whether or not the camera is under the water level
      Returns:
      true if the camera is under the water level
    • getUnderWaterFogDistance

      public float getUnderWaterFogDistance()
      returns the distance of the fog when underwater
      Returns:
      the distance
    • setUnderWaterFogDistance

      public void setUnderWaterFogDistance(float underWaterFogDistance)
      Sets the distance of the fog when underwater. Default is 120 (120 world units). Use a high value to raise the view range underwater.
      Parameters:
      underWaterFogDistance - the desired distance (in world units, default=120)
    • getCausticsIntensity

      public float getCausticsIntensity()
      Gets the intensity of caustics underwater
      Returns:
      the intensity value (≥0, ≤1)
    • setCausticsIntensity

      public void setCausticsIntensity(float causticsIntensity)
      Sets the intensity of caustics underwater. Goes from 0 to 1, default is 0.5.
      Parameters:
      causticsIntensity - the desired intensity (≥0, ≤1, default=0.5)
    • getCenter

      public com.jme3.math.Vector3f getCenter()
      returns the center of this effect
      Returns:
      the center of this effect
    • setCenter

      public void setCenter(com.jme3.math.Vector3f center)
      Set the center of the effect. By default, the water will extend across the entire scene. By setting a center and a radius you can restrain it to a portion of the scene.
      Parameters:
      center - the center of the effect
    • getRadius

      public float getRadius()
      returns the radius of this effect
      Returns:
      the radius of this effect
    • setRadius

      public void setRadius(float radius)
      Set the radius of the effect. By default, the water will extend across the entire scene. By setting a center and a radius you can restrain it to a portion of the scene.
      Parameters:
      radius - the radius of the effect
    • getShapeType

      public WaterFilter.AreaShape getShapeType()
      returns the shape of the water area
      Returns:
      the shape of the water area
    • setShapeType

      public void setShapeType(WaterFilter.AreaShape shapeType)
      Set the shape of the water area (Circular (default) or Square). if the shape is square the radius is considered as an extent.
      Parameters:
      shapeType - the shape type
    • jmeClone

      public Object jmeClone()
      Specified by:
      jmeClone in interface com.jme3.util.clone.JmeCloneable
    • cloneFields

      public void cloneFields(com.jme3.util.clone.Cloner cloner, Object original)
      Specified by:
      cloneFields in interface com.jme3.util.clone.JmeCloneable
    • setNeedSaveReflectionScene

      public void setNeedSaveReflectionScene(boolean needSaveReflectionScene)
      Sets the flag.
      Parameters:
      needSaveReflectionScene - true if need to save reflection scene.
    • isNeedSaveReflectionScene

      public boolean isNeedSaveReflectionScene()
      Returns:
      true if need to save reflection scene.