org.xith3d.scenegraph.primitives
Class RectBillboard

java.lang.Object
  extended by org.xith3d.scenegraph.SceneGraphObject
      extended by org.xith3d.scenegraph.Node
          extended by org.xith3d.scenegraph.Leaf
              extended by org.xith3d.scenegraph.Shape3D
                  extended by org.xith3d.scenegraph.primitives.Quad
                      extended by org.xith3d.scenegraph.primitives.Rectangle
                          extended by org.xith3d.scenegraph.primitives.RectBillboard
All Implemented Interfaces:
org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.NamedObject, org.openmali.spatial.SpatialNode, Billboard

public class RectBillboard
extends Rectangle
implements Billboard

This is a reguar Rectangle, which will always face the View.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.xith3d.scenegraph.primitives.Rectangle
Rectangle.ZeroPointLocation
 
Field Summary
protected  org.openmali.vecmath2.Point3f[] transformedVertices
           
protected  org.openmali.vecmath2.Tuple3f[] zeroVertices
           
 
Fields inherited from class org.xith3d.scenegraph.Node
bounds, boundsAutoCompute, boundsDirty, globalIgnoreBounds, instanceBoundsTypeHint, transformGroup, untransformedBounds
 
Fields inherited from class org.xith3d.scenegraph.SceneGraphObject
XITH3D_USERDATAKEY_OLDUSERDATA
 
Constructor Summary
RectBillboard(float width, float height)
          Creates an untextured RectBillboard.
RectBillboard(float width, float height, org.openmali.vecmath2.Colorf color)
          Creates an untextured, but colored RectBillboard.
RectBillboard(float width, float height, float zOffset)
          Creates an untextured RectBillboard without alpha channel.
RectBillboard(float width, float height, float zOffset, org.openmali.vecmath2.Colorf color)
          Creates an untextured, but colored RectBillboard.
RectBillboard(float width, float height, float zOffset, java.lang.String texture)
          Creates a textured RectBillboard.
RectBillboard(float width, float height, float zOffset, Texture texture)
          Creates a textured RectBillboard.
RectBillboard(float width, float height, float zOffset, Texture texture, org.openmali.vecmath2.Tuple2f texLowerLeft, org.openmali.vecmath2.Tuple2f texUpperRight)
          Creates a textured RectBillboard.
RectBillboard(float width, float height, Rectangle.ZeroPointLocation zpl)
          Creates an untextured RectBillboard.
RectBillboard(float width, float height, Rectangle.ZeroPointLocation zpl, org.openmali.vecmath2.Colorf color)
          Creates an untextured, but colored RectBillboard.
RectBillboard(float width, float height, Rectangle.ZeroPointLocation zpl, float zOffset)
          Creates an untextured RectBillboard without alpha channel.
RectBillboard(float width, float height, Rectangle.ZeroPointLocation zpl, float zOffset, org.openmali.vecmath2.Colorf color)
          Creates an untextured, but colored RectBillboard.
RectBillboard(float width, float height, Rectangle.ZeroPointLocation zpl, float zOffset, java.lang.String texture)
          Creates a textured RectBillboard.
RectBillboard(float width, float height, Rectangle.ZeroPointLocation zpl, float zOffset, Texture texture, org.openmali.vecmath2.Tuple2f texLowerLeft, org.openmali.vecmath2.Tuple2f texUpperRight)
          Creates a textured RectBillboard.
RectBillboard(float width, float height, Rectangle.ZeroPointLocation zpl, java.lang.String texture)
          Creates a textured RectBillboard.
RectBillboard(float width, float height, Rectangle.ZeroPointLocation zpl, java.lang.String texture, org.openmali.vecmath2.Tuple2f texLowerLeft, org.openmali.vecmath2.Tuple2f texUpperRight)
          Creates a textured RectBillboard.
RectBillboard(float width, float height, Rectangle.ZeroPointLocation zpl, Texture texture)
          Creates a textured RectBillboard.
RectBillboard(float width, float height, java.lang.String texture)
          Creates a textured RectBillboard.
RectBillboard(float width, float height, Texture texture)
          Creates a textured RectBillboard.
RectBillboard(float width, float height, Texture texture, org.openmali.vecmath2.Tuple2f texLowerLeft, org.openmali.vecmath2.Tuple2f texUpperRight)
          Creates a textured RectBillboard.
RectBillboard(float width, float height, org.openmali.vecmath2.Tuple3f offset)
          Creates an untextured RectBillboard without alpha channel.
RectBillboard(float width, float height, org.openmali.vecmath2.Tuple3f offset, org.openmali.vecmath2.Colorf color)
          Creates an untextured, but colored RectBillboard.
RectBillboard(float width, float height, org.openmali.vecmath2.Tuple3f offset, java.lang.String texture)
          Creates a textured RectBillboard.
RectBillboard(float width, float height, org.openmali.vecmath2.Tuple3f offset, java.lang.String texture, org.openmali.vecmath2.Tuple2f texLowerLeft, org.openmali.vecmath2.Tuple2f texUpperRight)
          Creates a textured RectBillboard.
RectBillboard(float width, float height, org.openmali.vecmath2.Tuple3f offset, java.lang.String texture, org.openmali.vecmath2.Tuple2f texLowerLeft, org.openmali.vecmath2.Tuple2f texUpperRight, org.openmali.vecmath2.Colorf color)
          Creates a textured RectBillboard.
RectBillboard(float width, float height, org.openmali.vecmath2.Tuple3f offset, Texture texture)
          Creates a textured RectBillboard.
RectBillboard(float width, float height, org.openmali.vecmath2.Tuple3f offset, Texture texture, org.openmali.vecmath2.Tuple2f texLowerLeft, org.openmali.vecmath2.Tuple2f texUpperRight)
          Creates a textured RectBillboard.
RectBillboard(float width, float height, org.openmali.vecmath2.Tuple3f offset, Texture texture, org.openmali.vecmath2.Tuple2f texLowerLeft, org.openmali.vecmath2.Tuple2f texUpperRight, org.openmali.vecmath2.Colorf color)
          Creates a textured RectBillboard.
RectBillboard(Texture texture, float width, float height, Rectangle.ZeroPointLocation zpl, float zOffset)
          Creates a textured RectBillboard.
 
Method Summary
 void absorbDetails(Node node)
          Turns the receiver into a shared copy of the node parameter.
 org.openmali.types.twodee.Sized2iRO getSizeOnScreen()
          Returns the Billboard desired on screen dimensions.
 RectBillboard sharedCopy()
          Creates a shared copy of this Node.
 RectBillboard sharedCopy(CopyListener listener)
          Creates a shared copy of this Node.
 void updateFaceToCamera(org.openmali.vecmath2.Matrix3f viewRotation, long frameId, long nanoTime, long nanoStep)
          This method is called by the renderer each frame, the BillBoard is rendered.
 
Methods inherited from class org.xith3d.scenegraph.primitives.Rectangle
createPosition, createPosition, createTextureCoordinates, createVertexCoords, createVertexCoords, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, createWithoutNormals, getHeight, getSize, getTexture, getWidth, resize, resize, resize, resize, resize, resize, setTexture, setTexture, setTexture, setTexturePosition, setTexturePosition
 
Methods inherited from class org.xith3d.scenegraph.primitives.Quad
createGeometry, generateNormals, getAlpha, getColor, getGeometry, setAlpha, setColor, setTexture, setTexture, setTexture, setTextureCoordinates, setTexturePosition, setVertexCoords, setVertexCoords, setVertexCoords, update, update
 
Methods inherited from class org.xith3d.scenegraph.Shape3D
copy, freeOpenGLResources, getAppearance, getAppearance, getCustomComparable, isBumpMappingEnabled, isShadowReceiver, isVisible, newAppearance, newInstance, setAppearance, setBounds, setBumpMappingEnabled, setBumpMappingEnabled, setCustomComparable, setGeometry, setIsShadowReceiver, setModListener, setVisible, traverse, updateBounds, updateBoundsCheap, updateWorldTransform, verifyAppChange
 
Methods inherited from class org.xith3d.scenegraph.Leaf
dump, getPickHost, setPickHost
 
Methods inherited from class org.xith3d.scenegraph.Node
cloneNode, detach, duplicateNode, freeOpenGLResources, getBounds, getBoundsAutoCompute, getBoundsType, getBoundsTypeHint, getDefaultPickable, getIndentString, getInheritedNodeAttributes, getModListener, getOrderedChild, getOrderedState, getParent, getRoot, getShadowAttachment, getShowBounds, getTransformGroup, getTreeCell, getWorldBounds, getWorldTransform, getWorldTransform, isBillboard, isIgnoreBounds, isOccluder, isPickable, isRenderable, isUpdatableNode, mergeInheritedClipper, mergeInheritedNodes, mergeInheritedScissorRect, popGlobalIgnoreBounds, printBounds, pushGlobalIgnoreBounds, setBoundsAutoCompute, setBoundsDirty, setBoundsDirtyUpward, setBoundsTypeHint, setDefaultPickable, setGlobalIgnoreBounds, setIgnoreBounds, setIsOccluder, setOrderedChild, setParent, setPickable, setPickableRecursive, setPickableRecursive, setRenderable, setShadowAttachment, setShowBounds, setTransformGroup, setTreeCell, traverse, unmergeInheritedFog, unmergeInheritedLight, unmergeInheritedNodes, updateOrderedChild, updateTransformGroup
 
Methods inherited from class org.xith3d.scenegraph.SceneGraphObject
getName, getUserData, getUserData, getUserDataMap, isLive, setLive, setName, setUserData, setUserData, setUserDataRecursive, setUserDataRecursive, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

zeroVertices

protected org.openmali.vecmath2.Tuple3f[] zeroVertices

transformedVertices

protected org.openmali.vecmath2.Point3f[] transformedVertices
Constructor Detail

RectBillboard

public RectBillboard(float width,
                     float height,
                     org.openmali.vecmath2.Tuple3f offset,
                     Texture texture,
                     org.openmali.vecmath2.Tuple2f texLowerLeft,
                     org.openmali.vecmath2.Tuple2f texUpperRight,
                     org.openmali.vecmath2.Colorf color)
Creates a textured RectBillboard.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
offset - relative Location of the Rectangle
texture - the texture
texLowerLeft - Lower-left texture coordinate
texUpperRight - Upper-right texture coordinate
color - the color for the ColoringAttributes

RectBillboard

public RectBillboard(float width,
                     float height,
                     org.openmali.vecmath2.Tuple3f offset,
                     java.lang.String texture,
                     org.openmali.vecmath2.Tuple2f texLowerLeft,
                     org.openmali.vecmath2.Tuple2f texUpperRight,
                     org.openmali.vecmath2.Colorf color)
Creates a textured RectBillboard.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
offset - relative Location of the Rectangle
texture - the texture
texLowerLeft - Lower-left texture coordinate
texUpperRight - Upper-right texture coordinate

RectBillboard

public RectBillboard(float width,
                     float height,
                     java.lang.String texture)
Creates a textured RectBillboard.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
texture - the name of the texture (loaded with the TextureLoader)

RectBillboard

public RectBillboard(float width,
                     float height,
                     org.openmali.vecmath2.Tuple3f offset,
                     java.lang.String texture)
Creates a textured RectBillboard.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
offset - relative Location of the Rectangle
texture - the name of the texture (loaded with the TextureLoader)

RectBillboard

public RectBillboard(float width,
                     float height,
                     float zOffset,
                     java.lang.String texture)
Creates a textured RectBillboard.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
zOffset - relative z-Location of the Rectangle
texture - the name of the texture (loaded with the TextureLoader)

RectBillboard

public RectBillboard(float width,
                     float height,
                     float zOffset)
Creates an untextured RectBillboard without alpha channel.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
zOffset - relative z-Location of the Rectangle

RectBillboard

public RectBillboard(float width,
                     float height,
                     org.openmali.vecmath2.Tuple3f offset)
Creates an untextured RectBillboard without alpha channel.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
offset -

RectBillboard

public RectBillboard(float width,
                     float height)
Creates an untextured RectBillboard.

Parameters:
width - width of the Rectangle
height - height of the Rectangle

RectBillboard

public RectBillboard(float width,
                     float height,
                     org.openmali.vecmath2.Tuple3f offset,
                     java.lang.String texture,
                     org.openmali.vecmath2.Tuple2f texLowerLeft,
                     org.openmali.vecmath2.Tuple2f texUpperRight)
Creates a textured RectBillboard.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
offset - relative Location of the Rectangle
texture - the name of the texture (loaded with the TextureLoader)
texLowerLeft - Lower-left texture coordinate
texUpperRight - Upper-right texture coordinate

RectBillboard

public RectBillboard(float width,
                     float height,
                     Texture texture)
Creates a textured RectBillboard.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
texture - the name of the texture (loaded with the TextureLoader)

RectBillboard

public RectBillboard(float width,
                     float height,
                     org.openmali.vecmath2.Tuple3f offset,
                     Texture texture)
Creates a textured RectBillboard.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
offset - relative Location of the Rectangle
texture - the name of the texture (loaded with the TextureLoader)

RectBillboard

public RectBillboard(float width,
                     float height,
                     float zOffset,
                     Texture texture)
Creates a textured RectBillboard.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
zOffset - relative z-Location of the Rectangle
texture - the name of the texture (loaded with the TextureLoader)

RectBillboard

public RectBillboard(float width,
                     float height,
                     float zOffset,
                     Texture texture,
                     org.openmali.vecmath2.Tuple2f texLowerLeft,
                     org.openmali.vecmath2.Tuple2f texUpperRight)
Creates a textured RectBillboard.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
zOffset - relative z-Location of the Rectangle
texture - the name of the texture (loaded with the TextureLoader)
texLowerLeft - Lower-left texture coordinate
texUpperRight - Upper-right texture coordinate

RectBillboard

public RectBillboard(float width,
                     float height,
                     Texture texture,
                     org.openmali.vecmath2.Tuple2f texLowerLeft,
                     org.openmali.vecmath2.Tuple2f texUpperRight)
Creates a textured RectBillboard.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
texture - the name of the texture (loaded with the TextureLoader)
texLowerLeft - Lower-left texture coordinate
texUpperRight - Upper-right texture coordinate

RectBillboard

public RectBillboard(float width,
                     float height,
                     org.openmali.vecmath2.Tuple3f offset,
                     Texture texture,
                     org.openmali.vecmath2.Tuple2f texLowerLeft,
                     org.openmali.vecmath2.Tuple2f texUpperRight)
Creates a textured RectBillboard.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
offset - relative Location of the Rectangle
texture - the texture
texLowerLeft - Lower-left texture coordinate
texUpperRight - Upper-right texture coordinate

RectBillboard

public RectBillboard(float width,
                     float height,
                     org.openmali.vecmath2.Tuple3f offset,
                     org.openmali.vecmath2.Colorf color)
Creates an untextured, but colored RectBillboard.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
offset - relative Location of the Rectangle
color - the color to use for colorin this Rectangle

RectBillboard

public RectBillboard(float width,
                     float height,
                     float zOffset,
                     org.openmali.vecmath2.Colorf color)
Creates an untextured, but colored RectBillboard.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
zOffset - relative z-Location of the Rectangle
color - the color to use for colorin this Rectangle

RectBillboard

public RectBillboard(float width,
                     float height,
                     org.openmali.vecmath2.Colorf color)
Creates an untextured, but colored RectBillboard.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
color - the color to use for colorin this Rectangle

RectBillboard

public RectBillboard(float width,
                     float height,
                     Rectangle.ZeroPointLocation zpl,
                     Texture texture)
Creates a textured RectBillboard.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
zpl - the location of the point (0, 0, 0)
texture - the name of the texture (loaded with the TextureLoader)

RectBillboard

public RectBillboard(Texture texture,
                     float width,
                     float height,
                     Rectangle.ZeroPointLocation zpl,
                     float zOffset)
Creates a textured RectBillboard.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
zpl - the location of the point (0, 0, 0)
zOffset - relative z-Location of the Rectangle
texture - the name of the texture (loaded with the TextureLoader)

RectBillboard

public RectBillboard(float width,
                     float height,
                     Rectangle.ZeroPointLocation zpl,
                     float zOffset,
                     Texture texture,
                     org.openmali.vecmath2.Tuple2f texLowerLeft,
                     org.openmali.vecmath2.Tuple2f texUpperRight)
Creates a textured RectBillboard.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
zpl - the location of the point (0, 0, 0)
zOffset - relative z-Location of the Rectangle
texture - the name of the texture (loaded with the TextureLoader)
texLowerLeft - Lower-left texture coordinate
texUpperRight - Upper-right texture coordinate

RectBillboard

public RectBillboard(float width,
                     float height,
                     Rectangle.ZeroPointLocation zpl,
                     java.lang.String texture)
Creates a textured RectBillboard.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
zpl - the location of the point (0, 0, 0)
texture - the name of the texture (loaded with the TextureLoader)

RectBillboard

public RectBillboard(float width,
                     float height,
                     Rectangle.ZeroPointLocation zpl,
                     float zOffset,
                     java.lang.String texture)
Creates a textured RectBillboard.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
zpl - the location of the point (0, 0, 0)
zOffset - relative z-Location of the Rectangle
texture - the name of the texture (loaded with the TextureLoader)

RectBillboard

public RectBillboard(float width,
                     float height,
                     Rectangle.ZeroPointLocation zpl,
                     java.lang.String texture,
                     org.openmali.vecmath2.Tuple2f texLowerLeft,
                     org.openmali.vecmath2.Tuple2f texUpperRight)
Creates a textured RectBillboard.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
zpl - the location of the point (0, 0, 0)
texture - the name of the texture (loaded with the TextureLoader)
texLowerLeft - Lower-left texture coordinate
texUpperRight - Upper-right texture coordinate

RectBillboard

public RectBillboard(float width,
                     float height,
                     Rectangle.ZeroPointLocation zpl,
                     float zOffset)
Creates an untextured RectBillboard without alpha channel.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
zpl - the location of the point (0, 0, 0)
zOffset - relative z-Location of the Rectangle

RectBillboard

public RectBillboard(float width,
                     float height,
                     Rectangle.ZeroPointLocation zpl)
Creates an untextured RectBillboard.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
zpl - the location of the point (0, 0, 0)

RectBillboard

public RectBillboard(float width,
                     float height,
                     Rectangle.ZeroPointLocation zpl,
                     float zOffset,
                     org.openmali.vecmath2.Colorf color)
Creates an untextured, but colored RectBillboard.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
zpl - the location of the point (0, 0, 0)
zOffset - relative z-Location of the Rectangle
color - the color to use for colorin this Rectangle

RectBillboard

public RectBillboard(float width,
                     float height,
                     Rectangle.ZeroPointLocation zpl,
                     org.openmali.vecmath2.Colorf color)
Creates an untextured, but colored RectBillboard.

Parameters:
width - width of the Rectangle
height - height of the Rectangle
zpl - the location of the point (0, 0, 0)
color - the color to use for colorin this Rectangle
Method Detail

getSizeOnScreen

public org.openmali.types.twodee.Sized2iRO getSizeOnScreen()
Returns the Billboard desired on screen dimensions. For the default Billboard implementation, this method should return null, as the on-screen dimension is dependant on the distance between the Billboard and the camera. If the desired effect is a Billboard having a constant size on screen (usefull for icons, or textual information that should be readable at any distance), then this method should return the desired size in pixels. In this case, the Sized2iRO returned will generally be a constant. This method is called by the renderer each frame the Billboard is rendered. Note to implementers: for this behaviour to work properly, the unmodified geometry should of course have a unit size, ie: the width and the height should should be equal to 1f. Else the effective desired size on screen will be scaled accordingly.

Specified by:
getSizeOnScreen in interface Billboard
Returns:
the desired size on screen, or null for a standard billboard.

updateFaceToCamera

public void updateFaceToCamera(org.openmali.vecmath2.Matrix3f viewRotation,
                               long frameId,
                               long nanoTime,
                               long nanoStep)
This method is called by the renderer each frame, the BillBoard is rendered.

Specified by:
updateFaceToCamera in interface Billboard
Parameters:
viewRotation - the camera's rotation
frameId - the current rendered frame's id

absorbDetails

public void absorbDetails(Node node)
Turns the receiver into a shared copy of the node parameter. This is precisely the inverse operation of sharedCopy; i.e., shared copy creates a new node, but absorbDetails turns the current node into a copy exactly equivalent to what would be returned, if you created a new copy via the sharedCopy() method.

Overrides:
absorbDetails in class Shape3D
Parameters:
node - the node to copy.
See Also:
Node.sharedCopy()

sharedCopy

public RectBillboard sharedCopy(CopyListener listener)
Creates a shared copy of this Node. A shared copy is one where the geometry and appearance is shared, but everything else is copied. This is a replacement for shared groups because of performance considerations. If you are loading the same model many times then this can save on memory and load times. The only allowable within the subtree are groups and shapes. This also copies a shapes bounds and turns autocomute off so that it is fast to insert the model into the scene.

Overrides:
sharedCopy in class Shape3D
Returns:
a shared copy of this Node
See Also:
Node.absorbDetails(Node)

sharedCopy

public RectBillboard sharedCopy()
Creates a shared copy of this Node. A shared copy is one where the geometry and appearance is shared, but everything else is copied. This is a replacement for shared groups because of performance considerations. If you are loading the same model many times then this can save on memory and load times. The only allowable within the subtree are groups and shapes. This also copies a shapes bounds and turns autocomute off so that it is fast to insert the model into the scene.

Overrides:
sharedCopy in class Shape3D
Returns:
a shared copy of this Node
See Also:
Node.absorbDetails(Node)