Package WildMagic.LibGraphics.Effects
Class RipplingOceanEffect
- java.lang.Object
-
- WildMagic.LibGraphics.ObjectSystem.GraphicsObject
-
- WildMagic.LibGraphics.Effects.Effect
-
- WildMagic.LibGraphics.Effects.ShaderEffect
-
- WildMagic.LibGraphics.Effects.RipplingOceanEffect
-
- All Implemented Interfaces:
java.io.Serializable,NameIdInterface,StreamInterface
public class RipplingOceanEffect extends ShaderEffect implements StreamInterface, java.io.Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected float[]m_afBumpSpeedBump-map speed:protected float[]m_afConstantsIndex 0 is averageDuDxDvDy, index 1 is ambient, index 2 is texture repeat, and index 3 is time.protected float[]m_afLightDirThe light direction is a 3-tuple.protected float[]m_afWaveDirXWave x-direction:protected float[]m_afWaveDirYWave y-direction:protected float[]m_afWaveHeightWave height:protected float[]m_afWaveOffsetWave offset:protected float[]m_afWaveSpeedWave speed:private static longserialVersionUID-
Fields inherited from class WildMagic.LibGraphics.Effects.ShaderEffect
m_iPassQuantity, m_kAlphaState, m_kCompiledPrograms, m_kPShader, m_kVShader
-
-
Constructor Summary
Constructors Constructor Description RipplingOceanEffect()streaming constructorRipplingOceanEffect(java.lang.String acBumpName, java.lang.String acWaterName, java.lang.String acEnvName)Creates a new RipplingOceanEffect
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Delete data members:floatGetAmbient()Returns the Ambient valuefloatGetAverageDuDxDvDy()Returns the Average DuDxDvDy valuevoidGetBumpSpeed(float[] afValue)Returns the Bump speed valuesintGetDiskUsed(StreamVersion rkVersion)Returns the size of this object and it's children on disk for the current StreamVersion parameter.Vector3fGetLightDir()Returns the Light directionfloatGetTextureRepeat()Returns the Texture repeat valuefloatGetTime()Returns the animation time valuevoidGetWaveDirX(float[] afValue)Returns the Wave x-directionvoidGetWaveDirY(float[] afValue)Returns the Wave y-directionvoidGetWaveHeight(float[] afValue)Returns the Wave height valuesvoidGetWaveOffset(float[] afValue)Returns the Wave offset valuesvoidGetWaveSpeed(float[] afValue)Returns the Wave speed valuesvoidLink(Stream rkStream, Stream.Link pkLink)Copies this objects children objects from the input Stream's HashTable, based on the LinkID of the child stored in the pkLink parameter.voidLoad(Stream rkStream, Stream.Link pkLink)Loads this object from the input parameter rkStream, using the input Stream.Link to store the IDs of children objects of this object for linking after all objects are loaded from the Stream.voidOnLoadPrograms(int iPass, Program pkVProgram, Program pkPProgram, Program pkCProgram)Exchange information between the effect and the programs.booleanRegister(Stream rkStream)Registers this object with the input Stream parameter.voidSave(Stream rkStream)Write this object and all it's children to the Stream.StringTreeSaveStrings(java.lang.String acTitle)Write this object into a StringTree for the scene-graph visualization.voidSetAmbient(float fValue)Sets the Ambient valuevoidSetAverageDuDxDvDy(float fValue)Sets the Average DuDxDvDy valuevoidSetBumpSpeed(float[] afValue)Sets the Bump speed valuesvoidSetLightDir(Vector3f rkLightDir)Sets the Light directionvoidSetTextureRepeat(float fValue)Sets the Texture repeat valuevoidSetTime(float fValue)Sets the animation time valuevoidSetWaveDirX(float[] afValue)Sets the Wave x-directionvoidSetWaveDirY(float[] afValue)Sets the Wave y-directionvoidSetWaveHeight(float[] afValue)Sets the Wave height valuesvoidSetWaveOffset(float[] afValue)Sets the Wave offset valuesvoidSetWaveSpeed(float[] afValue)Sets the Wave speed values-
Methods inherited from class WildMagic.LibGraphics.Effects.ShaderEffect
GetAllObjectsByName, GetBlending, GetCProgram, GetObjectByID, GetObjectByName, GetPassQuantity, GetPProgram, GetSamplerInformation, GetTexture, GetTexture, GetTextureQuantity, GetVProgram, LoadPrograms, LoadResources, OnReleasePrograms, ReleasePrograms, ReleaseResources, RestoreGlobalState, SetCProgram, SetDefaultAlphaState, SetGlobalState, SetPassQuantity, SetPShader, SetVShader
-
Methods inherited from class WildMagic.LibGraphics.ObjectSystem.GraphicsObject
GetID, GetName, GetNextID, GetObjectByIDBase, GetObjectByNameBase, SetName
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
m_afLightDir
protected float[] m_afLightDir
The light direction is a 3-tuple. The last component is unused.
-
m_afWaveDirX
protected float[] m_afWaveDirX
Wave x-direction:
-
m_afWaveDirY
protected float[] m_afWaveDirY
Wave y-direction:
-
m_afWaveSpeed
protected float[] m_afWaveSpeed
Wave speed:
-
m_afWaveOffset
protected float[] m_afWaveOffset
Wave offset:
-
m_afWaveHeight
protected float[] m_afWaveHeight
Wave height:
-
m_afBumpSpeed
protected float[] m_afBumpSpeed
Bump-map speed:
-
m_afConstants
protected float[] m_afConstants
Index 0 is averageDuDxDvDy, index 1 is ambient, index 2 is texture repeat, and index 3 is time.
-
-
Constructor Detail
-
RipplingOceanEffect
public RipplingOceanEffect()
streaming constructor
-
RipplingOceanEffect
public RipplingOceanEffect(java.lang.String acBumpName, java.lang.String acWaterName, java.lang.String acEnvName)Creates a new RipplingOceanEffect- Parameters:
acBumpName- the name for the BumpMap image fileacWaterName- the name for the Water image fileacEnvName- the name for the Environment image file
-
-
Method Detail
-
dispose
public void dispose()
Delete data members:- Overrides:
disposein classShaderEffect
-
GetAmbient
public float GetAmbient()
Returns the Ambient value- Returns:
- the Ambient value
-
GetAverageDuDxDvDy
public float GetAverageDuDxDvDy()
Returns the Average DuDxDvDy value- Returns:
- the Average DuDxDvDy value
-
GetBumpSpeed
public void GetBumpSpeed(float[] afValue)
Returns the Bump speed values- Parameters:
afValue- return parameter for the Bump speed values.
-
GetDiskUsed
public int GetDiskUsed(StreamVersion rkVersion)
Returns the size of this object and it's children on disk for the current StreamVersion parameter.- Specified by:
GetDiskUsedin interfaceStreamInterface- Overrides:
GetDiskUsedin classShaderEffect- Parameters:
rkVersion- the current version of the Stream file being created.- Returns:
- the size of this object on disk.
-
GetLightDir
public Vector3f GetLightDir()
Returns the Light direction- Returns:
- the light direction vector.
-
GetTextureRepeat
public float GetTextureRepeat()
Returns the Texture repeat value- Returns:
- the Texture repeat value
-
GetTime
public float GetTime()
Returns the animation time value- Returns:
- the animation time value
-
GetWaveDirX
public void GetWaveDirX(float[] afValue)
Returns the Wave x-direction- Parameters:
afValue- return parameter for the Wave x-direction values.
-
GetWaveDirY
public void GetWaveDirY(float[] afValue)
Returns the Wave y-direction- Parameters:
afValue- return parameter for the Wave y-direction values.
-
GetWaveHeight
public void GetWaveHeight(float[] afValue)
Returns the Wave height values- Parameters:
afValue- return parameter for the Wave height values.
-
GetWaveOffset
public void GetWaveOffset(float[] afValue)
Returns the Wave offset values- Parameters:
afValue- -- return parameter the Wave offset values.
-
GetWaveSpeed
public void GetWaveSpeed(float[] afValue)
Returns the Wave speed values- Parameters:
afValue- -- return parameter the Wave speed values.
-
Link
public void Link(Stream rkStream, Stream.Link pkLink)
Copies this objects children objects from the input Stream's HashTable, based on the LinkID of the child stored in the pkLink parameter.- Specified by:
Linkin interfaceStreamInterface- Overrides:
Linkin classShaderEffect- Parameters:
rkStream- the Stream where the child objects are stored.pkLink- the Link class from which the child object IDs are read.
-
Load
public void Load(Stream rkStream, Stream.Link pkLink)
Loads this object from the input parameter rkStream, using the input Stream.Link to store the IDs of children objects of this object for linking after all objects are loaded from the Stream.- Specified by:
Loadin interfaceStreamInterface- Overrides:
Loadin classShaderEffect- Parameters:
rkStream- the Stream from which this object is being read.pkLink- the Link class for storing the IDs of this object's children objects.
-
OnLoadPrograms
public void OnLoadPrograms(int iPass, Program pkVProgram, Program pkPProgram, Program pkCProgram)Exchange information between the effect and the programs.- Overrides:
OnLoadProgramsin classShaderEffect- Parameters:
iPass- the rendering passpkVProgram- the Vertex ProgrampkPProgram- the Pixel Program
-
Register
public boolean Register(Stream rkStream)
Registers this object with the input Stream parameter. All objects streamed to disk are registered with the Stream so that a unique list of objects is maintained.- Specified by:
Registerin interfaceStreamInterface- Overrides:
Registerin classShaderEffect- Parameters:
rkStream- the Stream where the child objects are stored.- Returns:
- true if this object is registered, false if the object has already been registered.
-
Save
public void Save(Stream rkStream)
Write this object and all it's children to the Stream.- Specified by:
Savein interfaceStreamInterface- Overrides:
Savein classShaderEffect- Parameters:
rkStream- the Stream where the child objects are stored.
-
SaveStrings
public StringTree SaveStrings(java.lang.String acTitle)
Write this object into a StringTree for the scene-graph visualization.- Specified by:
SaveStringsin interfaceStreamInterface- Overrides:
SaveStringsin classShaderEffect- Parameters:
acTitle- the header for this object in the StringTree.- Returns:
- StringTree containing a String-based representation of this object and it's children.
-
SetAmbient
public void SetAmbient(float fValue)
Sets the Ambient value- Parameters:
fValue- the Ambient value
-
SetAverageDuDxDvDy
public void SetAverageDuDxDvDy(float fValue)
Sets the Average DuDxDvDy value- Parameters:
fValue- the Average DuDxDvDy value
-
SetBumpSpeed
public void SetBumpSpeed(float[] afValue)
Sets the Bump speed values- Parameters:
afValue- the Bump speed values.
-
SetLightDir
public void SetLightDir(Vector3f rkLightDir)
Sets the Light direction- Parameters:
rkLightDir- the light direction vector.
-
SetTextureRepeat
public void SetTextureRepeat(float fValue)
Sets the Texture repeat value- Parameters:
fValue- the Texture repeat value
-
SetTime
public void SetTime(float fValue)
Sets the animation time value- Parameters:
fValue- the animation time value
-
SetWaveDirX
public void SetWaveDirX(float[] afValue)
Sets the Wave x-direction- Parameters:
afValue- the Wave x-direction values.
-
SetWaveDirY
public void SetWaveDirY(float[] afValue)
Sets the Wave y-direction- Parameters:
afValue- the Wave y-direction values.
-
SetWaveHeight
public void SetWaveHeight(float[] afValue)
Sets the Wave height values- Parameters:
afValue- the Wave height values.
-
SetWaveOffset
public void SetWaveOffset(float[] afValue)
Sets the Wave offset values- Parameters:
afValue- the Wave offset values.
-
SetWaveSpeed
public void SetWaveSpeed(float[] afValue)
Sets the Wave speed values- Parameters:
afValue- the Wave speed values.
-
-