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_afBumpSpeed
Bump-map speed:protected float[]
m_afConstants
Index 0 is averageDuDxDvDy, index 1 is ambient, index 2 is texture repeat, and index 3 is time.protected float[]
m_afLightDir
The light direction is a 3-tuple.protected float[]
m_afWaveDirX
Wave x-direction:protected float[]
m_afWaveDirY
Wave y-direction:protected float[]
m_afWaveHeight
Wave height:protected float[]
m_afWaveOffset
Wave offset:protected float[]
m_afWaveSpeed
Wave speed:private static long
serialVersionUID
-
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 void
dispose()
Delete data members:float
GetAmbient()
Returns the Ambient valuefloat
GetAverageDuDxDvDy()
Returns the Average DuDxDvDy valuevoid
GetBumpSpeed(float[] afValue)
Returns the Bump speed valuesint
GetDiskUsed(StreamVersion rkVersion)
Returns the size of this object and it's children on disk for the current StreamVersion parameter.Vector3f
GetLightDir()
Returns the Light directionfloat
GetTextureRepeat()
Returns the Texture repeat valuefloat
GetTime()
Returns the animation time valuevoid
GetWaveDirX(float[] afValue)
Returns the Wave x-directionvoid
GetWaveDirY(float[] afValue)
Returns the Wave y-directionvoid
GetWaveHeight(float[] afValue)
Returns the Wave height valuesvoid
GetWaveOffset(float[] afValue)
Returns the Wave offset valuesvoid
GetWaveSpeed(float[] afValue)
Returns the Wave speed valuesvoid
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.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.void
OnLoadPrograms(int iPass, Program pkVProgram, Program pkPProgram, Program pkCProgram)
Exchange information between the effect and the programs.boolean
Register(Stream rkStream)
Registers this object with the input Stream parameter.void
Save(Stream rkStream)
Write this object and all it's children to the Stream.StringTree
SaveStrings(java.lang.String acTitle)
Write this object into a StringTree for the scene-graph visualization.void
SetAmbient(float fValue)
Sets the Ambient valuevoid
SetAverageDuDxDvDy(float fValue)
Sets the Average DuDxDvDy valuevoid
SetBumpSpeed(float[] afValue)
Sets the Bump speed valuesvoid
SetLightDir(Vector3f rkLightDir)
Sets the Light directionvoid
SetTextureRepeat(float fValue)
Sets the Texture repeat valuevoid
SetTime(float fValue)
Sets the animation time valuevoid
SetWaveDirX(float[] afValue)
Sets the Wave x-directionvoid
SetWaveDirY(float[] afValue)
Sets the Wave y-directionvoid
SetWaveHeight(float[] afValue)
Sets the Wave height valuesvoid
SetWaveOffset(float[] afValue)
Sets the Wave offset valuesvoid
SetWaveSpeed(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:
dispose
in 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:
GetDiskUsed
in interfaceStreamInterface
- Overrides:
GetDiskUsed
in 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:
Link
in interfaceStreamInterface
- Overrides:
Link
in 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:
Load
in interfaceStreamInterface
- Overrides:
Load
in 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:
OnLoadPrograms
in 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:
Register
in interfaceStreamInterface
- Overrides:
Register
in 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:
Save
in interfaceStreamInterface
- Overrides:
Save
in 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:
SaveStrings
in interfaceStreamInterface
- Overrides:
SaveStrings
in 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.
-
-