org.deegree.rendering.r3d.opengl.rendering.model.geometry
Class BillBoard
java.lang.Object
org.deegree.rendering.r3d.model.QualityModel<RenderableQualityModelPart>
org.deegree.rendering.r3d.opengl.rendering.model.geometry.RenderableQualityModel
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
Constructor Summary |
BillBoard(String texture,
float[] location,
float width,
float height)
Constructs a billboard data structure with the given texture id. |
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 billboardwidth
- of this billboardheight
- of this billboard
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:
- The projection matrix of
context
has been set up correctly by the caller.
- The view parameters
params
matches the projection and the screen size, so the callee can depend
on them to perform view frustum culling and LOD adaptation.
- 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:
- boolean -- code = (f ? 0 : 1)
- byte, char, short, int -- code = (int)f
- long -- code = (int)(f ^ (f >>>32))
- float -- code = Float.floatToIntBits(f);
- double -- long l = Double.doubleToLongBits(f); code = (int)(l ^ (l >>> 32))
- all Objects, (where equals( ) calls equals( ) for this field) -- code = f.hashCode( )
- Array -- Apply above rules to each element
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.