|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectviewer.GLViewer
public class GLViewer
Displays the actual GL drawings and takes care of all GL needs for the viewer.
| Field Summary | |
|---|---|
Lights |
lights
|
| Constructor Summary | |
|---|---|
GLViewer(Viewer viewer)
create a new instance of GLViewer and set up some basic variables |
|
| Method Summary | |
|---|---|
void |
changeBrightness(int i)
Change the brightness of the lights |
void |
display(javax.media.opengl.GLAutoDrawable drawable)
draw what we want to draw |
void |
displayChanged(javax.media.opengl.GLAutoDrawable drawable,
boolean modeChanged,
boolean deviceChanged)
|
void |
draw()
redraw the screen |
double[] |
getCam()
returns the camera array |
javax.media.opengl.GLCanvas |
getCanvas()
|
javax.media.opengl.GL |
getGL()
Return the GL object |
boolean |
getTextureState()
return if textures are on |
void |
init(javax.media.opengl.GLAutoDrawable drawable)
initialize all of the GL stuff |
void |
requestFocus()
request that the gl receives focus |
void |
reshape(javax.media.opengl.GLAutoDrawable drawable,
int x,
int y,
int width,
int height)
|
void |
screenshot()
take a screenshot have to do this messy hack because of glContexts not being active on threads or some such thing |
void |
set3D(boolean b)
set whether to display in 3D or 2D |
void |
setCam(double[] cam)
Sets the camera array to the the camera array gioven |
void |
setForceRenderNext(boolean f)
|
void |
setFov(double fov)
Set the field of vision to the specified angle |
void |
setLights(boolean b)
turn lights on or off |
void |
setMap(Model map)
set the internal map to the map that we want to view |
void |
setMapSameGL(Model map)
|
void |
showTextures(boolean b)
Set whether or not to display the textures |
void |
startGL()
start all of the GL code this is seperate since we might want to do some setup before we actually do this |
void |
takeScreenshot()
actually take a screenshot |
void |
updateLights(boolean b)
we changed the lights, so update gl with the new lights |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public Lights lights
| Constructor Detail |
|---|
public GLViewer(Viewer viewer)
| Method Detail |
|---|
public void setForceRenderNext(boolean f)
public javax.media.opengl.GLCanvas getCanvas()
public void setMap(Model map)
map - the map that we will be viewingpublic void setMapSameGL(Model map)
public void startGL()
public void init(javax.media.opengl.GLAutoDrawable drawable)
init in interface javax.media.opengl.GLEventListenerpublic void display(javax.media.opengl.GLAutoDrawable drawable)
display in interface javax.media.opengl.GLEventListener
public void displayChanged(javax.media.opengl.GLAutoDrawable drawable,
boolean modeChanged,
boolean deviceChanged)
displayChanged in interface javax.media.opengl.GLEventListener
public void reshape(javax.media.opengl.GLAutoDrawable drawable,
int x,
int y,
int width,
int height)
reshape in interface javax.media.opengl.GLEventListenerpublic double[] getCam()
public void setCam(double[] cam)
cam - the camera array to set the camera topublic void setFov(double fov)
fov - the fov angle we wantpublic void draw()
public void set3D(boolean b)
b - true if to display in 3Dpublic void showTextures(boolean b)
b - true if we wnat to display texturespublic void changeBrightness(int i)
i - the intensity of the lightspublic void updateLights(boolean b)
b - true if we changed lightspublic void setLights(boolean b)
b - true to turn lights onpublic javax.media.opengl.GL getGL()
public void requestFocus()
public void takeScreenshot()
public void screenshot()
public boolean getTextureState()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||