org.deegree.rendering.r3d.opengl.rendering.model.geometry
Class BillBoard

java.lang.Object
  extended by org.deegree.rendering.r3d.model.QualityModel<RenderableQualityModelPart>
      extended by org.deegree.rendering.r3d.opengl.rendering.model.geometry.RenderableQualityModel
          extended by org.deegree.rendering.r3d.opengl.rendering.model.geometry.BillBoard
All Implemented Interfaces:
Serializable, PositionableModel, MemoryAware, JOGLRenderable

public class BillBoard
extends RenderableQualityModel
implements PositionableModel

The BillBoard class represents a billboard an object always facing the viewer, with the z-axis as it's rotation axis.

Version:
$Revision: 29127 $, $Date: 2011-01-10 16:13:35 +0100 (Mon, 10 Jan 2011) $
Author:
Rutger Bezema, last edited by: $Author: aschmitz $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.deegree.rendering.r3d.model.QualityModel
prototype, qualityModelParts
 
Constructor Summary
BillBoard(String texture, float[] location, float width, float height)
          Constructs a billboard data structure with the given texture id.
 
Method Summary
 boolean equals(Object obj)
           
 float getErrorScalar()
           
 float getGroundLevel()
           
 float getHeight()
           
 float[] getLocation()
           
 float[] getModelBBox()
           
 float getObjectHeight()
           
 float[] getPosition()
           
 String getTextureID()
           
 float getWidth()
           
 int hashCode()
          Implementation as proposed by Joshua Block in Effective Java (Addison-Wesley 2001), which supplies an even distribution and is relatively fast.
 void render(RenderContext glRenderContext)
          Called to render this object to an OpenGL context.
 void renderPrepared(javax.media.opengl.GL context, float[] eye)
           
 long sizeOf()
           
 String toString()
           
 
Methods inherited from class org.deegree.rendering.r3d.opengl.rendering.model.geometry.RenderableQualityModel
getOrdinateCount, getTextureOrdinateCount, renderPrepared
 
Methods inherited from class org.deegree.rendering.r3d.model.QualityModel
addQualityModelPart, addQualityModelParts, getPrototypeReference, getQualityModelPart, getQualityModelParts, setPrototype
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BillBoard

public BillBoard(String texture,
                 float[] location,
                 float width,
                 float height)
Constructs a billboard data structure with the given texture id.

Parameters:
texture -
location - of the billboard
width - of this billboard
height - of this billboard
Method Detail

render

public void render(RenderContext glRenderContext)
Description copied from interface: JOGLRenderable
Called to render this object to an OpenGL context.

The following pre-conditions hold:

Specified by:
render in interface JOGLRenderable
Overrides:
render in class RenderableQualityModel
Parameters:
glRenderContext - TODO

toString

public String toString()
Overrides:
toString in class RenderableQualityModel

sizeOf

public long sizeOf()
Specified by:
sizeOf in interface MemoryAware
Overrides:
sizeOf in class QualityModel<RenderableQualityModelPart>
Returns:
the bytes this geometry occupies

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Implementation as proposed by Joshua Block in Effective Java (Addison-Wesley 2001), which supplies an even distribution and is relatively fast. It is created from field f as follows:

Combining the hash code(s) computed above: result = 37 * result + code;

Overrides:
hashCode in class Object
Returns:
(int) ( result >>> 32 ) ^ (int) result;
See Also:
Object.hashCode()

getTextureID

public final String getTextureID()
Returns:
the id of it's texture

getLocation

public final float[] getLocation()
Returns:
the location of this billboard (it's center axis)

getPosition

public float[] getPosition()
Specified by:
getPosition in interface PositionableModel
Returns:
the position of the implementing class.

getWidth

public final float getWidth()
Returns:
the width

getHeight

public final float getHeight()
Returns:
the height

renderPrepared

public void renderPrepared(javax.media.opengl.GL context,
                           float[] eye)
Parameters:
context -
eye -

getErrorScalar

public float getErrorScalar()
Specified by:
getErrorScalar in interface PositionableModel
Returns:
a scalar which is represents the 'error' of this positionable.

getObjectHeight

public float getObjectHeight()
Specified by:
getObjectHeight in interface PositionableModel
Returns:
a scalar which represents the 'height' of this positionable.

getGroundLevel

public float getGroundLevel()
Specified by:
getGroundLevel in interface PositionableModel
Returns:
a scalar which represents the 'groundlevel' of this positionable.

getModelBBox

public float[] getModelBBox()
Specified by:
getModelBBox in interface PositionableModel
Returns:
the boundingbox of the model with float[0][0-3] the min, float[1][0-3] the max.


Copyright © 2011. All Rights Reserved.