|
j3d.org Code | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.j3d.renderer.java3d.overlay.TextureOverlay
An overlay implementation that uses a Java3D
Texture2D object for the renderable surface.
This is different to other overlays in this package in that it assumes another part of the application has created the pre-canned texture instance to use rather than internally generating it.
Note:
Textures, by default, don't look too good if you just give it the straight
image. In order to have pixel-perfect textures, you should also have the
following setup prior to passing the textures to this class:
texture.setMagFilter(Texture.NICEST); texture.setMinFilter(Texture.FASTEST);
| Field Summary | |
protected javax.media.j3d.BranchGroup |
consoleBG
Root branchgroup for the entire overlay system |
protected static int |
DIRTY_ACTIVE_BUFFER
Mark the active buffer as dirty and needing swapping |
protected static int |
DIRTY_POSITION
Mark the position as dirty and needing correction |
protected static int |
DIRTY_SIZE
Mark the size as dirty and needing correction |
protected static int |
DIRTY_VISIBLE
Mark the visible flag as dirty |
| Fields inherited from interface org.j3d.renderer.java3d.overlay.Overlay |
BACKGROUND_COPY, BACKGROUND_NONE |
| Constructor Summary | |
TextureOverlay(javax.media.j3d.Canvas3D canvas,
java.awt.Dimension size)
Constructs an overlay window. |
|
TextureOverlay(javax.media.j3d.Canvas3D canvas,
java.awt.Dimension size,
boolean hasAlpha,
UpdateManager updateManager,
javax.media.j3d.Texture2D texture)
Constructs an overlay window. |
|
TextureOverlay(javax.media.j3d.Canvas3D canvas,
java.awt.Dimension size,
javax.media.j3d.Texture2D texture)
Constructs an overlay window. |
|
| Method Summary | |
void |
componentHidden(java.awt.event.ComponentEvent e)
Notification that the component has been hidden. |
void |
componentMoved(java.awt.event.ComponentEvent e)
Notification that the component has been moved. |
void |
componentResized(java.awt.event.ComponentEvent e)
Notification that the component has been resized. |
void |
componentShown(java.awt.event.ComponentEvent e)
Notification that the component has been shown. |
boolean |
contains(java.awt.Point p)
Check to see if the point passed in is contained within the bounds of the overlay. |
java.awt.Rectangle |
getBounds()
Returns the rectangular portion of the canvas that this overlay covers. |
javax.media.j3d.BranchGroup |
getRoot()
Return the root of the Overlay so it can be added to the scene graph. |
UpdateManager |
getUpdateManager()
Returns the UpdateManager responsible for seeing that updates to the Overlay only take place between frames. |
void |
initialize()
Post construction initialisation before turning the overlay live. |
boolean |
isAntialiased()
Returns whether drawing on this overlay is anti-aliased. |
boolean |
isVisible()
Returns the visiblity of the Overlay. |
void |
setAntialiased(boolean state)
Sets whether drawing onto this Overlay is anialiased. |
void |
setComponentDetails(java.awt.Dimension size,
double fov)
Update the canvas component details of size and field of view settings. |
void |
setLocation(int x,
int y)
Sets the location of the top-left corner of the overlay. |
void |
setSize(int w,
int h)
Change the size of the texture to the new size. |
void |
setTexture(javax.media.j3d.Texture2D tex)
Change the texture to the new version. |
void |
setUpdateManager(UpdateManager mgr)
Set the UpdateManager to the new value. |
void |
setVisible(boolean visible)
Changes the visibility of the Overlay. |
void |
update()
Notification from the update manager that something has changed and we should fix up the appropriate bits. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final int DIRTY_VISIBLE
protected static final int DIRTY_POSITION
protected static final int DIRTY_ACTIVE_BUFFER
protected static final int DIRTY_SIZE
protected javax.media.j3d.BranchGroup consoleBG
| Constructor Detail |
public TextureOverlay(javax.media.j3d.Canvas3D canvas,
java.awt.Dimension size)
canvas - The canvas the overlay is drawn onsize - The size of the overlay in pixels
java.lang.IllegalArgumentException - Both the canvas and bounds are null
public TextureOverlay(javax.media.j3d.Canvas3D canvas,
java.awt.Dimension size,
javax.media.j3d.Texture2D texture)
canvas - The canvas the overlay is drawn onsize - The size of the overlay in pixels
java.lang.IllegalArgumentException - Both the canvas and bounds are null
public TextureOverlay(javax.media.j3d.Canvas3D canvas,
java.awt.Dimension size,
boolean hasAlpha,
UpdateManager updateManager,
javax.media.j3d.Texture2D texture)
canvas - The canvas the overlay is drawn onsize - The size of the overlay in pixelshasAlpha - True if the texture has an alpha componentupdateManager - Responsible for allowing the Overlay to update
between renders. If this is null a default manager is created
java.lang.IllegalArgumentException - Both the canvas and bounds are null| Method Detail |
public void initialize()
initialize in interface Overlaypublic javax.media.j3d.BranchGroup getRoot()
getRoot in interface Overlaypublic java.awt.Rectangle getBounds()
getBounds in interface Overlaypublic boolean contains(java.awt.Point p)
contains in interface Overlayp - The point to check if it is contained
public UpdateManager getUpdateManager()
getUpdateManager in interface Overlaypublic void setUpdateManager(UpdateManager mgr)
setUpdateManager in interface Overlaymgr - A reference to the new manage instance to use
public void setLocation(int x,
int y)
setLocation in interface Overlayx - The x coordinate of the locationy - The y coordinate of the location
public void setSize(int w,
int h)
setSize in interface Overlayw - The new width of the overlayh - The new height of the overlaypublic void setAntialiased(boolean state)
setAntialiased in interface Overlaystate - true if this overlay should antialias the linespublic boolean isAntialiased()
isAntialiased in interface Overlaypublic void setVisible(boolean visible)
setVisible in interface Overlayvisible - true to make the overlay visiblepublic boolean isVisible()
isVisible in interface Overlay
public void setComponentDetails(java.awt.Dimension size,
double fov)
setComponentDetails in interface Overlaysize - The new dimensions of the componentfov - The new field of view for the current viewpublic void update()
update in interface UpdatableEntitypublic void componentResized(java.awt.event.ComponentEvent e)
componentResized in interface java.awt.event.ComponentListenere - The event that caused this method to be calledpublic void componentMoved(java.awt.event.ComponentEvent e)
componentMoved in interface java.awt.event.ComponentListenere - The event that caused this method to be calledpublic void componentShown(java.awt.event.ComponentEvent e)
componentShown in interface java.awt.event.ComponentListenere - The event that caused this method to be calledpublic void componentHidden(java.awt.event.ComponentEvent e)
componentHidden in interface java.awt.event.ComponentListenere - The event that caused this method to be calledpublic void setTexture(javax.media.j3d.Texture2D tex)
tex - The new texture object to use
|
j3d.org Code | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||