|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.microedition.lcdui.Displayable
javax.microedition.lcdui.Canvas
javax.microedition.lcdui.game.GameCanvas
m3g08.EmulatingLightSample
public class EmulatingLightSample
Shows alternatives to real lighting.
| Field Summary | |
|---|---|
private int |
currentLighting
Current lighting mode. |
private javax.microedition.lcdui.Graphics |
graphics
2D graphics singleton used for rendering. |
private javax.microedition.m3g.Graphics3D |
graphics3d
3D graphics singleton used for rendering. |
private static int |
LIGHTING_BAKED_TEXTURE
Texture baking. |
private static int |
LIGHTING_DYNAMIC
Real lighting. |
private static int |
LIGHTING_LIGHT_MAP
Light map |
private static int |
LIGHTING_VERTEX_COLORS
Vertex colors. |
private javax.microedition.m3g.Mesh |
mesh
Mesh for display. |
private javax.microedition.m3g.Transform |
meshTransform
The mesh's transformation. |
private static int |
NUMBER_OF_LIGHTING_MODES
Number of light modes. |
private float |
rotY
Current rotation value. |
private static byte[] |
VERTEX_COLORS
Vertex colors with lighting information. |
| Fields inherited from class javax.microedition.lcdui.game.GameCanvas |
|---|
DOWN_PRESSED, FIRE_PRESSED, GAME_A_PRESSED, GAME_B_PRESSED, GAME_C_PRESSED, GAME_D_PRESSED, LEFT_PRESSED, RIGHT_PRESSED, UP_PRESSED |
| Fields inherited from class javax.microedition.lcdui.Canvas |
|---|
DOWN, FIRE, GAME_A, GAME_B, GAME_C, GAME_D, KEY_NUM0, KEY_NUM1, KEY_NUM2, KEY_NUM3, KEY_NUM4, KEY_NUM5, KEY_NUM6, KEY_NUM7, KEY_NUM8, KEY_NUM9, KEY_POUND, KEY_STAR, LEFT, RIGHT, UP |
| Constructor Summary | |
|---|---|
EmulatingLightSample()
Constructor. |
|
| Method Summary | |
|---|---|
private javax.microedition.m3g.Mesh |
bakedTexture()
Creates a new mesh with lighting baked into the texture. |
private javax.microedition.m3g.Mesh |
createMesh(int mode)
Creates a new mesh according to the given lighting mode. |
void |
destroy()
Destroys the sample. |
private void |
drawMenu(javax.microedition.lcdui.Graphics graphics)
Draws a menu for the current key assignments. |
private javax.microedition.m3g.Mesh |
dynamicLight()
Creates a new mesh for real lighting. |
void |
init()
Initializes the sample. |
protected void |
keyPressed(int keyCode)
Handles key presses. |
private javax.microedition.m3g.Mesh |
lightMap()
Creates a new mesh with a light map applied. |
private void |
render(javax.microedition.lcdui.Graphics graphics)
Renders the sample. |
private javax.microedition.m3g.Mesh |
vertexColors()
Creates a new mesh with lighting information in the vertex colors. |
| Methods inherited from class javax.microedition.lcdui.game.GameCanvas |
|---|
flushGraphics, flushGraphics, getGraphics, getKeyStates, paint |
| Methods inherited from class javax.microedition.lcdui.Canvas |
|---|
getGameAction, getKeyCode, getKeyName, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, hideNotify, isDoubleBuffered, keyReleased, keyRepeated, pointerDragged, pointerPressed, pointerReleased, repaint, repaint, serviceRepaints, setFullScreenMode, showNotify, sizeChanged |
| Methods inherited from class javax.microedition.lcdui.Displayable |
|---|
addCommand, getHeight, getTicker, getTitle, getWidth, isShown, removeCommand, setCommandListener, setTicker, setTitle |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private javax.microedition.m3g.Mesh mesh
private javax.microedition.m3g.Transform meshTransform
private float rotY
private static final int LIGHTING_BAKED_TEXTURE
private static final int LIGHTING_VERTEX_COLORS
private static final int LIGHTING_LIGHT_MAP
private static final int LIGHTING_DYNAMIC
private static final int NUMBER_OF_LIGHTING_MODES
private int currentLighting
private javax.microedition.m3g.Graphics3D graphics3d
private javax.microedition.lcdui.Graphics graphics
private static final byte[] VERTEX_COLORS
| Constructor Detail |
|---|
public EmulatingLightSample()
| Method Detail |
|---|
public void init()
init in interface Samplepublic void destroy()
destroy in interface Sampleprivate javax.microedition.m3g.Mesh createMesh(int mode)
mode - lighting mode.
private javax.microedition.m3g.Mesh lightMap()
private javax.microedition.m3g.Mesh bakedTexture()
private javax.microedition.m3g.Mesh vertexColors()
private javax.microedition.m3g.Mesh dynamicLight()
private void render(javax.microedition.lcdui.Graphics graphics)
graphics - graphics context for drawing.protected void keyPressed(int keyCode)
keyPressed in class javax.microedition.lcdui.CanvaskeyCode - key code.private void drawMenu(javax.microedition.lcdui.Graphics graphics)
graphics - graphics context for drawing.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||