N

name attribute, 108, 110, 113 narrow phase collision detection, 379-384 circle collision, 379-380 circle/rectangle collision, 382-383 coding, 383-384 rectangle collision, 381-382 NES controller, 22 New Android Project dialog box,

Eclipse, 113 new highscore: #score, 479 new highscore: #value, 482 New I/O buffers. See NIO buffers newBitmap, 552 newMusic( ) method, 188 newObject( ) method, 195-196 newPixmap( ) method, 218 newSound( ) method, 188 Next button, signed export dialog box, 628

Nexus One, 16-17 NIO (New I/O) buffers limitations with using, 339-340 overview, 293-294 nonindexed, 319 nor( ) method, 359, 529 normalized device space, 275 normals specifying, 540-544 vertex, 533-534 NullPointerException, 320 numbers.png image, 231, 243-245 NUM_BOBS Bob instances, 332 NUM_BOBS constant, 331 numerical Euler integration, 365-366 numSprites, 414

OBJ loaders, implementing, 566-570 object representation bounding shapes constructing, 375-377 overview, 373-375 collision detection and, 572-576 bounding shapes in 3D, 572-573 bounding sphere overlap testing,

573-574 GameObject3D and DynamicGameObject3D classes, 574-576 example, 386-399 coding, 395-399 GameObject, DynamicGameObject, and Cannon classes, 386-387 spatial hash grid, 387-394 game object attributes, 377-378 ObjLoader.load( ) method, 571 ObjTest, 570 offsetX parameter, 450 offsetY parameter, 450 onAccuracyChanged( ) method, 143, 194

OnClickListener interface, 36-37 OnClickListener.onClick( ) method, 37 OnCompletionListener interface, 155, 190, 192

OnCompletionListener.onCompletion( )

method, 190, 192 onCreate( ) method, 37, 120, 123, 126,

135, 153, 172, 180, 280, 283 onDestroy( ) method, 123 onDraw( ) method, 158, 161, 163, 173, 176

onDrawFrame( ) method, 278, 280, 285 onKey( ) method, 137, 139, 199, 203 OnKeyEventListener.onKeyEvent( )

method, 197 OnKeyListener interface, 137, 139, 197-198

OnKeyListener.onKey( ) method, 198 onListItemClick( ) method, 118 onListItemClicked( ) method, 119

180, 182, 278, 284, 449, 592 onRestart( ) method, 122 onResume( ) method, 122-123,

onSensorChanged( ) method, 143, 194 onStart( ) method, 121-122 onStop( ) method, 120-123 onSurfaceChanged( ) method, 278, 280, 284

onSurfaceCreate( ) method, 284, 449 onSurfaceCreated( ) method, 278-280, 592

203-204, 206-207 OnTouchListener interface, 127, 129, 131, 135, 153, 201-203, 205 Open Perspective option, Window menu, 32 OpenCore, 10 OpenFeint service, 637 OpenGL ES/JNI (Java Native Interface) methods, reducing calls to, 344-345 OpenGL ES standard

2D transformations with model-view matrix, 326-338 combining transformations,

335-338 example using translation,

329-333 matrices, 328-329 rotation, 334-335 scaling, 335

world and model space, 326-328 alpha blending, 321-325 defining projection matrix, 289-292 code snippet, 292 matrix modes and active matrices, 289 orthographic projection with glOrthof method, 289-292 defining viewport, 288-289 example code, 296-300

GLGame class, implementing game interface, 281-288 GLSurfaceView class, 278-281 indexed vertices, 315-321 example code, 316-318 Vertices class, 318-321 lighting in, 530-548

enabling and disabling, 534-535 light sources, 532-533, 539 materials, 533 vertex normals, 533-534 matrices, 275-276 normalized device space and viewport, 275 optimizing for performance, 338-349 binding vertices, 345-349 limitations with using NIO buffers,

339-340 measuring frame rate, 338-339 reducing calls to OpenGL ES/JNI

methods, 344-345 reducing texture size, 343-344 removing unnecessary state changes, 341-343 slow rendering, 340-341 primitives, points, lines, strips, and fans, 325-326 programming model, 270-272 projections, 272-275 rendering pipeline, 276-277 specifying per vertex color, 300-304 specifying triangles, 292-296 NIO buffers, 293-294 sending vertices to OpenGL ES, 294-296 texture mapping, 304-315 code snippet, 310 coordinates, 304-306 deleting textures, 309 enabling texturing, 310 example code, 310-313 filtering, 308-309 Texture class, 313-315 uploading bitmaps, 306-307 optimizations, Droid Invaders game, 622-623

OptimizedBobTest, 348 optimizing, 338-349

binding vertices, 345-349 limitations with using NIO buffers,

339-340 measuring frame rate, 338-339 reducing calls to OpenGL ES/JNI

methods, 344-345 reducing texture size, 343-344 removing unnecessary state changes, 341-343 slow rendering, 340-341 Super Jumper game, 486-487 orientationChange, 278 orthographic projection, with glOrthof method, 289-292 Outline view, 45 OutputStreams, 75-76, 186 outVec array, 527, 529 overlap testing, bounding spheres,

573-574 overlapCircles( ) method, 380 OverlapTester class, 383, 574

0 0

Post a comment