|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--yaarq.sys.yrqVisual
|
+--yaarq.sys.yrqOverlayVisual
This class extends the yrqVisual class providing support for textured geometry.
The overlay class provides support for 2D sprites seemingly positioned exactly on the 2D screen plane. Normally, such operations would be done in the postRender method of the Java3D canvas, but the update routines used by Java3D have very low performance, so this class creates 3D objects and manipulates them to appear as if they were twodimensional and screen- aligned.
OverlayVisuals are internally attached to the viewport transform group to allow for automatic viewport alignment.
TODO: When allowing fov changes to viewport, change transform code!
| Field Summary |
| Fields inherited from class yaarq.sys.yrqVisual |
COLOR_AMBIENT, COLOR_DIFFUSE, COLOR_EMISSIVE, COLOR_SPECULAR, m_parent, MODE_ADD, MODE_BLEND, MODE_NONE, TEXTURE_DOT3BUMP, TEXTURE_LIGHTMAP, TEXTURE_MATERIAL, TEXTURE_REFLECT |
| Constructor Summary | |
yrqOverlayVisual(yrqEngine a_engine,
javax.media.j3d.Texture2D a_texture,
javax.vecmath.Point2d a_position,
int a_mode,
float a_transparency)
Constructs a new overlayvisual using the passed parameters. |
|
yrqOverlayVisual(yrqEngine a_engine,
javax.media.j3d.Texture2D a_texture,
javax.vecmath.Point2d a_position,
int a_width,
int a_height,
int a_mode,
float a_transparency)
Constructs a new overlayvisual using the passed parameters. |
|
| Method Summary | |
void |
attach(javax.media.j3d.Group a_group)
This method attaches the overlay to a parent. |
void |
detach()
This method detaches the overlay to a parent. |
javax.vecmath.Point2d |
getPosition()
This function retrieves the current location of the overlay in screen coordinates |
javax.media.j3d.Texture2D |
getTexture()
This function returns the texture used by the overlay |
int |
getTransparencyMode()
Returns the transparency mode of the visual. |
float |
getTransparencyValue()
Returns the transparency value for this visual. |
void |
setPosition(javax.vecmath.Point2d a_pos)
This method sets the location of the overlay, in screen coordinates (pixels). |
void |
setRotation(double a_angle)
This method sets the rotation for the overlay visual. |
void |
setTexture(javax.media.j3d.Texture2D a_texture)
This method sets the texture to use for the overlay. |
void |
setTextureAnimation(double a_left,
double a_top,
double a_width,
double a_height)
This function sets a continuous texture animation to the base material texture. |
void |
setTextureAnimation(int a_clipIndex,
int a_clipCountX,
int a_clipCountY)
This function set a clip-based texture animation to the base material texture. |
void |
setTransparency(float a_alpha,
int a_mode)
Sets the transparency factor for the visual. |
| Methods inherited from class yaarq.sys.yrqVisual |
getBaseShape3D, getBumpShape3D, getGeometry, getParent, getTexture, setBrightness, setColor, setGeometry, setShininess, setTexture |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public yrqOverlayVisual(yrqEngine a_engine,
javax.media.j3d.Texture2D a_texture,
javax.vecmath.Point2d a_position,
int a_mode,
float a_transparency)
a_texture - The texture to use for the overlaya_position - The initial position of the overlaya_mode - The transparency mode of the visual. Use one of the MODE_xxx constants of yrqVisuala_transparency - The initial transparency of the visual
public yrqOverlayVisual(yrqEngine a_engine,
javax.media.j3d.Texture2D a_texture,
javax.vecmath.Point2d a_position,
int a_width,
int a_height,
int a_mode,
float a_transparency)
a_texture - The texture to use for the overlaya_position - The initial position of the overlaya_height - The pixel height of the overlaya_mode - The transparency mode of the visual. Use one of the MODE_xxx constants of yrqVisuala_transparency - The initial transparency of the visual| Method Detail |
public void attach(javax.media.j3d.Group a_group)
attach in class yrqVisuala_group - The group to which to attachpublic void detach()
detach in class yrqVisualpublic javax.vecmath.Point2d getPosition()
public javax.media.j3d.Texture2D getTexture()
public int getTransparencyMode()
getTransparencyMode in class yrqVisualpublic float getTransparencyValue()
getTransparencyValue in class yrqVisualpublic void setPosition(javax.vecmath.Point2d a_pos)
a_pos - The new location, in screen pixel coordinates, of the overlaypublic void setRotation(double a_angle)
a_angle - Rotation angle in radians.public void setTexture(javax.media.j3d.Texture2D a_texture)
a_texture - The texture to use for the overlay
public void setTextureAnimation(double a_left,
double a_top,
double a_width,
double a_height)
setTextureAnimation in class yrqVisuala_left - Left clip position, normalized (0-1)a_top - Top clip position, normalized (0-1)a_width - Width of clip to use, normalized (0-1)a_height - Height of clip to use, normalized (0-1)
public void setTextureAnimation(int a_clipIndex,
int a_clipCountX,
int a_clipCountY)
setTextureAnimation in class yrqVisuala_clipIndex - Index of the clip within the texturea_clipCountX - Number of clips in X directiona_clipCountY - Number of clips in Y direction
public void setTransparency(float a_alpha,
int a_mode)
setTransparency in class yrqVisuala_alpha - Global transparency factor for this visuala_mode - Transparency mode for this visual
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||