Package WildMagic.LibGraphics.Effects
Class PlanarReflectionEffect
- java.lang.Object
-
- WildMagic.LibGraphics.ObjectSystem.GraphicsObject
-
- WildMagic.LibGraphics.Effects.Effect
-
- WildMagic.LibGraphics.Effects.PlanarReflectionEffect
-
- All Implemented Interfaces:
java.io.Serializable,NameIdInterface,StreamInterface
public class PlanarReflectionEffect extends Effect implements NameIdInterface, StreamInterface, java.io.Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected float[]m_afReflectanceReflectance factorsprotected TriMesh[]m_aspkPlaneReflection planesprotected intm_iQuantityNumber of reflection planesprotected AlphaStatem_spkAStateTemporary render state for drawing.protected StencilStatem_spkSStateTemporary render state for drawing.protected ZBufferStatem_spkZStateTemporary render state for drawing.private static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description PlanarReflectionEffect()Streaming constructorPlanarReflectionEffect(int iQuantity)Creates a new PlanarReflectionEffect for the number of planes specified.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Delete data members:voidDraw(Renderer pkRenderer, Spatial pkGlobalObject, int iMin, int iMax, VisibleObject[] akVisible)Draw the planar reflectionsvoidGetAllObjectsByName(java.lang.String rkName, java.util.Vector<GraphicsObject> rkObjects)Writes all GraphicsObjects with the name that matches the input parameter, rkName into the Vector parameter rkObjects.intGetDiskUsed(StreamVersion rkVersion)Returns the size of this object and it's children on disk for the current StreamVersion parameter.GraphicsObjectGetObjectByID(int uiID)Returns the GraphicsObject with the ID that matches the input parameter, uiID.GraphicsObjectGetObjectByName(java.lang.String rkName)Returns the GraphicsObject with the name that matches the input parameter, rkName.TriMeshGetPlane(int i)Returns the ith reflection planeintGetQuantity()Return the number of reflection planesfloatGetReflectance(int i)Returns the reflectance for the ith reflection planeprotected voidGetReflectionMatrixAndPlane(int i, Matrix4f rkReflection, Plane3f rkPlane)Computes and returns the reflection matrix for the ith plane in world coordinates.voidLink(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.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.voidSetPlane(int i, TriMesh spkPlane)Sets the ith reflection planevoidSetReflectance(int i, float fReflectance)Sets the reflectance for the ith reflection plane-
Methods inherited from class WildMagic.LibGraphics.Effects.Effect
LoadResources, ReleaseResources
-
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_iQuantity
protected int m_iQuantity
Number of reflection planes
-
m_aspkPlane
protected TriMesh[] m_aspkPlane
Reflection planes
-
m_afReflectance
protected float[] m_afReflectance
Reflectance factors
-
m_spkAState
protected AlphaState m_spkAState
Temporary render state for drawing.
-
m_spkSState
protected StencilState m_spkSState
Temporary render state for drawing.
-
m_spkZState
protected ZBufferState m_spkZState
Temporary render state for drawing.
-
-
Method Detail
-
dispose
public void dispose()
Delete data members:- Overrides:
disposein classGraphicsObject
-
Draw
public void Draw(Renderer pkRenderer, Spatial pkGlobalObject, int iMin, int iMax, VisibleObject[] akVisible)
Draw the planar reflections
-
GetAllObjectsByName
public void GetAllObjectsByName(java.lang.String rkName, java.util.Vector<GraphicsObject> rkObjects)Writes all GraphicsObjects with the name that matches the input parameter, rkName into the Vector parameter rkObjects.- Specified by:
GetAllObjectsByNamein interfaceNameIdInterface- Overrides:
GetAllObjectsByNamein classGraphicsObject- Parameters:
rkName- the name of the objects to return.rkObjects- a Vector of all objects with the matching name.
-
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 classEffect- Parameters:
rkVersion- the current version of the Stream file being created.- Returns:
- the size of this object on disk.
-
GetObjectByID
public GraphicsObject GetObjectByID(int uiID)
Returns the GraphicsObject with the ID that matches the input parameter, uiID.- Specified by:
GetObjectByIDin interfaceNameIdInterface- Overrides:
GetObjectByIDin classGraphicsObject- Parameters:
uiID- the ID of the object to return.- Returns:
- the GraphicsObject that matches the input name.
-
GetObjectByName
public GraphicsObject GetObjectByName(java.lang.String rkName)
Returns the GraphicsObject with the name that matches the input parameter, rkName.- Specified by:
GetObjectByNamein interfaceNameIdInterface- Overrides:
GetObjectByNamein classGraphicsObject- Parameters:
rkName- the name of the object to return.- Returns:
- the GraphicsObject that matches the input name.
-
GetPlane
public TriMesh GetPlane(int i)
Returns the ith reflection plane- Parameters:
i- the ith reflection plane- Returns:
- the ith reflection plane
-
GetQuantity
public int GetQuantity()
Return the number of reflection planes- Returns:
- the number of reflection planes
-
GetReflectance
public float GetReflectance(int i)
Returns the reflectance for the ith reflection plane- Parameters:
i- the ith reflection plane- Returns:
- the reflectance parameter
-
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 classEffect- 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 classEffect- 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.
-
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 classEffect- 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 classEffect- 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 classEffect- Parameters:
acTitle- the header for this object in the StringTree.- Returns:
- StringTree containing a String-based representation of this object and it's children.
-
SetPlane
public void SetPlane(int i, TriMesh spkPlane)Sets the ith reflection plane- Parameters:
i- the ith reflection plane to setspkPlane- the reflection plane
-
SetReflectance
public void SetReflectance(int i, float fReflectance)Sets the reflectance for the ith reflection plane- Parameters:
i- the ith reflection planefReflectance- the reflectance parameter
-
GetReflectionMatrixAndPlane
protected void GetReflectionMatrixAndPlane(int i, Matrix4f rkReflection, Plane3f rkPlane)Computes and returns the reflection matrix for the ith plane in world coordinates.- Parameters:
i- the ith reflection planerkReflection- returned value of the reflection matrixrkPlane- returned value of the plane in world coordinates.
-
-