public class PlanarReflectionEffect extends Effect implements NameIdInterface, StreamInterface, Serializable
Modifier and Type | Field and Description |
---|---|
protected float[] |
m_afReflectance
Reflectance factors
|
protected TriMesh[] |
m_aspkPlane
Reflection planes
|
protected int |
m_iQuantity
Number of reflection planes
|
protected AlphaState |
m_spkAState
Temporary render state for drawing.
|
protected StencilState |
m_spkSState
Temporary render state for drawing.
|
protected ZBufferState |
m_spkZState
Temporary render state for drawing.
|
private static long |
serialVersionUID |
Constructor and Description |
---|
PlanarReflectionEffect()
Streaming constructor
|
PlanarReflectionEffect(int iQuantity)
Creates a new PlanarReflectionEffect for the number of planes
specified.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Delete data members:
|
void |
Draw(Renderer pkRenderer,
Spatial pkGlobalObject,
int iMin,
int iMax,
VisibleObject[] akVisible)
Draw the planar reflections
|
void |
GetAllObjectsByName(String rkName,
Vector<GraphicsObject> rkObjects)
Writes all GraphicsObjects with the name that matches the input
parameter, rkName into the Vector parameter rkObjects.
|
int |
GetDiskUsed(StreamVersion rkVersion)
Returns the size of this object and it's children on disk for the
current StreamVersion parameter.
|
GraphicsObject |
GetObjectByID(int uiID)
Returns the GraphicsObject with the ID that matches the input parameter, uiID.
|
GraphicsObject |
GetObjectByName(String rkName)
Returns the GraphicsObject with the name that matches the input parameter, rkName.
|
TriMesh |
GetPlane(int i)
Returns the ith reflection plane
|
int |
GetQuantity()
Return the number of reflection planes
|
float |
GetReflectance(int i)
Returns the reflectance for the ith reflection plane
|
protected void |
GetReflectionMatrixAndPlane(int i,
Matrix4f rkReflection,
Plane3f rkPlane)
Computes and returns the reflection matrix for the ith plane in world
coordinates.
|
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.
|
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.
|
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(String acTitle)
Write this object into a StringTree for the scene-graph visualization.
|
void |
SetPlane(int i,
TriMesh spkPlane)
Sets the ith reflection plane
|
void |
SetReflectance(int i,
float fReflectance)
Sets the reflectance for the ith reflection plane
|
LoadResources, ReleaseResources
GetID, GetName, GetNextID, GetObjectByIDBase, GetObjectByNameBase, SetName
private static final long serialVersionUID
protected int m_iQuantity
protected TriMesh[] m_aspkPlane
protected float[] m_afReflectance
protected AlphaState m_spkAState
protected StencilState m_spkSState
protected ZBufferState m_spkZState
public PlanarReflectionEffect()
public PlanarReflectionEffect(int iQuantity)
iQuantity
- the number of reflection planes.public void dispose()
dispose
in class GraphicsObject
public void Draw(Renderer pkRenderer, Spatial pkGlobalObject, int iMin, int iMax, VisibleObject[] akVisible)
public void GetAllObjectsByName(String rkName, Vector<GraphicsObject> rkObjects)
GetAllObjectsByName
in interface NameIdInterface
GetAllObjectsByName
in class GraphicsObject
rkName
- the name of the objects to return.rkObjects
- a Vector of all objects with the matching name.public int GetDiskUsed(StreamVersion rkVersion)
GetDiskUsed
in interface StreamInterface
GetDiskUsed
in class Effect
rkVersion
- the current version of the Stream file being created.public GraphicsObject GetObjectByID(int uiID)
GetObjectByID
in interface NameIdInterface
GetObjectByID
in class GraphicsObject
uiID
- the ID of the object to return.public GraphicsObject GetObjectByName(String rkName)
GetObjectByName
in interface NameIdInterface
GetObjectByName
in class GraphicsObject
rkName
- the name of the object to return.public TriMesh GetPlane(int i)
i
- the ith reflection planepublic int GetQuantity()
public float GetReflectance(int i)
i
- the ith reflection planepublic void Link(Stream rkStream, Stream.Link pkLink)
Link
in interface StreamInterface
Link
in class Effect
rkStream
- the Stream where the child objects are stored.pkLink
- the Link class from which the child object IDs are read.public void Load(Stream rkStream, Stream.Link pkLink)
Load
in interface StreamInterface
Load
in class Effect
rkStream
- the Stream from which this object is being read.pkLink
- the Link class for storing the IDs of this object's
children objects.public boolean Register(Stream rkStream)
Register
in interface StreamInterface
Register
in class Effect
rkStream
- the Stream where the child objects are stored.public void Save(Stream rkStream)
Save
in interface StreamInterface
Save
in class Effect
rkStream
- the Stream where the child objects are stored.public StringTree SaveStrings(String acTitle)
SaveStrings
in interface StreamInterface
SaveStrings
in class Effect
acTitle
- the header for this object in the StringTree.public void SetPlane(int i, TriMesh spkPlane)
i
- the ith reflection plane to setspkPlane
- the reflection planepublic void SetReflectance(int i, float fReflectance)
i
- the ith reflection planefReflectance
- the reflectance parameterprotected void GetReflectionMatrixAndPlane(int i, Matrix4f rkReflection, Plane3f rkPlane)
i
- the ith reflection planerkReflection
- returned value of the reflection matrixrkPlane
- returned value of the plane in world coordinates.