- Small cleanups in SceneVieweropComponent and SceneApplication

- Add new nifty wiki pages to manual
- Update wiki pages

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7135 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 14 years ago
parent 67adc1737c
commit 55ea5239cb
  1. 54
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/application_states.html
  2. 31
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/asset_manager.html
  3. BIN
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/butterfly-particle-emitter.png
  4. 4
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/camera.html
  5. 6
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/cinematics.html
  6. 11
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/combo_moves.html
  7. 32
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/custom_controls.html
  8. 2
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/custom_meshes.html
  9. 4
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/debugging.html
  10. 42
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/effects_overview.html
  11. BIN
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/explosion-5.png
  12. 2
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/hinges_and_joints.html
  13. 7
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/hud.html
  14. 5
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/input_handling.html
  15. 51
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/jme3_shaders.html
  16. BIN
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/light-scattering-filter.png
  17. 8
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/light_and_shadow.html
  18. 49
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/logging.html
  19. 4
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/materials_overview.html
  20. 10
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/multiple_camera_views.html
  21. 203
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/multithreading.html
  22. 339
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/networking.html
  23. BIN
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/nifty-gui-example.png
  24. BIN
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/nifty-gui.png
  25. BIN
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/nifty-screen-layer-panel.png
  26. 421
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/nifty_gui.html
  27. 184
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_java_interaction.html
  28. 69
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_overlay.html
  29. 96
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_projection.html
  30. 193
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_xml_layout.html
  31. BIN
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/otoglow.png
  32. BIN
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/otonobloom.png
  33. BIN
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/particle.png
  34. 105
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/physics.html
  35. 174
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/physics_listeners.html
  36. 4
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/post-processor_water.html
  37. BIN
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/pssm.png
  38. 2
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/ragdoll.html
  39. BIN
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/ragdoll.png
  40. BIN
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/simplewater.png
  41. 8
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/swing_canvas.html
  42. BIN
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/toon-dino.png
  43. 8
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/vehicles.html
  44. 6
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/walking_character.html
  45. BIN
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/water-post.png
  46. BIN
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/water.png
  47. BIN
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/beginner-assets-models.png
  48. BIN
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/beginner-materials.png
  49. 23
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_animation.html
  50. 22
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_asset.html
  51. 10
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_audio.html
  52. 35
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_collision.html
  53. 11
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_effects.html
  54. 15
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_input_system.html
  55. 42
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_main_event_loop.html
  56. 32
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_material.html
  57. 13
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_node.html
  58. 11
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_physics.html
  59. 20
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_picking.html
  60. 12
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_simpleapplication.html
  61. 10
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_terrain.html
  62. 136
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/build_jme3_sources_with_netbeans.html
  63. 103
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/bullet_multithreading.html
  64. 39
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/api_feature_mapping.html
  65. 49
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/best_practices.html
  66. BIN
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/coordinate-system.png
  67. 4
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/headlessserver.html
  68. 385
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/my_first_game.html
  69. 45
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/terminology.html
  70. 34
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/webstart.html
  71. 10
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/asset_packs.html
  72. 2
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/development/scene.html
  73. 24
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/development/sceneexplorer.html
  74. BIN
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/jmonkeyplatform-docu-2.png
  75. 2
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/version_control.html
  76. 4
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/spidermonkey/tutorial/compression.html
  77. 5
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/spidermonkey/tutorial/connection.html
  78. 2
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/spidermonkey/tutorial/sending_and_receiving_messages.html
  79. 2
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/spidermonkey/tutorial/serializing.html
  80. 5
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/spidermonkey/tutorial/services.html
  81. 5
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/spidermonkey/tutorial/streaming.html
  82. 2
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/wiki-map.xml
  83. 5
      sdk/jme3-core/javahelp/wiki_help.properties
  84. 11
      sdk/jme3-core/src/com/jme3/gde/core/scene/SceneApplication.java
  85. 30
      sdk/jme3-core/src/com/jme3/gde/core/sceneviewer/SceneViewerTopComponent.java

@ -17,7 +17,7 @@ To implement game logic:
</li>
</ul>
</li>
<li><div> Attach the AppState to your application&#039;s AppStateManager (<code>stateManager.attach(myState);</code>) to activate it.</div>
<li><div> Attach the AppState to your application&#039;s AppStateManager (<code>stateManager.attach(myAppState);</code>) to activate it.</div>
</li>
<li><div> Create one AppState for each type of game behavior. When you add several AppStates to one Application, they will be executed in the order they were added.</div>
</li>
@ -34,11 +34,11 @@ JME3 comes with a BulletAppState that implements Physical behaviour (using the j
</p>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/jbullet/com/jme3/bullet/"><param name="text" value="<html><u>BulletAppState</u></html>"><param name="textColor" value="blue"></object> controls physical behaviour in PhysicsControl&#039;ed Spatials.</div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/jbullet/com/jme3/bullet/"><param name="text" value="<html><u>BulletAppState</u></html>"><param name="textColor" value="blue"></object> controls physical behaviour in PhysicsControl&#039;ed Spatials.</div>
</li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/app/state/TestAppStates.java"><param name="text" value="<html><u>TestAppStates.java</u></html>"><param name="textColor" value="blue"></object> an exmaple of a custom AppState</div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/app/state/TestAppStates.java"><param name="text" value="<html><u>TestAppStates.java</u></html>"><param name="textColor" value="blue"></object> an example of a custom AppState</div>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/app/state/RootNodeState.java"><param name="text" value="<html><u>RootNodeState.java</u></html>"><param name="textColor" value="blue"></object></div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/app/state/RootNodeState.java"><param name="text" value="<html><u>RootNodeState.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>
</li>
@ -123,15 +123,11 @@ Usage:
TestAppStates app = new TestAppStates&#40;&#41;;
app.start&#40;&#41;;
&#125;
&nbsp;
@Override
public void start&#40;JmeContext.Type contextType&#41;&#123;
super.start&#40;contextType&#41;;
&#125;
&nbsp;
@Override
public void initialize&#40;&#41;&#123;
super.initialize&#40;&#41;;MyAppState state = new MyAppState&#40;&#41;;
super.initialize&#40;&#41;;
MyAppState state = new MyAppState&#40;&#41;;
stateManager.attach&#40;state&#41;;
System.out.println&#40;&quot;Use the state's methods... &quot; + state.getX&#40;&#41;&#41;;
&#125;
@ -143,11 +139,11 @@ Usage:
stateManager.render&#40;renderManager&#41;;
renderManager.render&#40;tpf&#41;;
&#125;
&nbsp;
@Override
public void destroy&#40;&#41;&#123;
super.destroy&#40;&#41;;
&#125;</pre>
&#125;</pre>
<p>
<strong>Note:</strong> If you use the AppState together with a SimpleApplication-based class, then this <code>update()</code> loop is already set up.
</p>
</div>
<h2><a>AppStateManager</a></h2>
@ -183,7 +179,33 @@ The AppStateManager&#039;s update(), render(), postRender(), and cleanUp() metho
<h2><a>Best Practices</a></h2>
<div>
<pre>app.getState(MyState.class).doStuff()</pre>
<p>
You can only change AppStates, or read and write to them, from certain places: In a Control&#039;s update() method, in an AppState&#039;s update() method, and it the SimpleApplication&#039;s simpleUpdate() loop (or the Application&#039;s update() loop).
</p>
<p>
To get data from the AppState <code>MyAppState</code>:
</p>
<pre>app.getState&#40;MyAppState.class&#41;.getInfoAboutSomething&#40;&#41;;</pre>
<p>
To pass new data into the AppState <code>MyAppState</code>:
</p>
<pre>app.getState&#40;MyAppState.class&#41;.setSomething&#40;blah&#41;;</pre>
<p>
To trigger a one-off method in the AppState <code>MyAppState</code>:
</p>
<pre>app.getState&#40;MyAppState.class&#41;.doSomeMoreStuff&#40;&#41;;</pre>
<p>
Don&#039;t mess with the AppState from other places, because from other methods you have no control over the order of updates. You don&#039;t know when (during which half-finished step of an update), your call was received.
</p>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:application_states?do=export_xhtmlbody">view online version</a></em></p>

@ -4,7 +4,7 @@
<p>
JME3 has an integrated an asset manager that helps you keep your project assets organized. By assets we mean media files, such as 3D models, materials, textures, scenes, shaders, sounds, and fonts.
JME3 has an integrated an asset manager that helps you keep your project assets organized. By assets we mean media files, such as 3D models, materials, textures, scenes, shaders, sounds, and fonts. Think of the asset manager as the filesystem of your game, independent of the actual deployment platform. It also manages the appropriate managing of OpenGL objects like textures so that they are e.g. not uploaded to the graphics card multiple times when multiple models use them.
</p>
<p>
@ -52,17 +52,26 @@ These are just the most common examples, you can name the directories inside the
<h2><a>Loading Assets</a></h2>
<div>
<pre> Material mat_brick = new Material(
assetManager, &quot;Common/MatDefs/Misc/SimpleTextured.j3md&quot;);</pre>
<pre> mat_brick.setTexture(&quot;m_ColorMap&quot;,
assetManager.loadTexture(&quot;Textures/Terrain/BrickWall/BrickWall.jpg&quot;));</pre>
<pre> guiFont = assetManager.loadFont(&quot;Interface/Fonts/Default.fnt&quot;);</pre>
<pre> Spatial ninja = assetManager.loadModel(&quot;Models/Ninja/Ninja.mesh.xml&quot;);</pre>
<pre> assetManager.registerLocator&#40;&quot;town.zip&quot;, ZipLocator.class.getName&#40;&#41;&#41;;
Spatial scene = assetManager.loadModel&#40;&quot;main.scene&quot;&#41;;
rootNode.attachChild&#40;scene&#41;;</pre>
<pre>// Creating a material instance with the definition &quot;Unshaded.j3md&quot;.
Material mat_brick = new Material&#40;
assetManager, &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;;
&nbsp;
// Applying a texture to the material
mat_brick.setTexture&#40;&quot;ColorMap&quot;,
assetManager.loadTexture&#40;&quot;Textures/Terrain/BrickWall/BrickWall.jpg&quot;&#41;&#41;;
&nbsp;
// Loading a font
guiFont = assetManager.loadFont&#40;&quot;Interface/Fonts/Default.fnt&quot;&#41;;
&nbsp;
// Loading a model
Spatial ninja = assetManager.loadModel&#40;&quot;Models/Ninja/Ninja.mesh.xml&quot;&#41;;
&nbsp;
// Loading a scene from an Ogre3D dotScene file stored inside a zip
assetManager.registerLocator&#40;&quot;town.zip&quot;, ZipLocator.class.getName&#40;&#41;&#41;;
Spatial scene = assetManager.loadModel&#40;&quot;main.scene&quot;&#41;;
rootNode.attachChild&#40;scene&#41;;</pre>
<p>
Here is a HttpZipLocator that can download zipped models:
Here is a HttpZipLocator that can stream models from a zip file online:
</p>
<pre> assetManager.registerLocator&#40;&quot;http://jmonkeyengine.googlecode.com/files/wildhouse.zip&quot;,
HttpZipLocator.class.getName&#40;&#41;&#41;;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

@ -163,6 +163,10 @@ ChaseCamera chaseCam = new ChaseCamera&#40;cam, target, inputManager&#41;;</pre>
<td>chaseCam.setDefaultHorizontalRotation(-FastMath.PI/2);</td><td>The default horizontal rotation angle of the camera around the target at the start of the application.</td>
</tr>
</table>
<div><span>
<a href="/wiki/doku.php/tag:camera?do=showtag&amp;tag=tag%3Acamera">camera</a>,
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>
</span></div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:camera?do=export_xhtmlbody">view online version</a></em></p>

@ -322,11 +322,11 @@ Details of the constructor:
<p>
You can extend individual CinematicEvents. The <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/animation/SubtitleTrack.java"><param name="text" value="<html><u>SubtitleTrack.java example</u></html>"><param name="textColor" value="blue"></object> shows how to extend a GuiTrack to script subtitles. See how the subtitles are used in the <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/animation/TestCinematic.java"><param name="text" value="<html><u>TestCinematic.java example</u></html>"><param name="textColor" value="blue"></object>.
You can extend individual CinematicEvents. The <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/animation/SubtitleTrack.java"><param name="text" value="<html><u>SubtitleTrack.java example</u></html>"><param name="textColor" value="blue"></object> shows how to extend a GuiTrack to script subtitles. See how the subtitles are used in the <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/animation/TestCinematic.java"><param name="text" value="<html><u>TestCinematic.java example</u></html>"><param name="textColor" value="blue"></object>.
</p>
<p>
You can also create new CinematicEvent by extending <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/core/com/jme3/cinematic/events/AbstractCinematicEvent.java"><param name="text" value="<html><u>AbstractCinematicEvent</u></html>"><param name="textColor" value="blue"></object>. An AbstractCinematicEvent implements the CinematicEvent interface and provides duration, time, speed, etc… management. Look at the <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/animation/TestCinematic.java"><param name="text" value="<html><u>TestCinematic.java example</u></html>"><param name="textColor" value="blue"></object> is to use this for a custom fadeIn/fadeOut effect in combination with a com.jme3.post.filters.FadeFilter.
You can also create new CinematicEvent by extending <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core/com/jme3/cinematic/events/AbstractCinematicEvent.java"><param name="text" value="<html><u>AbstractCinematicEvent</u></html>"><param name="textColor" value="blue"></object>. An AbstractCinematicEvent implements the CinematicEvent interface and provides duration, time, speed, etc… management. Look at the <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/animation/TestCinematic.java"><param name="text" value="<html><u>TestCinematic.java example</u></html>"><param name="textColor" value="blue"></object> is to use this for a custom fadeIn/fadeOut effect in combination with a com.jme3.post.filters.FadeFilter.
</p>
</div>
@ -346,7 +346,7 @@ The camera management is handled as follows:
</li>
<li><div> Use activateCamera() to give the control of the camera to this node. You now see the scene from this camera&#039;s point of view. For example to see through the camera node named “top view”, 6 seconds after the start of the cinematic, you&#039;d write <pre>cinematic.activateCamera&#40;6, &quot;topView&quot;&#41;;</pre></div>
</li>
<li><div> If desired, attach the camNode to a MotionTrack to let it travel along waypoints. This is demonstrated in the <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/animation/TestCinematic.java"><param name="text" value="<html><u>TestCameraMotionPath.java example</u></html>"><param name="textColor" value="blue"></object>.</div>
<li><div> If desired, attach the camNode to a MotionTrack to let it travel along waypoints. This is demonstrated in the <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/animation/TestCinematic.java"><param name="text" value="<html><u>TestCameraMotionPath.java example</u></html>"><param name="textColor" value="blue"></object>.</div>
</li>
</ol>

@ -34,11 +34,11 @@ Copy the two classes ComboMoveExecution.java and ComboMove.java into your applic
<h2><a>Example Code</a></h2>
<div>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/input/combomoves/TestComboMoves.java"><param name="text" value="<html><u>TestComboMoves.java</u></html>"><param name="textColor" value="blue"></object></div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/input/combomoves/TestComboMoves.java"><param name="text" value="<html><u>TestComboMoves.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/input/combomoves/ComboMoveExecution.java"><param name="text" value="<html><u>ComboMoveExecution.java</u></html>"><param name="textColor" value="blue"></object> ← required</div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/input/combomoves/ComboMoveExecution.java"><param name="text" value="<html><u>ComboMoveExecution.java</u></html>"><param name="textColor" value="blue"></object> ← required</div>
</li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/input/combomoves/ComboMove.java"><param name="text" value="<html><u>ComboMove.java</u></html>"><param name="textColor" value="blue"></object> ← required</div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/input/combomoves/ComboMove.java"><param name="text" value="<html><u>ComboMove.java</u></html>"><param name="textColor" value="blue"></object> ← required</div>
</li>
</ul>
@ -254,6 +254,11 @@ Depending on the game genre, the designer can reward the players&#039; intrinsic
<li><div> (extrinsical:) Sport and fighter games typically choose to reward the player&#039;s “manual” skills: The success of a special move solely depends on the player&#039;s own dexterity. These games typically offer optional Combos.</div>
</li>
</ul>
<div><span>
<a href="/wiki/doku.php/tag:keyinput?do=showtag&amp;tag=tag%3Akeyinput">keyinput</a>,
<a href="/wiki/doku.php/tag:input?do=showtag&amp;tag=tag%3Ainput">input</a>,
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>
</span></div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:combo_moves?do=export_xhtmlbody">view online version</a></em></p>

@ -4,28 +4,30 @@
<p>
<code>com.jme3.scene.control.Control</code> is a customizable jME3 interface that allows you to cleanly implement Game Logic. You use Controls to control the behaviour of types of Spatials. To control global game behaviour see <a href="/com/jme3/gde/core/docs/jme3/advanced/application_states.html">Application States</a> – you can use both together.
A <code>com.jme3.scene.control.Control</code> is a customizable jME3 interface that allows you to cleanly implement game logic, such as game rules, or artificially intelligent behaviour in NPCs. You use Controls to control the behaviour of types of spatials. To control global game behaviour see <a href="/com/jme3/gde/core/docs/jme3/advanced/application_states.html">Application States</a> – you can use both together.
</p>
<p>
To control the behaviour of types of entities:
</p>
<ol>
<li><div> Create one control for each type of behavior. When you add several controls to one spatial, they will be executed in the order they were added. <br/>
For example, an NPC can be controlled by a PhysicsControl and an AIControl. </div>
</li>
<li><div> You define a custom control and implement its behaviour in the Control&#039;s update() method.</div>
<ul>
<li><div> You can pass arguments and manipulate the spatial in any way: Modify its transformation (move, scale, rotate), play animations, check for enemies around it and react, etc. </div>
<li><div> In the control, you can pass arguments and manipulate the spatial in any way: Modify its transformation (move, scale, rotate), play animations, check for enemies around it and react, etc. </div>
</li>
</ul>
</li>
<li><div> Add the control to a Spatial (<code>spatial.addControl(myControl)</code>), and the Spatial&#039;s game state is updated automatically from now on. </div>
</li>
<li><div> Create one control for each type of behavior. When you add several controls to one spatial, they will be executed in the order they were added.</div>
<li><div> Add the control to a spatial and the Spatial&#039;s game state is updated automatically from now on. <br/>
<code>spatial.addControl(myControl)</code></div>
</li>
</ol>
<p>
To implement game logic for a Spatial, you will either extend AbstractControl, or implement Control, as explained in this article.
To implement game logic for a type of spatial, you will either extend AbstractControl, or implement the Control interface, as explained in this article.
</p>
</div>
@ -35,7 +37,7 @@ To implement game logic for a Spatial, you will either extend AbstractControl, o
<p>
For example, you could write a CharacterAnimControl that animates a character accordingly while its being moved by a CharacterControl. Or you can write an AIControl that remote controls NPC behaviour. Or you could write a DestructionControl that automatically replaces a structure with an appropriate piece of debris after collision with a projectile… The possibilities are endless. <img src="/wiki/lib/images/smileys/icon_smile.gif" class="middle" alt=":-)" />
For example, you could write a CharacterAnimControl that animates a character accordingly while it is being moved by a CharacterControl. Or you can write an AIControl that remote-controls NPC behaviour in fight situatons. Or you could write a DestructionControl that automatically replaces a structure with an appropriate piece of debris after collision with a projectile… The possibilities are endless. <img src="/wiki/lib/images/smileys/icon_smile.gif" class="middle" alt=":-)" />
</p>
<p>
@ -43,13 +45,13 @@ Existing examples in the code base include:
</p>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/core/com/jme3/animation/AnimControl.java"><param name="text" value="<html><u>AnimControl.java</u></html>"><param name="textColor" value="blue"></object> allows manipulation of skeletal animation, including blending an channels.</div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core/com/jme3/animation/AnimControl.java"><param name="text" value="<html><u>AnimControl.java</u></html>"><param name="textColor" value="blue"></object> allows manipulation of skeletal animation, including blending and multiple channels.</div>
</li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/core/com/jme3/scene/control/CameraControl.java"><param name="text" value="<html><u>CameraControl.java</u></html>"><param name="textColor" value="blue"></object> allows you to sync the camera position with the position of a given spatial.</div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core/com/jme3/scene/control/CameraControl.java"><param name="text" value="<html><u>CameraControl.java</u></html>"><param name="textColor" value="blue"></object> allows you to sync the camera position with the position of a given spatial.</div>
</li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/core/com/jme3/scene/control/BillboardControl.java"><param name="text" value="<html><u>BillboardControl.java</u></html>"><param name="textColor" value="blue"></object> displays a flat picture orthogonally, e.g. a speech bubble or informational dialog.</div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core/com/jme3/scene/control/BillboardControl.java"><param name="text" value="<html><u>BillboardControl.java</u></html>"><param name="textColor" value="blue"></object> displays a flat picture orthogonally, e.g. a speech bubble or informational dialog.</div>
</li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/#src%2Fjbullet%2Fcom%2Fjme3%2Fbullet%2Fcontrol"><param name="text" value="<html><u>PhysicsControl</u></html>"><param name="textColor" value="blue"></object> subclasses (such as CharacterControl, RigidBodyControl, VehicleControl) allow you to add physical properties to any spatial. PhysicsControls tie into capabilities provided by the BulletAppState. </div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/#src%2Fjbullet%2Fcom%2Fjme3%2Fbullet%2Fcontrol"><param name="text" value="<html><u>PhysicsControl</u></html>"><param name="textColor" value="blue"></object> subclasses (such as CharacterControl, RigidBodyControl, VehicleControl) allow you to add physical properties to any spatial. PhysicsControls tie into capabilities provided by the BulletAppState. </div>
</li>
</ul>
@ -197,7 +199,7 @@ Usage: Your custom subclass must implement the three methods <code>controlUpdate
&nbsp;
@Override
protected void controlRender&#40;RenderManager rm, ViewPort vp&#41;&#123;
// ... optionial
// ... optional
&#125;
&nbsp;
@Override
@ -227,11 +229,11 @@ Usage: Your custom subclass must implement the three methods <code>controlUpdate
<p>
<strong>Tip:</strong> You can use the getControl() accessor to get Control objects from Spatials! No need to pass around lots of object references.
<strong>Tip:</strong> Use the getControl() accessor to get Control objects from Spatials. No need to pass around lots of object references.
</p>
<p>
Here an example from the monkeyzone code:
Here an example from the <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/monkeyzone/"><param name="text" value="<html><u>MonkeyZone</u></html>"><param name="textColor" value="blue"></object> code:
</p>
<pre>public class CharacterAnimControl implements Control &#123;
...
@ -270,7 +272,7 @@ Then add the appropriate controls to spatials:
vehicleSpatial.addControl&#40;new ManualVehicleControl&#40;&#41;&#41;;
...</pre>
<p>
<strong>Tip:</strong> Use the getControl() method on a Spatial, get a specific Control object, and activate its behaviour!
<strong>Tip:</strong> Use the getControl() method on a Spatial to get a specific Control object, and activate its behaviour!
</p>
<pre>ManualControl c = mySpatial.getControl&#40;ManualControl.class&#41;;
c.steerX&#40;steerX&#41;;</pre>

@ -16,7 +16,7 @@ In this tutorial, we (re)create a very simple rectangular mesh, and we have a lo
</p>
<ul>
<li><div> Full code sample: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/model/shape/TestCustomMesh.java"><param name="text" value="<html><u>TestCustomMesh.java</u></html>"><param name="textColor" value="blue"></object></div>
<li><div> Full code sample: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.googlecode.com/svn/branches/stable-alpha4/engine/src/test/jme3test/model/shape/TestCustomMesh.java"><param name="text" value="<html><u>TestCustomMesh.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>

@ -42,11 +42,11 @@ The coordinate axes (com.jme3.scene.debug.Arrow) help you see the cardinal direc
arrow.setLineWidth&#40;4&#41;; // make arrow thicker
putShape&#40;arrow, ColorRGBA.Red&#41;.setLocalTranslation&#40;pos&#41;;
&nbsp;
Arrow arrow = new Arrow&#40;Vector3f.UNIT_Y&#41;;
arrow = new Arrow&#40;Vector3f.UNIT_Y&#41;;
arrow.setLineWidth&#40;4&#41;; // make arrow thicker
putShape&#40;arrow, ColorRGBA.Green&#41;.setLocalTranslation&#40;pos&#41;;
&nbsp;
Arrow arrow = new Arrow&#40;Vector3f.UNIT_Z&#41;;
arrow = new Arrow&#40;Vector3f.UNIT_Z&#41;;
arrow.setLineWidth&#40;4&#41;; // make arrow thicker
putShape&#40;arrow, ColorRGBA.Blue&#41;.setLocalTranslation&#40;pos&#41;;
&#125;

@ -33,15 +33,15 @@ jME3 supports various post-rendering and particle effects. This list contains sc
</p>
<p>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/post/TestSSAO.java"><param name="text" value="<html><u>jme3/src/test/jme3test/post/TestSSAO.java</u></html>"><param name="textColor" value="blue"></object>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/post/TestSSAO.java"><param name="text" value="<html><u>jme3/src/test/jme3test/post/TestSSAO.java</u></html>"><param name="textColor" value="blue"></object>
</p>
<p>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/post/TestSSAO2.java"><param name="text" value="<html><u>jme3/src/test/jme3test/post/TestSSAO2.java</u></html>"><param name="textColor" value="blue"></object>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/post/TestSSAO2.java"><param name="text" value="<html><u>jme3/src/test/jme3test/post/TestSSAO2.java</u></html>"><param name="textColor" value="blue"></object>
</p>
<p>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/post/TestTransparentSSAO.java"><param name="text" value="<html><u>jme3/src/test/jme3test/post/TestTransparentSSAO.java</u></html>"><param name="textColor" value="blue"></object>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/post/TestTransparentSSAO.java"><param name="text" value="<html><u>jme3/src/test/jme3test/post/TestTransparentSSAO.java</u></html>"><param name="textColor" value="blue"></object>
</p>
<p>
@ -59,7 +59,7 @@ jME3 supports various post-rendering and particle effects. This list contains sc
<p>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/post/TestLightScattering.java"><param name="text" value="<html><u>jme3/src/test/jme3test/post/TestLightScattering.java</u></html>"><param name="textColor" value="blue"></object>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/post/TestLightScattering.java"><param name="text" value="<html><u>jme3/src/test/jme3test/post/TestLightScattering.java</u></html>"><param name="textColor" value="blue"></object>
</p>
</div>
@ -69,7 +69,7 @@ jME3 supports various post-rendering and particle effects. This list contains sc
<p>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/post/TestBloom.java"><param name="text" value="<html><u>jme3/src/test/jme3test/post/TestBloom.java</u></html>"><param name="textColor" value="blue"></object>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/post/TestBloom.java"><param name="text" value="<html><u>jme3/src/test/jme3test/post/TestBloom.java</u></html>"><param name="textColor" value="blue"></object>
</p>
<p>
@ -87,11 +87,11 @@ jME3 supports various post-rendering and particle effects. This list contains sc
<p>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/post/TestCartoonEdge.java"><param name="text" value="<html><u>jme3/src/test/jme3test/post/TestCartoonEdge.java</u></html>"><param name="textColor" value="blue"></object>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/post/TestCartoonEdge.java"><param name="text" value="<html><u>jme3/src/test/jme3test/post/TestCartoonEdge.java</u></html>"><param name="textColor" value="blue"></object>
</p>
<p>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/post/TestTransparentCartoonEdge.java"><param name="text" value="<html><u>jme3/src/test/jme3test/post/TestTransparentCartoonEdge.java</u></html>"><param name="textColor" value="blue"></object>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/post/TestTransparentCartoonEdge.java"><param name="text" value="<html><u>jme3/src/test/jme3test/post/TestTransparentCartoonEdge.java</u></html>"><param name="textColor" value="blue"></object>
</p>
</div>
@ -105,7 +105,7 @@ jME3 supports various post-rendering and particle effects. This list contains sc
</p>
<p>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/post/TestDepthOfField.java"><param name="text" value="<html><u>jme3/src/test/jme3test/post/TestDepthOfField.java</u></html>"><param name="textColor" value="blue"></object>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/post/TestDepthOfField.java"><param name="text" value="<html><u>jme3/src/test/jme3test/post/TestDepthOfField.java</u></html>"><param name="textColor" value="blue"></object>
</p>
</div>
@ -115,7 +115,7 @@ jME3 supports various post-rendering and particle effects. This list contains sc
<p>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/post/TestFog.java"><param name="text" value="<html><u>jme3/src/test/jme3test/post/TestFog.java</u></html>"><param name="textColor" value="blue"></object> (temporary workaround, will be deprecated)
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/post/TestFog.java"><param name="text" value="<html><u>jme3/src/test/jme3test/post/TestFog.java</u></html>"><param name="textColor" value="blue"></object> (temporary workaround, will be deprecated)
</p>
<p>
@ -129,11 +129,11 @@ jME3 supports various post-rendering and particle effects. This list contains sc
<p>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/light/TestSimpleLighting.java"><param name="text" value="<html><u>jme3/src/test/jme3test/light/TestSimpleLighting.java</u></html>"><param name="textColor" value="blue"></object>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/light/TestSimpleLighting.java"><param name="text" value="<html><u>jme3/src/test/jme3test/light/TestSimpleLighting.java</u></html>"><param name="textColor" value="blue"></object>
</p>
<p>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/light/TestLightRadius.java"><param name="text" value="<html><u>jme3/src/test/jme3test/light/TestLightRadius.java</u></html>"><param name="textColor" value="blue"></object>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/light/TestLightRadius.java"><param name="text" value="<html><u>jme3/src/test/jme3test/light/TestLightRadius.java</u></html>"><param name="textColor" value="blue"></object>
</p>
<p>
@ -141,15 +141,15 @@ jME3 supports various post-rendering and particle effects. This list contains sc
</p>
<p>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/light/TestManyLights.java"><param name="text" value="<html><u>jme3/src/test/jme3test/light/TestManyLights.java</u></html>"><param name="textColor" value="blue"></object>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/light/TestManyLights.java"><param name="text" value="<html><u>jme3/src/test/jme3test/light/TestManyLights.java</u></html>"><param name="textColor" value="blue"></object>
</p>
<p>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/light/TestShadow.java"><param name="text" value="<html><u>jme3/src/test/jme3test/light/TestShadow.java</u></html>"><param name="textColor" value="blue"></object>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/light/TestShadow.java"><param name="text" value="<html><u>jme3/src/test/jme3test/light/TestShadow.java</u></html>"><param name="textColor" value="blue"></object>
</p>
<p>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/light/TestPssmShadow.java"><param name="text" value="<html><u>jme3/src/test/jme3test/light/TestPssmShadow.java</u></html>"><param name="textColor" value="blue"></object> = Parallel-Split Shadow Mapping (PSSM)
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/light/TestPssmShadow.java"><param name="text" value="<html><u>jme3/src/test/jme3test/light/TestPssmShadow.java</u></html>"><param name="textColor" value="blue"></object> = Parallel-Split Shadow Mapping (PSSM)
</p>
</div>
@ -167,11 +167,11 @@ jME3 supports various post-rendering and particle effects. This list contains sc
</p>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/water/TestSceneWater.java"><param name="text" value="<html><u>jme3/src/test/jme3test/water/TestSceneWater.java</u></html>"><param name="textColor" value="blue"></object></div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/water/TestSceneWater.java"><param name="text" value="<html><u>jme3/src/test/jme3test/water/TestSceneWater.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/water/TestSimpleWater.java"><param name="text" value="<html><u>jme3/src/test/jme3test/water/TestSimpleWater.java</u></html>"><param name="textColor" value="blue"></object></div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/water/TestSimpleWater.java"><param name="text" value="<html><u>jme3/src/test/jme3test/water/TestSimpleWater.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>
@ -185,11 +185,11 @@ jME3 supports various post-rendering and particle effects. This list contains sc
</p>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/water/TestPostWater.java"><param name="text" value="<html><u>jme3/src/test/jme3test/water/TestPostWater.java</u></html>"><param name="textColor" value="blue"></object></div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/water/TestPostWater.java"><param name="text" value="<html><u>jme3/src/test/jme3test/water/TestPostWater.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/water/TestPostWaterLake.java"><param name="text" value="<html><u>jme3/src/test/jme3test/water/TestPostWaterLake.java</u></html>"><param name="textColor" value="blue"></object></div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/water/TestPostWaterLake.java"><param name="text" value="<html><u>jme3/src/test/jme3test/water/TestPostWaterLake.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>
@ -222,11 +222,11 @@ jME3 supports various post-rendering and particle effects. This list contains sc
<p>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/effect/TestExplosionEffect.java"><param name="text" value="<html><u>jme3/src/test/jme3test/effect/TestExplosionEffect.java</u></html>"><param name="textColor" value="blue"></object> – debris, flame, flash, shockwave, smoke, sparks
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/effect/TestExplosionEffect.java"><param name="text" value="<html><u>jme3/src/test/jme3test/effect/TestExplosionEffect.java</u></html>"><param name="textColor" value="blue"></object> – debris, flame, flash, shockwave, smoke, sparks
</p>
<p>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/effect/TestParticleEmitter.java"><param name="text" value="<html><u>jme3/src/test/jme3test/effect/TestParticleEmitter.java</u></html>"><param name="textColor" value="blue"></object>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/effect/TestParticleEmitter.java"><param name="text" value="<html><u>jme3/src/test/jme3test/effect/TestParticleEmitter.java</u></html>"><param name="textColor" value="blue"></object>
</p>
<p>
@ -240,7 +240,7 @@ jME3 supports various post-rendering and particle effects. This list contains sc
<p>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/effect/TestMovingParticle.java"><param name="text" value="<html><u>jme3/src/test/jme3test/effect/TestMovingParticle.java</u></html>"><param name="textColor" value="blue"></object>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/effect/TestMovingParticle.java"><param name="text" value="<html><u>jme3/src/test/jme3test/effect/TestMovingParticle.java</u></html>"><param name="textColor" value="blue"></object>
</p>
<p>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

@ -20,7 +20,7 @@ In this example, we will create a pendulum. The joint is the (invisible) connect
<h2><a>Sample Code</a></h2>
<div>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/bullet/TestPhysicsHingeJoint.java"><param name="text" value="<html><u>TestPhysicsHingeJoint.java</u></html>"><param name="textColor" value="blue"></object></div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet/TestPhysicsHingeJoint.java"><param name="text" value="<html><u>TestPhysicsHingeJoint.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>

@ -175,6 +175,11 @@ Use the update loop to keep the content up-to-date.
...
picture.setImage&#40;assetManager, &quot;Interface/statechange.png&quot;, true&#41;;
...
&#125;</pre>
&#125;</pre><div><span>
<a href="/wiki/doku.php/tag:gui?do=showtag&amp;tag=tag%3Agui">gui</a>,
<a href="/wiki/doku.php/tag:display?do=showtag&amp;tag=tag%3Adisplay">display</a>,
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>
</span></div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:hud?do=export_xhtmlbody">view online version</a></em></p>

@ -261,6 +261,11 @@ It&#039;s very common that you want an action to be only triggered once, in the
This approach of separating triggers from actions has the advantage that you can remap triggers easily. Maybe your players have different keyboard layouts, are used to “reversed” mouse navigation, or prefer different navigational keys than the ones you defined. In any case, you only need to replace the trigger parts in the <code>inputManager.addMapping()</code> lines with variables, and load different sets of trigger objects when the game starts. The rest of the code stays as it is.
</p>
<div><span>
<a href="/wiki/doku.php/tag:keyinput?do=showtag&amp;tag=tag%3Akeyinput">keyinput</a>,
<a href="/wiki/doku.php/tag:input?do=showtag&amp;tag=tag%3Ainput">input</a>,
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>
</span></div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:input_handling?do=export_xhtmlbody">view online version</a></em></p>

@ -192,7 +192,7 @@ Note that in the shader the uniform names will be prefixed by a “g_”.<br/>
In the example above, WorldViewProjectionMatrix is declared as uniform mat4 g_WorldViewProjectionMatrix in the shader.<br/>
The complete list of global uniforms that can be used in JME3 can be found <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/core/com/jme3/shader/UniformBinding.java"><param name="text" value="<html><u>here</u></html>"><param name="textColor" value="blue"></object>.<br/>
The complete list of global uniforms that can be used in JME3 can be found <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core/com/jme3/shader/UniformBinding.java"><param name="text" value="<html><u>here</u></html>"><param name="textColor" value="blue"></object>.<br/>
<br/>
@ -207,7 +207,7 @@ The complete list of global uniforms that can be used in JME3 can be found <obje
<p>
Those are different attributes that are always passed to your shader.<br/>
you can find a complete list of those attribute in the Type enum of the VertexBuffer <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/core/com/jme3/scene/VertexBuffer.java"><param name="text" value="<html><u>here</u></html>"><param name="textColor" value="blue"></object>.<br/>
you can find a complete list of those attribute in the Type enum of the VertexBuffer <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core/com/jme3/scene/VertexBuffer.java"><param name="text" value="<html><u>here</u></html>"><param name="textColor" value="blue"></object>.<br/>
Note that in the shader the attributes names will be prefixed by a “in”.<br/>
@ -218,6 +218,42 @@ Note that in the shader the attributes names will be prefixed by a “in”.<br/
</div>
<h3><a>User&#039;s uniforms</a></h3>
<div>
<p>
At some point when making your own shader you&#039;ll need to pass your own uniforms<br/>
Any uniform has to be declared in the material definition file in the “MaterialParameters” section.<br/>
</p>
<pre> MaterialParameters &#123;
Vector4 Color
&#125;</pre>
<p>
This material parameter will be sent from the engine to the shader as follow
</p>
<pre> material.setColor&#40;&quot;Color&quot;, ColorRGBA&#40;1.0f, 0.0f, 0.0f, 1.0f&#41;;//red color</pre>
<p>
Note that there is a setXXXX method for any type of uniform you want to pass.<br/>
To use this uniform in the shader, you need to declare it in the .frag or in the .vert files (depending on where you need it) as follow :
</p>
<pre> uniform vec4 m_Color;</pre>
<p>
<strong>Note the “m_” prefix that specifies that the uniform is a material parameter.</strong><br/>
This uniform will be populated at runtime with the value you sent.
</p>
</div>
<h3><a>Step by step</a></h3>
<div>
<ul>
@ -278,12 +314,21 @@ GLSL 1.0 to 1.2 comes with build in attributes and uniforms (ie, gl_Vertex, gl_M
<td>gl_ProjectionMatrix </td><td>g_ProjectionMatrix</td>
</tr>
<tr>
<td>gl_ModelViewProjectionMatrix </td><td>g_WorldViewMatrix</td>
<td>gl_ModelViewProjectionMatrix </td><td>g_WorldViewProjectionMatrix</td>
</tr>
<tr>
<td>gl_NormalMatrix </td><td>g_NormalMatrix</td>
</tr>
</table>
</div>
<h3><a>Useful links</a></h3>
<div>
<p>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.eng.utah.edu/~cs5610/lectures/GLSL-ATI-Intro.pdf"><param name="text" value="<html><u>http://www.eng.utah.edu/~cs5610/lectures/GLSL-ATI-Intro.pdf</u></html>"><param name="textColor" value="blue"></object>
</p>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:jme3_shaders?do=export_xhtmlbody">view online version</a></em></p>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

@ -55,9 +55,9 @@ A SpotLight is like a flashlight that sends a distinct beam of light. (Still wor
<h2><a>Simple Lighting</a></h2>
<div>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/light/TestSimpleLighting.java"><param name="text" value="<html><u>TestSimpleLighting.java</u></html>"><param name="textColor" value="blue"></object></div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/light/TestSimpleLighting.java"><param name="text" value="<html><u>TestSimpleLighting.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/light/TestLightRadius.java"><param name="text" value="<html><u>TestLightRadius.java</u></html>"><param name="textColor" value="blue"></object></div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/light/TestLightRadius.java"><param name="text" value="<html><u>TestLightRadius.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>
@ -103,7 +103,7 @@ This lighting method doesn&#039;t make the node cast a shadow onto other nodes.
<h2><a>BasicShadowRenderer</a></h2>
<div>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/light/TestShadow.java"><param name="text" value="<html><u>TestShadow.java</u></html>"><param name="textColor" value="blue"></object></div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/light/TestShadow.java"><param name="text" value="<html><u>TestShadow.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>
@ -140,7 +140,7 @@ ghost.setShadowMode&#40;ShadowMode.Off&#41;;
<h2><a>Parallel-Split Shadow Map</a></h2>
<div>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/light/TestPssmShadow.java"><param name="text" value="<html><u>TestPssmShadow.java</u></html>"><param name="textColor" value="blue"></object></div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/light/TestPssmShadow.java"><param name="text" value="<html><u>TestPssmShadow.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>

@ -4,16 +4,35 @@
</div>
<h2><a>Development Log Output</a></h2>
<h2><a>Development Phase Log Output</a></h2>
<div>
<p>
jME uses the standard Java logger from <code>java.util.logging</code>.
Many developers just use System.out.println() to print diagnostic strings to the terminal. The problem with that is that before the release, you&#039;d have to go through all your code and make certain you removed all these println() calls. You do not want your users to see them and worry about ominous strings babbling about old development diagnostics.
</p>
<p>
To write to the log:
Instead of println(), you use the standard Java logger from <code>java.util.logging</code>. It has many advantages for professional game development:
</p>
<ul>
<li><div> You “tag” each message with a log level: Severe error, informative warning, etc.</div>
</li>
<li><div> You can switch off printing of all messages up to certain log level with just one line of code.</div>
<ul>
<li><div> During development, you would set the log level to fine, because you want all warnings printed.</div>
</li>
<li><div> For the release, you set the log level to only report severe errors, and no informative diagnostics.</div>
</li>
</ul>
</li>
<li><div> The logger string is localizable, since it contains variables. You may want to localize all errors.</div>
</li>
</ul>
<p>
So to print comments like a pro, you use the following logger syntax. The variables a, b, c, can be any printable Java object, e.g. <code>Vector3f a = cam.getLocation()</code>. They are numbered {0},{1},{2},etc for use in the string, in the order you put them in the Object array.
</p>
<pre>private static final Logger logger = Logger.getLogger&#40;HelloWorld.class.getName&#40;&#41;&#41;;</pre>
<p>
@ -21,15 +40,21 @@ To write to the log:
Replace HelloWorld by the name of the class where you are using this line.
</p>
<pre>logger.severe&#40;&quot;something has failed&quot;&#41;;</pre>
<pre>logger.log&#40;Level.WARNING, &quot;ok seriously wtf somebody check why {0} is {1} again?!&quot;,
new Object&#91;&#93;&#123;a , b&#125;&#41;;</pre>
<p>
or
</p>
<pre>logger.warning&#40;&quot;verify something...&quot;&#41;;</pre>
<pre>logger.log&#40;Level.SEVERE, &quot;Game error: {0} must not be {1} after {2}! Please check your flux generator.&quot;,
new Object&#91;&#93;&#123;a , b , c&#125;&#41;;</pre>
<p>
As you see in the example, you should phrase potentially “customer facing” errors in a neutral way and offer a reason and a solution. If you use WARNINGs as replacement for casual printlns, make sure you deactivate them for the release.
</p>
<p>
More about <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://download.oracle.com/javase/6/docs/api/java/util/logging/Level.html"><param name="text" value="<html><u>log levels here</u></html>"><param name="textColor" value="blue"></object>.
More details about <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://download.oracle.com/javase/6/docs/api/java/util/logging/Level.html"><param name="text" value="<html><u>Java log levels</u></html>"><param name="textColor" value="blue"></object> here.
</p>
</div>
@ -86,5 +111,17 @@ Logger.getLogger&#40;HelloWorld.class.getName&#40;&#41;&#41;.log&#40;Level.INFO,
Replace HelloWorld by the name of the class where you are using this line.
</p>
<p>
The result looks like the following example:
</p>
<pre>
Caps: [FrameBuffer, FrameBufferMRT, FrameBufferMultisample, OpenGL20, ARBprogram, GLSL100, GLSL110, GLSL120, VertexTextureFetch, FloatTexture, TextureCompressionLATC]
</pre>
<p>
This would tell you that this user&#039;s graphic card only supports OpenGL 2.0 and cannot handle newer OpenGL features.
</p>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:logging?do=export_xhtmlbody">view online version</a></em></p>

@ -60,7 +60,7 @@ Also note that many other parameters are optional, even if they are not explicit
</tr>
<tr>
<td> Common/MatDefs/Misc/Particle.j3md </td><td> Used with texture masks for particle effects, or for point sprites. <br/>
The Quadratic value scales the particle for perspective view (<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/core/com/jme3/effect/ParticleEmitter.java"><param name="text" value="<html><u>formula</u></html>"><param name="textColor" value="blue"></object>). <br/>
The Quadratic value scales the particle for perspective view (<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/core/com/jme3/effect/ParticleEmitter.java"><param name="text" value="<html><u>formula</u></html>"><param name="textColor" value="blue"></object>). <br/>
Does support an optional colored glow effect. <br/>
See also: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_effects.html">Hello Effects</a> </td><td> Texture : Texture <br/>
GlowMap : Texture <br/>
@ -159,7 +159,7 @@ Also note that many other parameters are optional, even if they are not explicit
<tr>
<td> Common/MatDefs/Light/Reflection.j3md </td><td> Reflective glass material with environment map (CubeMap/SphereMap). <br/>
Requires light source. <br/>
See also: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/texture/TestCubeMap.java"><param name="text" value="<html><u>TestCubeMap.java</u></html>"><param name="textColor" value="blue"></object> </td><td> Texture : Texture <br/>
See also: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/texture/TestCubeMap.java"><param name="text" value="<html><u>TestCubeMap.java</u></html>"><param name="textColor" value="blue"></object> </td><td> Texture : Texture <br/>
SphereMap: Boolean </td>
</tr>
</table>

@ -8,7 +8,7 @@ You can split the screen and look into the 3D scene from different camera angles
</p>
<p>
The packages used in this example are <code>com.jme3.renderer.Camera</code> and <code>com.jme3.renderer.ViewPort</code>. You can get the full sample code here: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/renderer/TestMultiViews.java"><param name="text" value="<html><u>TestMultiViews.java</u></html>"><param name="textColor" value="blue"></object>
The packages used in this example are <code>com.jme3.renderer.Camera</code> and <code>com.jme3.renderer.ViewPort</code>. You can get the full sample code here: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/renderer/TestMultiViews.java"><param name="text" value="<html><u>TestMultiViews.java</u></html>"><param name="textColor" value="blue"></object>
</p>
</div>
@ -39,7 +39,7 @@ We will have a detailed look at how we use setViewPort() to position and resize
<p>
Here is the outline for how you create the three other cams and viewPorts (<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/renderer/TestMultiViews.java"><param name="text" value="<html><u>Full code sample is here</u></html>"><param name="textColor" value="blue"></object>.) In the code snippet, <code>cam_n</code> stand for <code>cam_2</code> - <code>cam_4</code>, respectively, same for <code>view_n</code>.
Here is the outline for how you create the three other cams and viewPorts (<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/renderer/TestMultiViews.java"><param name="text" value="<html><u>Full code sample is here</u></html>"><param name="textColor" value="blue"></object>.) In the code snippet, <code>cam_n</code> stand for <code>cam_2</code> - <code>cam_4</code>, respectively, same for <code>view_n</code>.
</p>
<ol>
@ -86,7 +86,7 @@ Imagine the view as a 1&times;1-sized box. By default, the settings is <code>cam
</p>
<p>
In the <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/renderer/TestMultiViews.java"><param name="text" value="<html><u>code sample</u></html>"><param name="textColor" value="blue"></object>, note the following four lines:
In the <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/renderer/TestMultiViews.java"><param name="text" value="<html><u>code sample</u></html>"><param name="textColor" value="blue"></object>, note the following four lines:
</p>
<pre>cam.setViewPort&#40; 0.5f, 1.0f, 0.0f, 0.5f&#41;;
...
@ -132,6 +132,10 @@ This layout shows 2&times;2 views. For a split screen you may want to lay out tw
<p>
If you scale the views in a way so that the aspect ratio changes, the views will obviously be distorted. In these cases, create custom camera objects with the right aspect ratio (redefine the default cam).
</p>
<div><span>
<a href="/wiki/doku.php/tag:camera?do=showtag&amp;tag=tag%3Acamera">camera</a>,
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>
</span></div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:multiple_camera_views?do=export_xhtmlbody">view online version</a></em></p>

@ -0,0 +1,203 @@
<h1><a>Multithreading Optimization</a></h1>
<div>
<p>
First, make sure you know what <a href="/com/jme3/gde/core/docs/jme3/advanced/application_states.html">Application States</a> and <a href="/com/jme3/gde/core/docs/jme3/advanced/custom_controls.html">Custom Controls</a> are.
</p>
<p>
More complex games may feature complex mathematical operations or artificially intelligent calculations (such as path finding for several NPCs). If you make many time-intensive calls on the same thread (e.g. in the simpleUpdate() loop), they will block one another, and thus slow down the game to a degree that makes it unplayable. If your game requires long running tasks, you should run them concurrently on separate threads, which speeds up the application considerably.
</p>
<p>
Often multithreading means having separate detached logical loops going on in parallel, which communicate about their state. (For example, one thread for AI, one Sound, one Graphics). However many programmers use a global update loop for game logic, and then just do multithreading within that loop when it is appropriate. This scales way better to multiple cores and does not break up your code logic.
</p>
<p>
Effectively, each for-loop in the main event loop might be a chance for multithreading, if you can break it up into self-contained tasks.
</p>
</div>
<h2><a>Java Multithreading</a></h2>
<div>
<p>
The java.util.concurrent package provides a good foundation for multithreading and dividing work into tasks that can be executed concurrently (hence the name). The three basic components are the Executor, Callable Objects (the tasks), and Future Objects. You can read about the concurrent package more <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://download.oracle.com/javase/tutorial/essential/concurrency/"><param name="text" value="<html><u>here</u></html>"><param name="textColor" value="blue"></object>, I will give just a short introduction.
</p>
<ul>
<li><div> A Callable is a class with a method call() that gets executed on a thread in the Executor. It represents one task (e.g, path finding).</div>
</li>
<li><div> The Executor is one central object that manages the threads that are running to execute the Callables. Every time a Callable is added to the Executor, the Executor returns a Future object for it. </div>
</li>
<li><div> A Future is an object that you use to check the status of an individual Callable&#039;s execution. It also gives you the return value in case one is created.</div>
</li>
</ul>
</div>
<h2><a>Multithreading in jME3</a></h2>
<div>
<p>
So how do we implement multithreading in jME3?
</p>
<p>
Let&#039;s take the example of a Control that controls an NPC Spatial. The NPC Control has to compute a lengthy pathfinding operation for each NPC. If we would execute the operations directly in the simpleUpdate() loop, it would block the game each time a NPC wants to move from A to B. Even if we move this behaviour into the update() method of a dedicated NPC Control, we would still get annoying freeze frames, because it still runs on the same event loop thread.
</p>
<p>
To avoid slowdown, we decide to keep the pathfinding operations in the NPC Control, <em>but execute it on another thread</em>.
</p>
</div>
<h3><a>Executor</a></h3>
<div>
<p>
You create the executor object in a global AppState (or the initSimpleApp() method), in any case in a high-level place where multiple controls can access it.
</p>
<pre>/* This constructor creates a new executor with a core pool size of 4. */
ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor&#40;4&#41;;</pre>
<p>
Pool size means the executor will keep four threads alive at any time. Having more threads in the pool means that more tasks can run concurrently. But a bigger pool only results in a speed gain if the PC can handle it! Allocating a pool that is uselessly large just wastes memory, so you need to find a good compromise: About the same to double the size of the number of cores in the computer makes sense.
</p>
</div>
<h3><a>Control Class Fields</a></h3>
<div>
<p>
In the NPC Control, we create the individual objects that the thread manipulates. In our example case (the pathfinding control), the task is about locations and path arrays, so we need the following variables:
</p>
<pre>//The vector to store the desired location in:
Vector3f desiredLocation = new Vector3f&#40;&#41;;
//The MyWayList object that contains the result waylist:
MyWayList wayList = null;
//The future that is used to check the execution status:
Future future = null;</pre>
<p>
Here we also created the Future object to track the state of this task.
</p>
</div>
<h3><a>Control Update() Method</a></h3>
<div>
<p>
Next let&#039;s look at the update() call of the Control where the time-intensive task starts. In our example, the task is the <code>findWay</code> Callable (which contains the pathfinding process). So instead of spelling out the pathfinding process in the Control&#039;s update() loop, we start the process via <code>future = executor.submit(findWay);</code>.
</p>
<pre>public void update&#40;float tpf&#41; &#123;
try&#123;
//If we have no waylist and not started a callable yet, do so!
if&#40;wayList == null &amp;&amp; future == null&#41;&#123;
//set the desired location vector, after that we should not modify it anymore
//because its being accessed on the other thread!
desiredLocation.set&#40;getGoodNextLocation&#40;&#41;&#41;;
//start the callable on the executor
future = executor.submit&#40;findWay&#41;; // Thread starts!
&#125;
//If we have started a callable already, we check the status
else if&#40;future != null&#41;&#123;
//Get the waylist when its done
if&#40;future.isDone&#40;&#41;&#41;&#123;
wayList = future.get&#40;&#41;;
future = null;
&#125;
else if&#40;future.isCancelled&#40;&#41;&#41;&#123;
//Set future to null. Maybe we succeed next time...
future = null;
&#125;
&#125;
&#125;
catch&#40;Exception e&#41;&#123;
Exceptions.printStackTrace&#40;e&#41;;
&#125;
if&#40;wayList != null&#41;&#123;
//.... Success! Let's process the wayList and move the NPC...
&#125;
&#125;</pre>
<p>
Note how this logic makes its decision based on the Future object.
</p>
<p>
Remember not to mess with the class fields after starting the thread, because they are being accessed and modified on the new thread. In more obvious terms: You cannot change the “desired location” of the NPC while the path finder is calculating a different path. You have to cancel the current Future first.
</p>
</div>
<h3><a>The Callable</a></h3>
<div>
<p>
The next code sample shows the Callable that is dedicated to performing the long-running task (here, wayfinding). This is the task that used to block the rest of the application, and is now executed on a thread of its own. You implement the task in the Callable always in an inner method named <code>call()</code>.
</p>
<p>
The task code in the Callable should be self-contained! It should not write or read any data of objects that are managed by the scene graph or OpenGL thread directly. Even reading locations of Spatials can be problematic! So ideally all data that is needed for the wayfinding process should be available to the new thread when it starts already, possibly in a cloned version so no concurrent access to the data happens.
</p>
<p>
In reality, you might need access to the game state. If you must read or write a current state from the scene graph, you must have a clone of the data in your thread. There are only two ways:
</p>
<ul>
<li><div> Use the execution queue <code>application.enqueue()</code> to create a sub-thread that clones the info. Only disadvantage is, it may be slower. <br/>
The example below gets the <code>Vector3f location</code> from the scene object <code>mySpatial</code> using this way.</div>
</li>
<li><div> Create a separate World class that allows safe access to its data via synchronized methods to access the scene graph. Alternatively it can also internally use <code>application.enqueue()</code>. <br/>
The following example gets the object <code>Data data = myWorld.getData();</code> using this way.</div>
</li>
</ul>
<p>
These two ways are thread-safe, they don&#039;t mess up the game logic, and keep the Callable code readable.
</p>
<pre>// A self-contained time-intensive task:
private Callable&lt;MyWayList&gt; findWay = new Callable&lt;MyWayList&gt;&#40;&#41;&#123;
public MyWayList call&#40;&#41; throws Exception &#123;
&nbsp;
//Read or write data from the scene graph -- via the execution queue:
Vector3f location = application.enqueue&#40;new Callable&lt;Vector3f&gt;&#40;&#41; &#123;
    public Vector3f call&#40;&#41; throws Exception &#123;
        //we clone the location so we can use the variable safely on our thread
        return mySpatial.getLocalTranslation&#40;&#41;.clone&#40;&#41;;
    &#125;
&#125;&#41;.get&#40;&#41;;
&nbsp;
// This world class allows safe access via synchronized methods
Data data = myWorld.getData&#40;&#41;;
&nbsp;
//... Now process data and find the way ...
&nbsp;
return wayList;
&#125;
&#125;;</pre>
</div>
<h2><a>Conclusion</a></h2>
<div>
<p>
The cool thing about this appraoch is that every entity creates one self-contained Callable for the Executor, and they are all executed in parallel. In theory, you can have one thread per entity without changing anything else but the settings of the executor.
</p>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:multithreading?do=export_xhtmlbody">view online version</a></em></p>

@ -0,0 +1,339 @@
<h1><a>Multiplayer Networking</a></h1>
<div>
<p>
This provides an overview of the new SpiderMonkey <acronym title="Application Programming Interface">API</acronym> and a path for migrating from the old, now deprecated, <acronym title="Application Programming Interface">API</acronym> to the newer version. Much has changed.
</p>
<p>
The <a href="/com/jme3/gde/core/docs/spidermonkey.html">original SpiderMonkey</a> implementation was a good concept and a clever implementation but suffered under the weight of rapid patches and some creeping design deficit. In the end, there were enough small problems, long-term maintenance issues, and limitations that a newer design was warranted.
</p>
<p>
Some things will be very similar but others have changed very much. Hopefully for the better.
</p>
</div>
<h2><a>Overview</a></h2>
<div>
<p>
Most of the new SpiderMonkey <acronym title="Application Programming Interface">API</acronym> now exists as a set of interfaces and helper classes in the &#039;com.jme3.network&#039; package. For most users, this package and the &#039;message&#039; package will be all they need to worry about. The &#039;base&#039; and &#039;kernel&#039; packages only come into play when implementing custom network transports or alternate client/server protocols (<em>which are now possible</em>).
</p>
<p>
Clients and Servers can be created from the factory methods on the Network helper class. Once a Server instance is created and started, it can accept remote connections from Clients. The Client objects represent the client-side of a client→server connection. Within the Server, these are HostedConnections. This is a distinct change from the old <acronym title="Application Programming Interface">API</acronym>.
</p>
<table>
<tr>
<th> Client </th><th> </th><th> Server </th>
</tr>
<tr>
<td> com.jme3.network.Client </td><td> ←→ </td><td> com.jme3.network.HostedConnection </td>
</tr>
</table>
<p>
HostedConnections can hold application defined client-specific session attributes that the server-side listeners and services can use to track player information, etc..
</p>
<p>
MessageListeners can be registered with either the Client or the Server to be notified when new messages arrive. As before, these listeners can be registered to be notified about only specific
types of messages.
</p>
<p>
ClientStateListeners can be registered with a Client to detect changes in connection state.
</p>
<p>
ConnectionListeners can be registered with a Server to be notified about HostedConnection arrivals and removals.
</p>
</div>
<h2><a>What&#039;s Gone?</a></h2>
<div>
<p>
All of &#039;connection&#039;, &#039;events&#039;, &#039;queue&#039;, &#039;service&#039;, &#039;streaming&#039;, and &#039;sync&#039; are now deprecated. The &#039;service&#039;, &#039;streaming&#039;, and &#039;sync&#039; packages were too difficult to easily port to the new <acronym title="Application Programming Interface">API</acronym> and would have required additional code review for thread-related issues. Since the service manager model has _not_ been ported and will likely live on in a different way, it was better to let these go until better solutions evolve. For example, streaming is probably better done more tightly integrated with the core <acronym title="Application Programming Interface">API</acronym> and as actual java.io streams.
</p>
</div>
<h2><a>Migration</a></h2>
<div>
</div>
<h3><a>Package/Class Imports</a></h3>
<div>
<p>
As a first pass, use the following table for conversion and then see specific class notes.
</p>
<table>
<tr>
<th> Old Class </th><th> New Class </th>
</tr>
<tr>
<td>com.jme3.network.connection.Client </td><td> com.jme3.network.Client or com.jme3.network.HostedConnection </td>
</tr>
<tr>
<td>com.jme3.network.connection.Server </td><td> com.jme3.network.Server </td>
</tr>
<tr>
<td>com.jme3.network.event.MessageListener </td><td> com.jme3.network.MessageListener </td>
</tr>
<tr>
<td>com.jme3.network.event.ConnectionListener </td><td> com.jme3.network.ClientStateListener or com.jme3.network.ConnectionListener </td>
</tr>
<tr>
<td>com.jme3.network.event.MessageAdapter </td><td> no equivalent class, implement MessageListener directly </td>
</tr>
<tr>
<td>com.jme3.network.event.ConnectionAdapter </td><td> no equivalent class, implement ClientStateListener or ConnectionListener directly </td>
</tr>
<tr>
<td>com.jme3.network.message.Message </td><td> if used as a reference and not a superclass, com.jme3.network.Message. The base class stays the same for message subclasses. </td>
</tr>
</table>
<p>
Doing all of those changes will certainly break your build… so now let&#039;s fix it.
</p>
</div>
<h3><a>Client and MessageListener</a></h3>
<div>
<p>
This class is the hardest migration to perform. Do not get discouraged.
</p>
<p>
The old version used com.jme3.network.connection.Client for both client side and server side. So, depending on context, these references will either change to com.jme3.network.Client or com.jme3.network.HostedConnection. In the case where calling code is not client or server specific, then there is also the common com.jme3.network.MessageConnection interface.
</p>
<p>
In general, the actual client changes are of one of the following to types:
</p>
<pre> Client client = new Client&#40; host, port &#41;;
&nbsp;
...becomes...
&nbsp;
Client client = Network.connectToServer&#40; host, port &#41;;</pre>
<p>
In the delayed connection case:
</p>
<pre> Client client = new Client&#40;&#41;;
...
client.connect&#40; host, port &#41;;
&nbsp;
...becomes...
&nbsp;
NetworkClient client = Network.createClient&#40;&#41;;
...
client.connectToServer&#40; host, port &#41;;</pre>
<p>
NetworkClient is a Client. The rest of your code can just refer to Client.
</p>
<p>
Those are the easy changes. The trickier ones are related to the MessageListeners.
</p>
</div>
<h4><a>MessageListener</a></h4>
<div>
<p>
By now you&#039;ve figured out that all of your MessageListeners are broken because the new method signature is different. The source of a message is no longer stored with the message and is instead provided to the MessageListener.
</p>
<p>
Depending on whether your MessageListener is being added to the Client or the Server, it will need to refer to either com.jme3.network.Client or com.jme3.network.HostedConnection in its messageReceived(), respectively. The MessageListener interface is generically typed to help make sure the right listener goes where it&#039;s supposed to and so the listener implementations don&#039;t have to cast all the time.
</p>
<pre>// An example client-specific listener
public class MyClientListener implements MessageListener&lt;Client&gt; &#123;
&nbsp;
public void messageReceived&#40; Client source, Message m &#41; &#123;
...do stuff...
&#125;
&#125;
&nbsp;
// And example server-specific listener
public class MyServerListener implements MessageListener&lt;HostedConnection&gt; &#123;
&nbsp;
public void messageReceived&#40; HostedConnection source, Message m &#41; &#123;
...do stuff...
&#125;
&#125;
&nbsp;
// A client or server listener
public class MyGenericListener implements MessageListener&lt;MessageConnection&gt; &#123;
&nbsp;
public void messageReceived&#40; MessageConnection source, Message m &#41; &#123;
... do limited stuff....
&#125;
&#125;</pre>
<p>
Your listeners will fall into one of those three categories.
</p>
<p>
<p><div>Several of the old MessageListener&#039;s methods have gone away. The object-based methods didn&#039;t fit with the new <acronym title="Application Programming Interface">API</acronym> and messageSent() seemed of little utility. It could be resurrected if there is demand.
</div></p>
</p>
</div>
<h4><a>Client method changes</a></h4>
<div>
<p>
Some of the methods on the old Client class have changed or been removed. Here is a basic summary:
</p>
<table>
<tr>
<th> Old Method </th><th> New Method </th>
</tr>
<tr>
<td> Client.disconnect() </td><td> Client.close() or HostedConnection.close(reason) </td>
</tr>
<tr>
<td> Client.kick(reason) </td><td> HostedConnection.close(reason) </td>
</tr>
<tr>
<td> Client.getClientID() </td><td> Client.getId() or HostedConnection.getId() </td>
</tr>
<tr>
<td> Client.get/setPlayerID() </td><td> no equivalent </td>
</tr>
<tr>
<td> Client.get/setLabel() </td><td> no equivalent </td>
</tr>
</table>
</div>
<h4><a>No IOExceptions</a></h4>
<div>
<p>
After you&#039;ve done all of that, the compiler will be complaining about the fact that send(), broadcast(), etc. no longer throw IOException. So remove all of those try/catch blocks.
<p><div>The truth is that even in the old <acronym title="Application Programming Interface">API</acronym>, expecting a real IOException from these methods was unreasonable because often times the message was queued and actually sent later by a separate thread. The new <acronym title="Application Programming Interface">API</acronym> assumes that all underlying transports will operate this way and so forgoes the artificial annoyance or sense of security provided by these &#039;throws&#039; clauses. It also simplifies the calling code a great deal.
</div></p>
</p>
<p>
Only <acronym title="Application Programming Interface">API</acronym> methods that actually perform direct IO (such as the Network.connectToServer() and NetworkClient.connectToServer() methods) will ever be declared to throw IOException.
</p>
</div>
<h3><a>Message.getClient() and Message.getConnection()</a></h3>
<div>
<p>
This is important enough to deserve its own sub-heading because your code <strong>will</strong> break if you use these as they now return null. Any reason for calling them is now provided directly to the MessageListener in the form of the source Client or source HostedConnection.
</p>
</div>
<h3><a>Client ID and Player ID</a></h3>
<div>
<p>
The ID of the Client and HostedConnection are now the same at both ends of a connection and the ID is given out authoritatively by the hosting Server. This removes some of the inconsistency on when to use the old player ID and when to use the old client ID as the new client ID serves both purposes. This leaves the game to be able to define its own player ID based on whatever user criteria it wants.
</p>
<p>
<p><div>Many of the reasons for accessing the client ID on the server can now be taken care of using the session attributes on HostedConnection. It seems like a common use-case for these IDs was to look-up player/client-specific information in a java.util.Map. This information can now be set directly on the HostedConnection.
</div></p>
</p>
</div>
<h3><a>com.jme3.network.event.ConnectionListener</a></h3>
<div>
<p>
Along with the shift from not using the same object at both ends of the client connection was a shift in the interfaces that are notified about those ends.
</p>
<p>
On the client, there is now com.jme3.network.ClientStateListener which is notified when the client fully connects to the server (including any internal handshaking) and when the client is disconnected.
</p>
<p>
On the server, com.jme3.network.ConnectionListener will be notified whenever new HostedConnections are added or removed. This listener isn&#039;t notified until the connection is fully setup (including any internal handshaking).
</p>
<table>
<tr>
<th> Old Method </th><th> New Method </th>
</tr>
<tr>
<td> clientConnected(Client) </td><td> connectionAdded(Server,HostedConnection) </td>
</tr>
<tr>
<td> clientDisconnected(Client) </td><td> connectionRemoved(Server,HostedConnection) </td>
</tr>
</table>
</div>
<h2><a>Why am I doing this again?</a></h2>
<div>
<p>
As you&#039;ve seen above, there are quite a few changes necessary to migrate to the new <acronym title="Application Programming Interface">API</acronym>. You might be asking yourself if it&#039;s worth the trouble.
</p>
<p>
The bottom line is that the old architecture had threading and stability issues that just couldn&#039;t be fixed in any reasonable way. Some were minor, others kind of severe… and they combined to make trouble. If you&#039;ve ever wondered why sometimes your clients connect and then the network connection hangs or stops sending data. Or if you&#039;ve ever wondered why UDP/unreliable messages get corrupted or somehow won&#039;t deserialize properly then you&#039;ve run into some of these issues.
</p>
<p>
Moreover, the lack of thread safety meant that user code sometimes had to do some strange and/or complicated work-arounds. The goal should be that the <acronym title="Application Programming Interface">API</acronym> should just work like it looks like it will with a minimum of hassle.
</p>
<p>
The new architecture is built from the ground up for threading stability and for a clean separation between the public <acronym title="Application Programming Interface">API</acronym>, the message passing layer, and the underlying network transport implementations. You should be able to throw all kinds of stuff at it that would make the old system fall over and it should just hum along.
</p>
<p>
There will certainly be some growing pains as we work the kinks out of the new system but it is already much more stable in even the most basic of stress tests.
</p>
<div><span>
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>,
<a href="/wiki/doku.php/tag:network?do=showtag&amp;tag=tag%3Anetwork">network</a>
</span></div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:networking?do=export_xhtmlbody">view online version</a></em></p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

@ -4,441 +4,65 @@
<p>
Although it is possible to embed a <a href="/com/jme3/gde/core/docs/jme3/advanced/swing_canvas.html">jME3 canvas</a> in a Swing <acronym title="Graphical User Interface">GUI</acronym> app, a 3D game typically runs full-screen, or in a window of its own. This soon raises the question of how to add a user interface: Most games respond to the escape key by displaying buttons that allow users to switch to different screens – for example to view high scores, customize settings, or load saved games.
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/nifty-gui.png">
</p>
<p>
This doc introduces you to <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://nifty-gui.lessvoid.com/"><param name="text" value="<html><u>Nifty GUI</u></html>"><param name="textColor" value="blue"></object>, a Java library for graphical user interfaces (GUIs). Nifty <acronym title="Graphical User Interface">GUI</acronym> (<code>de.lessvoid.nifty</code> package) is well integrated with jME3 via the <code>com.jme3.niftygui</code> package. You define the <acronym title="Graphical User Interface">GUI</acronym> layout in <acronym title="Extensible Markup Language">XML</acronym> and call it from your Java code. All the JAR libraries that you need are already included in your jME3 download, so you do not need to install anything extra (Just make sure they are on the classpath).
Although it is possible to embed a <a href="/com/jme3/gde/core/docs/jme3/advanced/swing_canvas.html">jME3 canvas</a> in a Swing <acronym title="Graphical User Interface">GUI</acronym> app, a 3D game typically runs full-screen, or in a window of its own. This soon raises the question of how to add a user interface: Most games respond to the escape key by displaying buttons that allow users to switch to different screens – for example to view high scores, customize settings, or load saved games.
</p>
<p>
There are three steps needed to add a <acronym title="Graphical User Interface">GUI</acronym> to your jME3 game:
This doc introduces you to <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://nifty-gui.lessvoid.com/"><param name="text" value="<html><u>Nifty GUI</u></html>"><param name="textColor" value="blue"></object>, a Java library for graphical user interfaces (GUIs). Nifty <acronym title="Graphical User Interface">GUI</acronym> (<code>de.lessvoid.nifty</code> package) is well integrated with jME3 via the <code>com.jme3.niftygui</code> package. You define the <acronym title="Graphical User Interface">GUI</acronym> layout in <acronym title="Extensible Markup Language">XML</acronym> and call it from your Java code. All the JAR libraries that you need are already included in your jME3 download, so you do not need to install anything extra (Just make sure they are on the classpath).
</p>
<ol>
<li><div> Lay out the <acronym title="Graphical User Interface">GUI</acronym></div>
<ul>
<li><div> in <acronym title="Extensible Markup Language">XML</acronym>, or</div>
</li>
<li><div> in Java (work in progress)</div>
</li>
</ul>
</li>
<li><div> Integrate the <acronym title="Graphical User Interface">GUI</acronym> into the Game</div>
<ul>
<li><div> Overlay the User Interface Over the Screen, or</div>
</li>
<li><div> Project the User Interface Onto a Texture</div>
</li>
</ul>
</li>
<li><div> Interact with the <acronym title="Graphical User Interface">GUI</acronym> from Java</div>
</li>
</ol>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/nifty-gui.png">
<em>Typically, you lay out the Nifty <acronym title="Graphical User Interface">GUI</acronym> using <acronym title="Extensible Markup Language">XML</acronym>, but using Java will soon be a second option.</em>
</p>
</div>
<h2><a>Sample Code</a></h2>
<div>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/niftygui/TestNiftyGui.java"><param name="text" value="<html><u>TestNiftyGui.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/niftygui/TestNiftyToMesh.java"><param name="text" value="<html><u>TestNiftyToMesh.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>
</div>
<h2><a>Laying out the GUI</a></h2>
<h2><a>Overview</a></h2>
<div>
<p>
Usually, you lay out the <acronym title="Graphical User Interface">GUI</acronym> using <acronym title="Extensible Markup Language">XML</acronym>, but using Java will soon be a second option.
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/nifty-gui-example.png">
</p>
</div>
<h3><a>a) Lay out the GUI in XML</a></h3>
<div>
<p>
There are three steps needed to add a <acronym title="Graphical User Interface">GUI</acronym> to your jME3 game:
Create an empty helloworld.xml file in the <code>assets/Interfaces/</code> directory of your project.
</p>
<p>
You “draw” the <acronym title="Graphical User Interface">GUI</acronym> to the screen by writing <acronym title="Extensible Markup Language">XML</acronym> code.
</p>
<ul>
<li><div> The base element is the screen.</div>
<ul>
<li><div> Name the first screen <code>id=“start”</code>. Name any others whatever you like.</div>
</li>
</ul>
</li>
<li><div> A screen contains one or more layers. </div>
</li>
<li><div> A layer contains elements such as panels, images, text fields.</div>
<ol>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_xml_layout.html">Lay out the GUI in XML</a></div>
</li>
<li><div> Every element has an id to refer to it.</div>
<li><div> Integrate the <acronym title="Graphical User Interface">GUI</acronym> into the Game</div>
<ul>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_overlay.html">Overlay the User Interface Over the Screen</a>, or</div>
</li>
<li><div> Every Screen has a Java class as ScreenController.</div>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_projection.html">Project the User Interface Onto a Texture</a></div>
</li>
</ul>
</div>
<h4><a>How to Use Screens and Layers</a></h4>
<div>
<p>
Here&#039;s a minimal example showing an empty centered layer:
</p>
<pre><span>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span>
<span><span>&lt;nifty&gt;</span></span>
<span>&lt;screen id=&quot;start&quot; controller=&quot;de.lessvoid.nifty.examples.helloworld.HelloWorldStartScreen&quot;&gt;</span>
<span>&lt;layer id=&quot;layer&quot; backgroundColor=&quot;#003f&quot; childLayout=&quot;center&quot;&gt;</span>
&lt;!-- panels and text fields go here --&gt;
<span><span>&lt;/layer&gt;</span></span>
<span><span>&lt;/screen&gt;</span></span>
<span><span>&lt;/nifty&gt;</span></span></pre>
<p>
Into a layer, you add elements (panels, text, images, etc), and specify their properties:
</p>
<p>
<strong>Load a Panel (rectangular colored box)</strong>
</p>
<pre>...
<span>&lt;panel height=&quot;25%&quot; width=&quot;35%&quot; align=&quot;center&quot; valign=&quot;center&quot; backgroundColor=&quot;#f60f&quot;</span>
<span> childLayout=&quot;center&quot; visibleToMouse=&quot;true&quot;&gt;</span>
<span><span>&lt;/panel&gt;</span></span>
...</pre>
<p>
<strong>Load a Piece of Text</strong>
</p>
<pre>...
<span>&lt;text font=&quot;verdana-24-shadow.fnt&quot; text=&quot;Hello World!&quot; align=&quot;center&quot; valign=&quot;center&quot; /&gt;</span>
...</pre>
<p>
or
</p>
<pre>...
<span>&lt;label text=&quot;this is my text&quot; align=&quot;left&quot;/&gt;</span>
...</pre>
<p>
<strong>Load an Image</strong>
</p>
<pre><span>&lt;image filename=&quot;Textures/jme-logo.png&quot; &gt;<span>&lt;/image&gt;</span></span></pre>
<p>
Nifty additionally offers predefined controls – learn more from the NiftyGUI page:
</p>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Layout_Introduction"><param name="text" value="<html><u>http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Layout_Introduction</u></html>"><param name="textColor" value="blue"></object></div>
</li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Elements"><param name="text" value="<html><u>http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Elements</u></html>"><param name="textColor" value="blue"></object></div>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_java_interaction.html">Interact with the GUI from Java</a></div>
</li>
</ul>
</ol>
</div>
<h4><a>How to Add Effects</a></h4>
<h2><a>Sample Code</a></h2>
<div>
<p>
You can register effects to screen elements.
</p>
<ul>
<li><div> Respond to element events such as onStartScreen, onEndScreen, onHover, onFocus, onActive,</div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/niftygui/TestNiftyGui.java"><param name="text" value="<html><u>TestNiftyGui.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
<li><div> Trigger effects that change movement, blending, size, color, fading, and much more.</div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/niftygui/TestNiftyToMesh.java"><param name="text" value="<html><u>TestNiftyToMesh.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>
<p>
Here is an example that moves a panel when the startScreen opens. You place an &lt; effect &gt; tag inside the element that you want to want to be affected.
</p>
<pre>...
<span>&lt;panel height=&quot;25%&quot; width=&quot;35%&quot; ...&gt;</span>
<span><span>&lt;effect&gt;</span></span>
<span>&lt;onStartScreen name=&quot;move&quot; mode=&quot;in&quot; direction=&quot;top&quot; </span>
<span> length=&quot;300&quot; startDelay=&quot;0&quot; inherit=&quot;true&quot;/&gt;</span>
<span><span>&lt;/effect&gt;</span></span>
<span><span>&lt;/panel&gt;</span></span>
...</pre>
<p>
Playing sounds using nifty is also possible with effects as triggers. Remember to first register the sound you&#039;re going to play:
</p>
<pre>...
<span>&lt;registerSound id=&quot;click&quot; filename=&quot;Sounds/Gui/ButtonClick.ogg&quot; /&gt;</span>
...
<span><span>&lt;label&gt;</span></span>
<span><span>&lt;effect&gt;</span></span>
<span>&lt;onClick name=&quot;playSound&quot; sound=&quot;click&quot;/&gt;</span>
<span><span>&lt;/effect&gt;</span></span>
<span><span>&lt;/label&gt;</span></span>
...</pre>
<p>
Learn more from the NiftyGUI page:
</p>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Effects"><param name="text" value="<html><u>http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Effects</u></html>"><param name="textColor" value="blue"></object></div>
<li><div> You can find more sample code in the nifty-examples-1.3-SNAPSHOT.jar file.</div>
</li>
</ul>
</div>
<h3><a>b) Lay out the GUI in Java</a></h3>
<div>
<p>
The Nifty team has started creating a “Builder Pattern” based way to create Nifty GUIs. These classes can be used from within Java to create a Nifty <acronym title="Graphical User Interface">GUI</acronym> without the need for an external <acronym title="Extensible Markup Language">XML</acronym> file. <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://nifty-gui.lessvoid.com/archives/179"><param name="text" value="<html><u>Check the ScreenBuilder out here.</u></html>"><param name="textColor" value="blue"></object>
</p>
</div>
<h2><a>Integrating the GUI into the Game</a></h2>
<div>
<p>
Define a key (for example escape) that switches the <acronym title="Graphical User Interface">GUI</acronym> on and off.
You can either overlay the running game with the <acronym title="Graphical User Interface">GUI</acronym> (you will most likely pause then game then), or even project it as a texture onto a mesh (but that makes clicking difficult).
</p>
</div>
<h3><a>a) Overlaying the User Interface Over the Screen</a></h3>
<div>
<p>
This code shows you how to overlay anything on the screen with the <acronym title="Graphical User Interface">GUI</acronym>. This is the most common usecase.
</p>
<pre>NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay&#40;
assetManager, inputManager, audioRenderer, guiViewPort&#41;;
nifty = niftyDisplay.getNifty&#40;&#41;;
&nbsp;
// init Nifty start screen
nifty.fromXml&#40;&quot;Interface/helloworld.xml&quot;, &quot;start&quot;&#41;;
&nbsp;
// attach the Nifty display to the gui view port as a processor
guiViewPort.addProcessor&#40;niftyDisplay&#41;;
// disable the fly cam
flyCam.setDragToRotate&#40;true&#41;;</pre>
</div>
<h3><a>b) Projecting the User Interface Onto a Texture</a></h3>
<div>
<p>
You can project the Nifty <acronym title="Graphical User Interface">GUI</acronym> onto a texture, load the texture into a material, and assign it to a 3D mesh. Allthough this is possible the approach is rarely used since it is difficult to record clicks this way, you can only interact with this UI by keyboard.
</p>
<pre>/** Create a new viewport for the GUI */
ViewPort niftyView = renderManager.createPreView&#40;&quot;NiftyView&quot;, new Camera&#40;1024, 768&#41;&#41;;
niftyView.setClearEnabled&#40;true&#41;;
&nbsp;
&nbsp;
/** Create a new NiftyJmeDisplay for the integration */
NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay&#40;
assetManager, inputManager, audioRenderer, niftyView&#41;;
&nbsp;
/** Create a new NiftyGUI object and read your XML */
Nifty nifty = niftyDisplay.getNifty&#40;&#41;;
nifty.fromXml&#40;&quot;Interface/helloworld.xml&quot;, &quot;start&quot;&#41;;
&nbsp;
/** We prepare a framebuffer for the texture niftytex */
niftyView.addProcessor&#40;niftyDisplay&#41;;
FrameBuffer fb = new FrameBuffer&#40;1024, 768, 0&#41;;
fb.setDepthBuffer&#40;Format.Depth&#41;;
Texture2D niftytex = new Texture2D&#40;1024, 768, Format.RGB8&#41;;
fb.setColorTexture&#40;niftytex&#41;;
niftyView.setClearEnabled&#40;true&#41;;
niftyView.setOutputFrameBuffer&#40;fb&#41;;
&nbsp;
/** This is the 3D cube we project the GUI on */
Box&#40;Vector3f.ZERO, 1, 1, 1&#41;;
Geometry geom = new Geometry&#40;&quot;Box&quot;, b&#41;;
Material mat = new Material&#40;assetManager, &quot;Common/MatDefs/Misc/SimpleTextured.j3md&quot;&#41;;
mat.setTexture&#40;&quot;m_ColorMap&quot;, niftytex&#41;; /** Here comes the texture! */
geom.setMaterial&#40;mat&#41;;
rootNode.attachChild&#40;geom&#41;;</pre>
<p>
You select buttons on this <acronym title="Graphical User Interface">GUI</acronym> with the arrow keys and then press return – Clicking them will not work.
</p>
<p>
Again, check the <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Main_Page"><param name="text" value="<html><u>Nifty GUI wiki</u></html>"><param name="textColor" value="blue"></object> to get all the “bells and whistles”!
</p>
</div>
<h2><a>Interacting with the GUI from Java</a></h2>
<div>
<p>
The main purpose of the <acronym title="Graphical User Interface">GUI</acronym> is to send events back to your Java class that indicate what the users clicked, which settings they chose, which values they entered into a field, etc. In the Java class, you want to respond with an appropriate action, or store the entered settings in a file, etc.
</p>
</div>
<h3><a>Connect GUI to Java Controller</a></h3>
<div>
<p>
How does the <acronym title="Extensible Markup Language">XML</acronym> file send a message back to your Java application? You register a ScreenController (a Java class) to every NiftyGUI screen.
</p>
<p>
Create a ScreenController by creating a Java class that implements the <code>de.lessvoid.nifty.screen.ScreenController</code> interface and its abtract methods.
</p>
<pre>package my.game;
import de.lessvoid.nifty.Nifty;
import de.lessvoid.nifty.screen.Screen;
import de.lessvoid.nifty.screen.ScreenController;
&nbsp;
public class MySettingsScreen implements ScreenController &#123;
&nbsp;
public void bind&#40;Nifty nifty, Screen screen&#41; &#123; &#125;
&nbsp;
public void onStartScreen&#40;&#41; &#123; &#125;
&nbsp;
public void onEndScreen&#40;&#41; &#123; &#125;
&#125;</pre>
<p>
The name and package of your custom ScreenController class (here <code>my.game.MySettingsScreen</code>) goes into the controller parameter of the respective screen it belongs to:
</p>
<pre><span><span>&lt;nifty&gt;</span></span>
<span>&lt;screen id=&quot;settings&quot; controller=&quot;my.game.MySettingsScreen&quot;&gt;</span>
&lt;!-- panel code ... --&gt;
<span><span>&lt;/screen&gt;</span></span>
<span><span>&lt;/nifty&gt;</span></span></pre>
<p>
Now the Java class <code>my.game.MySettingsScreen</code> and this <acronym title="Graphical User Interface">GUI</acronym> screen (<code>settings</code>) are connected.
</p>
</div>
<h3><a>Make GUI and Java Interact</a></h3>
<div>
<p>
You can use any of the three following approaches to interact, and you can also combine them, depending on what you want to do.
</p>
</div>
<h4><a>a) GUI Calls a Void Java Method</a></h4>
<div>
<p>
To respond to an interaction, add the &lt;interact /&gt; element to a panel and specify the Java method you want to call. In this example, we want to call <code>sayHello()</code> when a panel on the screen is clicked.
</p>
<pre>...
<span>&lt;panel id=&quot;panel&quot; height=&quot;25%&quot; width=&quot;35%&quot; align=&quot;center&quot; valign=&quot;center&quot; </span>
<span> backgroundColor=&quot;#f60f&quot; childLayout=&quot;center&quot; visibleToMouse=&quot;true&quot;&gt;</span>
<span>&lt;text id=&quot;text&quot; font=&quot;aurulent-sans-17.fnt&quot; color=&quot;#000f&quot; </span>
<span> text=&quot;Hello World!&quot; align=&quot;center&quot; valign=&quot;center&quot; /&gt;</span>
<span>&lt;interact onClick=&quot;sayHello(hi)&quot;/&gt;</span>
<span><span>&lt;/panel&gt;</span></span>
...</pre>
<p>
Back in this screen&#039;s Java class, we specify what the <code>sayHello()</code> method does. As you see, you can include String arguments in the call.
</p>
<pre>public class MySettingsScreen implements ScreenController &#123;
...
public void sayHello&#40;String myarg&#41; &#123;
System.out.println&#40;&quot;Nifty says &quot;+myarg&#41;;
&#125;
&nbsp;
public String callThis&#40;&#41; &#123;
return &quot;my friend&quot;;
&#125;
&#125;</pre>
</div>
<h4><a>b) GUI Gets Return Value from Java Method</a></h4>
<div>
<p>
To send a message from Java to Nifty, Nifty uses <code>${CALL.callThis()}</code> to get the return value of a custom <code>callThis()</code> method from your Java class.
</p>
<pre>...
<span>&lt;panel id=&quot;panel&quot; height=&quot;25%&quot; width=&quot;35%&quot; align=&quot;center&quot; valign=&quot;center&quot; </span>
<span> backgroundColor=&quot;#f60f&quot; childLayout=&quot;center&quot; visibleToMouse=&quot;true&quot;&gt;</span>
<span>&lt;text id=&quot;text&quot; font=&quot;aurulent-sans-17.fnt&quot; color=&quot;#000f&quot; </span>
<span> text=&quot;Hello World, ${CALL.callThis()}!&quot; align=&quot;center&quot; valign=&quot;center&quot; /&gt;</span>
<span>&lt;interact onClick=&quot;sayHello(hi)&quot;/&gt;</span>
<span><span>&lt;/panel&gt;</span></span>
...</pre>
<p>
The Java class callThis() in MySettingsScreen defines the Text that is displayed in the textfield after the words <code>Hello World, …!</code>
</p>
</div>
<h4><a>c) Java Modifies Nifty Elements and Events</a></h4>
<div>
<p>
You can also alter the appearance and functions of your nifty elements from Java.
</p>
<p>
Here&#039;s an example of how to change an image:
</p>
<pre>NiftyImage img = nifty.getRenderEngine&#40;&#41;.createImage&#40;&quot;Interface/Images/image.png&quot;, false&#41;;
Element niftyElement = nifty.getCurrentScreen&#40;&#41;.findElementByName&#40;&quot;myElement&quot;&#41;;
niftyElement.getRenderer&#40;ImageRenderer.class&#41;.setImage&#40;img&#41;;</pre>
<p>
To change the onClick() event of an element:
</p>
<pre>Element niftyElement = nifty.getCurrentScreen&#40;&#41;.findElementByName&#40;&quot;myElement&quot;&#41;;
niftyElement.setInteraction&#40;new ElementInteraction&#40;nifty&#41; &#123;
&nbsp;
@Override
public void onClick&#40;&#41; &#123;
// call java functions normally.
niftyController.onElementClicked&#40;&#41;;
super.onClick&#40;&#41;;
&#125;
&nbsp;
@Override
public boolean onClick&#40;MouseInputEvent inputEvent&#41; &#123;
niftyController.onElementClicked&#40;&#41;;
return super.onClick&#40;inputEvent&#41;;
&#125;
&#125;&#41;;</pre>
<p>
For this to work, there already needs to be an &lt; interact &gt; tag inside your xml element:
</p>
<pre>&lt;interact onClick=&quot;doNothing()&quot;/&gt;</pre>
<p>
Learn more: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=MarkUp"><param name="text" value="<html><u>Nifty Syntax</u></html>"><param name="textColor" value="blue"></object>
</p>
</div>
<h2><a>Pro Tip: Use XML Schema</a></h2>
<div>
@ -452,7 +76,7 @@ If you include the following <acronym title="Extensible Markup Language">XML</ac
<span> xsi:schemaLocation=&quot;http://nifty-gui.sourceforge.net/nifty.xsd
http://nifty-gui.sourceforge.net/nifty.xsd&quot;&gt;</span>
&nbsp;
&lt;!-- Example: The IDE will tell you that 1 &lt;screen&gt;&lt;/screen&gt; element is expected here --&gt;
&lt;!-- Example: The IDE will now tell you that one &lt;screen&gt;&lt;/screen&gt; element is expected here, etc. --&gt;
&nbsp;
<span><span>&lt;/nifty&gt;</span></span></pre>
</div>
@ -476,6 +100,11 @@ Learn more from the NiftyGUI page!
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.org/groups/gui/forum/topic/anyone-succeeded-in-changing-text-in-nifty-programatically/#post-109510"><param name="text" value="<html><u>Changing the Text in Nifty GUIs programmatically</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>
<div><span>
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>,
<a href="/wiki/doku.php/tag:gui?do=showtag&amp;tag=tag%3Agui">gui</a>,
<a href="/wiki/doku.php/tag:input?do=showtag&amp;tag=tag%3Ainput">input</a>
</span></div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:nifty_gui?do=export_xhtmlbody">view online version</a></em></p>

@ -0,0 +1,184 @@
<h1><a>Interacting with the GUI from Java</a></h1>
<div>
<ol>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_xml_layout.html">Nifty GUI XML Layout</a> </div>
</li>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_overlay.html">Nifty GUI Overlay</a> or <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_projection.html">Nifty GUI Projection</a></div>
</li>
<li><div> <strong>Nifty <acronym title="Graphical User Interface">GUI</acronym> Java Interaction</strong></div>
</li>
</ol>
<p>
The main purpose of the <acronym title="Graphical User Interface">GUI</acronym> is to send events back to your Java class that indicate what the users clicked, which settings they chose, which values they entered into a field, etc. In the Java class, you want to respond with an appropriate action, or store the entered settings in a file, etc.
</p>
</div>
<h2><a>Connect GUI to Java Controller</a></h2>
<div>
<p>
How does the <acronym title="Extensible Markup Language">XML</acronym> file send a message back to your Java application? You register a ScreenController (a Java class) to every NiftyGUI screen.
</p>
<p>
Create a ScreenController by creating a Java class that implements the <code>de.lessvoid.nifty.screen.ScreenController</code> interface and its abtract methods.
</p>
<pre>package my.game;
import de.lessvoid.nifty.Nifty;
import de.lessvoid.nifty.screen.Screen;
import de.lessvoid.nifty.screen.ScreenController;
&nbsp;
public class MySettingsScreen implements ScreenController &#123;
&nbsp;
public void bind&#40;Nifty nifty, Screen screen&#41; &#123; &#125;
&nbsp;
public void onStartScreen&#40;&#41; &#123; &#125;
&nbsp;
public void onEndScreen&#40;&#41; &#123; &#125;
&#125;</pre>
<p>
The name and package of your custom ScreenController class (here <code>my.game.MySettingsScreen</code>) goes into the controller parameter of the respective screen it belongs to:
</p>
<pre><span><span>&lt;nifty&gt;</span></span>
<span>&lt;screen id=&quot;settings&quot; controller=&quot;my.game.MySettingsScreen&quot;&gt;</span>
&lt;!-- layer and panel code ... --&gt;
<span><span>&lt;/screen&gt;</span></span>
<span><span>&lt;/nifty&gt;</span></span></pre>
<p>
Now the Java class <code>my.game.MySettingsScreen</code> and this <acronym title="Graphical User Interface">GUI</acronym> screen (<code>settings</code>) are connected.
</p>
</div>
<h2><a>Make GUI and Java Interact</a></h2>
<div>
<p>
You can use any of the three following approaches to interact, and you can also combine them, depending on what you want to do.
</p>
</div>
<h3><a>GUI Calls a Void Java Method</a></h3>
<div>
<p>
To respond to an interaction, add the &lt;interact /&gt; element to a panel and specify the Java method you want to call. In this example, we want to call <code>sayHello()</code> when a panel on the screen is clicked.
</p>
<pre>...
<span>&lt;panel id=&quot;panel&quot; height=&quot;25%&quot; width=&quot;35%&quot; align=&quot;center&quot; valign=&quot;center&quot; </span>
<span> backgroundColor=&quot;#f60f&quot; childLayout=&quot;center&quot; visibleToMouse=&quot;true&quot;&gt;</span>
<span>&lt;text id=&quot;text&quot; font=&quot;aurulent-sans-17.fnt&quot; color=&quot;#000f&quot; </span>
<span> text=&quot;Hello World!&quot; align=&quot;center&quot; valign=&quot;center&quot; /&gt;</span>
<span>&lt;interact onClick=&quot;sayHello(hi)&quot;/&gt;</span>
<span><span>&lt;/panel&gt;</span></span>
...</pre>
<p>
Back in this screen&#039;s Java class, we specify what the <code>sayHello()</code> method does. As you see, you can include String arguments in the call.
</p>
<pre>public class MySettingsScreen implements ScreenController &#123;
...
public void sayHello&#40;String myarg&#41; &#123;
System.out.println&#40;&quot;Nifty says &quot;+myarg&#41;;
&#125;
&#125;</pre>
</div>
<h3><a>GUI Gets Return Value from Java Method</a></h3>
<div>
<p>
You can send a message from Java to Nifty. In this example, the Java class <code>callThis()</code> in MySettingsScreen defines the Text that is displayed in the textfield after the words <code>Hello World, …!</code>
</p>
<p>
First define a Java method in the screen controller, in this example, <code>callThis()</code>.
</p>
<pre>public class MySettingsScreen implements ScreenController &#123;
...
public String callThis&#40;&#41; &#123;
return &quot;my friend&quot;;
&#125;
&#125;</pre>
<p>
Nifty uses <code>${CALL.callThis()}</code> to get the return value of a method from your ScreenController Java class.
</p>
<pre>...
<span>&lt;panel id=&quot;panel&quot; height=&quot;25%&quot; width=&quot;35%&quot; align=&quot;center&quot; valign=&quot;center&quot; </span>
<span> backgroundColor=&quot;#f60f&quot; childLayout=&quot;center&quot; visibleToMouse=&quot;true&quot;&gt;</span>
<span>&lt;text id=&quot;text&quot; font=&quot;aurulent-sans-17.fnt&quot; color=&quot;#000f&quot; </span>
<span> text=&quot;Hello World, ${CALL.callThis()}!&quot; align=&quot;center&quot; valign=&quot;center&quot; /&gt;</span>
<span>&lt;interact onClick=&quot;sayHello(hi)&quot;/&gt;</span>
<span><span>&lt;/panel&gt;</span></span>
...</pre>
<p>
You can also use this for Strings and numeric values, e.g. when you read settings from a file, you read them like this.
</p>
</div>
<h3><a>Java Modifies Nifty Elements and Events</a></h3>
<div>
<p>
You can also alter the appearance and functions of your nifty elements from Java.
</p>
<p>
Here&#039;s an example of how to change the image <code>myElement</code>:
</p>
<pre>NiftyImage img = nifty.getRenderEngine&#40;&#41;.createImage&#40;&quot;Interface/Images/image.png&quot;, false&#41;;
Element niftyElement = nifty.getCurrentScreen&#40;&#41;.findElementByName&#40;&quot;myElement&quot;&#41;;
niftyElement.getRenderer&#40;ImageRenderer.class&#41;.setImage&#40;img&#41;;</pre>
<p>
The same is valid for other elements, for example text fields:
</p>
<pre>niftyElement.getRenderer&#40;TextRenderer.class&#41;.setText&#40;&quot;New text&quot;&#41;;</pre>
<p>
Similarly, to change the onClick() event of an element, create an <code>ElementInteraction</code> object:
</p>
<pre>Element niftyElement = nifty.getCurrentScreen&#40;&#41;.findElementByName&#40;&quot;myElement&quot;&#41;;
niftyElement.setInteraction&#40;new ElementInteraction&#40;nifty&#41; &#123;
&nbsp;
@Override
public void onClick&#40;&#41; &#123;
// call java functions normally.
niftyController.onElementClicked&#40;&#41;;
super.onClick&#40;&#41;;
&#125;
&nbsp;
@Override
public boolean onClick&#40;MouseInputEvent inputEvent&#41; &#123;
niftyController.onElementClicked&#40;&#41;;
return super.onClick&#40;inputEvent&#41;;
&#125;
&#125;&#41;;</pre>
<p>
For this to work, there already needs to be an &lt; interact &gt; tag inside your xml element:
</p>
<pre>&lt;interact onClick=&quot;doNothing()&quot;/&gt;</pre>
<p>
Learn more: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=MarkUp"><param name="text" value="<html><u>Nifty Syntax</u></html>"><param name="textColor" value="blue"></object>
</p>
<div><span>
<a href="/wiki/doku.php/tag:gui?do=showtag&amp;tag=tag%3Agui">gui</a>,
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>,
<a href="/wiki/doku.php/tag:input?do=showtag&amp;tag=tag%3Ainput">input</a>,
<a href="/wiki/doku.php/tag:controller?do=showtag&amp;tag=tag%3Acontroller">controller</a>,
<a href="/wiki/doku.php/tag:controllers?do=showtag&amp;tag=tag%3Acontrollers">controllers</a>
</span></div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:nifty_gui_java_interaction?do=export_xhtmlbody">view online version</a></em></p>

@ -0,0 +1,69 @@
<h1><a>Integrating Nifty GUI: Overlay</a></h1>
<div>
<ol>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_xml_layout.html">Nifty GUI XML Layout</a> </div>
</li>
<li><div> <strong>Nifty <acronym title="Graphical User Interface">GUI</acronym> Overlay</strong> or <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_projection.html">Nifty GUI Projection</a></div>
</li>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_java_interaction.html">Interact with the GUI from Java</a></div>
</li>
</ol>
<p>
Define a key (for example escape) that switches the <acronym title="Graphical User Interface">GUI</acronym> on and off.
You can either overlay the running game with the <acronym title="Graphical User Interface">GUI</acronym> (you will most likely pause the game then), or even <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_projection.html">project</a> it as a texture onto a mesh texture (but then you cannot click to select).
</p>
<p>
On this page, we look at the overlay variant (more commonly used).
</p>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/nifty-gui-example.png">
</p>
</div>
<h2><a>Sample Code</a></h2>
<div>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/niftygui/TestNiftyGui.java"><param name="text" value="<html><u>TestNiftyGui.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>
</div>
<h2><a>Overlaying the User Interface Over the Screen</a></h2>
<div>
<p>
This code shows you how to overlay anything on the screen with the <acronym title="Graphical User Interface">GUI</acronym>. This is the most common usecase.
</p>
<pre>NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay&#40;
assetManager, inputManager, audioRenderer, guiViewPort&#41;;
Nifty nifty = niftyDisplay.getNifty&#40;&#41;;
&nbsp;
// init Nifty start screen
nifty.fromXml&#40;&quot;Interface/helloworld.xml&quot;, &quot;start&quot;&#41;;
&nbsp;
// attach the Nifty display to the gui view port as a processor
guiViewPort.addProcessor&#40;niftyDisplay&#41;;
// disable the fly cam
flyCam.setDragToRotate&#40;true&#41;;</pre><hr />
<ol>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_xml_layout.html">Nifty GUI XML Layout</a> </div>
</li>
<li><div> <strong>Nifty <acronym title="Graphical User Interface">GUI</acronym> Overlay</strong> or <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_projection.html">Nifty GUI Projection</a></div>
</li>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_java_interaction.html">Interact with the GUI from Java</a></div>
</li>
</ol>
<div><span>
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>,
<a href="/wiki/doku.php/tag:gui?do=showtag&amp;tag=tag%3Agui">gui</a>
</span></div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:nifty_gui_overlay?do=export_xhtmlbody">view online version</a></em></p>

@ -0,0 +1,96 @@
<h1><a>Integrating Nifty GUI: Projection</a></h1>
<div>
<ol>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_xml_layout.html">Nifty GUI XML Layout</a> </div>
</li>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_overlay.html">Nifty GUI Overlay</a> or <strong>Nifty <acronym title="Graphical User Interface">GUI</acronym> Projection</strong></div>
</li>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_java_interaction.html">Interact with the GUI from Java</a></div>
</li>
</ol>
<p>
Define a key (for example escape) that switches the <acronym title="Graphical User Interface">GUI</acronym> on and off. You can either <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_overlay.html">overlay</a> the running game with the <acronym title="Graphical User Interface">GUI</acronym> (you will most likely pause the game then), or even project it as a texture onto a mesh textures (but then you cannot click to select).
</p>
<p>
On this page, we look at the projection variant (less commonly used).
</p>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/nifty-gui.png">
</p>
</div>
<h2><a>Sample Code</a></h2>
<div>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/niftygui/TestNiftyToMesh.java"><param name="text" value="<html><u>TestNiftyToMesh.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>
</div>
<h2><a>Projecting the User Interface Onto a Texture</a></h2>
<div>
<p>
You can project the Nifty <acronym title="Graphical User Interface">GUI</acronym> onto a texture, load the texture into a material, and assign it to a 3D mesh. Allthough this is possible the approach is rarely used since it is difficult to record clicks this way, you can only interact with this UI by keyboard.
</p>
<pre>/** Create a new viewport for the GUI */
ViewPort niftyView = renderManager.createPreView&#40;&quot;NiftyView&quot;, new Camera&#40;1024, 768&#41;&#41;;
niftyView.setClearEnabled&#40;true&#41;;
&nbsp;
&nbsp;
/** Create a new NiftyJmeDisplay for the integration */
NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay&#40;
assetManager, inputManager, audioRenderer, niftyView&#41;;
&nbsp;
/** Create a new NiftyGUI object and read your XML */
Nifty nifty = niftyDisplay.getNifty&#40;&#41;;
nifty.fromXml&#40;&quot;Interface/helloworld.xml&quot;, &quot;start&quot;&#41;;
&nbsp;
/** We prepare a framebuffer for the texture niftytex */
niftyView.addProcessor&#40;niftyDisplay&#41;;
FrameBuffer fb = new FrameBuffer&#40;1024, 768, 0&#41;;
fb.setDepthBuffer&#40;Format.Depth&#41;;
Texture2D niftytex = new Texture2D&#40;1024, 768, Format.RGB8&#41;;
fb.setColorTexture&#40;niftytex&#41;;
niftyView.setClearEnabled&#40;true&#41;;
niftyView.setOutputFrameBuffer&#40;fb&#41;;
&nbsp;
/** This is the 3D cube we project the GUI on */
Box&#40;Vector3f.ZERO, 1, 1, 1&#41;;
Geometry geom = new Geometry&#40;&quot;Box&quot;, b&#41;;
Material mat = new Material&#40;assetManager, &quot;Common/MatDefs/Misc/SimpleTextured.j3md&quot;&#41;;
mat.setTexture&#40;&quot;m_ColorMap&quot;, niftytex&#41;; /** Here comes the texture! */
geom.setMaterial&#40;mat&#41;;
rootNode.attachChild&#40;geom&#41;;</pre>
<p>
You select buttons on this <acronym title="Graphical User Interface">GUI</acronym> with the arrow keys and then press return – Clicking them will not work.
</p>
<p>
Again, check the <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Main_Page"><param name="text" value="<html><u>Nifty GUI wiki</u></html>"><param name="textColor" value="blue"></object> to get all the “bells and whistles”!
</p>
<hr />
<ol>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_xml_layout.html">Nifty GUI XML Layout</a> </div>
</li>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_overlay.html">Nifty GUI Overlay</a> or <strong>Nifty <acronym title="Graphical User Interface">GUI</acronym> Projection</strong></div>
</li>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_java_interaction.html">Interact with the GUI from Java</a></div>
</li>
</ol>
<div><span>
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>,
<a href="/wiki/doku.php/tag:gui?do=showtag&amp;tag=tag%3Agui">gui</a>,
<a href="/wiki/doku.php/tag:texture?do=showtag&amp;tag=tag%3Atexture">texture</a>
</span></div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:nifty_gui_projection?do=export_xhtmlbody">view online version</a></em></p>

@ -0,0 +1,193 @@
<h1><a>Laying out the GUI in XML</a></h1>
<div>
<ol>
<li><div> <strong>Nifty <acronym title="Graphical User Interface">GUI</acronym> <acronym title="Extensible Markup Language">XML</acronym> Layout</strong></div>
</li>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_overlay.html">Nifty GUI Overlay</a> or <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_projection.html">Nifty GUI Projection</a></div>
</li>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_java_interaction.html">Interact with the GUI from Java</a></div>
</li>
</ol>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/nifty-screen-layer-panel.png">
</p>
<p>
You “draw” the <acronym title="Graphical User Interface">GUI</acronym> to the screen by writing <acronym title="Extensible Markup Language">XML</acronym> code. We will be referring to the following elements:
</p>
<ul>
<li><div> Every Nifty Gui is made up of screens.</div>
<ul>
<li><div> Nifty can display only one screen at a time.</div>
</li>
<li><div> You must name the first screen <code>id=“start”</code>. Name any others whatever you like.</div>
</li>
<li><div> Every screen is <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_java_interaction.html">controlled by a Java class</a>.</div>
</li>
</ul>
</li>
<li><div> A screen contains one or more layers. </div>
<ul>
<li><div> Layers are containers that impose an alignment on their content (vertical, horizontal, centered)</div>
</li>
<li><div> Layers can overlap (z-order), but cannot be nested.</div>
</li>
<li><div> Layers are usually transparent (but can be opaque).</div>
</li>
</ul>
</li>
<li><div> A layer contains panels.</div>
<ul>
<li><div> Panels are containers that impose an alignment on their content (vertical, horizontal, centered)</div>
</li>
<li><div> Panels can be nested, but not overlap.</div>
</li>
<li><div> Panels are usually opaque (but can be transparent). ?</div>
</li>
</ul>
</li>
<li><div> A panel can contain images, text fields, buttons, controls.</div>
</li>
<li><div> Every element has an id to refer to it.</div>
</li>
</ul>
</div>
<h2><a>How to Use Screens and Layers</a></h2>
<div>
<p>
Create an empty helloworld.xml file in the <code>assets/Interfaces/</code> directory of your project.
</p>
<p>
Here&#039;s a minimal example showing an empty centered layer on the start screen:
</p>
<pre><span>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span>
<span>&lt;nifty xmlns=&quot;http://nifty-gui.sourceforge.net/nifty.xsd&quot; </span>
<span> xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; </span>
<span> xsi:schemaLocation=&quot;http://nifty-gui.sourceforge.net/nifty.xsd
http://nifty-gui.sourceforge.net/nifty.xsd&quot;&gt;</span>
&nbsp;
<span>&lt;screen id=&quot;start&quot; controller=&quot;de.lessvoid.nifty.examples.helloworld.HelloWorldStartScreen&quot;&gt;</span>
<span>&lt;layer id=&quot;layer1&quot; backgroundColor=&quot;#003f&quot; childLayout=&quot;center&quot;&gt;</span>
&lt;!-- ... panels go here... --&gt;
<span><span>&lt;/layer&gt;</span></span>
<span><span>&lt;/screen&gt;</span></span>
&nbsp;
<span><span>&lt;/nifty&gt;</span></span></pre>
<p>
Into a layer, you add panels (text, images, etc), and specify their properties:
</p>
</div>
<h3><a>Panel</a></h3>
<div>
<p>
A panels looks like a rectangular colored box.
</p>
<pre>...
<span>&lt;panel height=&quot;25%&quot; width=&quot;35%&quot; align=&quot;center&quot; valign=&quot;center&quot; backgroundColor=&quot;#f60f&quot;</span>
<span> childLayout=&quot;center&quot; visibleToMouse=&quot;true&quot;&gt;</span>
<span><span>&lt;/panel&gt;</span></span>
...</pre>
</div>
<h3><a>Text</a></h3>
<div>
<pre>...
<span>&lt;text font=&quot;verdana-24-shadow.fnt&quot; text=&quot;Hello World!&quot; align=&quot;center&quot; valign=&quot;center&quot; /&gt;</span>
...</pre>
<p>
or
</p>
<pre>...
<span>&lt;label text=&quot;this is my text&quot; align=&quot;left&quot;/&gt;</span>
...</pre>
</div>
<h3><a>Image</a></h3>
<div>
<pre><span>&lt;image filename=&quot;Textures/jme-logo.png&quot; &gt;<span>&lt;/image&gt;</span></span></pre>
<p>
Nifty additionally offers predefined controls – learn more from the NiftyGUI page:
</p>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Layout_Introduction"><param name="text" value="<html><u>http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Layout_Introduction</u></html>"><param name="textColor" value="blue"></object></div>
</li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Elements"><param name="text" value="<html><u>http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Elements</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>
</div>
<h2><a>Effects</a></h2>
<div>
<p>
You can register effects to screen elements.
</p>
<ul>
<li><div> Respond to element events such as onStartScreen, onEndScreen, onHover, onFocus, onActive,</div>
</li>
<li><div> Trigger effects that change movement, blending, size, color, fading, and much more.</div>
</li>
</ul>
<p>
Here is an example that moves a panel when the startScreen opens. You place an &lt; effect &gt; tag inside the element that you want to want to be affected.
</p>
<pre>...
<span>&lt;panel height=&quot;25%&quot; width=&quot;35%&quot; ...&gt;</span>
<span><span>&lt;effect&gt;</span></span>
<span>&lt;onStartScreen name=&quot;move&quot; mode=&quot;in&quot; direction=&quot;top&quot; </span>
<span> length=&quot;300&quot; startDelay=&quot;0&quot; inherit=&quot;true&quot;/&gt;</span>
<span><span>&lt;/effect&gt;</span></span>
<span><span>&lt;/panel&gt;</span></span>
...</pre>
<p>
Playing sounds using nifty is also possible with effects as triggers. Remember to first register the sound you&#039;re going to play:
</p>
<pre>...
<span>&lt;registerSound id=&quot;click&quot; filename=&quot;Sounds/Gui/ButtonClick.ogg&quot; /&gt;</span>
...
<span><span>&lt;label&gt;</span></span>
<span><span>&lt;effect&gt;</span></span>
<span>&lt;onClick name=&quot;playSound&quot; sound=&quot;click&quot;/&gt;</span>
<span><span>&lt;/effect&gt;</span></span>
<span><span>&lt;/label&gt;</span></span>
...</pre>
<p>
Learn more from the NiftyGUI page:
</p>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Effects"><param name="text" value="<html><u>http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Effects</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>
<hr />
<ol>
<li><div> <strong>Nifty <acronym title="Graphical User Interface">GUI</acronym> <acronym title="Extensible Markup Language">XML</acronym> Layout</strong></div>
</li>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_overlay.html">Nifty GUI Overlay</a> or <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_projection.html">Nifty GUI Projection</a></div>
</li>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_java_interaction.html">Interact with the GUI from Java</a></div>
</li>
</ol>
<div><span>
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>,
<a href="/wiki/doku.php/tag:gui?do=showtag&amp;tag=tag%3Agui">gui</a>
</span></div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:nifty_gui_xml_layout?do=export_xhtmlbody">view online version</a></em></p>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 KiB

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 KiB

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 14 KiB

@ -5,7 +5,10 @@
<p>
The jMonkeyEngine3 has built-in support for <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jbullet.advel.cz"><param name="text" value="<html><u>jBullet physics</u></html>"><param name="textColor" value="blue"></object> via the <code>com.jme3.bullet</code> package.
Game Physics are used in applications that simulate mass/gravity, collisions, and friction. Think of pool billiard or car racing simulations.
</p>
<p>
If you are looking for info on how to respond to physics events, read about <a href="/com/jme3/gde/core/docs/jme3/advanced/physics_listeners.html">Physics Listeners</a>.
</p>
</div>
@ -52,13 +55,13 @@ Full code samples are here:
</p>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/bullet/TestBrickWall.java"><param name="text" value="<html><u>TestBrickWall.java</u></html>"><param name="textColor" value="blue"></object></div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet/TestBrickWall.java"><param name="text" value="<html><u>TestBrickWall.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/bullet/TestQ3.java"><param name="text" value="<html><u>TestQ3.java</u></html>"><param name="textColor" value="blue"></object></div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet/TestQ3.java"><param name="text" value="<html><u>TestQ3.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/bullet/TestSimplePhysics.java"><param name="text" value="<html><u>TestSimplePhysics.java</u></html>"><param name="textColor" value="blue"></object></div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet/TestSimplePhysics.java"><param name="text" value="<html><u>TestSimplePhysics.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/bullet/TestWalkingChar.java"><param name="text" value="<html><u>TestWalkingChar.java</u></html>"><param name="textColor" value="blue"></object></div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet/TestWalkingChar.java"><param name="text" value="<html><u>TestWalkingChar.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>
@ -540,104 +543,15 @@ Physics also supports the following features:
</div>
<h2><a>Responding to a PhysicsCollisionEvent</a></h2>
<div>
<p>
If you do not implement the PhysicsCollisionListener interface, a collisions will just mean that forces are applied automatically. If you just want “Balls rolling, bricks falling” you do not need a listener.
</p>
<p>
If you want to respond to a collision event with a custom action however, then you need to implement the PhysicsCollisionListener interface. Typical actions triggered by collisions include:
</p>
<ul>
<li><div> increasing a counter (score points)</div>
</li>
<li><div> decreasing a counter (health points)</div>
</li>
<li><div> triggering an effect (explosion)</div>
</li>
<li><div> playing a sound (explosion, ouch) </div>
</li>
<li><div> … and countless more</div>
</li>
</ul>
</div>
<h3><a>Overriding the Collision() Method</a></h3>
<div>
<p>
To respond to the PhysicsCollisionEvent you have to override the <code>collision()</code> method. This gives you access to the event object. Mostly you will be interested in the identity of any two nodes that collided: <code>event.getNodeA()</code> and <code>event.getNodeB()</code>.
</p>
<p>
After you identify the colliding nodes, specify the action to trigger when this pair collides. Note that you cannot know which one will be Node A or Node B, you have to deal with either variant.
</p>
<pre> public void collision&#40;PhysicsCollisionEvent event&#41; &#123;
if &#40; event.getNodeA&#40;&#41;.getName&#40;&#41;.equals&#40;&quot;player&quot;&#41; &#41; &#123;
final Node node = event.getNodeA&#40;&#41;;
/** ... do something with the node ... */
&#125; else if &#40; event.getNodeB&#40;&#41;.getName&#40;&#41;.equals&#40;&quot;player&quot;&#41; &#41; &#123;
final Node node = event.getNodeB&#40;&#41;;
/** ... do something with the node ... */
&#125;
&#125;</pre>
<p>
<p><div>Note that after the collision() method ends, the PhysicsCollisionEvent is cleared. You must get all objects and values you need within the collision() method.
</div></p>
</p>
</div>
<h3><a>Reading Details From a PhysicsCollisionEvent</a></h3>
<h2><a>Best Practices</a></h2>
<div>
<p>
The PhysicsCollisionEvent <code>event</code> gives you access to detailed information about the collision. You already know the event objects can identify which nodes collided, but it even knows how hard they collided:
You can control the game by triggering forces; or may want to respond to collisions, e.g. by substracting health points, or by playing a sound. To specify how the game responds to physics events, you use <a href="/com/jme3/gde/core/docs/jme3/advanced/physics_listeners.html">Physics Listeners</a>.
</p>
<table>
<tr>
<th>Method </th><th>Purpose</th>
</tr>
<tr>
<td> getNodeA() <br/>
getNodeB() </td><td> The two participants in the collision. You cannot know in advance whether some node will be recorded as A or B, you always have to consider both cases. </td>
</tr>
<tr>
<td> getAppliedImpulse() </td><td> A float value representing the collision impulse </td>
</tr>
<tr>
<td> getAppliedImpulseLateral1() </td><td> A float value representing the lateral collision impulse </td>
</tr>
<tr>
<td> getAppliedImpulseLateral2() </td><td> A float value representing the lateral collision impulse </td>
</tr>
<tr>
<td> getCombinedFriction() </td><td> A float value representing the collision friction </td>
</tr>
<tr>
<td> getCombinedRestitution() </td><td> A float value representing the collision restitution (bounciness) </td>
</tr>
</table>
<p>
Note that after the collision method has been called the object is not valid anymore so you should copy any data you want to keep into local variables.
</p>
</div>
<h2><a>Best Practices</a></h2>
<div>
<p>
Do not overuse physics nodes. Although the physics nodes are put to “sleep” when they are not moved, creating a world solely out of dynamic physics nodes will quickly bring you to the limits of your computer&#039;s capabilities.
</p>
@ -651,7 +565,6 @@ If you get weird behaviour, such as physical nodes jittering wildy and being eje
<p>
For large static meshes like shooter levels or terrain its best to divide the mesh into multiple physics objects to allow the less cpu intense broadphase to filter out most collision items.
</p>
</div>

@ -0,0 +1,174 @@
<h1><a>Physics Listeners</a></h1>
<div>
<p>
You can control physical objects by triggering forces. Or maybe you want to respond to collisions, e.g. by substracting health points, or by playing a sound. To specify how the game responds to such physics events, you use Physics Listeners.
</p>
</div>
<h2><a>Physics Tick Listener</a></h2>
<div>
<p>
The jBullet Physics implementation is stepped at a constant 60 physics ticks per second frame rate.
Applying forces or checking for overlaps only has an effect right at a physics update cycle, which is not every frame. If you do physics interactions at arbitrary spots in the simpleUpdate() loop, calls will be dropped at irregular intervals, because they happen out of cycle.
</p>
</div>
<h3><a>When (Not) to Use Tick Listener?</a></h3>
<div>
<p>
When you write game mechanics that apply forces, you must implement a tick listener (com.jme3.bullet.PhysicsTickListener) for it. The tick listener makes certain the forces are not dropped, but applied in time for the next physics tick.
</p>
<p>
Also, when you check for overlaps of physical objects with a PhysicsGhostObject, you cannot just go <code>physicsSpace.add(ghost); ghost.getOverLappingObjects()</code> somewhere. You have to make certain 1 physics tick has passed before the overlapping objects list is filled with data. Again, the PhysicsTickListener does that for you.
</p>
<p>
When your game mechanics however just poll the current state (e.g. location) of physical objects, or if you only use the Ghost control like a sphere trigger, then you don&#039;t need a PhysicsTickListener.
</p>
</div>
<h3><a>How to Listen to Physics Ticks</a></h3>
<div>
<p>
Here&#039;s is the declaration of an examplary Physics Control that listens to ticks.
</p>
<pre>public class MyCustomControl
extends RigidBodyControl implements PhysicsTickListener &#123; ... &#125;</pre>
<p>
When you implement the interface, you have to implement preTick() and postTick() methods.
</p>
<ul>
<li><div> <code>prePhysicsTick()</code> is called before the step, here you apply forces (change the state).</div>
</li>
<li><div> <code>physicsTick()</code> is called after the step, here you poll the results (get the current state).</div>
</li>
</ul>
<pre>@override
public void prePhysicsTick&#40;PhysicsSpace space, float f&#41;&#123;
// apply state changes ...
&#125;
@override
public void physicsTick&#40;PhysicsSpace space, float f&#41;&#123;
// poll game state ...
&#125;</pre>
</div>
<h2><a>Physics Collision Listener</a></h2>
<div>
</div>
<h3><a>When (Not) to Use Collision Listener</a></h3>
<div>
<p>
If you do not implement the Collision Listener interface (com.jme3.bullet.collision.PhysicsCollisionListener), a collisions will just mean that physical forces are applied automatically. If you just want “Balls rolling, bricks falling” you do not need a listener.
</p>
<p>
If however you want to respond to a collision event (com.jme3.bullet.collision.PhysicsCollisionEvent) with a custom action, then you need to implement the PhysicsCollisionListener interface. Typical actions triggered by collisions include:
</p>
<ul>
<li><div> Increasing a counter (e.g. score points)</div>
</li>
<li><div> Decreasing a counter (e.g. health points)</div>
</li>
<li><div> Triggering an effect (e.g. explosion)</div>
</li>
<li><div> Playing a sound (e.g. explosion, ouch) </div>
</li>
<li><div> … and countless more, depending on your game</div>
</li>
</ul>
</div>
<h3><a>How to Listen to Collisions</a></h3>
<div>
<p>
Again, here&#039;s the example declaration of a Physics Control that uses a collision listener.
</p>
<pre>public class MyCustomControl
extends RigidBodyControl
implements PhysicsCollisionListener &#123; ... &#125;</pre>
<p>
To respond to the PhysicsCollisionEvent you have to override the <code>collision()</code> method. This gives you access to the event object. Mostly you will be interested in the identity of any two nodes that collided: <code>event.getNodeA()</code> and <code>event.getNodeB()</code>.
</p>
<p>
After you identify the colliding nodes, specify the action to trigger when this pair collides. Note that you cannot know which one will be Node A or Node B, you have to deal with either variant.
</p>
<pre> public void collision&#40;PhysicsCollisionEvent event&#41; &#123;
if &#40; event.getNodeA&#40;&#41;.getName&#40;&#41;.equals&#40;&quot;player&quot;&#41; &#41; &#123;
final Node node = event.getNodeA&#40;&#41;;
/** ... do something with the node ... */
&#125; else if &#40; event.getNodeB&#40;&#41;.getName&#40;&#41;.equals&#40;&quot;player&quot;&#41; &#41; &#123;
final Node node = event.getNodeB&#40;&#41;;
/** ... do something with the node ... */
&#125;
&#125;</pre>
<p>
<p><div>Note that after the collision() method ends, the PhysicsCollisionEvent is cleared. You must get all objects and values you need within the collision() method.
</div></p>
</p>
</div>
<h3><a>Reading Details From a PhysicsCollisionEvent</a></h3>
<div>
<p>
The PhysicsCollisionEvent <code>event</code> gives you access to detailed information about the collision. You already know the event objects can identify which nodes collided, but it even knows how hard they collided:
</p>
<table>
<tr>
<th>Method </th><th>Purpose</th>
</tr>
<tr>
<td> getNodeA() <br/>
getNodeB() </td><td> The two participants in the collision. You cannot know in advance whether some node will be recorded as A or B, you always have to consider both cases. </td>
</tr>
<tr>
<td> getAppliedImpulse() </td><td> A float value representing the collision impulse </td>
</tr>
<tr>
<td> getAppliedImpulseLateral1() </td><td> A float value representing the lateral collision impulse </td>
</tr>
<tr>
<td> getAppliedImpulseLateral2() </td><td> A float value representing the lateral collision impulse </td>
</tr>
<tr>
<td> getCombinedFriction() </td><td> A float value representing the collision friction </td>
</tr>
<tr>
<td> getCombinedRestitution() </td><td> A float value representing the collision restitution (bounciness) </td>
</tr>
</table>
<p>
Note that after the collision method has been called the object is not valid anymore so you should copy any data you want to keep into local variables.
</p>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:physics_listeners?do=export_xhtmlbody">view online version</a></em></p>

@ -62,11 +62,11 @@ There are two test cases in the jME3 repository:
</p>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/water/TestPostWater.java"><param name="text" value="<html><u>jme3/src/test/jme3test/water/TestPostWater.java</u></html>"><param name="textColor" value="blue"></object> (ocean island)</div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/water/TestPostWater.java"><param name="text" value="<html><u>jme3/src/test/jme3test/water/TestPostWater.java</u></html>"><param name="textColor" value="blue"></object> (ocean island)</div>
</li>
</ul>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/water/TestPostWaterLake.java"><param name="text" value="<html><u>jme3/src/test/jme3test/water/TestPostWaterLake.java</u></html>"><param name="textColor" value="blue"></object> (calm and muddy water pond)</div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/water/TestPostWaterLake.java"><param name="text" value="<html><u>jme3/src/test/jme3test/water/TestPostWaterLake.java</u></html>"><param name="textColor" value="blue"></object> (calm and muddy water pond)</div>
</li>
</ul>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

@ -12,7 +12,7 @@ The jMonkeyEngine3 has built-in support for <object classid="java:org.netbeans.m
<h2><a>Sample Code</a></h2>
<div>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/bullet/TestRagDoll.java"><param name="text" value="<html><u>TestRagDoll.java</u></html>"><param name="textColor" value="blue"></object> (Tip: Click to pull the ragdoll up)</div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet/TestRagDoll.java"><param name="text" value="<html><u>TestRagDoll.java</u></html>"><param name="textColor" value="blue"></object> (Tip: Click to pull the ragdoll up)</div>
</li>
</ul>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 100 KiB

@ -14,7 +14,7 @@ This can be useful when you create some sort of interactive 3D viewer with a use
<ul>
<li><div> Advantages: </div>
<ul>
<li><div> You can use Swing components (frame, panels, menus, controls) in your jME3 game. </div>
<li><div> You can use Swing components (frame, panels, menus, controls) next to your jME3 game. </div>
</li>
<li><div> The NetBeans <acronym title="Graphical User Interface">GUI</acronym> builder is compatible with the jMonkeyEngine; you can use it it to lay out the Swing <acronym title="Graphical User Interface">GUI</acronym> frame, and then add() the jME canvas into it. Install the <acronym title="Graphical User Interface">GUI</acronym> builder via Tools → Plugins → Available Plugins.</div>
</li>
@ -30,7 +30,7 @@ This can be useful when you create some sort of interactive 3D viewer with a use
<p>
Here is the full <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/app/SwingCanvasTest.java?r=5796"><param name="text" value="<html><u>SwingCanvasTest.java</u></html>"><param name="textColor" value="blue"></object> code sample, contributed by pgi.
Here is the full <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/app/SwingCanvasTest.java?r=5796"><param name="text" value="<html><u>SwingCanvasTest.java</u></html>"><param name="textColor" value="blue"></object> code sample, contributed by pgi.
</p>
</div>
@ -155,6 +155,10 @@ Clean, build, and run!
Remember, to navigate in the scene, click and drag (!) the mouse, or press the WASD keys. Depending on your game you may even want to define custom inputs to handle navigation in this untypical environment.
</p>
<div><span>
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>,
<a href="/wiki/doku.php/tag:gui?do=showtag&amp;tag=tag%3Agui">gui</a>
</span></div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:swing_canvas?do=export_xhtmlbody">view online version</a></em></p>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

@ -30,9 +30,9 @@ Full code samples are here:
</p>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/bullet/TestPhysicsCar.java"><param name="text" value="<html><u>TestPhysicsCar.java</u></html>"><param name="textColor" value="blue"></object></div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet/TestPhysicsCar.java"><param name="text" value="<html><u>TestPhysicsCar.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/bullet/TestFancyCar.java"><param name="text" value="<html><u>TestFancyCar.java</u></html>"><param name="textColor" value="blue"></object></div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet/TestFancyCar.java"><param name="text" value="<html><u>TestFancyCar.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>
@ -94,7 +94,7 @@ The goal is to create a physical vehicle with wheels that can be steered and tha
<p>
The vehicle that we create here in the <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/bullet/TestPhysicsCar.java"><param name="text" value="<html><u>TestPhysicsCar.java</u></html>"><param name="textColor" value="blue"></object> example is just a “box on wheels”, a basic vehicle shape that you can replace with a fancy car model, as demonstrated in <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/bullet/TestFancyCar.java"><param name="text" value="<html><u>TestFancyCar.java</u></html>"><param name="textColor" value="blue"></object>.
The vehicle that we create here in the <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet/TestPhysicsCar.java"><param name="text" value="<html><u>TestPhysicsCar.java</u></html>"><param name="textColor" value="blue"></object> example is just a “box on wheels”, a basic vehicle shape that you can replace with a fancy car model, as demonstrated in <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet/TestFancyCar.java"><param name="text" value="<html><u>TestFancyCar.java</u></html>"><param name="textColor" value="blue"></object>.
</p>
<p>
@ -322,7 +322,7 @@ This example shows a very simple but functional vehicle. For a game you would im
</p>
<p>
For a more advanced example, look at <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/bullet/TestFancyCar.java"><param name="text" value="<html><u>TestFancyCar.java</u></html>"><param name="textColor" value="blue"></object>.
For a more advanced example, look at <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet/TestFancyCar.java"><param name="text" value="<html><u>TestFancyCar.java</u></html>"><param name="textColor" value="blue"></object>.
</p>
</div>

@ -29,11 +29,11 @@ This is why jME3 offers a special CharacterControl to implement walking characte
The full code sample can be found here:
</p>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/bullet/TestWalkingChar.java"><param name="text" value="<html><u>TestPhysicsCharacter.java</u></html>"><param name="textColor" value="blue"></object> (third-person view)</div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet/TestWalkingChar.java"><param name="text" value="<html><u>TestPhysicsCharacter.java</u></html>"><param name="textColor" value="blue"></object> (third-person view)</div>
</li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/bullet/TestWalkingChar.java"><param name="text" value="<html><u>TestWalkingChar.java</u></html>"><param name="textColor" value="blue"></object> (third-person view)</div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet/TestWalkingChar.java"><param name="text" value="<html><u>TestWalkingChar.java</u></html>"><param name="textColor" value="blue"></object> (third-person view)</div>
</li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/bullet/TestQ3.java"><param name="text" value="<html><u>TestQ3.java</u></html>"><param name="textColor" value="blue"></object> (first-person view)</div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet/TestQ3.java"><param name="text" value="<html><u>TestQ3.java</u></html>"><param name="textColor" value="blue"></object> (first-person view)</div>
</li>
</ul>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

@ -1,5 +1,5 @@
<h1><a>Getting Started with JME3 (7) - Hello Animation</a></h1>
<h1><a>JME 3 Tutorial (7) - Hello Animation</a></h1>
<div>
<p>
@ -9,11 +9,7 @@ Next: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_picking.html">Hello P
</p>
<p>
<br/>
This tutorial shows how to add an animation controller and channels, and how to respond to user input by triggering an animation in a loaded model.
<br/>
</p>
<p>
@ -109,7 +105,7 @@ public class HelloAnimation extends SimpleApplication
<p>
You create animated models with a tool such as Blender. Take some time and learn how to create your own models in these <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.blender.org/education-help/tutorials/animation/"><param name="text" value="<html><u>Blender Animation Tutorials</u></html>"><param name="textColor" value="blue"></object>. For now, download and use a free model, such as the one included here as an example (<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.googlecode.com/svn/branches/jme3/src/test-data/Models/Oto/"><param name="text" value="<html><u>Oto Golem</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.googlecode.com/svn/branches/jme3/src/test-data/Models/Ninja/"><param name="text" value="<html><u>Ninja</u></html>"><param name="textColor" value="blue"></object>).
You create animated models with a tool such as Blender. Take some time and learn how to create your own models in these <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.blender.org/education-help/tutorials/animation/"><param name="text" value="<html><u>Blender Animation Tutorials</u></html>"><param name="textColor" value="blue"></object>. For now, download and use a free model, such as the one included here as an example (<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.googlecode.com/svn/trunk/engine/src/test-data/Models/Oto/"><param name="text" value="<html><u>Oto Golem</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.googlecode.com/svn/trunk/engine/src/test-data/Models/Ninja/"><param name="text" value="<html><u>Ninja</u></html>"><param name="textColor" value="blue"></object>).
</p>
<p>
@ -301,11 +297,11 @@ Can you identify individual bones in the skeleton?
<p>
Now you can load animated models, identify stored animations, and trigger by using onAnimCycleDone() and onAnimChange(). You also learned that you can play several animations simultaneously, by starting each in a channel of its own. This could be useful if you ever want to animate the lower and upper part of the characters body independently, for example the legs run, and the arms use a weapon.
Now you can load animated models, identify stored animations, and trigger by using onAnimCycleDone() and onAnimChange(). You also learned that you can play several animations simultaneously, by starting each in a channel of its own. This could be useful if you ever want to animate the lower and upper part of the characters body independently, for example the legs run, while the arms use a weapon.
</p>
<p>
Now that your character can walk, wouldn&#039;t it be cool if it could also pick up things, or aim a weapon at things, or open doors? Time to learn more about <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_picking.html">picking</a>!
Now that your character can walk, wouldn&#039;t it be cool if it could also pick up things, or aim a weapon at things, or open doors? Time to learn more about the secrets of <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_picking.html">picking</a>!
</p>
<hr />
@ -314,6 +310,17 @@ Now that your character can walk, wouldn&#039;t it be cool if it could also pick
See also: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="https://docs.google.com/leaf?id=0B9hhZie2D-fEYmRkMTYwN2YtMzQ0My00NTM4LThhOTYtZTk1MTRlYTNjYTc3&amp;hl=en"><param name="text" value="<html><u>Creating Animated OgreXML Models in Blender</u></html>"><param name="textColor" value="blue"></object>
</p>
<div><span>
<a href="/wiki/doku.php/tag:beginner?do=showtag&amp;tag=tag%3Abeginner">beginner</a>,
<a href="/wiki/doku.php/tag:beginner?do=showtag&amp;tag=tag%3Abeginner">beginner,</a>,
<a href="/wiki/doku.php/tag:intro?do=showtag&amp;tag=tag%3Aintro">intro</a>,
<a href="/wiki/doku.php/tag:animation?do=showtag&amp;tag=tag%3Aanimation">animation</a>,
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>,
<a href="/wiki/doku.php/tag:keyinput?do=showtag&amp;tag=tag%3Akeyinput">keyinput</a>,
<a href="/wiki/doku.php/tag:input?do=showtag&amp;tag=tag%3Ainput">input</a>,
<a href="/wiki/doku.php/tag:node?do=showtag&amp;tag=tag%3Anode">node</a>,
<a href="/wiki/doku.php/tag:model?do=showtag&amp;tag=tag%3Amodel">model</a>
</span></div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_animation?do=export_xhtmlbody">view online version</a></em></p>

@ -1,15 +1,15 @@
<h1><a>Getting Started with JME3 (3) - Hello Assets</a></h1>
<h1><a>JME 3 Tutorial (3) - Hello Assets</a></h1>
<div>
<p>
Previous: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_node.html">Hello Node</a>,
Next: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_main_event_loop.html">Hello Main Event Loop</a>
Next: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_main_event_loop.html">Hello Update Loop</a>
</p>
<p>
In this Tutorial we will learn to load 3-D models and text into the scene graph, using the jME asset manager. You also learn how to arrive at the correct paths, and which file formats to use.
In this tutorial we will learn to load 3-D models and text into the scene graph, using the jME asset manager. You also learn how to arrive at the correct paths, and which file formats to use.
</p>
<p>
@ -314,7 +314,7 @@ As an exercise, let&#039;s try different ways of loading a scene. You can load a
</p>
<ol>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.googlecode.com/svn/branches/jme3/town.zip"><param name="text" value="<html><u>Download the town.zip</u></html>"><param name="textColor" value="blue"></object> sample scene. </div>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.googlecode.com/svn/trunk/engine/town.zip"><param name="text" value="<html><u>Download the town.zip</u></html>"><param name="textColor" value="blue"></object> sample scene. </div>
</li>
<li><div> (Optional:) Unzip the town.zip to see the structure of the contained Ogre dotScene: You&#039;ll get a directory named <code>town</code>. It contains <acronym title="Extensible Markup Language">XML</acronym> and texture files, and file called main.scene. (This is just for your information, you do not need to do anything with it.)</div>
</li>
@ -421,7 +421,7 @@ Now you know how to populate the scenegraph with static shapes and models, and h
</p>
<p>
Let&#039;s add some action to the scene and continue with the <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_main_event_loop.html">main event loop</a>.
Let&#039;s add some action to the scene and continue with the <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_main_event_loop.html">Update Loop</a>.
</p>
<hr />
@ -439,6 +439,18 @@ Let&#039;s add some action to the scene and continue with the <a href="/com/jme3
<li><div> If you want to learn more about loading textures and materials, see <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_material.html">Hello Material</a></div>
</li>
</ul>
<div><span>
<a href="/wiki/doku.php/tag:beginner?do=showtag&amp;tag=tag%3Abeginner">beginner</a>,
<a href="/wiki/doku.php/tag:beginner?do=showtag&amp;tag=tag%3Abeginner">beginner,</a>,
<a href="/wiki/doku.php/tag:intro?do=showtag&amp;tag=tag%3Aintro">intro</a>,
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>,
<a href="/wiki/doku.php/tag:lightnode?do=showtag&amp;tag=tag%3Alightnode">lightnode</a>,
<a href="/wiki/doku.php/tag:material?do=showtag&amp;tag=tag%3Amaterial">material</a>,
<a href="/wiki/doku.php/tag:model?do=showtag&amp;tag=tag%3Amodel">model</a>,
<a href="/wiki/doku.php/tag:node?do=showtag&amp;tag=tag%3Anode">node</a>,
<a href="/wiki/doku.php/tag:gui?do=showtag&amp;tag=tag%3Agui">gui</a>,
<a href="/wiki/doku.php/tag:texture?do=showtag&amp;tag=tag%3Atexture">texture</a>
</span></div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_asset?do=export_xhtmlbody">view online version</a></em></p>

@ -1,5 +1,5 @@
<h1><a>Hello Audio</a></h1>
<h1><a>JME 3 Tutorial (11) - Hello Audio</a></h1>
<div>
<p>
@ -9,7 +9,6 @@ Next: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_effects.html">Hello E
</p>
<p>
This tutorial explains how to add 3D sound to a game, and how to trigger when sounds are to be played. We will use an Audio Listener, an Audio Renderer, two Audio Nodes, and an Action Listener.
</p>
@ -280,6 +279,13 @@ Tip: jME&#039;s Audio implementation also supports more advanced effects such as
Want some fire and explosions to go with your sounds? Read on to learn more about <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_effects.html">effects</a>.
</p>
<div><span>
<a href="/wiki/doku.php/tag:sound?do=showtag&amp;tag=tag%3Asound">sound</a>,
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>,
<a href="/wiki/doku.php/tag:beginner?do=showtag&amp;tag=tag%3Abeginner">beginner,</a>,
<a href="/wiki/doku.php/tag:beginner?do=showtag&amp;tag=tag%3Abeginner">beginner</a>,
<a href="/wiki/doku.php/tag:intro?do=showtag&amp;tag=tag%3Aintro">intro</a>
</span></div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_audio?do=export_xhtmlbody">view online version</a></em></p>

@ -1,5 +1,5 @@
<h1><a>Getting Started with JME3 (9) - Hello Collision</a></h1>
<h1><a>JME 3 Tutorial (9) - Hello Collision</a></h1>
<div>
<p>
@ -31,7 +31,7 @@ The solution shown here can be used for first-person shooters, mazes, and simila
<p>
If you don&#039;t have it yet, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.googlecode.com/svn/branches/jme3/town.zip"><param name="text" value="<html><u>download the town.zip</u></html>"><param name="textColor" value="blue"></object> sample scene.
If you don&#039;t have it yet, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.googlecode.com/svn/trunk/engine/town.zip"><param name="text" value="<html><u>download the town.zip</u></html>"><param name="textColor" value="blue"></object> sample scene.
</p>
<pre>jMonkeyProjects$ ls -1 BasicGame
assets/
@ -155,13 +155,13 @@ public class HelloCollision extends SimpleApplication
* We do not walk yet, we just keep track of the direction the user pressed. */</span>
public void onAction&#40;String binding, boolean value, float tpf&#41; &#123;
if &#40;binding.equals&#40;&quot;Lefts&quot;&#41;&#41; &#123;
if &#40;value&#41; &#123; left = true; &#125; else &#123; left = false; &#125;
left = value;
&#125; else if &#40;binding.equals&#40;&quot;Rights&quot;&#41;&#41; &#123;
if &#40;value&#41; &#123; right = true; &#125; else &#123; right = false; &#125;
right = value;
&#125; else if &#40;binding.equals&#40;&quot;Ups&quot;&#41;&#41; &#123;
if &#40;value&#41; &#123; up = true; &#125; else &#123; up = false; &#125;
up = value;
&#125; else if &#40;binding.equals&#40;&quot;Downs&quot;&#41;&#41; &#123;
if &#40;value&#41; &#123; down = true; &#125; else &#123; down = false; &#125;
down = value;
&#125; else if &#40;binding.equals&#40;&quot;Jumps&quot;&#41;&#41; &#123;
player.jump&#40;&#41;;
&#125;
@ -269,7 +269,7 @@ For the scene, you load the <code>sceneModel</code> from a zip file, and adjust
sceneModel = assetManager.loadModel&#40;&quot;main.scene&quot;&#41;;
sceneModel.setLocalScale&#40;2f&#41;;</pre>
<p>
The file <code>town.zip</code> is included as a sample model in the JME3 sources – you can <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.googlecode.com/svn/branches/jme3/town.zip"><param name="text" value="<html><u>download it here</u></html>"><param name="textColor" value="blue"></object>. (Optionally, use any OgreXML scene of your own.) For this sample, place the zip file in the application&#039;s top level directory (that is, next to src/, assets/, build.xml).
The file <code>town.zip</code> is included as a sample model in the JME3 sources – you can <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.googlecode.com/svn/trunk/engine/town.zip"><param name="text" value="<html><u>download it here</u></html>"><param name="textColor" value="blue"></object>. (Optionally, use any OgreXML scene of your own.) For this sample, place the zip file in the application&#039;s top level directory (that is, next to src/, assets/, build.xml).
</p>
<pre> CollisionShape sceneShape =
CollisionShapeFactory.createMeshShape&#40;&#40;Node&#41; sceneModel&#41;;
@ -397,13 +397,13 @@ Remember that we declared this class an <code>ActionListener</code> so we could
</p>
<pre> public void onAction&#40;String binding, boolean value, float tpf&#41; &#123;
if &#40;binding.equals&#40;&quot;Lefts&quot;&#41;&#41; &#123;
if &#40;value&#41; &#123; left = true; &#125; else &#123; left = false; &#125;
left = value;
&#125; else if &#40;binding.equals&#40;&quot;Rights&quot;&#41;&#41; &#123;
if &#40;value&#41; &#123; right = true; &#125; else &#123; right = false; &#125;
right = value;
&#125; else if &#40;binding.equals&#40;&quot;Ups&quot;&#41;&#41; &#123;
if &#40;value&#41; &#123; up = true; &#125; else &#123; up = false; &#125;
up = value;
&#125; else if &#40;binding.equals&#40;&quot;Downs&quot;&#41;&#41; &#123;
if &#40;value&#41; &#123; down = true; &#125; else &#123; down = false; &#125;
down = value;
&#125; else if &#40;binding.equals&#40;&quot;Jumps&quot;&#41;&#41; &#123;
player.jump&#40;&#41;;
&#125;
@ -476,7 +476,7 @@ To learn more about different ways of loading models and scene have a look at <a
<p>
There are also other possible solutions for this task that do not require physics.
Have a look at <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/collision/TestSimpleCollision.java?r=5192&amp;spec=svn5192"><param name="text" value="<html><u>jme3test.collision.TestSimpleCollision.java</u></html>"><param name="textColor" value="blue"></object> (and SphereMotionAllowedListener.java).
Have a look at <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/collision/TestSimpleCollision.java?r=5192&amp;spec=svn5192"><param name="text" value="<html><u>jme3test.collision.TestSimpleCollision.java</u></html>"><param name="textColor" value="blue"></object> (and SphereMotionAllowedListener.java).
To learn more about complex physics scenes where several mobile physical objects bump into each other, read <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_physics.html">Hello Physics</a>.
</p>
@ -484,6 +484,17 @@ To learn more about complex physics scenes where several mobile physical objects
Do you want to hear your player say “ouch!” when he bumps into a wall? Continue with learning <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_audio.html">how to add sound</a> to your game.
</p>
<div><span>
<a href="/wiki/doku.php/tag:beginner?do=showtag&amp;tag=tag%3Abeginner">beginner</a>,
<a href="/wiki/doku.php/tag:beginner?do=showtag&amp;tag=tag%3Abeginner">beginner,</a>,
<a href="/wiki/doku.php/tag:collision?do=showtag&amp;tag=tag%3Acollision">collision</a>,
<a href="/wiki/doku.php/tag:controller?do=showtag&amp;tag=tag%3Acontroller">controller</a>,
<a href="/wiki/doku.php/tag:controllers?do=showtag&amp;tag=tag%3Acontrollers">controllers</a>,
<a href="/wiki/doku.php/tag:intro?do=showtag&amp;tag=tag%3Aintro">intro</a>,
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>,
<a href="/wiki/doku.php/tag:model?do=showtag&amp;tag=tag%3Amodel">model</a>,
<a href="/wiki/doku.php/tag:physics?do=showtag&amp;tag=tag%3Aphysics">physics</a>
</span></div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_collision?do=export_xhtmlbody">view online version</a></em></p>

@ -1,5 +1,5 @@
<h1><a>Getting Started with JME3 (12) - Hello Effects</a></h1>
<h1><a>JME 3 Tutorial (12) - Hello Effects</a></h1>
<div>
<p>
@ -105,7 +105,7 @@ public class HelloEffects extends SimpleApplication &#123;
&#125;</pre>
<p>
You should see an explosion that sends debris flying, and a fire.
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.googlecode.com/svn/branches/jme3/src/test/jme3test/effect/"><param name="text" value="<html><u>More example code</u></html>"><param name="textColor" value="blue"></object>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.googlecode.com/svn/trunk/engine/src/test/jme3test/effect/"><param name="text" value="<html><u>More example code</u></html>"><param name="textColor" value="blue"></object>
</p>
</div>
@ -325,6 +325,13 @@ You have learned that many different effects can be created by changing the para
Now we move on to the next exciting chapter – the simulation of <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_physics"><param name="text" value="<html><u>physical objects</u></html>"><param name="textColor" value="blue"></object>. Let&#039;s shoot some cannon balls at a brick wall!
</p>
<div><span>
<a href="/wiki/doku.php/tag:beginner?do=showtag&amp;tag=tag%3Abeginner">beginner</a>,
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>,
<a href="/wiki/doku.php/tag:intro?do=showtag&amp;tag=tag%3Aintro">intro</a>,
<a href="/wiki/doku.php/tag:transparency?do=showtag&amp;tag=tag%3Atransparency">transparency</a>,
<a href="/wiki/doku.php/tag:effect?do=showtag&amp;tag=tag%3Aeffect">effect</a>
</span></div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_effects?do=export_xhtmlbody">view online version</a></em></p>

@ -1,15 +1,14 @@
<h1><a>Getting Started with JME3 (5) - Hello Input System</a></h1>
<h1><a>JME 3 Tutorial (5) - Hello Input System</a></h1>
<div>
<p>
Previous: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_main_event_loop.html">Hello Event Loop</a>,
Previous: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_main_event_loop.html">Hello Update Loop</a>,
Next: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_material.html">Hello Material</a>
</p>
<p>
By default, SimpleApplication sets up an input system that allows you to steer the camera with the WASD keys, the arrow keys, and the mouse. You can use it as a flying first-person camera right away. But what if you need a third-person camera, or you want keys to trigger special game actions?
</p>
@ -346,8 +345,16 @@ You now how to add custom interactions to your game: You know now that you first
<p>
Now you can already write a little interactive game! But wouldn&#039;t it be cooler if these old boxes were a bit more fancy? Let&#039;s continue with learning about <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_material.html">materials</a>.
</p>
<div><span>
<a href="/wiki/doku.php/tag:input?do=showtag&amp;tag=tag%3Ainput">input</a>,
<a href="/wiki/doku.php/tag:intro?do=showtag&amp;tag=tag%3Aintro">intro</a>,
<a href="/wiki/doku.php/tag:beginner?do=showtag&amp;tag=tag%3Abeginner">beginner</a>,
<a href="/wiki/doku.php/tag:beginner?do=showtag&amp;tag=tag%3Abeginner">beginner,</a>,
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>,
<a href="/wiki/doku.php/tag:keyinput?do=showtag&amp;tag=tag%3Akeyinput">keyinput</a>,
<a href="/wiki/doku.php/tag:click?do=showtag&amp;tag=tag%3Aclick">click</a>
</span></div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_input_system?do=export_xhtmlbody">view online version</a></em></p>

@ -1,18 +1,15 @@
<h1><a>Getting Started with JME3 (4) - Hello Event Loop</a></h1>
<h1><a>JME 3 Tutorial (4) - Hello Update Loop</a></h1>
<div>
<p>
<br/>
Previous: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_asset.html">Hello Assets</a>,
Next: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_input_system.html">Hello Input System</a>
<br/>
<br/>
</p>
Now that you know how to load assets such as 3-D models, you want them to implement the actual gameplay. The event loop of your game is where the action happens.
<p>
Now that you know how to load assets such as 3-D models, you want them to implement the actual gameplay. In this tutorial we look at the update loop. The update loop of your game is where the action happens.
</p>
</div>
@ -28,7 +25,7 @@ import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Box;
&nbsp;
<span>/** Sample 4 - how to trigger repeating actions from the main event loop.
<span>/** Sample 4 - how to trigger repeating actions from the main update loop.
* In this example, we make the player character rotate. */</span>
public class HelloLoop extends SimpleApplication &#123;
&nbsp;
@ -50,7 +47,7 @@ public class HelloLoop extends SimpleApplication &#123;
rootNode.attachChild&#40;player&#41;;
&#125;
&nbsp;
/* This is the main event loop */
/* This is the update loop */
@Override
public void simpleUpdate&#40;float tpf&#41; &#123;
// make the player rotate
@ -68,13 +65,11 @@ Build and run the file: You see a constantly rotating cube.
<p>
Compared to our previous code samples you note that the player Geometry is now a class field. This is because we want the main event loop to be able to access and transform this Geometry. As you can see, we initialize the player object in the <code>simpleInitApp()</code> method.
Compared to our previous code samples you note that the player Geometry is now a class field. This is because we want the update loop to be able to access and transform this Geometry. As you can see, we initialize the player object in the <code>simpleInitApp()</code> method.
</p>
<p>
<br/>
Now have a closer look at the <code>simpleUpdate()</code> method, this is the main event loop.
Now have a closer look at the <code>simpleUpdate()</code> method, this is the update loop.
</p>
<ul>
<li><div> The <code>player.rotate(0, 2*tpf, 0);</code> line changes the rotation of the player object. </div>
@ -85,20 +80,16 @@ Now have a closer look at the <code>simpleUpdate()</code> method, this is the ma
</div>
<h2><a>The Event Loop</a></h2>
<h2><a>The Update Loop</a></h2>
<div>
<p>
A rotating object is just a simple example. In the event loop, you can update score and health points, check for collisions, make enemies calculate their next move, roll the dice whether a trap has been set off, play random ambient sounds, and much more.
</p>
<p>
<br/>
A rotating object is just a simple example. In the update loop, you can update score and health points, check for collisions, make enemies calculate their next move, roll the dice whether a trap has been set off, play random ambient sounds, and much more.
</p>
<ul>
<li><div> The event loop starts after the <code>simpleInitApp()</code> method has set up the scenegraph and state variables.</div>
<li><div> The update loop starts after the <code>simpleInitApp()</code> method has set up the scenegraph and state variables.</div>
</li>
<li><div> JME executes everything in the <code>simpleUpdate()</code> method repeatedly, as fast as possible.</div>
<ol>
@ -155,6 +146,17 @@ The next thing the game needs is some <em>inter</em>action! Continue learning ho
<p>
See also: Advanced jME3 developers additionally use <a href="/com/jme3/gde/core/docs/jme3/advanced/application_states.html">Application States</a> and <a href="/com/jme3/gde/core/docs/jme3/advanced/custom_controls.html">Custom Controls</a> to implement more complex mechanics in their game loops. You will come across these topics later when you proceed to advanced documentation.
</p>
<div><span>
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>,
<a href="/wiki/doku.php/tag:beginner?do=showtag&amp;tag=tag%3Abeginner">beginner,</a>,
<a href="/wiki/doku.php/tag:state?do=showtag&amp;tag=tag%3Astate">state</a>,
<a href="/wiki/doku.php/tag:states?do=showtag&amp;tag=tag%3Astates">states</a>,
<a href="/wiki/doku.php/tag:intro?do=showtag&amp;tag=tag%3Aintro">intro</a>,
<a href="/wiki/doku.php/tag:beginner?do=showtag&amp;tag=tag%3Abeginner">beginner</a>,
<a href="/wiki/doku.php/tag:controller?do=showtag&amp;tag=tag%3Acontroller">controller</a>,
<a href="/wiki/doku.php/tag:controllers?do=showtag&amp;tag=tag%3Acontrollers">controllers</a>,
<a href="/wiki/doku.php/tag:loop?do=showtag&amp;tag=tag%3Aloop">loop</a>
</span></div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_main_event_loop?do=export_xhtmlbody">view online version</a></em></p>

@ -1,5 +1,5 @@
<h1><a>Getting Started with JME3 (6) - Hello Materials</a></h1>
<h1><a>JME 3 Tutorial (6) - Hello Materials</a></h1>
<div>
<p>
@ -9,7 +9,7 @@ Next: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_animation.html">Hello
</p>
<p>
When we speak of Materials, we mean everything that influences what the surface of a 3D model looks like: The color, texture, and material (shininess, opacity/transparency). Simple Coloring is covered in <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_node.html">Hello Node</a>. Loading models that come with materials is covered in <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_asset.html">Hello Asset</a>. Here we focus on using and creating <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.youtube.com/watch?v=Feu3-mrpolc"><param name="text" value="<html><u>JME3 Material Definitions</u></html>"><param name="textColor" value="blue"></object>.
When we speak of Materials, we mean everything that influences what the surface of a 3D model looks like: The color, texture, and material (shininess, opacity/transparency). Simple coloring is covered in <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_node.html">Hello Node</a>. Loading models that come with materials is covered in <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_asset.html">Hello Asset</a>. Here we focus on using and creating JME3 Material Definitions.
</p>
<p>
@ -33,6 +33,8 @@ import com.jme3.scene.shape.Box;
import com.jme3.scene.shape.Sphere;
import com.jme3.texture.Texture;
import com.jme3.util.TangentBinormalGenerator;
import com.jme3.renderer.queue.RenderQueue.Bucket;
&nbsp;
&nbsp;
<span>/** Sample 6 - how to give an object's surface a material and texture.
* How to make objects transparent, or let colors &quot;leak&quot; through partially
@ -64,6 +66,8 @@ public class HelloMaterial extends SimpleApplication &#123;
assetManager.loadTexture&#40;&quot;Textures/ColoredTex/Monkey.png&quot;&#41;&#41;;
mat_tt.getAdditionalRenderState&#40;&#41;.setBlendMode&#40;BlendMode.Alpha&#41;;
window_frame.setMaterial&#40;mat_tt&#41;;
/** Objects with transparency need to be in the render bucket for transparent objects: */
window_frame.setQueueBucket&#40;Bucket.Transparent&#41;;
rootNode.attachChild&#40;window_frame&#41;;
&nbsp;
/** A cube with base color &quot;leaking&quot; through a partially transparent texture */
@ -156,6 +160,10 @@ Here is what we did:
<code>Monkey.png</code> is the same texture as <code>Monkey.jpg</code>, but with an added alpha channel. The alpha channel allows you to specify which areas of the texture you want to be translucent: Black areas remain opaque, gray areas become translucent, and white areas become transparent. In combination with setting the texture blend mode to <code>BlendMode.Alpha</code>, this results in a partially translucent/transparent texture!
</p>
<p>
You also need to set the render bucket of the object with the translucent texture to <code>Bucket.Transparent</code>. This ensures that the translucent object is drawn on top of objects behind it, and they show up correctly under the translucent parts. For non-translucent objects the drawing order is not so important, because the z-buffer keeps track of whether a pixel is behind something else or not, and the color of a pixel doesn&#039;t depend on the pixels under it, so they can be drawn in any order.
</p>
<pre> /** A translucent/transparent texture. */
Box&#40;new Vector3f&#40;0f,0f,0f&#41;, 1f,1f,0.01f&#41;;
Geometry seethrough = new Geometry&#40;&quot;see-through box&quot;, boxshape3&#41;;
@ -164,6 +172,7 @@ Here is what we did:
assetManager.loadTexture&#40;&quot;Textures/ColoredTex/Monkey.png&quot;&#41;&#41;;
mat_tt.getAdditionalRenderState&#40;&#41;.setBlendMode&#40;BlendMode.Alpha&#41;; // activate transparency
seethrough.setMaterial&#40;mat_tt&#41;;
seethrough.setQueueBucket&#40;Bucket.Transparent&#41;;
rootNode.attachChild&#40;seethrough&#41;;</pre>
<p>
What we did it the same as before, with only one added step for the transparency.
@ -176,9 +185,13 @@ What we did it the same as before, with only one added step for the transparency
<li><div> Create a texture from the <code>Monkey.png</code> file and load it into the material. <br/>
The ColorMap is the material layer where textures go. The <acronym title="Portable Network Graphics">PNG</acronym> file must have an alpha layer.</div>
</li>
<li><div> Activate transparency in the material by setting the blend mode to Alpha!</div>
<li><div> Activate transparency in the material by setting the blend mode to Alpha! </div>
</li>
<li><div> Apply the material to the cube and attach the cube to the rootnode.</div>
<li><div> Apply the material to the cube.</div>
</li>
<li><div> Set the QueueBucket of the cube to <code>Bucket.Transparent</code> to ensure that the translucent objects is drawn after objects behind it.</div>
</li>
<li><div> Attach the cube to the rootnode.</div>
</li>
</ol>
@ -397,6 +410,17 @@ See also
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.shaders.org/ifw2_textures/whatsin10.htm"><param name="text" value="<html><u>Various Material screenshots</u></html>"><param name="textColor" value="blue"></object> (Not done with JME3, this is just to show the fantastic range of Material parameters in the hands of an expert, until we have a JME3 demo for it.)</div>
</li>
</ul>
<div><span>
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>,
<a href="/wiki/doku.php/tag:beginner?do=showtag&amp;tag=tag%3Abeginner">beginner,</a>,
<a href="/wiki/doku.php/tag:beginner?do=showtag&amp;tag=tag%3Abeginner">beginner</a>,
<a href="/wiki/doku.php/tag:intro?do=showtag&amp;tag=tag%3Aintro">intro</a>,
<a href="/wiki/doku.php/tag:model?do=showtag&amp;tag=tag%3Amodel">model</a>,
<a href="/wiki/doku.php/tag:material?do=showtag&amp;tag=tag%3Amaterial">material</a>,
<a href="/wiki/doku.php/tag:color?do=showtag&amp;tag=tag%3Acolor">color</a>,
<a href="/wiki/doku.php/tag:texture?do=showtag&amp;tag=tag%3Atexture">texture</a>,
<a href="/wiki/doku.php/tag:transparency?do=showtag&amp;tag=tag%3Atransparency">transparency</a>
</span></div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_material?do=export_xhtmlbody">view online version</a></em></p>

@ -1,5 +1,5 @@
<h1><a>Getting Started with JME3 (2) - Hello Node</a></h1>
<h1><a>JME 3 Tutorial (2) - Hello Node</a></h1>
<div>
<p>
@ -13,7 +13,7 @@ When creating a 3D game, you start out with creating a scene and some objects. Y
</p>
<p>
In this Tutorial we will have a look at a simple 3D scene. You will learn that the 3D world is represented in a scene graph, and why the rootNode is important. You will learn how to create simple objects and how to transform them – move, scale, rotate. You will understand the difference between the two types of Spatials in the scene graph, Node and Geometry. For a visual introduction to the scene graph check out our <a href="/com/jme3/gde/core/docs/jme3/scenegraph_for_dummies.html"> Scene Graph for Dummies</a> presentation.
In this tutorial we will have a look at a simple 3D scene. You will learn that the 3D world is represented in a scene graph, and why the rootNode is important. You will learn how to create simple objects and how to transform them – move, scale, rotate. You will understand the difference between the two types of Spatials in the scene graph, Node and Geometry. For a visual introduction to the scene graph check out our <a href="/com/jme3/gde/core/docs/jme3/scenegraph_for_dummies.html"> Scene Graph for Dummies</a> presentation.
</p>
</div>
@ -311,6 +311,15 @@ You have learned that the 3D world is a Scene Graph of Spatials: Visible Geometr
<p>
Since standard shapes like spheres and boxes get old fast, continue with the next chapter where you learn to <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_asset.html">load assets, such as 3-D models</a>.
</p>
<div><span>
<a href="/wiki/doku.php/tag:beginner?do=showtag&amp;tag=tag%3Abeginner">beginner</a>,
<a href="/wiki/doku.php/tag:beginner?do=showtag&amp;tag=tag%3Abeginner">beginner,</a>,
<a href="/wiki/doku.php/tag:rootnode?do=showtag&amp;tag=tag%3Arootnode">rootnode</a>,
<a href="/wiki/doku.php/tag:node?do=showtag&amp;tag=tag%3Anode">node</a>,
<a href="/wiki/doku.php/tag:intro?do=showtag&amp;tag=tag%3Aintro">intro</a>,
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>,
<a href="/wiki/doku.php/tag:color?do=showtag&amp;tag=tag%3Acolor">color</a>
</span></div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_node?do=export_xhtmlbody">view online version</a></em></p>

@ -1,5 +1,5 @@
<h1><a>Getting Started with JME3 (13) - Hello Physics</a></h1>
<h1><a>JME 3 Tutorial (13) - Hello Physics</a></h1>
<div>
<p>
@ -590,6 +590,15 @@ Additionally you have learned how to add shadows to a scene.
This is the last beginner tutorial for now. Now you are ready to start <a href="/com/jme3/gde/core/docs/jme3.html">combining</a> what you learned to create a game of your own!
</p>
<div><span>
<a href="/wiki/doku.php/tag:beginner?do=showtag&amp;tag=tag%3Abeginner">beginner</a>,
<a href="/wiki/doku.php/tag:intro?do=showtag&amp;tag=tag%3Aintro">intro</a>,
<a href="/wiki/doku.php/tag:physics?do=showtag&amp;tag=tag%3Aphysics">physics</a>,
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>,
<a href="/wiki/doku.php/tag:input?do=showtag&amp;tag=tag%3Ainput">input</a>,
<a href="/wiki/doku.php/tag:model?do=showtag&amp;tag=tag%3Amodel">model</a>,
<a href="/wiki/doku.php/tag:controller?do=showtag&amp;tag=tag%3Acontroller">controller</a>
</span></div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_physics?do=export_xhtmlbody">view online version</a></em></p>

@ -1,5 +1,5 @@
<h1><a>Getting Started with JME3 (8) - Hello Picking</a></h1>
<h1><a>JME 3 Tutorial (8) - Hello Picking</a></h1>
<div>
<p>
@ -9,15 +9,15 @@ Next: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_collision.html">Hello
</p>
<p>
Common interactions in games include shooting, picking up objects, and opening doors.
Typical interactions in games include shooting, picking up objects, and opening doors.
</p>
<p>
From an implementation point of view, these apparently different interactions are very similar: The user first aims and selects a target in the 3D scene, and then triggers an action on it. We call that picking.
From an implementation point of view, these apparently different interactions are very similar: The user first aims and selects a target in the 3D scene, and then triggers an action on it. We call this process picking.
</p>
<p>
You can pick something by either pressing a key on the keyboard, or by clicking with the mouse. In either case, you identify the target by aiming a ray –a straight line– into the scene. This method to implement picking is called <em>ray casting</em> (not the same as <em>ray tracing</em>).
You can pick something by either pressing a key on the keyboard, or by clicking with the mouse. In either case, you identify the target by aiming a ray –a straight line– into the scene. This method to implement picking is called <em>ray casting</em> (which is not the same as <em>ray tracing</em>).
</p>
<p>
@ -447,6 +447,18 @@ Use your imagination from here:
Now, wouldn&#039;t it be nice if those targets and the floor were solid objects and you could walk among them? Let&#039;s continue with <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_collision.html">Collision Detection</a>.
</p>
<div><span>
<a href="/wiki/doku.php/tag:beginner?do=showtag&amp;tag=tag%3Abeginner">beginner</a>,
<a href="/wiki/doku.php/tag:beginner?do=showtag&amp;tag=tag%3Abeginner">beginner,</a>,
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>,
<a href="/wiki/doku.php/tag:intro?do=showtag&amp;tag=tag%3Aintro">intro</a>,
<a href="/wiki/doku.php/tag:node?do=showtag&amp;tag=tag%3Anode">node</a>,
<a href="/wiki/doku.php/tag:ray?do=showtag&amp;tag=tag%3Aray">ray</a>,
<a href="/wiki/doku.php/tag:click?do=showtag&amp;tag=tag%3Aclick">click</a>,
<a href="/wiki/doku.php/tag:collision?do=showtag&amp;tag=tag%3Acollision">collision</a>,
<a href="/wiki/doku.php/tag:keyinput?do=showtag&amp;tag=tag%3Akeyinput">keyinput</a>,
<a href="/wiki/doku.php/tag:input?do=showtag&amp;tag=tag%3Ainput">input</a>
</span></div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_picking?do=export_xhtmlbody">view online version</a></em></p>

@ -1,16 +1,15 @@
<h1><a>Getting Started with JME3 (1) - Hello SimpleApplication</a></h1>
<h1><a>JME 3 Tutorial (1) - Hello SimpleApplication</a></h1>
<div>
<p>
Previous: <a href="/com/jme3/gde/core/docs/jme3#installing_jmonkeyengine_3.html">Installing JME3</a>,
Next: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_node.html">Hello Node</a>
<br/>
</p>
<p>
This tutorial assumes that you have already <a href="/com/jme3/gde/core/docs/jme3#installing_jmonkeyengine_3.html">downloaded and set up jMonkeyEngine3</a> in an IDE of your choice, and are able to run the bundled samples.
</p>
@ -242,6 +241,13 @@ Continue with the <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_node.html
See also: <a href="/com/jme3/gde/core/docs/jme3/simpleapplication_from_the_commandline.html">SimpleApplication from the commandline</a>
</p>
<div><span>
<a href="/wiki/doku.php/tag:beginner?do=showtag&amp;tag=tag%3Abeginner">beginner,</a>,
<a href="/wiki/doku.php/tag:beginner?do=showtag&amp;tag=tag%3Abeginner">beginner</a>,
<a href="/wiki/doku.php/tag:intro?do=showtag&amp;tag=tag%3Aintro">intro</a>,
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>,
<a href="/wiki/doku.php/tag:init?do=showtag&amp;tag=tag%3Ainit">init</a>
</span></div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_simpleapplication?do=export_xhtmlbody">view online version</a></em></p>

@ -1,5 +1,5 @@
<h1><a>Hello Terrain</a></h1>
<h1><a>JME 3 Tutorial (10) - Hello Terrain</a></h1>
<div>
<p>
@ -510,6 +510,14 @@ In the next chapter, you will learn how to add <a href="/com/jme3/gde/core/docs/
<p>
See also: <a href="/com/jme3/gde/core/docs/jme3/intermediate/terrain_collision.html">Terrain Collision</a>
</p>
<div><span>
<a href="/wiki/doku.php/tag:beginner?do=showtag&amp;tag=tag%3Abeginner">beginner</a>,
<a href="/wiki/doku.php/tag:beginner?do=showtag&amp;tag=tag%3Abeginner">beginner,</a>,
<a href="/wiki/doku.php/tag:heightmap?do=showtag&amp;tag=tag%3Aheightmap">heightmap</a>,
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>,
<a href="/wiki/doku.php/tag:terrain?do=showtag&amp;tag=tag%3Aterrain">terrain</a>,
<a href="/wiki/doku.php/tag:texture?do=showtag&amp;tag=tag%3Atexture">texture</a>
</span></div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_terrain?do=export_xhtmlbody">view online version</a></em></p>

@ -1,10 +1,10 @@
<h1><a>Setting up a svn checkout of the jME3 Engine</a></h1>
<h1><a>Setting up JME3 in Netbeans 6.x</a></h1>
<div>
<p>
You are welcome to try out the new jME3, and contribute patches and features! This document shows how to download, set up, build, and run the latest development version from the sources.
You are welcome to try out the new jME3, and contribute patches and features! This document shows how to download, set up, build, and run the latest development version from the sources. (As of Spring 2010, we are in alpha.) These instructions work in NetBeans IDE 6 or better.
</p>
<p>
@ -18,12 +18,13 @@ Note: In the following, always replace ”~” with the path to your home direct
<p>
Check out the sources from the repository.
Check out the sources from the repository. (The following NetBeans instructions are equivalent to executing <code>cd ~/NetBeansProjects; svn checkout <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.googlecode.com/svn/trunk/engine"><param name="text" value="<html><u>http://jmonkeyengine.googlecode.com/svn/trunk/engine</u></html>"><param name="textColor" value="blue"></object> jme3</code> on the commandline.)
</p>
<ol>
<li><div> In jMonkeyPlatform go to Team &gt; Subversion &gt; Checkout</div>
<li><div> In NetBeans go to Team &gt; Subversion &gt; Checkout</div>
<ol>
<li><div> Repository <acronym title="Uniform Resource Locator">URL</acronym>: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="https://jmonkeyengine.googlecode.com/svn"><param name="text" value="<html><u>https://jmonkeyengine.googlecode.com/svn</u></html>"><param name="textColor" value="blue"></object></div>
<li><div> Repository <acronym title="Uniform Resource Locator">URL</acronym>: <code><object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="https://jmonkeyengine.googlecode.com/svn"><param name="text" value="<html><u>https://jmonkeyengine.googlecode.com/svn</u></html>"><param name="textColor" value="blue"></object></code></div>
</li>
<li><div> You can leave user/pw blank for anonymous access. </div>
</li>
@ -31,9 +32,11 @@ Check out the sources from the repository.
</li>
<li><div> Click Next</div>
<ol>
<li><div> Repository Folders: “trunk/engine”</div>
<li><div> Repository Folders: <code>trunk/engine</code></div>
</li>
<li><div> Enable the checkbox to Skip “engine” and only checkout its contents.</div>
</li>
<li><div> Local Folder: ~/jMonkeyProjects</div>
<li><div> Local Folder: <code>~/NetBeansProjects/jme3</code></div>
</li>
</ol>
</li>
@ -43,8 +46,52 @@ Check out the sources from the repository.
<p>
The jme3 project opens in the Project window.
The jme3 project opens in the Project window. It already includes a working ANT build script for building and running.
</p>
<p>
Look into the Libraries node and confirm that the project depends on the following libraries in the classpath:
</p>
<pre>
jME3-natives-joal.jar lwjgl.jar gluegen-rt.jar
jME3-lwjgl-natives.jar jinput.jar swing-layout-1.0.4.jar
j-ogg-oggd.jar vecmath.jar stack-alloc.jar
j-ogg-vorbisd.jar asm-all-3.1.jar jbullet.jar
jheora-jst-debug-0.6.0.jar xmlpull.xpp3-1.1.4c.jar
nifty*.jar eventbus-1.4.jar
</pre>
</div>
<h3><a>Optional: Setting up Android Support</a></h3>
<div>
<p>
Work in progress …
</p>
<p>
A jme3 application can either be deployed to the desktop (as Java Swing application) and web browser (as JNLP/WebStart or Applet), or to an Android phone. While the former is the default, switching to Android deployment can be done in a few steps.
</p>
<ol>
<li><div> Open Project Properties, go to Sources category.</div>
</li>
<li><div> At Source Packages Folders, click “Add Folder”. </div>
<ul>
<li><div> Add <code>src/android/</code></div>
</li>
<li><div> Remove <code>src/desktop</code></div>
</li>
<li><div> Remove <code>src/desktop_fx</code></div>
</li>
</ul>
</li>
<li><div> build.xml…</div>
</li>
</ol>
</div>
<h2><a>Build and Run</a></h2>
@ -52,14 +99,14 @@ The jme3 project opens in the Project window.
<p>
That&#039;s it!
That&#039;s it!
</p>
<ol>
<li><div> Right-click the jme3 project node and “Clean and Build” the project.</div>
</li>
<li><div> In the Projects window, browse to the <code>src/jme3_test</code> folder. </div>
<li><div> In the Projects window, browse to the <code>src/test/jme3test</code> folder. </div>
</li>
<li><div> Right-click the file <code>jme3_test/model/TestBox.java</code> and choose “Run” to run a sample. </div>
<li><div> Right-click e.g. the file <code>src/test/jme3test/model/TestHoverTank.java</code> and choose “Run” to run a sample. </div>
<ol>
<li><div> In the sample application, use the mouse and the AWSD keys to move around the test object.</div>
</li>
@ -69,5 +116,72 @@ That&#039;s it!
</li>
</ol>
<p>
Sample code for cool features is in the <code>src/test/jme3test</code> folder. A sample game can be found in <code>src/games/jme3game/cubefield/CubeField.java</code>.
</p>
<p>
Tips:
</p>
<ul>
<li><div> To run runnable classes from the Projects window, right-click and choose Run.</div>
</li>
<li><div> To run any runnable class that is open in the editor, press shift-F6.</div>
</li>
</ul>
</div>
<h2><a>Optional: Javadoc Popups and Source Navigation in NetBeans</a></h2>
<div>
<p>
If you are working on the jme3 sources:
</p>
<ol>
<li><div> In the Projects window, right-click the jme3 project and choose Generate Javadoc. Wait.</div>
</li>
<li><div> Confirm in the Files window that the javadoc has been created in <code>~/NetBeansProjects/jme3/dist/javadoc</code></div>
</li>
<li><div> In the editor, place the caret in a jme class and press ctrl-space to view javadoc.</div>
</li>
</ol>
<p>
If you are working on a game project that depends on jme3:
</p>
<ol>
<li><div> First follow the previous tip. (In the future, we may offer jme javadoc as download instead.)</div>
</li>
<li><div> In your game project, right-click the Libraries node and choose “Properties”.</div>
</li>
<li><div> In the Library properties, select jme3.jar and click the Edit button.</div>
<ol>
<li><div> For the Javadoc field, browse to <code>~/NetBeansProjects/jme3/dist/javadoc</code>. Check “as relative path” and click select.</div>
</li>
<li><div> For the Sources field, browse to <code>~/NetBeansProjects/jme3/src</code>. Check “as relative path” and click select.</div>
</li>
<li><div> Click OK.</div>
</li>
</ol>
</li>
<li><div> In the editor, place the caret in a jme class and press ctrl-space to view javadoc. Ctrl-click any jme3 method to jump to its definition in the sources. </div>
</li>
</ol>
<p>
This tip works for any third-party JAR library that you use. (You may have to download the javadoc/sources from their home page separately).
</p>
<hr />
<p>
Sources used: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/wiki/BuildJme3"><param name="text" value="<html><u>BuildJme3</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.jmonkeyengine.com/forum/index.php?topic=13108.0"><param name="text" value="<html><u>netbeans tutorial from forum</u></html>"><param name="textColor" value="blue"></object>
</p>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:build_jme3_sources_with_netbeans?do=export_xhtmlbody">view online version</a></em></p>

@ -8,11 +8,7 @@
<div>
<p>
With computers having multiple cores nowadays, it seems feasible to let the physics run on a separate thread. However, there are some implications and plain multithreading is not always the solution for problems but bring on new ones.
</p>
<p>
Multithreading is misunderstood by many programmers nowadays. The secret is not to have separate detached logical loops going on in parallel and have them communicate about their state (Like one thread AI, one Sound, one Graphics) but to have a normal “loop” for logic and then just multithread within that loop when its appropriate. Each for loop in the main loop might be a chance for MT&#039;ing, this scales way better to multiple cores and does not break up code logic. So ideally, the physics system makes use of multiple cores itself and is still included in a “normal” update order. Since bullet is not (yet) multithreaded or GPU accelerated the jME3 implementation allows some ways to run the physics on a separate thread. These are described here.
Since bullet is not (yet) multithreaded or GPU accelerated the jME3 implementation allows to run each physics space on a separate thread that is executed in parallel to rendering.
</p>
</div>
@ -27,7 +23,7 @@ A SimpleApplication with a BulletAppState allows setting the threading type via
<pre>setThreadingType(ThreadingType type);</pre>
<p>
where ThreadingType can be either SEQUENTIAL, PARALLEL or DETACHED.
where ThreadingType can be either SEQUENTIAL or PARALLEL.
</p>
<p>
@ -36,101 +32,8 @@ In the simpleInitApp() method:
<pre>bulletAppState = new BulletAppState&#40;&#41;;
bulletAppState.setThreadingType&#40;BulletAppState.ThreadingType.PARALLEL&#41;;
stateManager.attach&#40;bulletAppState&#41;;</pre>
</div>
<h3><a>SEQUENTIAL</a></h3>
<div>
<p>
This does everything sequentially on one thread, updating the scene, updating physics and then rendering the scene.
</p>
</div>
<h4><a>Good about this way:</a></h4>
<div>
<ol>
<li><div> Seamless for user, no syncing problems</div>
</li>
</ol>
</div>
<h4><a>Bad about this way:</a></h4>
<div>
<ol>
<li><div> no multithreading (only one core is used)</div>
</li>
</ol>
</div>
<h3><a>PARALLEL</a></h3>
<div>
<p>
This solution comes close to the “one loop /w parallel computations” way I described before. Here the physics update happens in parallel to rendering, after the users changes have been made in the update() call. This way the loop logic is still maintained: the user can set and change values in physics and scenegraph objects before render() and physicsUpdate() are called in parallel.
This is the “standard” form of multithreading since it will produce less problems for users.
</p>
</div>
<h4><a>Good about this way:</a></h4>
<div>
<ol>
<li><div> Seamless for user, no syncing problems</div>
</li>
</ol>
</div>
<h4><a>Bad about this way:</a></h4>
<div>
<ol>
<li><div> render and physics thread will have to wait for each other, lowering the multithreading efficiency</div>
</li>
<li><div> user update(), updateGeometric() and updateLogic() takes away cpu cycles for rendering and physics, not just render time</div>
</li>
</ol>
</div>
<h3><a>DETACHED</a></h3>
<div>
<p>
This mode lets the physics update loop run completely separate on another thread and the location/rotation of the single physics objects (via the MotionState) is atomized. This way the scenegraph loop can safely get and set these values. However all physics parameters have still to be changed from the physics thread and adding/removing of objects has to happen via the physics thread.
The updatePhysics() method is called by a separate thread and you have to care for yourself that you access the physics parameters of a PhysicsNode from the physics thread and the “rest” of the parameters via the opengl thread.
</p>
</div>
<h4><a>Good about this way:</a></h4>
<div>
<ol>
<li><div> Because only the single objects are atomized, the scenegraph and physics update loops will seldom block each other as they&#039;re probably working in different “areas” of the scenegraph most of the time. This means maximum thread efficiency.</div>
</li>
</ol>
</div>
<h4><a>Bad about this way:</a></h4>
<div>
<ol>
<li><div> Because only the single objects are atomized, the state of the physics objects that is applied to the jme objects is not assured to be from the same physics step for all objects. But still many users of bullet handle it this way and in effect its not noticeable.</div>
</li>
<li><div> User has to care about what to modify from what thread</div>
</li>
</ol>
</div>
<h2><a>Future of jme3/bullet</a></h2>
<div>
<p>
In the future, I hope that when I have integrated the native bullet version with OpenCL support etc. the PARALLEL solution or even the SEQUENTIAL solution becomes the standard way of doing things as the boost in performance from the graphics card should beat the boost from using another CPU by far.
The physics update happens in parallel to rendering, after the users changes have been made in the update() call. This way the loop logic is still maintained: the user can set and change values in physics and scenegraph objects before render() and physicsUpdate() are called in parallel.
</p>

@ -36,6 +36,9 @@ Knowing exactly what you are looking for allows you to search more efficiently,
<th>Use first-person view </th><td>Use camera <code>flyCam</code> <br/>
com.jme3.input.FlyByCamera </td><td><a href="/com/jme3/gde/core/docs/jme3/beginner/hello_collision.html">Hello Collision</a> </td>
</tr>
<tr>
<th>Increase camera speed </th><td><code>flyCam.setMoveSpeed(50f);</code> </td><td></td>
</tr>
<tr>
<th>Only draw outline of the scene </th><td>Use a wireframe material, e.g. for debugging. </td><td> <a href="/com/jme3/gde/core/docs/jme3/advanced/debugging.html">Debugging</a> </td>
</tr>
@ -65,7 +68,7 @@ Knowing exactly what you are looking for allows you to search more efficiently,
</tr>
<tr>
<th>Make simple shapes like cubes, spheres </th><td>com.jme3.scene.Geometry, com.jme3.scene.shape.* </td><td> <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_node.html">Hello Node</a>, <a href="/com/jme3/gde/core/docs/jme3/advanced/shape.html">Shape</a> <br/>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/model/shape/TestCylinder.java"><param name="text" value="<html><u>TestCylinder.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/model/shape/TestBox.java"><param name="text" value="<html><u>TestBox.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/model/shape/TestSphere.java"><param name="text" value="<html><u>TestSphere.java</u></html>"><param name="textColor" value="blue"></object> </td>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/model/shape/TestCylinder.java"><param name="text" value="<html><u>TestCylinder.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/model/shape/TestBox.java"><param name="text" value="<html><u>TestBox.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/model/shape/TestSphere.java"><param name="text" value="<html><u>TestSphere.java</u></html>"><param name="textColor" value="blue"></object> </td>
</tr>
<tr>
<th>Create a 3-D model </th><td>Create the model in a 3-D mesh editor (for example Blender) and export it as Ogre <acronym title="Extensible Markup Language">XML</acronym> mesh. </td><td><object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://blender.org"><param name="text" value="<html><u>Download Blender</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro"><param name="text" value="<html><u>Blender tutorial</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.ogre3d.org/wiki/index.php/Blender_Exporter"><param name="text" value="<html><u>Blender-to-Ogre plugin</u></html>"><param name="textColor" value="blue"></object> <br/>
@ -76,7 +79,7 @@ Knowing exactly what you are looking for allows you to search more efficiently,
jMonkeyPlatform: Converting Ogre to j3o binary format speeds up model loading. <br/>
AssetManager, com.jme3.scene.plugins.ogre.*, com.jme3.scene.Geometry </td><td> <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_asset.html">Hello Asset</a> <br/>
<a href="/com/jme3/gde/core/docs/sdk/model_loader_and_viewer.html">jMonkeyPlatform j3o converter</a> <br/>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/model/TestOgreLoading.java"><param name="text" value="<html><u>TestOgreLoading.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/export/TestOgreConvert.java"><param name="text" value="<html><u>TestOgreConvert.java</u></html>"><param name="textColor" value="blue"></object> </td>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/model/TestOgreLoading.java"><param name="text" value="<html><u>TestOgreLoading.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/export/TestOgreConvert.java"><param name="text" value="<html><u>TestOgreConvert.java</u></html>"><param name="textColor" value="blue"></object> </td>
</tr>
<tr>
<th>Move or turn or resize an object </th><td>Use transformations: geo.setLocalTranslation(), geo.rotate(), geo.scale() <br/>
@ -93,23 +96,23 @@ Knowing exactly what you are looking for allows you to search more efficiently,
<a href="/com/jme3/gde/core/docs/jme3/advanced/update_loop.html">Update Loop</a> <br/>
<a href="/com/jme3/gde/core/docs/jme3/advanced/custom_controls.html">Custom Controls</a> <br/>
<a href="/com/jme3/gde/core/docs/jme3/advanced/cinematics.html">Cinematics</a> <br/>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/material/TestBumpModel.java"><param name="text" value="<html><u>TestBumpModel.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/model/TestOgreLoading.java"><param name="text" value="<html><u>TestOgreLoading.java</u></html>"><param name="textColor" value="blue"></object> </td>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/material/TestBumpModel.java"><param name="text" value="<html><u>TestBumpModel.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/model/TestOgreLoading.java"><param name="text" value="<html><u>TestOgreLoading.java</u></html>"><param name="textColor" value="blue"></object> </td>
</tr>
<tr>
<th>Manipulate the color or shininess of an object </th><td>Materials, AssetManager </td><td> <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_material.html">Hello Material</a> <br/>
<a href="/com/jme3/gde/core/docs/jme3/advanced/materials_overview.html">Materials Overview</a> <br/>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/light/TestNormalMapping.java"><param name="text" value="<html><u>TestNormalMapping.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/model/TestSphere.java"><param name="text" value="<html><u>TestSphere.java</u></html>"><param name="textColor" value="blue"></object> </td>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/light/TestNormalMapping.java"><param name="text" value="<html><u>TestNormalMapping.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/model/TestSphere.java"><param name="text" value="<html><u>TestSphere.java</u></html>"><param name="textColor" value="blue"></object> </td>
</tr>
<tr>
<th>Manipulate the surface of an object (wood vs stone vs metal etc) </th><td>Textures, AssetManager. </td><td><a href="/com/jme3/gde/core/docs/jme3/beginner/hello_material.html">Hello Material</a> <br/>
<a href="/com/jme3/gde/core/docs/jme3/advanced/materials_overview.html">Materials Overview</a> <br/>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/material/TestSimpleBumps.java"><param name="text" value="<html><u>TestSimpleBumps.java</u></html>"><param name="textColor" value="blue"></object> <br/>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/material/TestSimpleBumps.java"><param name="text" value="<html><u>TestSimpleBumps.java</u></html>"><param name="textColor" value="blue"></object> <br/>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://wiki.blender.org/index.php/Doc:Manual/Textures/Maps/Bump_and_Normal_Maps"><param name="text" value="<html><u>Blender: Creating Bump Maps and Normal maps</u></html>"><param name="textColor" value="blue"></object> </td>
</tr>
<tr>
<th>Make objects cast a shadow </th><td>com.jme3.shadow.BasicShadowRenderer, com.jme3.light.DirectionalLight <br/>
setShadowMode() </td><td> <a href="/com/jme3/gde/core/docs/jme3/advanced/light_and_shadow.html">Light and Shadow</a> <br/>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/jme3test/fx/TestEverything.java"><param name="text" value="<html><u>TestEverything.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/jme3test/light/TestShadow.java"><param name="text" value="<html><u>TestShadow.java</u></html>"><param name="textColor" value="blue"></object> </td>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/jme3test/fx/TestEverything.java"><param name="text" value="<html><u>TestEverything.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/jme3test/light/TestShadow.java"><param name="text" value="<html><u>TestShadow.java</u></html>"><param name="textColor" value="blue"></object> </td>
</tr>
<tr>
<th>Render transparent objects (glass, window panes, water, tree leaves) </th><td>Assign a transparent texture to the Material and set material.getAdditionalRenderState().setBlendMode(BlendMode.Alpha); </td><td><a href="/com/jme3/gde/core/docs/jme3/beginner/hello_material.html">Hello Material</a> <br/>
@ -152,13 +155,13 @@ Knowing exactly what you are looking for allows you to search more efficiently,
<tr>
<th>Let players interact by clicking, e.g. picking up objects, opening doors, shooting </th><td>Intersect a Ray from the player with the Bounding Volume of the target: com.jme3.bounding.*, com.jme3.math.Ray, com.jme3.collision.CollisionResults. </td><td><a href="/com/jme3/gde/core/docs/jme3/beginner/hello_picking.html">Hello Picking</a> <br/>
<a href="/com/jme3/gde/core/docs/jme3/advanced/collision_and_intersection.html">Collision and Intersection</a> <br/>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/bounding/TestRayCollision.java"><param name="text" value="<html><u>TestRayCollision.java</u></html>"><param name="textColor" value="blue"></object> </td>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bounding/TestRayCollision.java"><param name="text" value="<html><u>TestRayCollision.java</u></html>"><param name="textColor" value="blue"></object> </td>
</tr>
<tr>
<th>Animate objects and characters </th><td>Create an animated OgreMesh model with Bones in a 3-D editor (e.g. Blender). <br/>
com.jme3.animation.* </td><td> <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_animation.html">Hello Animation</a> <br/>
<a href="/com/jme3/gde/core/docs/jme3/advanced/animation.html">Animation</a> <br/>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/model/anim/"><param name="text" value="<html><u>animation</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://wiki.blender.org/index.php/Doc:Tutorials/Animation/BSoD/Character_Animation"><param name="text" value="<html><u>Blender animation tutorial</u></html>"><param name="textColor" value="blue"></object> </td>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/model/anim/"><param name="text" value="<html><u>animation</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://wiki.blender.org/index.php/Doc:Tutorials/Animation/BSoD/Character_Animation"><param name="text" value="<html><u>Blender animation tutorial</u></html>"><param name="textColor" value="blue"></object> </td>
</tr>
<tr>
<th>Keep players walking on floors of scenes </th><td>Collision detection – raycasting or physics. </td><td><a href="/com/jme3/gde/core/docs/jme3/beginner/hello_collision.html">Hello Collision</a> <br/>
@ -174,16 +177,16 @@ Knowing exactly what you are looking for allows you to search more efficiently,
<th>Let balls, cars, etc bounce off obstacles and roll on floors </th><td>Use physics nodes and bounding volumes: com.jme3.bounding.*, com.jme3.bullet.collisions, com.jme3.bullet.nodes.PhysicsNode etc <br/>
geo.setModelBound(); geo.updateModelBound(); </td><td><a href="/com/jme3/gde/core/docs/jme3/beginner/hello_physics.html">Hello Physics</a> <br/>
<a href="/com/jme3/gde/core/docs/jme3/advanced/physics.html">Physics</a> <br/>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/bullet/TestSimplePhysics.java"><param name="text" value="<html><u>TestSimplePhysics.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/bullet"><param name="text" value="<html><u>more samples</u></html>"><param name="textColor" value="blue"></object> </td>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet/TestSimplePhysics.java"><param name="text" value="<html><u>TestSimplePhysics.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet"><param name="text" value="<html><u>more samples</u></html>"><param name="textColor" value="blue"></object> </td>
</tr>
<tr>
<th>Steer cars, motorcycles, etc </th><td>Use physics characters and vehicles: com.jme3.bullet.*, PhysicsCharacterNode, PhysicsVehicleNode </td><td><a href="/com/jme3/gde/core/docs/jme3/advanced/vehicles.html">Vehicles</a> <br/>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/bullet/TestFancyCar.java"><param name="text" value="<html><u>TestFancyCar.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/bullet/TestPhysicsCharacter.java"><param name="text" value="<html><u>TestPhysicsCharacter.java</u></html>"><param name="textColor" value="blue"></object> <br/>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet/TestFancyCar.java"><param name="text" value="<html><u>TestFancyCar.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet/TestPhysicsCharacter.java"><param name="text" value="<html><u>TestPhysicsCharacter.java</u></html>"><param name="textColor" value="blue"></object> <br/>
(Press HUJK keys to steer, spacebar to jump.) </td>
</tr>
<tr>
<th>Let an object swing like a pendulum or chain links </th><td>Use physics joints: com.jme3.bullet.joints.PhysicsHingeJoint </td><td><a href="/com/jme3/gde/core/docs/jme3/advanced/hinges_and_joints.html">Hinges and Joints</a> <br/>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/bullet/TestPhysicsHingeJoint.java"><param name="text" value="<html><u>TestPhysicsHingeJoint.java</u></html>"><param name="textColor" value="blue"></object> <br/>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/bullet/TestPhysicsHingeJoint.java"><param name="text" value="<html><u>TestPhysicsHingeJoint.java</u></html>"><param name="textColor" value="blue"></object> <br/>
(Press HK keys to turn, spacebar to swing.) </td>
</tr>
</table>
@ -202,11 +205,11 @@ Knowing exactly what you are looking for allows you to search more efficiently,
<tr>
<th>Display text (score, health), flat mini-maps or status icons </th><td>Attach a picture to the orthogonal <code>guiNode</code> to create a heads-up display (<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikipedia.org/wiki/HUD_%28video_gaming%29"><param name="text" value="<html><u>HUD</u></html>"><param name="textColor" value="blue"></object>). <br/>
com.jme3.font.*, com.jme3.ui.Picture. guiNode.attachChild() </td><td> <a href="/com/jme3/gde/core/docs/jme3/advanced/hud.html">HUD</a> <br/>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/gui/TestOrtho.java"><param name="text" value="<html><u>TestOrtho.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/gui/TestBitmapFont.java"><param name="text" value="<html><u>TestBitmapFont.java</u></html>"><param name="textColor" value="blue"></object> </td>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/gui/TestOrtho.java"><param name="text" value="<html><u>TestOrtho.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/gui/TestBitmapFont.java"><param name="text" value="<html><u>TestBitmapFont.java</u></html>"><param name="textColor" value="blue"></object> </td>
</tr>
<tr>
<th>Display buttons to let the player switch between the game/settings/score screens </th><td>Nifty <acronym title="Graphical User Interface">GUI</acronym> </td><td><a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui.html">Nifty GUI</a> <br/>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/niftygui/TestNiftyGui.java"><param name="text" value="<html><u>TestNiftyGui.java</u></html>"><param name="textColor" value="blue"></object> </td>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/niftygui/TestNiftyGui.java"><param name="text" value="<html><u>TestNiftyGui.java</u></html>"><param name="textColor" value="blue"></object> </td>
</tr>
</table>
@ -221,29 +224,29 @@ Knowing exactly what you are looking for allows you to search more efficiently,
<tr>
<th>Play sounds and noises </th><td>AudioRenderer, Listener, and AudioNode from com.jme3.audio.* </td><td><a href="/com/jme3/gde/core/docs/jme3/beginner/hello_audio.html">Hello Audio</a> <br/>
<a href="/com/jme3/gde/core/docs/jme3/advanced/audio.html">Audio</a> <br/>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/audio"><param name="text" value="<html><u>audio</u></html>"><param name="textColor" value="blue"></object> </td>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/audio"><param name="text" value="<html><u>audio</u></html>"><param name="textColor" value="blue"></object> </td>
</tr>
<tr>
<th>Simulate fire, flames, smoke, explosions, swarms, dust, magic spells </th><td>Use particle emitters: com.jme3.effect.EmitterSphereShape, com.jme3.effect.ParticleEmitter </td><td><a href="/com/jme3/gde/core/docs/jme3/beginner/hello_effects.html">Hello Effects</a> <br/>
<a href="/com/jme3/gde/core/docs/jme3/advanced/particle_emitters.html">Particle Emitters</a> <br/>
<a href="/com/jme3/gde/core/docs/jme3/advanced/bloom_and_glow.html">Bloom and Glow</a> <br/>
<a href="/com/jme3/gde/core/docs/jme3/advanced/effects_overview.html">Effects Overview</a> <br/>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/fx/TestExplosionEffect.java"><param name="text" value="<html><u>TestExplosionEffect.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/fx/TestParticleEmitter.java"><param name="text" value="<html><u>TestParticleEmitter.java</u></html>"><param name="textColor" value="blue"></object> </td>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/fx/TestExplosionEffect.java"><param name="text" value="<html><u>TestExplosionEffect.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/fx/TestParticleEmitter.java"><param name="text" value="<html><u>TestParticleEmitter.java</u></html>"><param name="textColor" value="blue"></object> </td>
</tr>
<tr>
<th>Simulate water, waves, reflections </th><td>com.jme3.water.* </td><td> <a href="/com/jme3/gde/core/docs/jme3/advanced/water.html">Water</a> <br/>
<a href="/com/jme3/gde/core/docs/jme3/advanced/post-processor_water.html">Post-Processor Water</a> <br/>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/water/TestSceneWater.java"><param name="text" value="<html><u>TestSceneWater.java</u></html>"><param name="textColor" value="blue"></object> </td>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/water/TestSceneWater.java"><param name="text" value="<html><u>TestSceneWater.java</u></html>"><param name="textColor" value="blue"></object> </td>
</tr>
<tr>
<th>Generate a terrain </th><td>com.jme3.terrain.* </td><td><a href="/com/jme3/gde/core/docs/jme3/beginner/hello_terrain.html">Hello Terrain</a> <br/>
<a href="/com/jme3/gde/core/docs/jme3/advanced/terrain.html">Terrain</a> <br/>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/terrain/TestTerrain.java"><param name="text" value="<html><u>TestTerrain.java</u></html>"><param name="textColor" value="blue"></object> </td>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/terrain/TestTerrain.java"><param name="text" value="<html><u>TestTerrain.java</u></html>"><param name="textColor" value="blue"></object> </td>
</tr>
<tr>
<th>Simulate a sky </th><td>rootNode.attachChild(SkyFactory.createSky( assetManager, “Textures/Sky/Bright/BrightSky.dds”, false)); <br/>
skyGeo.setQueueBucket(Bucket.Sky) </td><td><a href="/com/jme3/gde/core/docs/jme3/advanced/sky.html">Sky</a> <br/>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/test/jme3test/texture/TestCubeMap.java"><param name="text" value="<html><u>TestCubeMap.java</u></html>"><param name="textColor" value="blue"></object> </td>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/texture/TestCubeMap.java"><param name="text" value="<html><u>TestCubeMap.java</u></html>"><param name="textColor" value="blue"></object> </td>
</tr>
</table>

@ -8,7 +8,7 @@ A collection of recommendations and expert tips. Feel free to add your own!
</p>
<p>
If you are a beginner, you should first <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.gamedevlessons.com/?page=free"><param name="text" value="<html><u>read some</u></html>"><param name="textColor" value="blue"></object> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://gamasutra.com/"><param name="text" value="<html><u>articles about</u></html>"><param name="textColor" value="blue"></object> game developement. We cannot cover all general tips here.
If you are a beginner, you should first <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.gamedevlessons.com/?page=free"><param name="text" value="<html><u>read some</u></html>"><param name="textColor" value="blue"></object> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://gamasutra.com/"><param name="text" value="<html><u>articles about</u></html>"><param name="textColor" value="blue"></object> game development. We cannot cover all general tips here.
</p>
</div>
@ -44,9 +44,9 @@ As a quick overview, answer yourself the following questions:
<ul>
<li><div> What is the start state, what is the end state? </div>
</li>
<li><div> What resources does the player manage? E.g. speed, gold, health, “points”</div>
<li><div> What resources does the player manage? How are resources gained, transformed, spent? E.g. speed, gold, health, “points”.</div>
</li>
<li><div> How does the player interact? Rules, challenges, game mechanics</div>
<li><div> How does the player interact? I.e. rules, challenges, game mechanics.</div>
</li>
<li><div> What state is considered winning, and what losing?</div>
</li>
@ -63,7 +63,7 @@ As a quick overview, answer yourself the following questions:
<ul>
<li><div> Can you achieve a high degree of input control? Even minor navigation and interaction glitches make the game unsolvable.</div>
</li>
<li><div> Clearly reflect status and changes in game states. E.g. health/damage.</div>
<li><div> Clearly reflect current status, and changes in game states. E.g. health/damage.</div>
</li>
<li><div> Clearly reward good moves and discourage bad ones.</div>
</li>
@ -104,23 +104,23 @@ As a quick overview, answer yourself the following questions:
</li>
</ol>
</li>
<li><div> Release Candidate</div>
<li><div> Gamma, Delta = Release Candidates</div>
<ol>
<li><div> Last chance to find a horrible bug.</div>
</li>
</ol>
</li>
<li><div> Final Release</div>
<li><div> Omega = Final Release</div>
</li>
</ol>
<p>
How you actually name or number these milestones is up to you. People use the words “milestone”, Greek letters, versions, numbers, or combinations thereof.
How you actually name or number these milestones is up to you. People use the words “milestone”, Greek letters, version numbers, or combinations thereof.
</p>
<p>
Every milestone has a development phase and a test phase. Here are some best practices:
Every milestone is made up of a development phase and a test phase. Here are some best practices:
</p>
</div>
@ -165,7 +165,7 @@ Acknowledge whether you want a feature because it is necessary for gameplay, or
<p>
Typically developers create a custom class off of jME3&#039;s SimpleApplication. For a racing game you would create a different base game class than for a space game or shooter.
Typically, developers extend a custom class off of jME3&#039;s com.jme3.app.SimpleApplication (or even com.jme3.app.Application). For a racing game you would create a different base game class than for a space game or a shooter.
</p>
<ol>
@ -229,11 +229,12 @@ Learn more about <a href="/com/jme3/gde/core/docs/jme3/advanced/custom_controls.
<h3><a>Optimize Application Performance</a></h3>
<div>
<p>
<a href="/com/jme3/gde/core/docs/jme3/intermediate/optimization.html">Optimization</a>
</p>
<ul>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/intermediate/optimization.html">Optimization</a></div>
</li>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/multithreading.html">Multithreading</a></div>
</li>
</ul>
</div>
@ -293,7 +294,7 @@ jMonkeyProjects/Pong/assets/Textures/ # .mesh.xml+.material, .mtl+.obj, .jpg, .
</pre>
<p>
See also: <a href="/com/jme3/gde/core/docs/jme3/jmonkeyplatform/asset_packs.html">Asset Packs</a>
See also: <a href="/com/jme3/gde/core/docs/sdk/asset_packs.html">Asset Packs</a>
</p>
</div>
@ -448,13 +449,15 @@ A Java Profiler can be added to the jMonkeyPlatform via Tools → Plugins → Av
<ul>
<li><div> Verify that all assets are up-to-date and converted to .j3o.</div>
</li>
<li><div> Prepare licenses of assets that you use for inclusion (you <em>did</em> obtain permission to use them, right…?)</div>
</li>
<li><div> Switch off fine <a href="/com/jme3/gde/core/docs/jme3/advanced/logging.html">logging</a> output.</div>
</li>
<li><div> Prepare a web page</div>
<li><div> Prepare promotional art: Cool screenshots (in thumbnail, square, vertical, horizontal, and fullscreen formats) and video clips. Include name, contact info, slogan, etc so customers can find you.</div>
</li>
<li><div> Prepare a readme.txt file, installation guide, or handbook – if applicable.</div>
<li><div> Prepare a web page, start getting advertisment slots, etc</div>
</li>
<li><div> Prepare promotional art: Cool screenshots (in thumbnail, square, vertical, horizontal, and fullscreen formats) and video clips. Include name, contact info, slogan, etc.</div>
<li><div> Prepare a readme.txt file, or installation guide, or handbook – if applicable.</div>
</li>
<li><div> Get a certificate if it is required for your distribution method (see below).</div>
</li>
@ -470,7 +473,7 @@ A Java Profiler can be added to the jMonkeyPlatform via Tools → Plugins → Av
</p>
<p>
Do you release your game as WebStart, Desktop JAR, or Applet? Each has its pros and cons.
The <a href="/com/jme3/gde/core/docs/sdk.html">SDK</a> can help you with deployment. Do you release your game as WebStart, Desktop JAR, or Applet? Each has its pros and cons.
</p>
<table>
@ -479,19 +482,19 @@ Do you release your game as WebStart, Desktop JAR, or Applet? Each has its pros
</tr>
<tr>
<td>Desktop Launcher <br/>
(.EXE, .app, .jar+.sh)</td><td>This is the standard way of distributing desktop applications. The jMonkeyPlatform can be configured to automatically create zipped launchers for each operating system. Your company does not need a certificate.</td><td>You need to offer three separate, platform-dependent downloads.</td>
(.EXE, .app, .jar+.sh)</td><td>This is the standard way of distributing desktop applications. The jMonkeyPlatform can be configured to automatically create zipped launchers for each operating system. </td><td>You need to offer three separate, platform-dependent downloads.</td>
</tr>
<tr>
<td>Desktop Application <br/>
(.JAR)</td><td>Platform independent desktop application. Your company does not need a certificate.</td><td>User must have Java configured to run JARs when they are opened; or user must know how to run JARs from command line; or you must provide a custom JAR wrapper.</td>
(.JAR)</td><td>Platform independent desktop application. </td><td>User must have Java configured to run JARs when they are opened; or user must know how to run JARs from command line; or you must provide a custom JAR wrapper.</td>
</tr>
<tr>
<td>Web Start <br/>
(.JNLP)</td><td>The user accesses a <acronym title="Uniform Resource Locator">URL</acronym>, saves the game as one executable file. Easy process, no installer required. You can allow the game to be played offline.</td><td>Users need network connection to install the game. Downloading bigger games takes a while as opposed to running them from a CD. Your company must have a trusted certificate.</td>
(.JNLP)</td><td>The user accesses a <acronym title="Uniform Resource Locator">URL</acronym>, saves the game as one executable file. Easy process, no installer required. You can allow the game to be played offline.</td><td>Users need network connection to install the game. Downloading bigger games takes a while as opposed to running them from a CD. </td>
</tr>
<tr>
<td>Browser Applet <br/>
(.<acronym title="HyperText Markup Language">HTML</acronym>+.JAR)</td><td>Easy to access and play game via most web browsers. Userfriendly solution for quick small games.</td><td>Game only runs in the browser. Game or settings cannot be saved to disk. Your company must have a trusted certificate. Some restrictions in default camera navigation (jME cannot capture mouse.)</td>
(.<acronym title="HyperText Markup Language">HTML</acronym>+.JAR)</td><td>Easy to access and play game via most web browsers. Userfriendly solution for quick small games.</td><td>Game only runs in the browser. Game or settings cannot be saved to disk. Some restrictions in default camera navigation (jME cannot capture mouse.)</td>
</tr>
</table>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 49 KiB

@ -69,7 +69,9 @@ Okay, so you can now start your game in a headless &#039;server mode&#039;, wher
<a href="/wiki/doku.php/tag:intermediate?do=showtag&amp;tag=tag%3Aintermediate">intermediate</a>,
<a href="/wiki/doku.php/tag:server?do=showtag&amp;tag=tag%3Aserver">server</a>,
<a href="/wiki/doku.php/tag:spidermonkey?do=showtag&amp;tag=tag%3Aspidermonkey">spidermonkey</a>,
<a href="/wiki/doku.php/tag:headless?do=showtag&amp;tag=tag%3Aheadless">headless</a>
<a href="/wiki/doku.php/tag:headless?do=showtag&amp;tag=tag%3Aheadless">headless</a>,
<a href="/wiki/doku.php/tag:network?do=showtag&amp;tag=tag%3Anetwork">network</a>,
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>
</span></div>
</div>

@ -1,135 +1,252 @@
<h1><a>My First Game - Tutorial Series (Draft)</a></h1>
<div>
<p>
<strong>DRAFT!</strong>
</p>
</div>
<h2><a>Outline</a></h2>
<div>
<p>
Goal: Concisely show how to write simple game, in context, from end to end.
</p>
<ul>
<li><div> Top-down overview of the finished game and its parts.</div>
</li>
<li><div> Bottom-up tutorial series.</div>
<ol>
<li><div> Analysis phase – What questions do I answer myself before I can start implementing?</div>
</li>
<li><div> Development phase – What is the work process like? (With code samples)</div>
<ul>
<li><div> Best practices for project structure (asset directories, packages, classes)</div>
</li>
<li><div> Best practices for common functionalities (input, settings, <acronym title="Graphical User Interface">GUI</acronym>, formats)</div>
</li>
<li><div> including debugging, profiling, QA testing</div>
</li>
</ul>
</li>
<li><div> Release phase – When do I consider my game complete?</div>
</li>
</ol>
</li>
</ul>
</div>
<h2><a>User Suggested Topics</a></h2>
<div>
<ol>
<li><div> Create and load a scene/terrain</div>
<ul>
<li><div> Creation: Refer to Blender tutorials until we have our own terrain/scene editor</div>
</li>
</ul>
</li>
<li><div> Create, load and animate models</div>
<ul>
<li><div> Creation: Refer to Blender tutorials</div>
</li>
</ul>
</li>
<li><div> Basic camera navigation (first-person/third-person view)</div>
</li>
<li><div> User input (character moves, attacks)</div>
</li>
<li><div> Collision (physics: floor/walls/obstacles)</div>
</li>
<li><div> Mouse interaction (shooting/picking up)</div>
</li>
<li><div> Basic enemy AI</div>
<ul>
<li><div> Mainly show how to integrate a simple interactive decision process</div>
</li>
</ul>
</li>
<li><div> Enhancements: Effects, scores, settings, audio, <acronym title="Graphical User Interface">GUI</acronym>, HUD </div>
<ul>
<li><div> Show very briefly what is possible and how to integrate L0l</div>
</li>
</ul>
</li>
</ol>
<p>
See also: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.jmonkeyengine.com/wiki/doku.php?id=flag_rush_tutorial_series_by_mojomonkey"><param name="text" value="<html><u>Flag Rush series</u></html>"><param name="textColor" value="blue"></object> for jme2
</p>
</div>
<h2><a>Tutorial Deliverables</a></h2>
<div>
<ol>
<li><div> Playable finished game executable available for download.</div>
</li>
<li><div> Finished sources (build script, libraries, assets) available for download.</div>
</li>
<li><div> Tutorial series describing the evolution of the project.</div>
</li>
<li><div> Snapshots of sources at different stages of development (to go with tutorials).</div>
</li>
<li><div> Illustrations and screenshots (to go with tutorials)</div>
</li>
</ol>
<hr />
<p>
Draft
</p>
<hr />
</div>
<h1><a>Taking a Look At the Finished JME3 Game</a></h1>
<div>
<p>
</p>
</div>
<h1><a>Developing your First JME3 Game</a></h1>
<div>
<p>
<a href="/com/jme3/gde/core/docs/jme3/intermediate/best_practices.html">Best Practices</a>
</p>
<p>
</p>
</div>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html
xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"><head
profile="http://gmpg.org/xfn/11"><link
rel="shortcut icon" href="http://jmonkeyengine.org/favicon.ico" /><meta
http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>jMonkeyEngine.org |</title><meta
name="generator" content="WordPress 3.1" /><link
rel="stylesheet" href="http://jmonkeyengine.org/wp-content/themes/bp-jme-1/style.css" type="text/css" media="screen" /><link
rel="alternate" type="application/rss+xml" title="jMonkeyEngine.org | Site Wide Activity RSS Feed" href="http://jmonkeyengine.org/activity/feed/" /><link
rel="alternate" type="application/rss+xml" title="jMonkeyEngine.org Blog Posts RSS Feed" href="http://jmonkeyengine.org/feed/" /><link
rel="alternate" type="application/atom+xml" title="jMonkeyEngine.org Blog Posts Atom Feed" href="http://jmonkeyengine.org/feed/atom/" /><link
rel="pingback" href="http://jmonkeyengine.org/xmlrpc.php" /> <script type="text/javascript">var _gaq=_gaq||[];_gaq.push(['_setAccount','UA-17652261-1']);_gaq.push(['_trackPageview']);(function(){var ga=document.createElement('script');ga.type='text/javascript';ga.async=true;ga.src=('https:'==document.location.protocol?'https://ssl':'http://www')+'.google-analytics.com/ga.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(ga,s);})();</script> <link
rel='stylesheet' id='fancybox-css' href='http://jmonkeyengine.org/wp-content/plugins/fancy-gallery/fancybox/jquery.fancybox-1.3.4.css?ver=1.3.4' type='text/css' media='all' /><link
rel='stylesheet' id='fancybox-ie-fix-css' href='http://jmonkeyengine.org/wp-content/plugins/fancy-gallery/fancybox/jquery.fancybox-1.3.4.css-png-fix.php?ver=3.1' type='text/css' media='all' /><link
rel='stylesheet' id='fancy-gallery-css' href='http://jmonkeyengine.org/wp-content/plugins/fancy-gallery/fancy-gallery.css?ver=3.1' type='text/css' media='all' /><link
rel='stylesheet' id='gsc_style-css' href='http://jmonkeyengine.org/wp-content/plugins/google-custom-search/css/smoothness/jquery-ui-1.7.3.custom.css?ver=3.1' type='text/css' media='all' /><link
rel='stylesheet' id='gsc_style_search_bar-css' href='http://www.google.com/cse/style/look/minimalist.css?ver=3.1' type='text/css' media='all' /><link
rel='stylesheet' id='gsc_style_search_bar_more-css' href='http://jmonkeyengine.org/wp-content/plugins/google-custom-search/css/gsc.css?ver=3.1' type='text/css' media='all' /><link
rel='stylesheet' id='gsc_style_search_bar_even_more-css' href='http://jmonkeyengine.org/wp-content/plugins/google-custom-search/css/gsc-no-search-button.css?ver=3.1' type='text/css' media='all' /><link
rel='stylesheet' id='toc_css-css' href='http://jmonkeyengine.org/wp-content/plugins/seo-friendly-table-of-contents/style.css?ver=3.1' type='text/css' media='all' /><link
rel='stylesheet' id='bpgc_screen-css' href='http://jmonkeyengine.org/wp-content/plugins/bp-group-control/css/screen.css?ver=3.1' type='text/css' media='all' /><link
rel='stylesheet' id='tabbed-widgets-css' href='http://jmonkeyengine.org/wp-content/plugins/tabbed-widgets/css/tabbed-widgets.css?ver=3.1' type='text/css' media='all' /><link
rel='stylesheet' id='bp-post-buttons-css-css' href='http://jmonkeyengine.org/wp-content/plugins/bp-post-buttons/include/style/bp_post_buttons.css?ver=3.1' type='text/css' media='all' /><link
rel='stylesheet' id='bubbleSheets-css' href='http://jmonkeyengine.org/wp-content/plugins/cd-bp-avatar-bubble/_inc/css/css3/bubble-green.css?ver=3.1' type='text/css' media='all' /><link
rel='stylesheet' id='wp_dlmp_styles-css' href='http://jmonkeyengine.org/wp-content/plugins/download-monitor/page-addon/styles.css?ver=3.1' type='text/css' media='all' /><link
rel='stylesheet' id='activity-subscription-style-css' href='http://jmonkeyengine.org/wp-content/plugins/buddypress-group-email-subscription/css/bp-activity-subscription-css.css?ver=3.1' type='text/css' media='all' /> <script type='text/javascript' src='http://jmonkeyengine.org/wp-includes/js/l10n.js?ver=20101110'></script> <script type='text/javascript' src='http://jmonkeyengine.org/wp-content/plugins/emailprotect/EMAILProtect.js?ver=0.8'></script> <script type='text/javascript' src='http://jmonkeyengine.org/wp-includes/js/jquery/jquery.js?ver=1.4.4'></script> <script type='text/javascript' src='http://jmonkeyengine.org/wp-content/plugins/fancy-gallery/fancybox/jquery.fancybox-1.3.4.pack.js?ver=1.3.4'></script> <script type='text/javascript' src='http://jmonkeyengine.org/wp-content/plugins/fancy-gallery/jquery.easing.1.3.js?ver=1.3'></script> <script type='text/javascript' src='http://jmonkeyengine.org/wp-content/plugins/fancy-gallery/jquery.mousewheel-3.0.4.pack.js?ver=3.0.4'></script> <script type='text/javascript' src='http://jmonkeyengine.org/wp-content/plugins/fancy-gallery/fancy-js.php?ver=3.1'></script> <script type='text/javascript' src='http://jmonkeyengine.org/wp-content/plugins/google-custom-search/js/gsc.js?ver=3.1'></script> <script type='text/javascript' src='http://www.google.com/jsapi?ver=3.1'></script> <script type='text/javascript'>var BP_DTheme={my_favs:"My Favorites",accepted:"Accepted",rejected:"Rejected",show_all_comments:"Show all comments for this thread",show_all:"Show all",comments:"comments",close:"Close",mention_explain:"@ is a unique identifier for that you can type into any message on this site. will be sent a notification and a link to your message any time you use it."};</script> <script type='text/javascript' src='http://jmonkeyengine.org/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/global.js?ver=3.1'></script> <script type='text/javascript' src='http://jmonkeyengine.org/wp-content/plugins/bp-group-control/js/screen.js?ver=3.1'></script> <script type='text/javascript' src='http://jmonkeyengine.org/wp-content/plugins/bp-post-buttons/include/js/insert_tags.js?ver=3.1'></script> <script type='text/javascript' src='http://jmonkeyengine.org/wp-content/plugins/buddypress-group-tags/group-tags.js?ver=3.1'></script> <script type='text/javascript' src='http://jmonkeyengine.org/wp-content/plugins/cd-bp-avatar-bubble/_inc/bubble-click.js?ver=3.1'></script> <link
rel="EditURI" type="application/rsd+xml" title="RSD" href="http://jmonkeyengine.org/xmlrpc.php?rsd" /><link
rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://jmonkeyengine.org/wp-includes/wlwmanifest.xml" /><link
rel='index' title='jMonkeyEngine.org' href='http://jmonkeyengine.org/' /><meta
name="generator" content="WordPress 3.1" /><link
rel="stylesheet" type="text/css" href="http://jmonkeyengine.org/wp-content/plugins/buddypress-better-pagination/pagination.css" media="screen" /><link
rel="stylesheet" type="text/css" href="http://jmonkeyengine.org/wp-content/plugins/buddypress-group-tags/group-tags.css" media="screen" /><link
rel="stylesheet" type="text/css" href="http://jmonkeyengine.org/wp-content/plugins/buddypress-rate-forum-posts/css/rating.css" media="screen" /> <script type="text/javascript">var ajaxurl="http://jmonkeyengine.org/wp-load.php";</script> <script type="text/javascript">var ajax_url="http://jmonkeyengine.org/wp-admin/admin-ajax.php";var ajax_image="http://jmonkeyengine.org/wp-content/plugins/cd-bp-avatar-bubble/_inc/images";var ajax_delay="0";</script> <meta
name="generator" content="DokuWiki Release 2009-02-14b" /><meta
name="robots" content="noindex,follow" /><meta
name="date" content="1970-01-01T00:00:00+0000" /><meta
name="keywords" content="jme3,intermediate,my_first_game" /><link
rel="search" type="application/opensearchdescription+xml" href="/wiki/lib/exe/opensearch.php" title="jMonkeyEngine.org" /><link
rel="start" href="/wiki/" /><link
rel="contents" href="/wiki/doku.php/jme3:intermediate:my_first_game?do=index" title="Index" /><link
rel="alternate" type="application/rss+xml" title="Recent Changes" href="/wiki/feed.php" /><link
rel="alternate" type="application/rss+xml" title="Current Namespace" href="/wiki/feed.php?mode=list&amp;ns=jme3:intermediate" /><link
rel="alternate" type="text/html" title="Plain HTML" href="/wiki/doku.php/jme3:intermediate:my_first_game?do=export_xhtml" /><link
rel="alternate" type="text/plain" title="Wiki Markup" href="/wiki/doku.php/jme3:intermediate:my_first_game?do=export_raw" /><link
rel="stylesheet" media="all" type="text/css" href="/wiki/lib/exe/css.php?s=all&amp;t=wp-integration" /><link
rel="stylesheet" media="screen" type="text/css" href="/wiki/lib/exe/css.php?t=wp-integration" /><link
rel="stylesheet" media="print" type="text/css" href="/wiki/lib/exe/css.php?s=print&amp;t=wp-integration" /> <script type="text/javascript" charset="utf-8" src="/wiki/lib/exe/js.php?edit=0&amp;write=0" ></script> <style type="text/css">#header{background-image:url(http://jmonkeyengine.org/wp-content/uploads/2010/09/header-new-31.gif)}#header h1, #header
#desc{display:none}</style><meta
id="syntaxhighlighteranchor" name="syntaxhighlighter-version" content="3.1.1" /> <script type="text/javascript">jQuery(document).ready(function(){jQuery("a.confirm").click(function(){if(confirm('Are you sure?'))return true;else return false;});});</script> </head><body
class=""><div
id="header"><h1><a
href="http://jmonkeyengine.org" title="Home">jMonkeyEngine.org</a></h1><div
id="search-bar"><div
id="custom-search"><form
action="http://jmonkeyengine.org/search" method="post"> <input
type="text" id="search-terms" name="search-terms" value="" /> <select
name="search-which"><option
value="wiki">Wiki</option><option
value="forums">Forums</option><option
value="posts">Blog</option><option
value="groups">Groups</option><option
value="members">Members</option><option
value="links">Links</option></select> <input
type="submit" name="search-submit" id="search-submit" value="Search" /> <input
type="hidden" id="_wpnonce" name="_wpnonce" value="401c23b197" /><input
type="hidden" name="_wp_http_referer" value="/com/jme3/gde/core/docs/jme3/intermediate/my_first_game.html" /></form></div></div><div
id="access"><ul
id="menu-mainmenu"><li
id="menu-item-688"><a
href="http://jmonkeyengine.org/">Home</a><ul
class="sub-menu"><li
id="menu-item-1698"><a
href="http://jmonkeyengine.org/">News</a></li><li
id="menu-item-705"><a
href="http://jmonkeyengine.org/news-archives/">News Archives</a></li><li
id="menu-item-437"><a
href="http://jmonkeyengine.org/activity/">Activity</a></li><li
id="menu-item-641"><a
href="http://jmonkeyengine.org/members/">Members</a></li><li
id="menu-item-474"><a
href="http://jmonkeyengine.org/legacy-links/">Links</a></li></ul></li><li
id="menu-item-696"><a
href="http://jmonkeyengine.org/introduction/">Introduction</a><ul
class="sub-menu"><li
id="menu-item-1697"><a
href="http://jmonkeyengine.org/introduction/">About</a></li><li
id="menu-item-944"><a
href="http://jmonkeyengine.org/introduction/website-manual/">Website Manual</a></li><li
id="menu-item-706"><a
href="http://jmonkeyengine.org/introduction/team/">Core Team</a></li><li
id="menu-item-1142"><a
href="http://jmonkeyengine.org/introduction/contributors-handbook/">Contributor’s Handbook</a><ul
class="sub-menu"><li
id="menu-item-1140"><a
href="http://jmonkeyengine.org/introduction/contributors-handbook/anyones-contribution-guidelines/">Anyone&#8217;s Contribution Guidelines</a></li><li
id="menu-item-1141"><a
href="http://jmonkeyengine.org/introduction/contributors-handbook/modelers-contribution-guidelines/">Modeler&#8217;s Contribution Guidelines</a></li><li
id="menu-item-1138"><a
href="http://jmonkeyengine.org/introduction/contributors-handbook/web-developers-contribution-guidelines/">Web Developer&#8217;s Contribution Guidelines</a></li><li
id="menu-item-1137"><a
href="http://jmonkeyengine.org/introduction/contributors-handbook/technical-writers-contribution-guidelines/">Technical Writer&#8217;s Contribution Guidelines</a></li><li
id="menu-item-1139"><a
href="http://jmonkeyengine.org/introduction/contributors-handbook/programmers-contribution-guidelines/">Programmer&#8217;s Contribution Guidelines</a></li></ul></li><li
id="menu-item-470"><a
href="http://jmonkeyengine.com">Product Showcase</a></li></ul></li><li
id="menu-item-693"><a
href="http://jmonkeyengine.org/forums">Forums</a><ul
class="sub-menu"><li
id="menu-item-473"><a
href="http://jmonkeyengine.org/forums">Latest Topics</a></li><li
id="menu-item-513"><a
href="http://jmonkeyengine.org/forums-index">All Categories</a></li><li
id="menu-item-330"><a
href="#">Troubleshooting ></a><ul
class="sub-menu"><li
id="menu-item-331"><a
href="http://jmonkeyengine.org/groups/general-2/forum/">General</a></li><li
id="menu-item-819"><a
href="http://jmonkeyengine.org/groups/import-assets/forum/">Import Assets</a></li><li
id="menu-item-332"><a
href="http://jmonkeyengine.org/groups/graphics/forum/">Graphics</a></li><li
id="menu-item-333"><a
href="http://jmonkeyengine.org/groups/effects/forum/">Effects</a></li><li
id="menu-item-334"><a
href="http://jmonkeyengine.org/groups/gui/forum/">GUI</a></li><li
id="menu-item-336"><a
href="http://jmonkeyengine.org/groups/physics/forum/">Physics</a></li><li
id="menu-item-338"><a
href="http://jmonkeyengine.org/groups/sound/forum/">Sound</a></li><li
id="menu-item-339"><a
href="http://jmonkeyengine.org/groups/networking/forum/">Networking</a></li><li
id="menu-item-690"><a
href="http://jmonkeyengine.org/groups/spidermonkey/forum/">SpiderMonkey</a></li><li
id="menu-item-689"><a
href="http://jmonkeyengine.org/groups/terramonkey/forum/">TerraMonkey</a></li><li
id="menu-item-360"><a
href="http://jmonkeyengine.org/groups/jmonkeyplatform/forum/">jMonkeyPlatform</a></li></ul></li><li
id="menu-item-345"><a
href="#">Project Relations ></a><ul
class="sub-menu"><li
id="menu-item-346"><a
href="http://jmonkeyengine.org/groups/free-announcements/forum/">Free Announcements</a></li><li
id="menu-item-347"><a
href="http://jmonkeyengine.org/groups/user-code-projects/forum/">User Code &#038; Projects</a></li><li
id="menu-item-352"><a
href="http://jmonkeyengine.org/groups/site-project/forum/">Site &#038; Project Feedback</a></li><li
id="menu-item-354"><a
href="http://jmonkeyengine.org/groups/features/forum/">Feature Discussion</a></li><li
id="menu-item-348"><a
href="http://jmonkeyengine.org/groups/general/forum/">Small Talk</a></li></ul></li><li
id="menu-item-340"><a
href="#">Development ></a><ul
class="sub-menu"><li
id="menu-item-343"><a
href="http://jmonkeyengine.org/groups/development-discussion-jme3/forum/">Developers Discussion</a></li><li
id="menu-item-344"><a
href="http://jmonkeyengine.org/groups/contribution-depot-jme3/forum/">Contributions</a></li><li
id="menu-item-710"><a
href="http://jmonkeyengine.org/groups/documentation-jme3/">Docs Discussion</a></li><li
id="menu-item-349"><a
href="http://jmonkeyengine.org/groups/jmonkeyplatform/forum/">jMonkeyPlatform</a></li><li
id="menu-item-350"><a
href="http://jmonkeyengine.org/groups/android/forum/">Android</a></li><li
id="menu-item-1475"><a
href="http://jmonkeyengine.org/groups/monkeyzone/forum/">MonkeyZone</a></li></ul></li><li
id="menu-item-699"><a
href="#">Legacy jME2 ></a><ul
class="sub-menu"><li
id="menu-item-341"><a
href="http://jmonkeyengine.org/groups/development-discussion-jme2/forum/">Discussion</a></li><li
id="menu-item-342"><a
href="http://jmonkeyengine.org/groups/contribution-depot-jme2/forum/">Contributions</a></li><li
id="menu-item-353"><a
href="http://jmonkeyengine.org/groups/documentation/forum/">Docs Discussion</a></li></ul></li></ul></li><li
id="menu-item-351"><a
href="http://jmonkeyengine.org/wiki/doku.php">Documentation</a><ul
class="sub-menu"><li
id="menu-item-1671"><a
href="http://jmonkeyengine.org/wiki/doku.php">Installation &#038; Setup</a></li><li
id="menu-item-1672"><a
href="http://jmonkeyengine.org/wiki/doku.php/jme3#tutorials_for_beginners">Tutorials &#038; Docs</a></li><li
id="menu-item-1673"><a
href="http://jmonkeyengine.org/wiki/doku.php/sdk">SDK Documentation</a></li><li
id="menu-item-1674"><a
href="http://jmonkeyengine.org/javadoc/">JavaDoc</a></li><li
id="menu-item-1675"><a
href="http://jmonkeyengine.org/groups/documentation-jme3/forum/">Docs Discussion</a></li></ul></li><li
id="menu-item-319"><a
href="http://jmonkeyengine.org/groups/tag/projects">Projects</a><ul
class="sub-menu"><li
id="menu-item-1699"><a
href="http://jmonkeyengine.org/groups/tag/projects">All Projects</a></li><li
id="menu-item-320"><a
href="http://jmonkeyengine.org/groups/tag/game">Games</a></li><li
id="menu-item-1117"><a
href="http://jmonkeyengine.org/groups/tag/tool">Tools</a></li><li
id="menu-item-323"><a
href="http://jmonkeyengine.org/groups/tag/oss">Open Source</a></li></ul></li><li
id="menu-item-717"><a
href="http://jmonkeyengine.org/downloads/">Downloads</a><ul
class="sub-menu"><li
id="menu-item-1695"><a
href="http://jmonkeyengine.org/downloads/">Download jME3 SDK</a></li><li
id="menu-item-464"><a
href="http://code.google.com/p/jmonkeyengine/source/checkout">SVN Checkout</a></li><li
id="menu-item-697"><a
href="http://code.google.com/p/jmonkeyengine/">GoogleCode</a></li><li
id="menu-item-463"><a
href="http://jmonkeyengine.com/nightly/">Nightly Builds</a></li></ul></li></ul></div></div><div
id="container"><div
class="dokuwiki"><div
class="stylehead"><div
class="breadcrumbs"> <span
class="bchead">You are here: </span><a
href="/wiki/doku.php/Documentation" title="Documentation">Documentation</a> &raquo; <a
href="/wiki/doku.php/jme3" title="jme3">jme3</a> &raquo; <a
href="/wiki/doku.php/jme3:intermediate:documentation" title="jme3:intermediate:documentation">intermediate</a> &raquo; <a
href="/wiki/doku.php/jme3:intermediate:my_first_game" title="jme3:intermediate:my_first_game">my_first_game</a></div></div><div
class="page"><h1><a
name="this_topic_does_not_exist_yet">This topic does not exist yet</a></h1><div
class="level1"><p>You&#039;ve followed a link to a topic that doesn&#039;t exist yet. If permissions allow, you may create it by using the <code>Create this page</code> button.</p></div></div><div
class="clearer">&nbsp;</div><div
class="stylefoot"><div
class="license">Except where otherwise noted, content on this wiki is licensed under the following license:<a
href="http://creativecommons.org/licenses/by/3.0/" rel="license">CC Attribution 3.0 Unported</a></div><div
class="breadcrumbs"> <span
class="bchead">Trace:</span></div></div></div><div
class="no"></div></div><div
id="footer"><p>jMonkeyEngine.org is proudly powered by <a
href="http://wordpress.org">WordPress</a> and <a
href="http://buddypress.org">BuddyPress</a></p></div><div
id="wp-admin-bar"><div
class="padder"><a
href="http://jmonkeyengine.org">jMonkeyEngine.org</a><ul
class="main-nav"><li
class="bp-login no-arrow"><a
href="http://jmonkeyengine.org/wp-login.php?redirect_to=http%3A%2F%2Fjmonkeyengine.org">Log In</a></li><li
class="bp-signup no-arrow"><a
href="http://jmonkeyengine.org/register">Sign Up</a></li><li
class="align-right"> <a
href="#">Visit</a><ul
class="random-list"><li><a
href="http://jmonkeyengine.org/members/?random-member">Random Member</a></li><li
class="alt"><a
href="http://jmonkeyengine.org/groups/?random-group">Random Group</a></li><li><a
href="http://jmonkeyengine.org/links/?random-link">Random Link</a></li></ul></li></ul></div></div> <script type='text/javascript' src='http://jmonkeyengine.org/wp-includes/js/jquery/ui.core.js?ver=1.8.9'></script> <script type='text/javascript' src='http://jmonkeyengine.org/wp-includes/js/jquery/ui.widget.js?ver=1.8.9'></script> <script type='text/javascript' src='http://jmonkeyengine.org/wp-includes/js/jquery/ui.mouse.js?ver=1.8.9'></script> <script type='text/javascript' src='http://jmonkeyengine.org/wp-includes/js/jquery/ui.resizable.js?ver=1.8.9'></script> <script type='text/javascript' src='http://jmonkeyengine.org/wp-includes/js/jquery/ui.draggable.js?ver=1.8.9'></script> <script type='text/javascript' src='http://jmonkeyengine.org/wp-includes/js/jquery/ui.button.js?ver=1.8.9'></script> <script type='text/javascript' src='http://jmonkeyengine.org/wp-includes/js/jquery/ui.position.js?ver=1.8.9'></script> <script type='text/javascript' src='http://jmonkeyengine.org/wp-includes/js/jquery/ui.dialog.js?ver=1.8.9'></script> <script type='text/javascript' src='http://jmonkeyengine.org/wp-content/plugins/tabbed-widgets/js/jquery-ui-custom.min.js?ver=3.1'></script> <script type='text/javascript' src='http://jmonkeyengine.org/wp-content/plugins/tabbed-widgets/js/jquery-cookie.min.js?ver=3.1'></script> <script type="text/javascript">var $rotateoptions=new Array();$rotateoptions[2]=new Array();$rotateoptions[2]["style"]="";$rotateoptions[2]["rotate"]=0;$rotateoptions[2]["random_start"]=0;$rotateoptions[2]["start_tab"]=0;$rotateoptions[2]["interval"]=10000;$rotateoptions[3]=new Array();$rotateoptions[3]["style"]="tabs";$rotateoptions[3]["rotate"]=0;$rotateoptions[3]["random_start"]=0;$rotateoptions[3]["start_tab"]=0;$rotateoptions[3]["interval"]=10000;</script> <script type="text/javascript" src="http://jmonkeyengine.org/wp-content/plugins/tabbed-widgets/js/init-plugin.js"></script>
<script src="http://stats.wordpress.com/e-201113.js" type="text/javascript"></script> <script type="text/javascript">st_go({blog:'14883676',v:'ext',post:'0'});var load_cmc=function(){linktracker_init(14883676,0,2);};if(typeof addLoadEvent!='undefined')addLoadEvent(load_cmc);else load_cmc();</script> </body></html>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/
Minified using apc
Served from: jmonkeyengine.org @ 2011-03-28 14:38:52 -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:intermediate:my_first_game?do=export_xhtmlbody">view online version</a></em></p>

@ -573,5 +573,50 @@ JME3, the game engine, only loads and plays your recorded animations. You must u
In the JME3 application, you register animated models to the Animation Controller. The controller object gives you access to the available animation sequences. The controller has several channels, each channels can run one animation sequence at a time. To run several sequences, you create several channels, and run them in parallel.
</p>
</div>
<h1><a>Artificial Intelligence (AI)</a></h1>
<div>
<p>
Non-player (computer-controlled) characters (NPCs) are only fun in a game if they do not stupidly bump into walls, or blindly run into the line of fire. You want to make NPCs “aware” of their surroundings and let them make decisions based on the game state – otherwise the player can just ignore them. The most common use case is that you want to make enemies interact in a way so they offer a more interesting challenge for the player.
</p>
<p>
“Smart” game elements are called artificially intelligent agents (AI agents). An AI agent can be an NPC, but also an “automatic alarm system” that locks doors after an intruder alert, or a trained pet.
</p>
<p>
The domain of artificial intelligence deals, among other things, with:
</p>
<ul>
<li><div> Knowledge – An agent only “knows” what it can “see and hear”, this implies that things can be hidden from it. You can make a group of agents share knowledge (e.g. guards with two-way radios know, other guards don&#039;t know about the intruder).</div>
</li>
<li><div> Goal Planning – The agent has a priority to achieve a specific goal (a future state). It splits the goal into subgoals, determines tactics and strategies, and prioritizes them. The agent keeps testing whether the current state is closer to the (sub)goal. If unsuccessful, the agent changes the tactics/strategy. E.g. Finding the best path to reach a target in a changing environment.</div>
</li>
<li><div> Problem solving – The agent uses a given set of facts and rules to deduct what state it is in. In every state, only a certain subset of reactions makes sense. The actual decision depends on the agent&#039;s goal. Examples: If target in range, attack or protect base or raise alarm. If idle, lay traps or heal oneself or recharge ammunition. If floor on fire, then danger. If danger, escape or kamikaze.</div>
</li>
</ul>
<p>
There are lots of resources explaining interesting AI algorithms:
</p>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.policyalmanac.org/games/aStarTutorial.htm"><param name="text" value="<html><u>A* (A-Star) pathfinding for beginners</u></html>"><param name="textColor" value="blue"></object></div>
</li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://theory.stanford.edu/~amitp/GameProgramming/"><param name="text" value="<html><u>A* (A-star) pathfinding theory</u></html>"><param name="textColor" value="blue"></object></div>
</li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://hem.fyristorg.com/dawnbringer/z-path.html"><param name="text" value="<html><u>&quot;Z-Path&quot; algorithm</u></html>"><param name="textColor" value="blue"></object> (backwards pathfinding)</div>
</li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://web.media.mit.edu/~jorkin/goap.html"><param name="text" value="<html><u>Goal-Oriented Action Planning</u></html>"><param name="textColor" value="blue"></object></div>
</li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://neuroph.sourceforge.net/"><param name="text" value="<html><u>Java Neural Networks</u></html>"><param name="textColor" value="blue"></object></div>
</li>
<li><div></div>
</li>
</ul>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:terminology?do=export_xhtmlbody">view online version</a></em></p>

@ -1,9 +1,31 @@
<h1><a>WebStart (JNLP) Deployment</a></h1>
<div>
<p>
When you <a href="/com/jme3/gde/core/docs/sdk/application_deployment.html">use the jMonkeyPlatform to deploy your application</a>, you can configure the project to build files required for WebStart automatically. If you use another IDE, or work on the command line, use the following tips to set up WebStart correctly:
</p>
<p>
Problem:
</p>
<p>
When running under WebStart, jMonkeyEngine may not have permission to extract the native libraries to the current directory. To avoid this problem, you can instruct WebStart to load the native libraries itself using the JNLP file, and then instruct jME3 not to try to do so itself.
When running under WebStart, jMonkeyEngine may not have permission to extract the native libraries to the current directory.
</p>
<h4><a>Simple way</a></h4>
<p>
Solution:
</p>
<p>
You can instruct WebStart to load the native libraries itself using the JNLP file, and then instruct jME3 not to try to do so itself.
</p>
</div>
<h2><a>Simple way</a></h2>
<div>
<p>
@ -13,12 +35,12 @@ You can import the LWJGL JNLP extension directly into your extension, however be
<pre><span>&lt;extension name=&quot;lwjgl&quot; href=&quot;http://lwjgl.org/webstart/2.7.1/extension.jnlp&quot; /&gt;</span></pre>
</div>
<h4><a>Reliable way</a></h4>
<h2><a>Reliable way</a></h2>
<div>
</div>
<h5><a>Native jars</a></h5>
<h3><a>Native jars</a></h3>
<div>
<p>
@ -43,7 +65,7 @@ Remember to sign all the jar files and move them into the right place from the t
</div>
<h5><a>JNLP file</a></h5>
<h3><a>JNLP file</a></h3>
<div>
<p>
@ -68,7 +90,7 @@ Add the following to your JNLP file:
<span><span>&lt;/resources&gt;</span></span></pre>
</div>
<h5><a>Set low-permissions mode</a></h5>
<h3><a>Set low-permissions mode</a></h3>
<div>
<p>

@ -12,7 +12,8 @@ AssetPacks are a way to package jME3 compatible assets like models, textures, so
<div>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/wp-uploads/2010/10/assetpackbrowser-300x166.jpg">
<img src="/wiki/lib/exe/fetch.php">
</p>
<p>
@ -86,7 +87,7 @@ You can access and change the project properties by right-clicking the project a
<div>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/wp-uploads/2010/10/assetpackimport-300x222.jpg">
<img src="/wiki/lib/exe/fetch.php">
</p>
<p>
@ -125,7 +126,7 @@ With the “add files” button you can open a file browser to select files from
</p>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/wp-uploads/2010/10/assetpackimport2-300x179.jpg">
<img src="/wiki/lib/exe/fetch.php">
</p>
<p>
@ -162,7 +163,8 @@ Supported formats for models are:
<div>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/wp-uploads/2010/10/assetpackdownload-263x300.jpg">
<img src="/wiki/lib/exe/fetch.php">
</p>
<p>

@ -42,6 +42,8 @@ There are several ways for your plugin to interact with the Scene:
</li>
<li><div> <em>The AssetManager of jme3 is threadsafe and can be used from any thread to load assets</em></div>
</li>
<li><div> <em>Use org.openide.filesystems.FileObject instead of java.io.File for file access, it always uses system-independent ”/” path separators and has some more advanced functions that make file handling easier. You can get a file from a string using Repository.getDefault().getDefaultFileSystem().getRoot().getFileObject(“aaa/bbb/ccc/whatever”);</em></div>
</li>
</ul>
</div>

@ -13,19 +13,15 @@ If your plugin brings in its own SceneGraph objects you can still have them work
</p>
<p>
<br/>
You will have to create your own class that extends org.openide.nodes.Node and implement the interface com.jme3.gde.core.sceneexplorer.nodes.SceneExplorerNode. Then you register that class by adding
</p>
<pre>@org.openide.util.lookup.ServiceProvider(service=com.jme3.gde.core.sceneexplorer.nodes.SceneExplorerNode.class)</pre>
<p>
above the “public class MyClass” line in your class. Thats all, your Spatial type will automatically be used and displayed in the SceneExplorer.
above the “public class MyClass” line in your class. Thats all, your Spatial type will automatically be used and displayed in the SceneExplorer. Make sure you register a jar with the used classes in the plugin preferences under “wrapped libraries”, otherwise the IDE cannot access those classes.
</p>
<p>
<br/>
Theres also AbstractSceneExplorerNode which brings some other useful features you might want to include like automatic creation of properly threaded properties etc. JmeSpatial for example bases on it. A simple SceneExplorerNode example for an object extending Spatial would be JmeGeometry (see below).
</p>
@ -107,16 +103,16 @@ public class JmeGhostControl extends AbstractSceneExplorerNode &#123;
&nbsp;
private static Image smallImage =
ImageUtilities.loadImage&#40;&quot;com/jme3/gde/core/sceneexplorer/nodes/icons/ghostcontrol.gif&quot;&#41;;
private GhostControl geom;
private GhostControl control;
&nbsp;
public JmeGhostControl&#40;&#41; &#123;
&#125;
&nbsp;
public JmeGhostControl&#40;GhostControl spatial, DataObject dataObject&#41; &#123;
public JmeGhostControl&#40;GhostControl control, DataObject dataObject&#41; &#123;
super&#40;dataObject&#41;;
getLookupContents&#40;&#41;.add&#40;this&#41;;
getLookupContents&#40;&#41;.add&#40;spatial&#41;;
this.geom = spatial;
getLookupContents&#40;&#41;.add&#40;control&#41;;
this.control = control;
setName&#40;&quot;GhostControl&quot;&#41;;
&#125;
&nbsp;
@ -152,7 +148,7 @@ public class JmeGhostControl extends AbstractSceneExplorerNode &#123;
SceneApplication.getApplication&#40;&#41;.enqueue&#40;new Callable&lt;Void&gt;&#40;&#41; &#123;
&nbsp;
public Exception &#123;
spat.removeControl&#40;geom&#41;;
spat.removeControl&#40;control&#41;;
return null;
&#125;
&#125;&#41;.get&#40;&#41;;
@ -170,7 +166,7 @@ public class JmeGhostControl extends AbstractSceneExplorerNode &#123;
Sheet.Set set = Sheet.createPropertiesSet&#40;&#41;;
set.setDisplayName&#40;&quot;GhostControl&quot;&#41;;
set.setName&#40;GhostControl.class.getName&#40;&#41;&#41;;
GhostControl obj = geom;//getLookup().lookup(Spatial.class);
GhostControl obj = control;//getLookup().lookup(Spatial.class);
if &#40;obj == null&#41; &#123;
return sheet;
&#125;
@ -224,17 +220,17 @@ public class GenerateTangentsTool extends AbstractToolAction &#123;
&#125;
&nbsp;
@Override
protected boolean doApplyTool&#40;AbstractSceneExplorerNode rootNode&#41; &#123;
protected Object doApplyTool&#40;AbstractSceneExplorerNode rootNode&#41; &#123;
Geometry geom = rootNode.getLookup&#40;&#41;.lookup&#40;Geometry.class&#41;;
Mesh mesh = geom.getMesh&#40;&#41;;
if &#40;mesh != null&#41; &#123;
TangentBinormalGenerator.generate&#40;mesh&#41;;
&#125;
return true;
return geom;
&#125;
&nbsp;
@Override
protected void doUndoTool&#40;AbstractSceneExplorerNode rootNode&#41; &#123;
protected void doUndoTool&#40;AbstractSceneExplorerNode rootNode, Object undoObject&#41; &#123;
Geometry geom = rootNode.getLookup&#40;&#41;.lookup&#40;Geometry.class&#41;;
Mesh mesh = geom.getMesh&#40;&#41;;
if &#40;mesh != null&#41; &#123;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 108 KiB

@ -87,7 +87,7 @@ You and your team mates check out (download) the repository to their individual
</li>
<li><div> Fill in your repo data into the wizard and click Finish.</div>
<ul>
<li><div> A typical repository <acronym title="Uniform Resource Locator">URL</acronym> looks like this example: <code><object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.googlecode.com/svn/branches/jme3"><param name="text" value="<html><u>http://jmonkeyengine.googlecode.com/svn/branches/jme3</u></html>"><param name="textColor" value="blue"></object></code></div>
<li><div> A typical repository <acronym title="Uniform Resource Locator">URL</acronym> looks like this example: <code><object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.googlecode.com/svn/trunk/engine"><param name="text" value="<html><u>http://jmonkeyengine.googlecode.com/svn/trunk/engine</u></html>"><param name="textColor" value="blue"></object></code></div>
</li>
<li><div> If you want to be able to submit changes, you must have a username and password to this repository. Otherwise leave these fields blank.</div>
</li>

@ -3,6 +3,8 @@
<div>
<p>
<p><div>This article covers a deprecated <acronym title="Application Programming Interface">API</acronym>! See <a href="/com/jme3/gde/core/docs/jme3/advanced/networking.html">networking</a> for current documentation.
</div></p>
Now this is going to be a real simply tutorial but still I wanted this in a separate article. Why you may ask? Simply because it&#039;s a feature that requires some explanation, since it has some caveats that I&#039;ll discuss. Also, I&#039;ll cover writing your own compression message.
</p>
@ -26,7 +28,7 @@ Really simple, but ZIP requires some explanation. The ZIPCompressedMessage class
<p>
Now of course I&#039;d love to see more compression methods in SpiderMonkey, so I&#039;ll discuss how to write your own. Let&#039;s just take GZIPCompressedMessage as example, since that one is the most straightforward. What I&#039;ve done, is I&#039;ve just created a GZIPCompressedMessage which extends CompressedMessage. It does not contain any extra messages, so the GZIPCompressedMessage class is practically &#039;empty&#039;. The magic happens at the serializer, which is called the GZIPSerializer (you can read about writing your own serializer <a href="/com/jme3/gde/core/docs/spidermonkey/tutorial/serializing.html">here</a>). Then I just registered the GZIPSerializer to GZIPCompressedMessage and presto - you&#039;re done. Don&#039;t forget that in the Serializer you need to use writeClassAndObject first and then compress that data, and for read you&#039;d need to use readClassAndObject after you&#039;ve uncompressed (inflated) the message. For this to be clear, it may be useful to read <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/branches/jme3/src/networking/com/jme3/network/serializing/serializers/GZIPSerializer.java"><param name="text" value="<html><u>the GZIPSerializer class</u></html>"><param name="textColor" value="blue"></object>.
Now of course I&#039;d love to see more compression methods in SpiderMonkey, so I&#039;ll discuss how to write your own. Let&#039;s just take GZIPCompressedMessage as example, since that one is the most straightforward. What I&#039;ve done, is I&#039;ve just created a GZIPCompressedMessage which extends CompressedMessage. It does not contain any extra messages, so the GZIPCompressedMessage class is practically &#039;empty&#039;. The magic happens at the serializer, which is called the GZIPSerializer (you can read about writing your own serializer <a href="/com/jme3/gde/core/docs/spidermonkey/tutorial/serializing.html">here</a>). Then I just registered the GZIPSerializer to GZIPCompressedMessage and presto - you&#039;re done. Don&#039;t forget that in the Serializer you need to use writeClassAndObject first and then compress that data, and for read you&#039;d need to use readClassAndObject after you&#039;ve uncompressed (inflated) the message. For this to be clear, it may be useful to read <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/networking/com/jme3/network/serializing/serializers/GZIPSerializer.java"><param name="text" value="<html><u>the GZIPSerializer class</u></html>"><param name="textColor" value="blue"></object>.
</p>
<p>

@ -2,6 +2,11 @@
<h1><a>Connecting</a></h1>
<div>
<p>
<p><div>This article covers a deprecated <acronym title="Application Programming Interface">API</acronym>! See <a href="/com/jme3/gde/core/docs/jme3/advanced/networking.html">networking</a> for current documentation.
</div></p>
</p>
<p>
This very first tutorial is going to teach you how to open a server and a client, and connect them to eachother. I&#039;ll also discuss how connection registration works. Since this is a very simple process in SpiderMonkey, this tutorial will be quite short.
</p>

@ -3,6 +3,8 @@
<div>
<p>
<p><div>This article covers a deprecated <acronym title="Application Programming Interface">API</acronym>! See <a href="/com/jme3/gde/core/docs/jme3/advanced/networking.html">networking</a> for current documentation.
</div></p>
In this tutorial I&#039;m going to cover sending and receiving messages. I&#039;ll also explain how to write your own messages. This tutorial assumes you already have a working server-client connection.
</p>

@ -3,6 +3,8 @@
<div>
<p>
<p><div>This article covers a deprecated <acronym title="Application Programming Interface">API</acronym>! See <a href="/com/jme3/gde/core/docs/jme3/advanced/networking.html">networking</a> for current documentation.
</div></p>
In this lesson you&#039;ll learn about a pretty advanced system of SpiderMonkey. Why so early, you may ask; it&#039;s because it is an important aspect of SpiderMonkey, that you need to understand to effectively network your games.
</p>

@ -2,6 +2,11 @@
<h1><a>Service system</a></h1>
<div>
<p>
<p><div>This article covers a deprecated <acronym title="Application Programming Interface">API</acronym>! See <a href="/com/jme3/gde/core/docs/jme3/advanced/networking.html">networking</a> for current documentation.
</div></p>
</p>
<p>
The service system is meant to create a common way of using plugins. It is a tiny system, on Server and Client level. In this tutorial I&#039;ll tell you how to use services, and how to create your own.
</p>

@ -2,6 +2,11 @@
<h1><a>Streaming service</a></h1>
<div>
<p>
<p><div>This article covers a deprecated <acronym title="Application Programming Interface">API</acronym>! See <a href="/com/jme3/gde/core/docs/jme3/advanced/networking.html">networking</a> for current documentation.
</div></p>
</p>
<p>
The streaming service is meant for situations where you want to transfer files, or other types of data to clients. In this tutorial we&#039;ll discuss how it works, and how to use it.
</p>

File diff suppressed because one or more lines are too long

@ -71,7 +71,12 @@ jme3:advanced:mesh,\
jme3:advanced:motion_path,\
jme3:advanced:multiple_camera_views,\
jme3:advanced:multithreading,\
jme3:advanced:networking,\
jme3:advanced:nifty_gui,\
jme3:advanced:nifty_gui_java_interaction,\
jme3:advanced:nifty_gui_overlay,\
jme3:advanced:nifty_gui_projection,\
jme3:advanced:nifty_gui_xml_layout,\
jme3:advanced:particle_emitters,\
jme3:advanced:physics,\
jme3:advanced:physics_listeners,\

@ -44,7 +44,6 @@ import com.jme3.input.MouseInput;
import com.jme3.input.controls.MouseAxisTrigger;
import com.jme3.input.controls.MouseButtonTrigger;
import com.jme3.light.PointLight;
import com.jme3.material.RenderState;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.renderer.RenderManager;
@ -128,16 +127,6 @@ public class SceneApplication extends Application implements LookupProvider, Loo
createCanvas();
startCanvas(true);
progressHandle.progress("initialize Base Application", 1);
// if (!java.awt.EventQueue.isDispatchThread()) {
// java.awt.EventQueue.invokeAndWait(new Runnable() {
//
// public void run() {
// SceneViewerTopComponent.findInstance();
// }
// });
// } else {
// SceneViewerTopComponent.findInstance();
// }
} catch (Exception e) {
getProgressHandle().finish();
SceneViewerTopComponent.showOpenGLError(e.toString());

@ -33,6 +33,7 @@ package com.jme3.gde.core.sceneviewer;
import com.jme3.gde.core.scene.SceneApplication;
import com.jme3.system.JmeCanvasContext;
import java.awt.Canvas;
import java.util.logging.Logger;
import org.openide.util.NbBundle;
import org.openide.windows.TopComponent;
@ -45,7 +46,6 @@ import org.openide.NotifyDescriptor.Message;
import org.openide.awt.UndoRedo;
import org.openide.util.HelpCtx;
import org.openide.util.Lookup;
import org.openide.util.lookup.InstanceContent;
/**
* Top component which displays something.
@ -58,11 +58,9 @@ public final class SceneViewerTopComponent extends TopComponent {
/** path to the icon used by the component and its open action */
static final String ICON_PATH = "com/jme3/gde/core/sceneviewer/jme-logo.png";
private static final String PREFERRED_ID = "SceneViewerTopComponent";
// private JmeCanvasContext ctx;
private SceneApplication app;
// private Lookup lookup;
// private final InstanceContent lookupContents = new InstanceContent();
private HelpCtx helpContext = new HelpCtx("com.jme3.gde.core.sceneviewer");
private Canvas oglCanvas;
public SceneViewerTopComponent() {
initComponents();
@ -70,14 +68,10 @@ public final class SceneViewerTopComponent extends TopComponent {
setName(NbBundle.getMessage(SceneViewerTopComponent.class, "CTL_SceneViewerTopComponent"));
setToolTipText(NbBundle.getMessage(SceneViewerTopComponent.class, "HINT_SceneViewerTopComponent"));
setIcon(ImageUtilities.loadImage(ICON_PATH, true));
// lookup = new AbstractLookup(lookupContents);
// associateLookup(lookup);
// putClientProperty(TopComponent.PROP_CLOSING_DISABLED, Boolean.TRUE);
try {
app = SceneApplication.getApplication();
// app.createCanvas();
// app.startCanvas(true);
oGLPanel.add(((JmeCanvasContext) app.getContext()).getCanvas());
oglCanvas = ((JmeCanvasContext) app.getContext()).getCanvas();
oGLPanel.add(oglCanvas);
} catch (Exception e) {
showOpenGLError(e.toString());
} catch (Error err) {
@ -234,14 +228,9 @@ public final class SceneViewerTopComponent extends TopComponent {
@Override
public void componentOpened() {
super.componentOpened();
try {
// app.startCanvas(true);
// oGLPanel.add(((JmeCanvasContext) app.getContext()).getCanvas());
} catch (Exception e) {
showOpenGLError(e.toString());
} catch (Error err) {
showOpenGLError(err.toString());
}
// oGLPanel.setMaximumSize(new Dimension(10000, 10000));
// ToolbarPool.getDefault().findToolbar("jMonkeyPlatform-Tools").remove(oglCanvas);
// oGLPanel.add(oglCanvas);
}
@Override
@ -257,7 +246,10 @@ public final class SceneViewerTopComponent extends TopComponent {
@Override
public void componentClosed() {
super.componentClosed();
// oGLPanel.removeAll();
// oGLPanel.remove(oglCanvas);
// oGLPanel.setPreferredSize(new Dimension(10, 10));
// oGLPanel.setMaximumSize(new Dimension(10, 10));
// ToolbarPool.getDefault().findToolbar("jMonkeyPlatform-Tools").add(oglCanvas);
}
void writeProperties(java.util.Properties p) {

Loading…
Cancel
Save