|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Canvas
javax.media.opengl.GLCanvas
view.GLComponent3Dview
public class GLComponent3Dview
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.BaselineResizeBehavior |
| Field Summary |
|---|
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
GLComponent3Dview(int fps)
Construtor da classe GLComponent3Dview. |
|
| Method Summary | |
|---|---|
static void |
arena(javax.media.opengl.GL gl)
arena desenha a parte da arena onde o Bob anda, esse método é chamado no init para criar a arena na glList |
static void |
bordaArena(javax.media.opengl.GL gl)
bordaArena desenha a parte da arena onde o Bob anda, esse método é chamado no init para criar a borda na glList, as coordenadas de textura são definidas também. |
void |
display(javax.media.opengl.GLAutoDrawable drawable)
display desenha a cena, ele é chamado pelo JOGL sempre que necessário, ele limpa os buffers e redesenha a cena, através de chamadas para a glList criada no init. |
void |
displayChanged(javax.media.opengl.GLAutoDrawable drawable,
boolean modeChanged,
boolean deviceChanged)
|
int |
getIndex(java.lang.String actionName)
getIndex responde o indice de uma ação na matriz de indices da glList |
void |
init(javax.media.opengl.GLAutoDrawable drawable)
init inicializa os componentes necessários para o desenho da cena: Abilita luz e depthTest; pede para que as texturas sejam lidas; lê todos os quadros de todas as animações de ações de .objs e deixa eles em uma glList para renderização rápida depois; desenha os outros objetos da cena e coloca eles em glLists também; registra as classes de tratamento de mouse e teclado para serem chamadas nesses eventos; inicializa o animador. |
static void |
player(javax.media.opengl.GL gl,
java.lang.String path)
player é responsável por carregar um arquivo .obj e desenha-lo, ele é chamado para popular uma glList com os objetos carregados através de .objs |
void |
reshape(javax.media.opengl.GLAutoDrawable drawable,
int x,
int y,
int width,
int height)
reshape trata eventos de quando a janela muda de tamanho, é também chamado no inicio da aplicação pelo JOGL, para tratar o tamanho inicial da janela. |
static void |
ring(javax.media.opengl.GL gl)
|
void |
setInstruct(java.lang.String newInstruct)
setInstruct muda a instrução em texto que pode ser desenhada pelo JOGL. |
static void |
sky(javax.media.opengl.GL gl)
sky desenha o céu da arena onde o Bob anda |
| Methods inherited from class javax.media.opengl.GLCanvas |
|---|
addGLEventListener, addNotify, createContext, display, getAutoSwapBufferMode, getChosenGLCapabilities, getContext, getGL, paint, removeGLEventListener, removeNotify, reshape, setAutoSwapBufferMode, setGL, setRealized, swapBuffers, update |
| Methods inherited from class java.awt.Canvas |
|---|
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface javax.media.opengl.GLAutoDrawable |
|---|
repaint |
| Methods inherited from interface javax.media.opengl.GLDrawable |
|---|
getHeight, getWidth, setSize |
| Methods inherited from interface javax.media.opengl.ComponentEvents |
|---|
addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener |
| Constructor Detail |
|---|
public GLComponent3Dview(int fps)
fps - é o número de frames por segundo que deseja-se manter na aplicação| Method Detail |
|---|
public void init(javax.media.opengl.GLAutoDrawable drawable)
init in interface javax.media.opengl.GLEventListenerdrawable - é o GLAutoDrawable passado para o init pelo proprio JOGL,
que é quem chama esse método, ele não é chamado pela nossa aplicação.
public void reshape(javax.media.opengl.GLAutoDrawable drawable,
int x,
int y,
int width,
int height)
reshape in interface javax.media.opengl.GLEventListenerdrawable - é o GLAutoDrawable passado pelo JOGLx - é a posição horizontal do canto da janelay - é a posição vertical do canto da janelawidth - é a largura da janelaheight - é a altura da janelapublic void display(javax.media.opengl.GLAutoDrawable drawable)
display in interface javax.media.opengl.GLEventListenerdrawable - é o GLAutoDrawable passado pelo JOGL
public void displayChanged(javax.media.opengl.GLAutoDrawable drawable,
boolean modeChanged,
boolean deviceChanged)
displayChanged in interface javax.media.opengl.GLEventListener
public static void player(javax.media.opengl.GL gl,
java.lang.String path)
gl - é o GL do contexto onde a glList esta sendo criada, usado para desenhar o objetopath - é o caminho e o nome do arquivo .obj de onde ele deve ler o objetopublic static void arena(javax.media.opengl.GL gl)
public static void bordaArena(javax.media.opengl.GL gl)
public static void sky(javax.media.opengl.GL gl)
public static void ring(javax.media.opengl.GL gl)
public void setInstruct(java.lang.String newInstruct)
newInstruct - é a string que passará a ser desenhada na tela caso a instrucao esteja sendo desenhada.public int getIndex(java.lang.String actionName)
actionName - é uma string com o nome da ação
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||