- update manual from wiki

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8975 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 13 years ago
parent 73cc27ec7b
commit 90ad508aa0
  1. 85
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/3d_models.html
  2. 354
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/animation.html
  3. 2
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/asset_manager.html
  4. 84
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/audio.html
  5. 147
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/audio_environment_presets.html
  6. 250
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/bloom_and_glow.html
  7. 47
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/bullet_multithreading.html
  8. 384
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/cinematics.html
  9. 40
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/combo_moves.html
  10. 202
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/effects_overview.html
  11. 100
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/hinges_and_joints.html
  12. 36
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/j3m_material_files.html
  13. 77
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/loading_screen.html
  14. 134
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/localization.html
  15. 65
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/logging.html
  16. 77
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/making_the_camera_follow_a_character.html
  17. 353
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/materials_overview.html
  18. 113
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/motionpath.html
  19. 43
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/mouse_picking.html
  20. 175
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/multiple_camera_views.html
  21. 146
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/multithreading.html
  22. 224
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/networking.html
  23. 19
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/nifty_gui.html
  24. 72
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_java_interaction.html
  25. 48
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_overlay.html
  26. 84
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_projection.html
  27. 279
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_xml_layout.html
  28. 195
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/open_game_finder.html
  29. 84
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/particle_emitters.html
  30. 167
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/physics.html
  31. 73
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/physics_listeners.html
  32. 46
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/remote-controlling_the_camera.html
  33. 45
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/save_and_load.html
  34. 94
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/sky.html
  35. 37
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/spatial.html
  36. 115
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/terrain.html
  37. 15
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/terrain_collision.html
  38. 111
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/vehicles.html
  39. 241
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/walking_character.html
  40. 35
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/water.html
  41. 161
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_animation.html
  42. 77
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_asset.html
  43. 18
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_audio.html
  44. 99
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_collision.html
  45. 155
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_effects.html
  46. 89
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_input_system.html
  47. 20
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_main_event_loop.html
  48. 22
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_material.html
  49. 90
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_node.html
  50. 24
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_terrain.html
  51. 56
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/build_from_sources.html
  52. 489
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/faq.html
  53. 100
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/appsettings.html
  54. 46
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/best_practices.html
  55. 78
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/file_types.html
  56. 367
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/headlessserver.html
  57. 45
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/optimization.html
  58. 42
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/simpleapplication.html
  59. 147
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/math.html
  60. 89
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/simpleapplication_from_the_commandline.html
  61. 116
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/terminology.html
  62. 98
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/the_scene_graph.html
  63. 99
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/webstart.html
  64. 46
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/application_deployment.html
  65. 25
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/asset_packs.html
  66. 42
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/blender.html
  67. 92
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/code_editor.html
  68. 38
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/debugging_profiling_testing.html
  69. 60
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/development.html
  70. 30
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/development/model_loader.html
  71. 43
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/development/projects_assets.html
  72. 96
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/development/scene.html
  73. 85
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/development/sceneexplorer.html
  74. 35
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/material_editing.html
  75. 47
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/project_creation.html
  76. 34
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/terrain_editor.html
  77. 31
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/troubleshooting.html
  78. 126
      sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/version_control.html

@ -1,84 +1,3 @@
<h1><a>Models and Scenes</a></h1>
<div>
<p>
Like <a href="/com/jme3/gde/core/docs/jme3/advanced/shape.html">Shape</a>s, 3D models are also made up of <a href="/com/jme3/gde/core/docs/jme3/advanced/mesh.html">Mesh</a>es, but models are more complex than Shapes. While Shapes are built into jME3, you typically create models in external 3D Mesh Editors.
</p>
</div>
<h2><a>Using Models and Scenes with jME3</a></h2>
<div>
<p>
To use 3D models in a jME3 application:
</p>
<ol>
<li><div> Export the 3D model in Ogre <acronym title="Extensible Markup Language">XML</acronym> or Wavefront OBJ format. Export Scenes as Ogre DotScene format.</div>
</li>
<li><div> Save the files into a subdirectory of your jME3 project&#039;s <code>assets</code> directory.</div>
</li>
<li><div> In your code, you use the <a href="/com/jme3/gde/core/docs/jme3/advanced/asset_manager.html">Asset Manager</a> to load models as <a href="/com/jme3/gde/core/docs/jme3/advanced/spatial.html">Spatial</a>s into a jME application. <pre>Spatial model = assetManager.loadModel&#40;
&quot;Models/MonkeyHead/MonkeyHead.mesh.xml&quot; &#41;;</pre>
</div>
</li>
<li><div> (For the release build:) Use the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> to convert models to .j3o format. You don&#039;t need this step as long you still develop and test the aplication within the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>.</div>
</li>
</ol>
</div>
<h2><a>Creating Models and Scenes</a></h2>
<div>
<p>
To create 3D models and scenes, you need a 3D Mesh Editor such as <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.blender.org/"><param name="text" value="<html><u>Blender</u></html>"><param name="textColor" value="blue"></object>, with an OgreXML Exporter plugin.
</p>
<p>
<strong>Tip:</strong> Consider creating <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/UV_Map_Basics"><param name="text" value="<html><u>UV textures</u></html>"><param name="textColor" value="blue"></object> for more complex models, it looks more professional.
</p>
<p>
3D mesh editors are third-party products, so please consult their documentation for instructions how to use them. Here is an example workflow for Blender users:
</p>
<p>
To export your models as Ogre <acronym title="Extensible Markup Language">XML</acronym> meshes with materials:
</p>
<ol>
<li><div> Open the menu File &gt; Export &gt; OgreXML Exporter to open the exporter dialog.</div>
</li>
<li><div> In the Export Materials field: Give the material the same name as the model. For example, the model <code>something.mesh.xml</code> goes with <code>something.material</code>, plus (optionally) <code>something.skeleton.xml</code>, and some <acronym title="Joint Photographics Experts Group">JPG</acronym> files.</div>
</li>
<li><div> In the Export Meshes field: Select a target subdirectory of your <code>assets/Models/</code> directory. E.g. <code>assets/Models/something/</code>.</div>
</li>
<li><div> Activate the following exporter settings: </div>
<ul>
<li><div> Copy Textures: YES</div>
</li>
<li><div> Rendering Materials: YES</div>
</li>
<li><div> Flip Axis: YES</div>
</li>
<li><div> Require Materials: YES</div>
</li>
<li><div> Skeleton name follows mesh: YES</div>
</li>
</ul>
</li>
<li><div> Click export.</div>
</li>
</ol>
<p>
You can now use the <a href="/com/jme3/gde/core/docs/sdk.html">jMonkeyEngine SDK</a> to <a href="/com/jme3/gde/core/docs/sdk/model_loader_and_viewer.html">load and view models</a>. You can <a href="/com/jme3/gde/core/docs/sdk/scene_composer.html">create scenes</a> from them and write cde that loads them into your application.
</p>
</div>
<h1><a>Models and Scenes</a></h1><div><p>Like <a href="/com/jme3/gde/core/docs/jme3/advanced/shape.html">Shape</a>s, 3D models are also made up of <a href="/com/jme3/gde/core/docs/jme3/advanced/mesh.html">Mesh</a>es, but models are more complex than Shapes. While Shapes are built into jME3, you typically create models in external 3D Mesh Editors.</p></div><h2><a>Using Models and Scenes with jME3</a></h2><div><p>To use 3D models in a jME3 application:</p><ol><li><div>Export the 3D model in Ogre <acronym title="Extensible Markup Language">XML</acronym> or Wavefront OBJ format. Export Scenes as Ogre DotScene format.</div></li><li><div>Save the files into a subdirectory of your jME3 project&#039;s <code>assets</code> directory.</div></li><li><div>In your code, you use the <a href="/com/jme3/gde/core/docs/jme3/advanced/asset_manager.html">Asset Manager</a> to load models as <a href="/com/jme3/gde/core/docs/jme3/advanced/spatial.html">Spatial</a>s into a jME application.<pre>Spatial model = assetManager.loadModel&#40;
&quot;Models/MonkeyHead/MonkeyHead.mesh.xml&quot; &#41;;</pre></div></li><li><div>(For the release build:) Use the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> to convert models to .j3o format. You don&#039;t need this step as long you still develop and test the aplication within the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>.</div></li></ol></div><h2><a>Creating Models and Scenes</a></h2><div><p>To create 3D models and scenes, you need a 3D Mesh Editor such as <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.blender.org/"><param name="text" value="<html><u>Blender</u></html>"><param name="textColor" value="blue"></object>, with an OgreXML Exporter plugin.</p><p><strong>Tip:</strong> Consider creating <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/UV_Map_Basics"><param name="text" value="<html><u>UV textures</u></html>"><param name="textColor" value="blue"></object> for more complex models, it looks more professional.</p><p>3D mesh editors are third-party products, so please consult their documentation for instructions how to use them. Here is an example workflow for Blender users:</p><p>To export your models as Ogre <acronym title="Extensible Markup Language">XML</acronym> meshes with materials:</p><ol><li><div>Open the menu File &gt; Export &gt; OgreXML Exporter to open the exporter dialog.</div></li><li><div>In the Export Materials field: Give the material the same name as the model. For example, the model <code>something.mesh.xml</code> goes with <code>something.material</code>, plus (optionally) <code>something.skeleton.xml</code>, and some <acronym title="Joint Photographics Experts Group">JPG</acronym> files.</div></li><li><div>In the Export Meshes field: Select a target subdirectory of your <code>assets/Models/</code> directory. E.g. <code>assets/Models/something/</code>.</div></li><li><div>Activate the following exporter settings:</div><ul><li><div>Copy Textures: YES</div></li><li><div>Rendering Materials: YES</div></li><li><div>Flip Axis: YES</div></li><li><div>Require Materials: YES</div></li><li><div>Skeleton name follows mesh: YES</div></li></ul></li><li><div>Click export.</div></li></ol><p>You can now use the <a href="/com/jme3/gde/core/docs/sdk.html">jMonkeyEngine SDK</a> to <a href="/com/jme3/gde/core/docs/sdk/model_loader_and_viewer.html">load and view models</a>. You can <a href="/com/jme3/gde/core/docs/sdk/scene_composer.html">create scenes</a> from them and write cde that loads them into your application.</p></div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:3d_models?do=export_xhtmlbody">view online version</a></em></p>

File diff suppressed because one or more lines are too long

@ -174,7 +174,7 @@ If you use the default build script created by the jMonkeyEngine <acronym title=
Before building the executable, you must use the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>&#039;s context menu action to <a href="/com/jme3/gde/core/docs/sdk/model_loader_and_viewer.html">convert OgreXML models to .j3o format</a>.
</p>
<ol>
<li><div> Open the kME3 Project in the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>.</div>
<li><div> Open the jME3 Project in the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>.</div>
</li>
<li><div> Browse the <code>assets</code> directory in the Projects window. </div>
</li>

@ -1,86 +1,4 @@
<h1><a>Audio in jME3</a></h1>
<div>
<p>
There are two ways to handle audio data: Short audio files are to be stored entirely in memory, while long audio files (music) is streamed from the hard drive as it is played.
</p>
<p>
Place audio files in the <code>assets/Sound/</code> directory of your project. jME3 supports Ogg Vorbis (.ogg) and Wave (.wav) formats.
</p>
</div>
<h2><a>Creating Audio Nodes: Streamed or Buffered</a></h2>
<div>
<p>
The main class to look at is <code>com.jme3.audio.AudioNode</code>.
</p>
<ul>
<li><div> <strong>Buffered:</strong> By default, a new audio node is buffered. This means jME3 loads the whole file into memory before playing. You create a buffered sound by setting the boolean to false, or using no boolean at all: <pre>AudioNode boom = new AudioNode&#40;assetManager, &quot;Sound/boom.wav&quot;&#41;;</pre>
</div>
</li>
<li><div> <strong>Streamed:</strong> If it is a long file, you stream the audio, that means, you load and play in parallel until the sound is done. You create a streamed sound by setting the boolean to true:<pre>AudioNode music = new AudioNode&#40;assetManager, &quot;Sound/music.wav&quot;, true&#41;;</pre>
</div>
</li>
</ul>
</div>
<h2><a>Getting AudioNode Properties</a></h2>
<div>
<div><table>
<tr>
<th>AudioNode Method</th><th>Usage</th>
</tr>
<tr>
<td>getStatus()</td><td>Returns either Status.Playing, Status.Stopped, or Status.Paused. </td>
</tr>
<tr>
<td>getVolume()</td><td>Returns the volume. </td>
</tr>
<tr>
<td>getPitch()</td><td>Returns the pitch. </td>
</tr>
</table></div>
<!-- EDIT1 TABLE [1068-1240] -->
<p>
There are other obvious getters to poll the status of corresponding setters below.
</p>
</div>
<h2><a>Setting AudioNode Properties</a></h2>
<div>
<div><table>
<tr>
<th>AudioNode Method</th><th>Usage</th>
</tr>
<tr>
<td>setVolume(1)</td><td>Sets the volume gain. 1 is the default volume, 2 is twice as loud, etc. 0 is silent/mute. </td>
</tr>
<tr>
<td>setPitch(1)</td><td>Makes the sound play in a higher or lower pitch. Default is 1. 2 is twice as high, .5f is half as low. </td>
</tr>
</table></div>
<!-- EDIT2 TABLE [1368-1616] --><div><table>
<tr>
<th>AudioNode Method</th><th>Usage</th>
</tr>
<tr>
<td>setLooping(false)</td><td>Configures the sound so that, if it is played, it plays once and stops. This is the default.</td>
</tr>
<tr>
<td>setLooping(true)</td><td>Configures the sound so that, if it is played, it plays repeats from the beginning, until stop() or pause() are called. Good for ambient background noises. <br/>
Does not work for streamed sounds! </td>
</tr>
<tr>
<h1><a>Audio in jME3</a></h1><div><p>There are two ways to handle audio data: Short audio files are to be stored entirely in memory, while long audio files (music) is streamed from the hard drive as it is played.</p><p>Place audio files in the <code>assets/Sound/</code> directory of your project. jME3 supports Ogg Vorbis (.ogg) and Wave (.wav) formats.</p></div><h2><a>Creating Audio Nodes: Streamed or Buffered</a></h2><div><p>The main class to look at is <code>com.jme3.audio.AudioNode</code>.</p><ul><li><div><strong>Buffered:</strong> By default, a new audio node is buffered. This means jME3 loads the whole file into memory before playing. You create a buffered sound by setting the boolean to false, or using no boolean at all:<pre>AudioNode boom = new AudioNode&#40;assetManager, &quot;Sound/boom.wav&quot;&#41;;</pre></div></li><li><div><strong>Streamed:</strong> If it is a long file, you stream the audio, that means, you load and play in parallel until the sound is done. You create a streamed sound by setting the boolean to true:<pre>AudioNode music = new AudioNode&#40;assetManager, &quot;Sound/music.wav&quot;, true&#41;;</pre></div></li></ul></div><h2><a>Getting AudioNode Properties</a></h2><div><div><table><tr><th>AudioNode Method</th><th>Usage</th></tr><tr><td>getStatus()</td><td>Returns either Status.Playing, Status.Stopped, or Status.Paused.</td></tr><tr><td>getVolume()</td><td>Returns the volume.</td></tr><tr><td>getPitch()</td><td>Returns the pitch.</td></tr></table></div><p>There are other obvious getters to poll the status of corresponding setters below.</p></div><h2><a>Setting AudioNode Properties</a></h2><div><div><table><tr><th>AudioNode Method</th><th>Usage</th></tr><tr><td>setVolume(1)</td><td>Sets the volume gain. 1 is the default volume, 2 is twice as loud, etc. 0 is silent/mute.</td></tr><tr><td>setPitch(1)</td><td>Makes the sound play in a higher or lower pitch. Default is 1. 2 is twice as high, .5f is half as low.</td></tr></table></div><div><table><tr><th>AudioNode Method</th><th>Usage</th></tr><tr><td>setLooping(false)</td><td>Configures the sound so that, if it is played, it plays once and stops. This is the default.</td></tr><tr><td>setLooping(true)</td><td>Configures the sound so that, if it is played, it plays repeats from the beginning, until stop() or pause() are called. Good for ambient background noises. <br/> Does not work for streamed sounds!</td></tr><tr>
<td>setPositional(false) <br/>
setDirectional(false)</td><td>All 3D effects switched off. This sound is global and comes from everywhere. Good for environmental ambient sounds and background music.</td>
</tr>

@ -1,27 +1,8 @@
<h1><a>Audio Environment Presets</a></h1>
<div>
<p>
Use these presets together with <a href="/com/jme3/gde/core/docs/jme3/advanced/audio.html">Audio</a> Nodes to create different &quot;moods&quot; for sounds. Environment effects make your audio sound as if the listener were in various places that have different types of echoes.
</p>
<p>
Usage:
</p>
<pre>Environment&#40;
<h1><a>Audio Environment Presets</a></h1><div><p>Use these presets together with <a href="/com/jme3/gde/core/docs/jme3/advanced/audio.html">Audio</a> Nodes to create different &quot;moods&quot; for sounds. Environment effects make your audio sound as if the listener were in various places that have different types of echoes.</p><p>Usage:</p><pre>Environment&#40;
new float&#91;&#93;&#123; 0, 7.5f, 1f, -1000, -100, 0, 1.49f, 0.83f, 1f, -2602,
0.007f, 0f, 0f, 0f, 200, 0.011f, 0f, 0f, 0f, 0.250f,
0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;
audioRenderer.setEnvironment&#40;myEnvironment&#41;;</pre>
</div>
<h2><a>Castle</a></h2>
<div>
<pre>CastleSmallRoom = new Environment &#40; new float&#91;&#93;&#123; 26, 8.3f, 0.890f, -1000, -800, -2000, 1.22f, 0.83f, 0.31f, -100, 0.022f, 0f, 0f, 0f, 600, 0.011f, 0f, 0f, 0f, 0.138f, 0.080f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20&#125; &#41; &#41;;
audioRenderer.setEnvironment&#40;myEnvironment&#41;;</pre></div><h2><a>Castle</a></h2><div><pre>CastleSmallRoom = new Environment &#40; new float&#91;&#93;&#123; 26, 8.3f, 0.890f, -1000, -800, -2000, 1.22f, 0.83f, 0.31f, -100, 0.022f, 0f, 0f, 0f, 600, 0.011f, 0f, 0f, 0f, 0.138f, 0.080f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20&#125; &#41; &#41;;
CastleShortPassage = new Environment &#40; new float&#91;&#93;&#123; 26, 8.3f, 0.890f, -1000, -1000, -2000, 2.32f, 0.83f, 0.31f, -100, 0.007f, 0f, 0f, 0f, 200, 0.023f, 0f, 0f, 0f, 0.138f, 0.080f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20&#125; &#41; &#41;;
CastleMediumroom = new Environment &#40; new float&#91;&#93;&#123; 26, 8.3f, 0.930f, -1000, -1100, -2000, 2.04f, 0.83f, 0.46f, -400, 0.022f, 0f, 0f, 0f, 400, 0.011f, 0f, 0f, 0f, 0.155f, 0.030f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20&#125; &#41; &#41;;
CastleLongpassage = new Environment &#40; new float&#91;&#93;&#123; 26, 8.3f, 0.890f, -1000, -800, -2000, 3.42f, 0.83f, 0.31f, -100, 0.007f, 0f, 0f, 0f, 300, 0.023f, 0f, 0f, 0f, 0.138f, 0.080f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20&#125; &#41; &#41;;
@ -29,13 +10,7 @@ CastleLargeroom = new Environment &#40; new float&#91;&#93;&#123; 26, 8.3f, 0
CastleHall = new Environment &#40; new float&#91;&#93;&#123; 26, 8.3f, 0.810f, -1000, -1100, -1500, 3.14f, 0.79f, 0.62f, -1500, 0.056f, 0f, 0f, 0f, 100, 0.024f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20&#125; &#41; &#41;;
CastleCupboard = new Environment &#40; new float&#91;&#93;&#123; 26, 8.3f, 0.890f, -1000, -1100, -2000, 0.67f, 0.87f, 0.31f, 300, 0.010f, 0f, 0f, 0f, 1100, 0.007f, 0f, 0f, 0f, 0.138f, 0.080f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20&#125; &#41; &#41;;
CastleCourtyard = new Environment &#40; new float&#91;&#93;&#123; 26, 8.3f, 0.420f, -1000, -700, -1400, 2.13f, 0.61f, 0.23f, -1300, 0.160f, 0f, 0f, 0f, -300, 0.036f, 0f, 0f, 0f, 0.250f, 0.370f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x1f&#125; &#41; &#41;;
CastleAlcove = new Environment &#40; new float&#91;&#93;&#123; 26, 8.3f, 0.890f, -1000, -600, -2000, 1.64f, 0.87f, 0.31f, 00, 0.007f, 0f, 0f, 0f, 300, 0.034f, 0f, 0f, 0f, 0.138f, 0.080f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20&#125; &#41; &#41;;</pre>
</div>
<h2><a>Warehouse, Factory</a></h2>
<div>
<pre>FactoryAlcove = new Environment &#40; new float&#91;&#93;&#123; 26, 1.8f, 0.590f, -1200, -200, -600, 3.14f, 0.65f, 1.31f, 300, 0.010f, 0f, 0f, 0f, 000, 0.038f, 0f, 0f, 0f, 0.114f, 0.100f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20&#125; &#41; &#41;;
CastleAlcove = new Environment &#40; new float&#91;&#93;&#123; 26, 1.8f, 0.590f, -1200, -200, -600, 3.14f, 0.65f, 1.31f, 300, 0.010f, 0f, 0f, 0f, 000, 0.038f, 0f, 0f, 0f, 0.114f, 0.100f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20&#125; &#41; &#41;;
FactoryShortpassage = new Environment &#40; new float&#91;&#93;&#123; 26, 1.8f, 0.640f, -1200, -200, -600, 2.53f, 0.65f, 1.31f, 0, 0.010f, 0f, 0f, 0f, 200, 0.038f, 0f, 0f, 0f, 0.135f, 0.230f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20&#125; &#41; &#41;;
FactoryMediumroom = new Environment &#40; new float&#91;&#93;&#123; 26, 1.9f, 0.820f, -1200, -200, -600, 2.76f, 0.65f, 1.31f, -1100, 0.022f, 0f, 0f, 0f, 300, 0.023f, 0f, 0f, 0f, 0.174f, 0.070f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20&#125; &#41; &#41;;
FactoryLongpassage = new Environment &#40; new float&#91;&#93;&#123; 26, 1.8f, 0.640f, -1200, -200, -600, 4.06f, 0.65f, 1.31f, 0, 0.020f, 0f, 0f, 0f, 200, 0.037f, 0f, 0f, 0f, 0.135f, 0.230f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20&#125; &#41; &#41;;
@ -43,13 +18,7 @@ FactoryLargeroom = new Environment &#40; new float&#91;&#93;&#123; 26, 1.9f,
FactoryHall = new Environment &#40; new float&#91;&#93;&#123; 26, 1.9f, 0.750f, -1000, -300, -400, 7.43f, 0.51f, 1.31f, -2400, 0.073f, 0f, 0f, 0f, -100, 0.027f, 0f, 0f, 0f, 0.250f, 0.070f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20&#125; &#41; &#41;;
FactoryCupboard = new Environment &#40; new float&#91;&#93;&#123; 26, 1.7f, 0.630f, -1200, -200, -600, 0.49f, 0.65f, 1.31f, 200, 0.010f, 0f, 0f, 0f, 600, 0.032f, 0f, 0f, 0f, 0.107f, 0.070f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20&#125; &#41; &#41;;
FactoryCourtyard = new Environment &#40; new float&#91;&#93;&#123; 26, 1.7f, 0.570f, -1000, -1000, -400, 2.32f, 0.29f, 0.56f, -1300, 0.140f, 0f, 0f, 0f, -800, 0.039f, 0f, 0f, 0f, 0.250f, 0.290f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20&#125; &#41; &#41;;
FactorySmallroom = new Environment &#40; new float&#91;&#93;&#123; 26, 1.8f, 0.820f, -1000, -200, -600, 1.72f, 0.65f, 1.31f, -300, 0.010f, 0f, 0f, 0f, 500, 0.024f, 0f, 0f, 0f, 0.119f, 0.070f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20&#125; &#41; &#41;;</pre>
</div>
<h2><a>Ice Palace</a></h2>
<div>
<pre>IcepalaceAlcove = new Environment &#40; new float&#91;&#93;&#123; 26, 2.7f, 0.840f, -1000, -500, -1100, 2.76f, 1.46f, 0.28f, 100, 0.010f, 0f, 0f, 0f, -100, 0.030f, 0f, 0f, 0f, 0.161f, 0.090f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20&#125; &#41; &#41;;
FactorySmallroom = new Environment &#40; new float&#91;&#93;&#123; 26, 2.7f, 0.840f, -1000, -500, -1100, 2.76f, 1.46f, 0.28f, 100, 0.010f, 0f, 0f, 0f, -100, 0.030f, 0f, 0f, 0f, 0.161f, 0.090f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20&#125; &#41; &#41;;
IcepalaceShortpassage = new Environment &#40; new float&#91;&#93;&#123; 26, 2.7f, 0.750f, -1000, -500, -1100, 1.79f, 1.46f, 0.28f, -600, 0.010f, 0f, 0f, 0f, 100, 0.019f, 0f, 0f, 0f, 0.177f, 0.090f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20&#125; &#41; &#41;;
IcepalaceMediumroom = new Environment &#40; new float&#91;&#93;&#123; 26, 2.7f, 0.870f, -1000, -500, -700, 2.22f, 1.53f, 0.32f, -800, 0.039f, 0f, 0f, 0f, 100, 0.027f, 0f, 0f, 0f, 0.186f, 0.120f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20&#125; &#41; &#41;;
IcepalaceLongpassage = new Environment &#40; new float&#91;&#93;&#123; 26, 2.7f, 0.770f, -1000, -500, -800, 3.01f, 1.46f, 0.28f, -200, 0.012f, 0f, 0f, 0f, 200, 0.025f, 0f, 0f, 0f, 0.186f, 0.040f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20&#125; &#41; &#41;;
@ -57,26 +26,14 @@ IcepalaceLargeroom = new Environment &#40; new float&#91;&#93;&#123; 26, 2.9f
IcepalaceHall = new Environment &#40; new float&#91;&#93;&#123; 26, 2.9f, 0.760f, -1000, -700, -500, 5.49f, 1.53f, 0.38f, -1900, 0.054f, 0f, 0f, 0f, -400, 0.052f, 0f, 0f, 0f, 0.226f, 0.110f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20&#125; &#41; &#41;;
IcepalaceCupboard = new Environment &#40; new float&#91;&#93;&#123; 26, 2.7f, 0.830f, -1000, -600, -1300, 0.76f, 1.53f, 0.26f, 100, 0.012f, 0f, 0f, 0f, 600, 0.016f, 0f, 0f, 0f, 0.143f, 0.080f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20&#125; &#41; &#41;;
IcepalaceCourtyard = new Environment &#40; new float&#91;&#93;&#123; 26, 2.9f, 0.590f, -1000, -1100, -1000, 2.04f, 1.20f, 0.38f, -1000, 0.173f, 0f, 0f, 0f, -1000, 0.043f, 0f, 0f, 0f, 0.235f, 0.480f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20&#125; &#41; &#41;;
IcepalaceSmallroom = new Environment &#40; new float&#91;&#93;&#123; 26, 2.7f, 0.840f, -1000, -500, -1100, 1.51f, 1.53f, 0.27f, -100, 0.010f, 0f, 0f, 0f, 300, 0.011f, 0f, 0f, 0f, 0.164f, 0.140f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20&#125; &#41; &#41;;</pre>
</div>
<h2><a>Space Station</a></h2>
<div>
<pre>SpacestationAlcove = new Environment &#40; new float&#91;&#93;&#123; 26, 1.5f, 0.780f, -1000, -300, -100, 1.16f, 0.81f, 0.55f, 300, 0.007f, 0f, 0f, 0f, 000, 0.018f, 0f, 0f, 0f, 0.192f, 0.210f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20&#125; &#41; &#41;;
IcepalaceSmallroom = new Environment &#40; new float&#91;&#93;&#123; 26, 1.5f, 0.780f, -1000, -300, -100, 1.16f, 0.81f, 0.55f, 300, 0.007f, 0f, 0f, 0f, 000, 0.018f, 0f, 0f, 0f, 0.192f, 0.210f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20&#125; &#41; &#41;;
SpacestationMediumroom = new Environment &#40; new float&#91;&#93;&#123; 26, 1.5f, 0.750f, -1000, -400, -100, 3.01f, 0.50f, 0.55f, -800, 0.034f, 0f, 0f, 0f, 100, 0.035f, 0f, 0f, 0f, 0.209f, 0.310f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20&#125; &#41; &#41;;
SpacestationShortpassage = new Environment &#40; new float&#91;&#93;&#123; 26, 1.5f, 0.870f, -1000, -400, -100, 3.57f, 0.50f, 0.55f, 0, 0.012f, 0f, 0f, 0f, 100, 0.016f, 0f, 0f, 0f, 0.172f, 0.200f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20&#125; &#41; &#41;;
SpacestationLongpassage = new Environment &#40; new float&#91;&#93;&#123; 26, 1.9f, 0.820f, -1000, -400, -100, 4.62f, 0.62f, 0.55f, 0, 0.012f, 0f, 0f, 0f, 200, 0.031f, 0f, 0f, 0f, 0.250f, 0.230f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20&#125; &#41; &#41;;
SpacestationLargeroom = new Environment &#40; new float&#91;&#93;&#123; 26, 1.8f, 0.810f, -1000, -400, -100, 3.89f, 0.38f, 0.61f, -1000, 0.056f, 0f, 0f, 0f, -100, 0.035f, 0f, 0f, 0f, 0.233f, 0.280f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20&#125; &#41; &#41;;
SpacestationHall = new Environment &#40; new float&#91;&#93;&#123; 26, 1.9f, 0.870f, -1000, -400, -100, 7.11f, 0.38f, 0.61f, -1500, 0.100f, 0f, 0f, 0f, -400, 0.047f, 0f, 0f, 0f, 0.250f, 0.250f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20&#125; &#41; &#41;;
SpacestationCupboard = new Environment &#40; new float&#91;&#93;&#123; 26, 1.4f, 0.560f, -1000, -300, -100, 0.79f, 0.81f, 0.55f, 300, 0.007f, 0f, 0f, 0f, 500, 0.018f, 0f, 0f, 0f, 0.181f, 0.310f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20&#125; &#41; &#41;;
SpacestationSmallroom = new Environment &#40; new float&#91;&#93;&#123; 26, 1.5f, 0.700f, -1000, -300, -100, 1.72f, 0.82f, 0.55f, -200, 0.007f, 0f, 0f, 0f, 300, 0.013f, 0f, 0f, 0f, 0.188f, 0.260f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20&#125; &#41; &#41;;</pre>
</div>
<h2><a>Wooden Hut or Ship</a></h2>
<div>
<pre>WoodenAlcove = new Environment &#40; new float&#91;&#93;&#123; 26, 7.5f, 1f, -1000, -1800, -1000, 1.22f, 0.62f, 0.91f, 100, 0.012f, 0f, 0f, 0f, -300, 0.024f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f&#125; &#41; &#41;;
SpacestationSmallroom = new Environment &#40; new float&#91;&#93;&#123; 26, 7.5f, 1f, -1000, -1800, -1000, 1.22f, 0.62f, 0.91f, 100, 0.012f, 0f, 0f, 0f, -300, 0.024f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f&#125; &#41; &#41;;
WoodenShortpassage = new Environment &#40; new float&#91;&#93;&#123; 26, 7.5f, 1f, -1000, -1800, -1000, 1.75f, 0.50f, 0.87f, -100, 0.012f, 0f, 0f, 0f, -400, 0.024f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f&#125; &#41; &#41;;
WoodenMediumroom = new Environment &#40; new float&#91;&#93;&#123; 26, 7.5f, 1f, -1000, -2000, -1100, 1.47f, 0.42f, 0.82f, -100, 0.049f, 0f, 0f, 0f, -100, 0.029f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f&#125; &#41; &#41;;
WoodenLongpassage = new Environment &#40; new float&#91;&#93;&#123; 26, 7.5f, 1f, -1000, -2000, -1000, 1.99f, 0.40f, 0.79f, 000, 0.020f, 0f, 0f, 0f, -700, 0.036f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f&#125; &#41; &#41;;
@ -84,113 +41,53 @@ WoodenLargeroom = new Environment &#40; new float&#91;&#93;&#123; 26, 7.5
WoodenHall = new Environment &#40; new float&#91;&#93;&#123; 26, 7.5f, 1f, -1000, -2200, -1100, 3.45f, 0.30f, 0.82f, -100, 0.088f, 0f, 0f, 0f, -200, 0.063f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f&#125; &#41; &#41;;
WoodenCupboard = new Environment &#40; new float&#91;&#93;&#123; 26, 7.5f, 1f, -1000, -1700, -1000, 0.56f, 0.46f, 0.91f, 100, 0.012f, 0f, 0f, 0f, 100, 0.028f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f&#125; &#41; &#41;;
WoodenSmallroom = new Environment &#40; new float&#91;&#93;&#123; 26, 7.5f, 1f, -1000, -1900, -1000, 0.79f, 0.32f, 0.87f, 00, 0.032f, 0f, 0f, 0f, -100, 0.029f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f&#125; &#41; &#41;;
WoodenCourtyard = new Environment &#40; new float&#91;&#93;&#123; 26, 7.5f, 0.650f, -1000, -2200, -1000, 1.79f, 0.35f, 0.79f, -500, 0.123f, 0f, 0f, 0f, -2000, 0.032f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f&#125; &#41; &#41;;</pre>
</div>
<h2><a>Sport</a></h2>
<div>
<pre>SportEmptystadium = new Environment &#40; new float&#91;&#93;&#123; 26, 7.2f, 1f, -1000, -700, -200, 6.26f, 0.51f, 1.10f, -2400, 0.183f, 0f, 0f, 0f, -800, 0.038f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x20&#125; &#41; &#41;;
WoodenCourtyard = new Environment &#40; new float&#91;&#93;&#123; 26, 7.2f, 1f, -1000, -700, -200, 6.26f, 0.51f, 1.10f, -2400, 0.183f, 0f, 0f, 0f, -800, 0.038f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x20&#125; &#41; &#41;;
SportSquashcourt = new Environment &#40; new float&#91;&#93;&#123; 26, 7.5f, 0.750f, -1000, -1000, -200, 2.22f, 0.91f, 1.16f, -700, 0.007f, 0f, 0f, 0f, -200, 0.011f, 0f, 0f, 0f, 0.126f, 0.190f, 0.250f, 0f, -5f, 7176.9f, 211.2f, 0f, 0x20&#125; &#41; &#41;;
SportSmallswimmingpool = new Environment &#40; new float&#91;&#93;&#123; 26, 36.2f, 0.700f, -1000, -200, -100, 2.76f, 1.25f, 1.14f, -400, 0.020f, 0f, 0f, 0f, -200, 0.030f, 0f, 0f, 0f, 0.179f, 0.150f, 0.895f, 0.190f, -5f, 5000f, 250f, 0f, 0x0&#125; &#41; &#41;;
SportLargeswimmingpool = new Environment &#40; new float&#91;&#93;&#123; 26, 36.2f, 0.820f, -1000, -200, 0, 5.49f, 1.31f, 1.14f, -700, 0.039f, 0f, 0f, 0f, -600, 0.049f, 0f, 0f, 0f, 0.222f, 0.550f, 1.159f, 0.210f, -5f, 5000f, 250f, 0f, 0x0&#125; &#41; &#41;;
SportGymnasium = new Environment &#40; new float&#91;&#93;&#123; 26, 7.5f, 0.810f, -1000, -700, -100, 3.14f, 1.06f, 1.35f, -800, 0.029f, 0f, 0f, 0f, -500, 0.045f, 0f, 0f, 0f, 0.146f, 0.140f, 0.250f, 0f, -5f, 7176.9f, 211.2f, 0f, 0x20&#125; &#41; &#41;;
SportFullstadium = new Environment &#40; new float&#91;&#93;&#123; 26, 7.2f, 1f, -1000, -2300, -200, 5.25f, 0.17f, 0.80f, -2000, 0.188f, 0f, 0f, 0f, -1100, 0.038f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x20&#125; &#41; &#41;;</pre>
</div>
<h2><a>Pipes</a></h2>
<div>
<pre>Sewerpipe = new Environment &#40; new float&#91;&#93;&#123; 21, 1.7f, 0.800f, -1000, -1000, 0, 2.81f, 0.14f, 1f, 429, 0.014f, 0f, 0f, 0f, 1023, 0.021f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;
SportFullstadium = new Environment &#40; new float&#91;&#93;&#123; 21, 1.7f, 0.800f, -1000, -1000, 0, 2.81f, 0.14f, 1f, 429, 0.014f, 0f, 0f, 0f, 1023, 0.021f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;
PipeSmall = new Environment &#40; new float&#91;&#93;&#123; 26, 50.3f, 1f, -1000, -900, -1300, 5.04f, 0.10f, 0.10f, -600, 0.032f, 0f, 0f, 0f, 800, 0.015f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 2854.4f, 20f, 0f, 0x3f&#125; &#41; &#41;;
PipeLongthin = new Environment &#40; new float&#91;&#93;&#123; 26, 1.6f, 0.910f, -1000, -700, -1100, 9.21f, 0.18f, 0.10f, -300, 0.010f, 0f, 0f, 0f, -300, 0.022f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 2854.4f, 20f, 0f, 0x0&#125; &#41; &#41;;
PipeLarge = new Environment &#40; new float&#91;&#93;&#123; 26, 50.3f, 1f, -1000, -900, -1300, 8.45f, 0.10f, 0.10f, -800, 0.046f, 0f, 0f, 0f, 400, 0.032f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 2854.4f, 20f, 0f, 0x3f&#125; &#41; &#41;;
PipeResonant = new Environment &#40; new float&#91;&#93;&#123; 26, 1.3f, 0.910f, -1000, -700, -1100, 6.81f, 0.18f, 0.10f, -300, 0.010f, 0f, 0f, 0f, 00, 0.022f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 2854.4f, 20f, 0f, 0x0&#125; &#41; &#41;;</pre>
</div>
<h2><a>Moods</a></h2>
<div>
<pre>Heaven = new Environment &#40; new float&#91;&#93;&#123; 26, 19.6f, 0.940f, -1000, -200, -700, 5.04f, 1.12f, 0.56f, -1230, 0.020f, 0f, 0f, 0f, 200, 0.029f, 0f, 0f, 0f, 0.250f, 0.080f, 2.742f, 0.050f, -2f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;
PipeResonant = new Environment &#40; new float&#91;&#93;&#123; 26, 19.6f, 0.940f, -1000, -200, -700, 5.04f, 1.12f, 0.56f, -1230, 0.020f, 0f, 0f, 0f, 200, 0.029f, 0f, 0f, 0f, 0.250f, 0.080f, 2.742f, 0.050f, -2f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;
Hell = new Environment &#40; new float&#91;&#93;&#123; 26, 100f, 0.570f, -1000, -900, -700, 3.57f, 0.49f, 2f, -10000, 0.020f, 0f, 0f, 0f, 300, 0.030f, 0f, 0f, 0f, 0.110f, 0.040f, 2.109f, 0.520f, -5f, 5000f, 139.5f, 0f, 0x40&#125; &#41; &#41;;
Memory = new Environment &#40; new float&#91;&#93;&#123; 26, 8f, 0.850f, -1000, -400, -900, 4.06f, 0.82f, 0.56f, -2800, 0f, 0f, 0f, 0f, 100, 0f, 0f, 0f, 0f, 0.250f, 0f, 0.474f, 0.450f, -10f, 5000f, 250f, 0f, 0x0&#125; &#41; &#41;;
Drugged = new Environment &#40; new float&#91;&#93;&#123; 23, 1.9f, 0.500f, -1000, 0, 0, 8.39f, 1.39f, 1f, -115, 0.002f, 0f, 0f, 0f, 985, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 1f, -5f, 5000f, 250f, 0f, 0x1f&#125; &#41; &#41;;
Dizzy = new Environment &#40; new float&#91;&#93;&#123; 24, 1.8f, 0.600f, -1000, -400, 0, 17.23f, 0.56f, 1f, -1713, 0.020f, 0f, 0f, 0f, -613, 0.030f, 0f, 0f, 0f, 0.250f, 1f, 0.810f, 0.310f, -5f, 5000f, 250f, 0f, 0x1f&#125; &#41; &#41;;
Psychotic = new Environment &#40; new float&#91;&#93;&#123; 25, 1f, 0.500f, -1000, -151, 0, 7.56f, 0.91f, 1f, -626, 0.020f, 0f, 0f, 0f, 774, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 4f, 1f, -5f, 5000f, 250f, 0f, 0x1f&#125; &#41; &#41;;</pre>
</div>
<h2><a>Car Racing</a></h2>
<div>
<pre>DrivingCommentator = new Environment &#40; new float&#91;&#93;&#123; 26, 3f, 0f, 1000, -500, -600, 2.42f, 0.88f, 0.68f, -1400, 0.093f, 0f, 0f, 0f, -1200, 0.017f, 0f, 0f, 0f, 0.250f, 1f, 0.250f, 0f, -10f, 5000f, 250f, 0f, 0x20&#125; &#41; &#41;;
Psychotic = new Environment &#40; new float&#91;&#93;&#123; 26, 3f, 0f, 1000, -500, -600, 2.42f, 0.88f, 0.68f, -1400, 0.093f, 0f, 0f, 0f, -1200, 0.017f, 0f, 0f, 0f, 0.250f, 1f, 0.250f, 0f, -10f, 5000f, 250f, 0f, 0x20&#125; &#41; &#41;;
DrivingPitgarage = new Environment &#40; new float&#91;&#93;&#123; 26, 1.9f, 0.590f, -1000, -300, -500, 1.72f, 0.93f, 0.87f, -500, 0f, 0f, 0f, 0f, 200, 0.016f, 0f, 0f, 0f, 0.250f, 0.110f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x0&#125; &#41; &#41;;
DrivingIncarRacer = new Environment &#40; new float&#91;&#93;&#123; 26, 1.1f, 0.800f, -1000, 0, -200, 0.17f, 2f, 0.41f, 500, 0.007f, 0f, 0f, 0f, -300, 0.015f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 10268.2f, 251f, 0f, 0x20&#125; &#41; &#41;;
DrivingIncarSports = new Environment &#40; new float&#91;&#93;&#123; 26, 1.1f, 0.800f, -1000, -400, 0, 0.17f, 0.75f, 0.41f, 0, 0.010f, 0f, 0f, 0f, -500, 0f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 10268.2f, 251f, 0f, 0x20&#125; &#41; &#41;;
DrivingIncarLuxury = new Environment &#40; new float&#91;&#93;&#123; 26, 1.6f, 1f, -1000, -2000, -600, 0.13f, 0.41f, 0.46f, -200, 0.010f, 0f, 0f, 0f, 400, 0.010f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 10268.2f, 251f, 0f, 0x20&#125; &#41; &#41;;
DrivingFullgrandstand = new Environment &#40; new float&#91;&#93;&#123; 26, 8.3f, 1f, -1000, -1100, -400, 3.01f, 1.37f, 1.28f, -900, 0.090f, 0f, 0f, 0f, -1500, 0.049f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 10420.2f, 250f, 0f, 0x1f&#125; &#41; &#41;;
DrivingEmptygrandstand = new Environment &#40; new float&#91;&#93;&#123; 26, 8.3f, 1f, -1000, 0, -200, 4.62f, 1.75f, 1.40f, -1363, 0.090f, 0f, 0f, 0f, -1200, 0.049f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 10420.2f, 250f, 0f, 0x1f&#125; &#41; &#41;;
DrivingTunnel = new Environment &#40; new float&#91;&#93;&#123; 26, 3.1f, 0.810f, -1000, -800, -100, 3.42f, 0.94f, 1.31f, -300, 0.051f, 0f, 0f, 0f, -300, 0.047f, 0f, 0f, 0f, 0.214f, 0.050f, 0.250f, 0f, -5f, 5000f, 155.3f, 0f, 0x20&#125; &#41; &#41;;</pre>
</div>
<h2><a>City</a></h2>
<div>
<pre>CityIndoors = new Environment &#40; new float&#91;&#93;&#123; 16, 7.5f, 0.500f, -1000, -800, 0, 1.49f, 0.67f, 1f, -2273, 0.007f, 0f, 0f, 0f, -1691, 0.011f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;
DrivingTunnel = new Environment &#40; new float&#91;&#93;&#123; 16, 7.5f, 0.500f, -1000, -800, 0, 1.49f, 0.67f, 1f, -2273, 0.007f, 0f, 0f, 0f, -1691, 0.011f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;
CityStreets = new Environment &#40; new float&#91;&#93;&#123; 26, 3f, 0.780f, -1000, -300, -100, 1.79f, 1.12f, 0.91f, -1100, 0.046f, 0f, 0f, 0f, -1400, 0.028f, 0f, 0f, 0f, 0.250f, 0.200f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x20&#125; &#41; &#41;;
CitySubway = new Environment &#40; new float&#91;&#93;&#123; 26, 3f, 0.740f, -1000, -300, -100, 3.01f, 1.23f, 0.91f, -300, 0.046f, 0f, 0f, 0f, 200, 0.028f, 0f, 0f, 0f, 0.125f, 0.210f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x20&#125; &#41; &#41;;
CityMuseum = new Environment &#40; new float&#91;&#93;&#123; 26, 80.3f, 0.820f, -1000, -1500, -1500, 3.28f, 1.40f, 0.57f, -1200, 0.039f, 0f, 0f, -0f, -100, 0.034f, 0f, 0f, 0f, 0.130f, 0.170f, 0.250f, 0f, -5f, 2854.4f, 107.5f, 0f, 0x0&#125; &#41; &#41;;
CityLibrary = new Environment &#40; new float&#91;&#93;&#123; 26, 80.3f, 0.820f, -1000, -1100, -2100, 2.76f, 0.89f, 0.41f, -900, 0.029f, 0f, 0f, -0f, -100, 0.020f, 0f, 0f, 0f, 0.130f, 0.170f, 0.250f, 0f, -5f, 2854.4f, 107.5f, 0f, 0x0&#125; &#41; &#41;;
CityUnderpass = new Environment &#40; new float&#91;&#93;&#123; 26, 3f, 0.820f, -1000, -700, -100, 3.57f, 1.12f, 0.91f, -800, 0.059f, 0f, 0f, 0f, -100, 0.037f, 0f, 0f, 0f, 0.250f, 0.140f, 0.250f, 0f, -7f, 5000f, 250f, 0f, 0x20&#125; &#41; &#41;;
CityAbandoned = new Environment &#40; new float&#91;&#93;&#123; 26, 3f, 0.690f, -1000, -200, -100, 3.28f, 1.17f, 0.91f, -700, 0.044f, 0f, 0f, 0f, -1100, 0.024f, 0f, 0f, 0f, 0.250f, 0.200f, 0.250f, 0f, -3f, 5000f, 250f, 0f, 0x20&#125; &#41; &#41;;</pre>
</div>
<h2><a>Small Indoor Rooms</a></h2>
<div>
<pre>Room = new Environment &#40; new float&#91;&#93;&#123; 2, 1.9f, 1f, -1000, -454, 0, 0.40f, 0.83f, 1f, -1646, 0.002f, 0f, 0f, 0f, 53, 0.003f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;
CityAbandoned = new Environment &#40; new float&#91;&#93;&#123; 2, 1.9f, 1f, -1000, -454, 0, 0.40f, 0.83f, 1f, -1646, 0.002f, 0f, 0f, 0f, 53, 0.003f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;
Bathroom = new Environment &#40; new float&#91;&#93;&#123; 3, 1.4f, 1f, -1000, -1200, 0, 1.49f, 0.54f, 1f, -370, 0.007f, 0f, 0f, 0f, 1030, 0.011f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;
Livingroom = new Environment &#40; new float&#91;&#93;&#123; 4, 2.5f, 1f, -1000, -6000, 0, 0.50f, 0.10f, 1f, -1376, 0.003f, 0f, 0f, 0f, -1104, 0.004f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;
Paddedcell = new Environment &#40; new float&#91;&#93;&#123; 1, 1.4f, 1f, -1000, -6000, 0, 0.17f, 0.10f, 1f, -1204, 0.001f, 0f, 0f, 0f, 207, 0.002f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;
Stoneroom = new Environment &#40; new float&#91;&#93;&#123; 5, 11.6f, 1f, -1000, -300, 0, 2.31f, 0.64f, 1f, -711, 0.012f, 0f, 0f, 0f, 83, 0.017f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;</pre>
</div>
<h2><a>Medium-Sized Indoor Rooms</a></h2>
<div>
<pre>Workshop = new Environment &#40; new float&#91;&#93;&#123; 26, 1.9f, 1f, -1000, -1700, -800, 0.76f, 1f, 1f, 0, 0.012f, 0f, 0f, 0f, 100, 0.012f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x0&#125; &#41; &#41;;
Stoneroom = new Environment &#40; new float&#91;&#93;&#123; 26, 1.9f, 1f, -1000, -1700, -800, 0.76f, 1f, 1f, 0, 0.012f, 0f, 0f, 0f, 100, 0.012f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x0&#125; &#41; &#41;;
Schoolroom = new Environment &#40; new float&#91;&#93;&#123; 26, 1.86f, 0.690f, -1000, -400, -600, 0.98f, 0.45f, 0.18f, 300, 0.017f, 0f, 0f, 0f, 300, 0.015f, 0f, 0f, 0f, 0.095f, 0.140f, 0.250f, 0f, -5f, 7176.9f, 211.2f, 0f, 0x20&#125; &#41; &#41;;
Practiseroom = new Environment &#40; new float&#91;&#93;&#123; 26, 1.86f, 0.870f, -1000, -800, -600, 1.12f, 0.56f, 0.18f, 200, 0.010f, 0f, 0f, 0f, 300, 0.011f, 0f, 0f, 0f, 0.095f, 0.140f, 0.250f, 0f, -5f, 7176.9f, 211.2f, 0f, 0x20&#125; &#41; &#41;;
Outhouse = new Environment &#40; new float&#91;&#93;&#123; 26, 80.3f, 0.820f, -1000, -1900, -1600, 1.38f, 0.38f, 0.35f, -100, 0.024f, 0f, 0f, -0f, -400, 0.044f, 0f, 0f, 0f, 0.121f, 0.170f, 0.250f, 0f, -5f, 2854.4f, 107.5f, 0f, 0x0&#125; &#41; &#41;;
Caravan = new Environment &#40; new float&#91;&#93;&#123; 26, 8.3f, 1f, -1000, -2100, -1800, 0.43f, 1.50f, 1f, 0, 0.012f, 0f, 0f, 0f, 600, 0.012f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x1f&#125; &#41; &#41;;
Dustyroom = new Environment &#40; new float&#91;&#93;&#123; 26, 1.8f, 0.560f, -1000, -200, -300, 1.79f, 0.38f, 0.21f, -600, 0.002f, 0f, 0f, 0f, 200, 0.006f, 0f, 0f, 0f, 0.202f, 0.050f, 0.250f, 0f, -10f, 13046f, 163.3f, 0f, 0x20&#125; &#41; &#41;;
Chapel = new Environment &#40; new float&#91;&#93;&#123; 26, 19.6f, 0.840f, -1000, -500, 0, 4.62f, 0.64f, 1.23f, -700, 0.032f, 0f, 0f, 0f, -200, 0.049f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0.110f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;</pre>
</div>
<h2><a>Large Indoor Rooms</a></h2>
<div>
<pre>Auditorium = new Environment &#40; new float&#91;&#93;&#123; 6, 21.6f, 1f, -1000, -476, 0, 4.32f, 0.59f, 1f, -789, 0.020f, 0f, 0f, 0f, -289, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;
Chapel = new Environment &#40; new float&#91;&#93;&#123; 6, 21.6f, 1f, -1000, -476, 0, 4.32f, 0.59f, 1f, -789, 0.020f, 0f, 0f, 0f, -289, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;
Concerthall = new Environment &#40; new float&#91;&#93;&#123; 7, 19.6f, 1f, -1000, -500, 0, 3.92f, 0.70f, 1f, -1230, 0.020f, 0f, 0f, 0f, -02, 0.029f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;
Cave = new Environment &#40; new float&#91;&#93;&#123; 8, 14.6f, 1f, -1000, 0, 0, 2.91f, 1.30f, 1f, -602, 0.015f, 0f, 0f, 0f, -302, 0.022f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x1f&#125; &#41; &#41;;
Arena = new Environment &#40; new float&#91;&#93;&#123; 9, 36.2f, 1f, -1000, -698, 0, 7.24f, 0.33f, 1f, -1166, 0.020f, 0f, 0f, 0f, 16, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;
Hangar = new Environment &#40; new float&#91;&#93;&#123; 10, 50.3f, 1f, -1000, -1000, 0, 10.05f, 0.23f, 1f, -602, 0.020f, 0f, 0f, 0f, 198, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;
DomeTomb = new Environment &#40; new float&#91;&#93;&#123; 26, 51.8f, 0.790f, -1000, -900, -1300, 4.18f, 0.21f, 0.10f, -825, 0.030f, 0f, 0f, 0f, 450, 0.022f, 0f, 0f, 0f, 0.177f, 0.190f, 0.250f, 0f, -5f, 2854.4f, 20f, 0f, 0x0&#125; &#41; &#41;;
DomeSaintPauls = new Environment &#40; new float&#91;&#93;&#123; 26, 50.3f, 0.870f, -1000, -900, -1300, 10.48f, 0.19f, 0.10f, -1500, 0.090f, 0f, 0f, 0f, 200, 0.042f, 0f, 0f, 0f, 0.250f, 0.120f, 0.250f, 0f, -5f, 2854.4f, 20f, 0f, 0x3f&#125; &#41; &#41;;</pre>
</div>
<h2><a>Hallways, Alleys</a></h2>
<div>
<pre>Carpettedhallway = new Environment &#40; new float&#91;&#93;&#123; 11, 1.9f, 1f, -1000, -4000, 0, 0.30f, 0.10f, 1f, -1831, 0.002f, 0f, 0f, 0f, -1630, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;
DomeSaintPauls = new Environment &#40; new float&#91;&#93;&#123; 11, 1.9f, 1f, -1000, -4000, 0, 0.30f, 0.10f, 1f, -1831, 0.002f, 0f, 0f, 0f, -1630, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;
Hallway = new Environment &#40; new float&#91;&#93;&#123; 12, 1.8f, 1f, -1000, -300, 0, 1.49f, 0.59f, 1f, -1219, 0.007f, 0f, 0f, 0f, 441, 0.011f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;
Stonecorridor = new Environment &#40; new float&#91;&#93;&#123; 13, 13.5f, 1f, -1000, -237, 0, 2.70f, 0.79f, 1f, -1214, 0.013f, 0f, 0f, 0f, 395, 0.020f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;
Alley = new Environment &#40; new float&#91;&#93;&#123; 14, 7.5f, 0.300f, -1000, -270, 0, 1.49f, 0.86f, 1f, -1204, 0.007f, 0f, 0f, 0f, -4, 0.011f, 0f, 0f, 0f, 0.125f, 0.950f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;</pre>
</div>
<h2><a>Outdoors</a></h2>
<div>
<pre>Backyard = new Environment &#40; new float&#91;&#93;&#123; 26, 80.3f, 0.450f, -1000, -1200, -600, 1.12f, 0.34f, 0.46f, -700, 0.069f, 0f, 0f, -0f, -300, 0.023f, 0f, 0f, 0f, 0.218f, 0.340f, 0.250f, 0f, -5f, 4399.1f, 242.9f, 0f, 0x0&#125; &#41; &#41;;
Alley = new Environment &#40; new float&#91;&#93;&#123; 26, 80.3f, 0.450f, -1000, -1200, -600, 1.12f, 0.34f, 0.46f, -700, 0.069f, 0f, 0f, -0f, -300, 0.023f, 0f, 0f, 0f, 0.218f, 0.340f, 0.250f, 0f, -5f, 4399.1f, 242.9f, 0f, 0x0&#125; &#41; &#41;;
Plain = new Environment &#40; new float&#91;&#93;&#123; 19, 42.5f, 0.210f, -1000, -2000, 0, 1.49f, 0.50f, 1f, -2466, 0.179f, 0f, 0f, 0f, -1926, 0.100f, 0f, 0f, 0f, 0.250f, 1f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;
Rollingplains = new Environment &#40; new float&#91;&#93;&#123; 26, 80.3f, 0f, -1000, -3900, -400, 2.13f, 0.21f, 0.46f, -1500, 0.300f, 0f, 0f, -0f, -700, 0.019f, 0f, 0f, 0f, 0.250f, 1f, 0.250f, 0f, -5f, 4399.1f, 242.9f, 0f, 0x0&#125; &#41; &#41;;
Deepcanyon = new Environment &#40; new float&#91;&#93;&#123; 26, 80.3f, 0.740f, -1000, -1500, -400, 3.89f, 0.21f, 0.46f, -1000, 0.223f, 0f, 0f, -0f, -900, 0.019f, 0f, 0f, 0f, 0.250f, 1f, 0.250f, 0f, -5f, 4399.1f, 242.9f, 0f, 0x0&#125; &#41; &#41;;
@ -199,14 +96,6 @@ Valley = new Environment &#40; new float&#91;&#93;&#123; 26, 80.3f, 0.280
Forest = new Environment &#40; new float&#91;&#93;&#123; 15, 38f, 0.300f, -1000, -3300, 0, 1.49f, 0.54f, 1f, -2560, 0.162f, 0f, 0f, 0f, -229, 0.088f, 0f, 0f, 0f, 0.125f, 1f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;
Mountains = new Environment &#40; new float&#91;&#93;&#123; 17, 100f, 0.270f, -1000, -2500, 0, 1.49f, 0.21f, 1f, -2780, 0.300f, 0f, 0f, 0f, -1434, 0.100f, 0f, 0f, 0f, 0.250f, 1f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x1f&#125; &#41; &#41;;
Quarry = new Environment &#40; new float&#91;&#93;&#123; 18, 17.5f, 1f, -1000, -1000, 0, 1.49f, 0.83f, 1f, -10000, 0.061f, 0f, 0f, 0f, 500, 0.025f, 0f, 0f, 0f, 0.125f, 0.700f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;
Parkinglot = new Environment &#40; new float&#91;&#93;&#123; 20, 8.3f, 1f, -1000, 0, 0, 1.65f, 1.50f, 1f, -1363, 0.008f, 0f, 0f, 0f, -1153, 0.012f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x1f&#125; &#41; &#41;;</pre>
</div>
<h2><a>Water</a></h2>
<div>
<pre>Underwater = new Environment &#40; new float&#91;&#93;&#123; 22, 1.8f, 1f, -1000, -4000, 0, 1.49f, 0.10f, 1f, -449, 0.007f, 0f, 0f, 0f, 1700, 0.011f, 0f, 0f, 0f, 0.250f, 0f, 1.180f, 0.348f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;
Smallwaterroom = new Environment &#40; new float&#91;&#93;&#123; 26, 36.2f, 0.700f, -1000, -698, 0, 1.51f, 1.25f, 1.14f, -100, 0.020f, 0f, 0f, 0f, 300, 0.030f, 0f, 0f, 0f, 0.179f, 0.150f, 0.895f, 0.190f, -7f, 5000f, 250f, 0f, 0x0&#125; &#41; &#41;;</pre>
</div>
Parkinglot = new Environment &#40; new float&#91;&#93;&#123; 22, 1.8f, 1f, -1000, -4000, 0, 1.49f, 0.10f, 1f, -449, 0.007f, 0f, 0f, 0f, 1700, 0.011f, 0f, 0f, 0f, 0.250f, 0f, 1.180f, 0.348f, -5f, 5000f, 250f, 0f, 0x3f&#125; &#41; &#41;;
Smallwaterroom = new Environment &#40; new float&#91;&#93;&#123; 26, 36.2f, 0.700f, -1000, -698, 0, 1.51f, 1.25f, 1.14f, -100, 0.020f, 0f, 0f, 0f, 300, 0.030f, 0f, 0f, 0f, 0.179f, 0.150f, 0.895f, 0.190f, -7f, 5000f, 250f, 0f, 0x0&#125; &#41; &#41;;</pre></div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:audio_environment_presets?do=export_xhtmlbody">view online version</a></em></p>

@ -1,96 +1,7 @@
<h1><a>Bloom and Glow</a></h1>
<div>
<p>
Bloom is a popular shader effect in 3D games industry. It usually consist in displaying a glowing halo around light sources or bright areas of a scene.
In practice, the bright areas are extracted from the rendered scene, blurred and finally added up to the render.
</p>
<p>
Those images gives an idea of what bloom does. The left image has no bloom effect, the right image does. <br/>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/nobloomsky.png"><img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/blomsky.png">
</p>
</div>
<h1><a>Bloom Usage</a></h1>
<div>
<ol>
<li><div> Create a FilterPostProcessor</div>
</li>
<li><div> Create a BloomFilter</div>
</li>
<li><div> Add the filter to the processor</div>
</li>
<li><div> Add the processor to the viewPort</div>
</li>
</ol>
<pre> FilterPostProcessor fpp=new FilterPostProcessor&#40;assetManager&#41;;
<h1><a>Bloom and Glow</a></h1><div><p>Bloom is a popular shader effect in 3D games industry. It usually consist in displaying a glowing halo around light sources or bright areas of a scene. In practice, the bright areas are extracted from the rendered scene, blurred and finally added up to the render.</p><p>Those images gives an idea of what bloom does. The left image has no bloom effect, the right image does. <br/> <img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/nobloomsky.png"><img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/blomsky.png"></p></div><h1><a>Bloom Usage</a></h1><div><ol><li><div>Create a FilterPostProcessor</div></li><li><div>Create a BloomFilter</div></li><li><div>Add the filter to the processor</div></li><li><div>Add the processor to the viewPort</div></li></ol><pre> FilterPostProcessor fpp=new FilterPostProcessor&#40;assetManager&#41;;
BloomFilter bloom=new BloomFilter&#40;&#41;;
fpp.addFilter&#40;bloom&#41;;
viewPort.addProcessor&#40;fpp&#41;;</pre>
<p>
Here are the parameters that you can tweak :
</p>
<div><table>
<tr>
<th> Parameter </th><th> Method </th><th> Default </th><th> Description </th>
</tr>
<tr>
<td> blur scale </td><td> <code>setBlurScale(float)</code> </td><td>1.5f </td><td> the scale of the bloom effect, but be careful, high values does artifacts </td>
</tr>
<tr>
<td> exposure Power </td><td> <code>setExposurePower(float)</code> </td><td>5.0f </td><td> the glowing channel color is raised to the value power </td>
</tr>
<tr>
<td> exposure cut-off </td><td> <code>setExposureCutOff(float)</code> </td><td>0.0f </td><td> the threshold of color to bloom during extraction </td>
</tr>
<tr>
<td> bloom intensity </td><td> <code>setBloomIntensity(float)</code> </td><td>2.0f </td><td> the resulting bloom value is multiplied by this intensity </td>
</tr>
</table></div>
<!-- EDIT1 TABLE [865-1454] -->
<p>
You&#039;ll probably need to adjust those parameters depending on your scene.
</p>
</div>
<h1><a>Bloom with a glow map</a></h1>
<div>
<p>
Sometimes, you want to have more control over what glows and does not glow.
The bloom filter supports a glow map or a glow color.
</p>
</div>
<h5><a>Creating a glow-map</a></h5>
<div>
<p>
Let&#039;s take the hover tank example bundled with JME3 test data.<br/>
Here you can see the diffuse map of the tank, and the associated glow map that only contains the parts of the texture that will glow and their glowing color: <br/>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/tank_diffuse_ss.png">
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/tank_glow_map_ss.png">
</p>
<p>
Glow maps works with Lighting.j3md, Particles.j3md and SolidColor.j3md material definitions.
The tank material looks like that :
</p>
<pre>Material My Material : Common/MatDefs/Light/Lighting.j3md {
viewPort.addProcessor&#40;fpp&#41;;</pre><p>Here are the parameters that you can tweak :</p><div><table><tr><th>Parameter</th><th>Method</th><th>Default</th><th>Description</th></tr><tr><td>blur scale</td><td><code>setBlurScale(float)</code></td><td>1.5f</td><td>the scale of the bloom effect, but be careful, high values does artifacts</td></tr><tr><td>exposure Power</td><td><code>setExposurePower(float)</code></td><td>5.0f</td><td>the glowing channel color is raised to the value power</td></tr><tr><td>exposure cut-off</td><td><code>setExposureCutOff(float)</code></td><td>0.0f</td><td>the threshold of color to bloom during extraction</td></tr><tr><td>bloom intensity</td><td><code>setBloomIntensity(float)</code></td><td>2.0f</td><td>the resulting bloom value is multiplied by this intensity</td></tr></table></div><p>You&#039;ll probably need to adjust those parameters depending on your scene.</p></div><h1><a>Bloom with a glow map</a></h1><div><p>Sometimes, you want to have more control over what glows and does not glow. The bloom filter supports a glow map or a glow color.</p></div><h5><a>Creating a glow-map</a></h5><div><p>Let&#039;s take the hover tank example bundled with JME3 test data.<br/> Here you can see the diffuse map of the tank, and the associated glow map that only contains the parts of the texture that will glow and their glowing color: <br/> <img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/tank_diffuse_ss.png"> <img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/tank_glow_map_ss.png"></p><p>Glow maps works with Lighting.j3md, Particles.j3md and SolidColor.j3md material definitions. The tank material looks like that :</p><pre>Material My Material : Common/MatDefs/Light/Lighting.j3md {
MaterialParameters {
SpecularMap : Models/HoverTank/tank_specular.png
Shininess : 8
@ -102,132 +13,17 @@ The tank material looks like that :
Diffuse : 1.0 1.0 1.0 1.0
Specular : 1.0 1.0 1.0 1.0
}
}</pre>
<p>
The glow map is defined here : <strong>GlowMap : Models/HoverTank/tank_glow_map_highres.png</strong>
</p>
</div>
<h5><a>Usage</a></h5>
<div>
<ol>
<li><div> Create a FilterPostProcessor</div>
</li>
<li><div> Create a BloomFilter with the GlowMode.Objects parameter</div>
</li>
<li><div> Add the filter to the processor</div>
</li>
<li><div> Add the processor to the viewPort</div>
</li>
</ol>
<pre> FilterPostProcessor fpp=new FilterPostProcessor(assetManager);
}</pre><p>The glow map is defined here : <strong>GlowMap : Models/HoverTank/tank_glow_map_highres.png</strong></p></div><h5><a>Usage</a></h5><div><ol><li><div>Create a FilterPostProcessor</div></li><li><div>Create a BloomFilter with the GlowMode.Objects parameter</div></li><li><div>Add the filter to the processor</div></li><li><div>Add the processor to the viewPort</div></li></ol><pre> FilterPostProcessor fpp=new FilterPostProcessor(assetManager);
BloomFilter bf=new BloomFilter(BloomFilter.GlowMode.Objects);
fpp.addFilter(bf);
viewPort.addProcessor(fpp);</pre>
<p>
Here is the result : <br/>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/tanlglow1.png">
</p>
</div>
<h1><a>Bloom with a glow color</a></h1>
<div>
<p>
Sometimes you need an entire object to glow, not just parts of it.
In this case you&#039;ll need to use the glow color parameter.
</p>
</div>
<h5><a>Usage</a></h5>
<div>
<ol>
<li><div> Create a material for your object and set the GlowColor parameter</div>
</li>
<li><div> Create a FilterPostProcessor</div>
</li>
<li><div> Create a BloomFilter with the GlowMode.Objects parameter</div>
</li>
<li><div> Add the filter to the processor</div>
</li>
<li><div> Add the processor to the viewPort</div>
</li>
</ol>
<pre> Material mat = new Material(getAssetManager(), &quot;Common/MatDefs/Misc/SolidColor.j3md&quot;);
viewPort.addProcessor(fpp);</pre><p>Here is the result : <br/> <img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/tanlglow1.png"></p></div><h1><a>Bloom with a glow color</a></h1><div><p>Sometimes you need an entire object to glow, not just parts of it. In this case you&#039;ll need to use the glow color parameter.</p></div><h5><a>Usage</a></h5><div><ol><li><div>Create a material for your object and set the GlowColor parameter</div></li><li><div>Create a FilterPostProcessor</div></li><li><div>Create a BloomFilter with the GlowMode.Objects parameter</div></li><li><div>Add the filter to the processor</div></li><li><div>Add the processor to the viewPort</div></li></ol><pre> Material mat = new Material(getAssetManager(), &quot;Common/MatDefs/Misc/SolidColor.j3md&quot;);
mat.setColor(&quot;Color&quot;, ColorRGBA.Green);
mat.setColor(&quot;GlowColor&quot;, ColorRGBA.Green);
fpp=new FilterPostProcessor(assetManager);
bloom= new BloomFilter(BloomFilter.GlowMode.Objects);
fpp.addFilter(bloom);
viewPort.addProcessor(fpp);</pre>
<p>
Here is the result on Oto&#039;s plasma ball (before and after) : <br/>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/otonobloom.png">
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/otoglow.png">
</p>
</div>
<h1><a>Hints and tricks</a></h1>
<div>
</div>
<h5><a>Increasing the blur range and reducing fps cost</a></h5>
<div>
<p>
The glow render is sampled on a texture that has the same dimensions as the viewport.
You can reduce the size of the bloom sampling just by using the setDownSamplingFactor method like this : <br/>
</p>
<pre> BloomFilter bloom=new BloomFilter&#40;&#41;;
bloom.setDownSamplingFactor&#40;2.0f&#41;; </pre>
<p>
In this example the sampling size is divided by 4 (width/2,height/2), resulting in less work to blur the scene.
The resulting texture is then up sampled to the screen size using hardware bilinear filtering. this results in a wider blur range.
</p>
</div>
<h5><a>Using classic bloom combined with a glow map</a></h5>
<div>
<p>
let&#039;s say you want a global bloom on your scene, but you have also a glowing object on it.
You can use only one bloom filter for both effects like that
</p>
<pre>BloomFilter bloom=new BloomFilter&#40;BloomFilter.GlowMode.SceneAndObjects&#41;;</pre>
<p>
However, note that both effects will share the same values of attribute, and sometimes, it won&#039;t be what you need.
</p>
</div>
<h5><a>Making your home brewed material definition support Glow</a></h5>
<div>
<p>
Let&#039;s say you have made a custom material on your own, and that you want it to support glow maps and glow color.
In your material definition you need to add those lines in the MaterialParameters section :
</p>
<pre> MaterialParameters {
viewPort.addProcessor(fpp);</pre><p>Here is the result on Oto&#039;s plasma ball (before and after) : <br/> <img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/otonobloom.png"> <img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/otoglow.png"></p></div><h1><a>Hints and tricks</a></h1><div></div><h5><a>Increasing the blur range and reducing fps cost</a></h5><div><p>The glow render is sampled on a texture that has the same dimensions as the viewport. You can reduce the size of the bloom sampling just by using the setDownSamplingFactor method like this : <br/></p><pre> BloomFilter bloom=new BloomFilter&#40;&#41;;
bloom.setDownSamplingFactor&#40;2.0f&#41;; </pre><p>In this example the sampling size is divided by 4 (width/2,height/2), resulting in less work to blur the scene. The resulting texture is then up sampled to the screen size using hardware bilinear filtering. this results in a wider blur range.</p></div><h5><a>Using classic bloom combined with a glow map</a></h5><div><p>let&#039;s say you want a global bloom on your scene, but you have also a glowing object on it. You can use only one bloom filter for both effects like that</p><pre>BloomFilter bloom=new BloomFilter&#40;BloomFilter.GlowMode.SceneAndObjects&#41;;</pre><p>However, note that both effects will share the same values of attribute, and sometimes, it won&#039;t be what you need.</p></div><h5><a>Making your home brewed material definition support Glow</a></h5><div><p>Let&#039;s say you have made a custom material on your own, and that you want it to support glow maps and glow color. In your material definition you need to add those lines in the MaterialParameters section :</p><pre> MaterialParameters {
....
@ -235,13 +31,7 @@ In your material definition you need to add those lines in the MaterialParameter
Texture2D GlowMap
// The glow color of the object
Color GlowColor
}</pre>
<p>
Then add the following technique :
</p>
<pre> Technique Glow {
}</pre><p>Then add the following technique :</p><pre> Technique Glow {
LightMode SinglePass
@ -256,29 +46,5 @@ Then add the following technique :
HAS_GLOWMAP : GlowMap
HAS_GLOWCOLOR : GlowColor
}
}</pre>
<p>
Then you can use this material with the BloomFilter
</p>
</div>
<h5><a>Make a glowing object stop to glow</a></h5>
<div>
<p>
If you are using a glow map, remove the texture from the material.
</p>
<pre>material.clearTextureParam(&quot;GlowMap&quot;);</pre>
<p>
If you are using a glow color, set it to black
</p>
<pre>material.setColor(&quot;GlowColor&quot;,ColorRGBA.Black);</pre>
</div>
}</pre><p>Then you can use this material with the BloomFilter</p></div><h5><a>Make a glowing object stop to glow</a></h5><div><p>If you are using a glow map, remove the texture from the material.</p><pre>material.clearTextureParam(&quot;GlowMap&quot;);</pre><p>If you are using a glow color, set it to black</p><pre>material.setColor(&quot;GlowColor&quot;,ColorRGBA.Black);</pre></div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:bloom_and_glow?do=export_xhtmlbody">view online version</a></em></p>

@ -1,47 +1,4 @@
<h1><a>Multithreading Bullet Physics in jme3</a></h1>
<div>
</div>
<h2><a>Introduction</a></h2>
<div>
<p>
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>
<h2><a>How is it handled in jme3 and bullet?</a></h2>
<div>
<p>
A SimpleApplication with a BulletAppState allows setting the threading type via
</p>
<pre>setThreadingType(ThreadingType type);</pre>
<p>
where ThreadingType can be either SEQUENTIAL or PARALLEL.
</p>
<p>
In the simpleInitApp() method:
</p>
<pre>bulletAppState = new BulletAppState&#40;&#41;;
<h1><a>Multithreading Bullet Physics in jme3</a></h1><div></div><h2><a>Introduction</a></h2><div><p>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><h2><a>How is it handled in jme3 and bullet?</a></h2><div><p>A SimpleApplication with a BulletAppState allows setting the threading type via</p><pre>setThreadingType(ThreadingType type);</pre><p>where ThreadingType can be either SEQUENTIAL or PARALLEL.</p><p>In the simpleInitApp() method:</p><pre>bulletAppState = new BulletAppState&#40;&#41;;
bulletAppState.setThreadingType&#40;BulletAppState.ThreadingType.PARALLEL&#41;;
stateManager.attach&#40;bulletAppState&#41;;</pre>
<p>
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. More physics spaces can simply be added by using multiple bulletAppStates.
</p>
<div><span>
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>,
<a href="/wiki/doku.php/tag:physics?do=showtag&amp;tag=tag%3Aphysics">physics</a>,
<a href="/wiki/doku.php/tag:threading?do=showtag&amp;tag=tag%3Athreading">threading</a>
</span></div>
</div>
stateManager.attach&#40;bulletAppState&#41;;</pre><p>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. More physics spaces can simply be added by using multiple bulletAppStates.</p><div><span><a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>, <a href="/wiki/doku.php/tag:physics?do=showtag&amp;tag=tag%3Aphysics">physics</a>, <a href="/wiki/doku.php/tag:threading?do=showtag&amp;tag=tag%3Athreading">threading</a> </span></div></div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:bullet_multithreading?do=export_xhtmlbody">view online version</a></em></p>

File diff suppressed because one or more lines are too long

@ -1,42 +1,4 @@
<h1><a>Combo Moves</a></h1>
<div>
<p>
The ComboMoves class allows you to define combinations of inputs that trigger special actions. Entering an input combo correctly can bring the player incremental rewards, such as an increased chance to hit, an increased effectiveness, or decreased change of being blocked, whatever the game designer chooses. <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikipedia.org/wiki/Combo_%28video_gaming%29"><param name="text" value="<html><u>More background info</u></html>"><param name="textColor" value="blue"></object>
</p>
<p>
Combos are usually a series of inputs, in a fixed order: For example a keyboard combo can look like: &quot;press Down, then Down+Right together, then Right&quot;.
</p>
<p>
Usage:
</p>
<ol>
<li><div> Create input triggers </div>
</li>
<li><div> Define combos</div>
</li>
<li><div> Detect combos in ActionListener </div>
</li>
<li><div> Execute combos in update loop </div>
</li>
</ol>
<p>
Copy the two classes ComboMoveExecution.java and ComboMove.java into your application and adjust them to your package paths.
</p>
</div>
<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/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/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>
<h1><a>Combo Moves</a></h1><div><p>The ComboMoves class allows you to define combinations of inputs that trigger special actions. Entering an input combo correctly can bring the player incremental rewards, such as an increased chance to hit, an increased effectiveness, or decreased change of being blocked, whatever the game designer chooses. <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikipedia.org/wiki/Combo_%28video_gaming%29"><param name="text" value="<html><u>More background info</u></html>"><param name="textColor" value="blue"></object></p><p>Combos are usually a series of inputs, in a fixed order: For example a keyboard combo can look like: &quot;press Down, then Down+Right together, then Right&quot;.</p><p>Usage:</p><ol><li><div>Create input triggers</div></li><li><div>Define combos</div></li><li><div>Detect combos in ActionListener</div></li><li><div>Execute combos in update loop</div></li></ol><p>Copy the two classes ComboMoveExecution.java and ComboMove.java into your application and adjust them to your package paths.</p></div><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/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/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/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>

File diff suppressed because one or more lines are too long

@ -1,103 +1,13 @@
<h1><a>Physical Hinges and Joints</a></h1>
<div>
<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.
</p>
<p>
Game Physics are not only employed to calculate collisions, but they can also simulate hinges and joints. Think of pulley chains, shaky rope bridges, swinging pendulums, or (trap)door and chest hinges. Physics are a great addition to e.g. an action or puzzle game.
</p>
<p>
In this example, we will create a pendulum. The joint is the (invisible) connection between the pendulum body and the hook. You will see that you can use what you learn from the simple pendulum and apply it to other joint/hinge objects (rope bridges, etc).
</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/bullet/TestPhysicsHingeJoint.java"><param name="text" value="<html><u>TestPhysicsHingeJoint.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>
</div>
<h2><a>Overview of this Physics Application</a></h2>
<div>
<ol>
<li><div> Create a SimpleApplication with a <a href="/com/jme3/gde/core/docs/jme3/advanced/physics.html">BulletAppState</a> </div>
<ul>
<li><div> This gives us a PhysicsSpace for PhysicsControls</div>
</li>
</ul>
</li>
<li><div> For the pendulum, we use a Spatial with a PhysicsControl, and we apply physical forces to them.</div>
<ul>
<li><div> The parts of the &quot;pendulum&quot; are Physics Control&#039;ed Spatials with Collision Shapes. </div>
</li>
<li><div> We create a fixed <code>hookNode</code> and a dynamic <code>pendulumNode</code>. </div>
</li>
</ul>
</li>
<li><div> We can &quot;crank the handle&quot; and rotate the joint like a hinge, or we can let loose and expose the joints freely to gravity. </div>
<ul>
<li><div> For physical forces we will use the method <code>joint.enableMotor();</code></div>
</li>
</ul>
</li>
</ol>
</div>
<h2><a>Creating a Fixed Node</a></h2>
<div>
<p>
The hookNode is the fixed point from which the pendulum hangs. It has no mass.
</p>
<pre>Node hookNode=PhysicsTestHelper.createPhysicsTestNode&#40;
<h1><a>Physical Hinges and Joints</a></h1><div><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.</p><p>Game Physics are not only employed to calculate collisions, but they can also simulate hinges and joints. Think of pulley chains, shaky rope bridges, swinging pendulums, or (trap)door and chest hinges. Physics are a great addition to e.g. an action or puzzle game.</p><p>In this example, we will create a pendulum. The joint is the (invisible) connection between the pendulum body and the hook. You will see that you can use what you learn from the simple pendulum and apply it to other joint/hinge objects (rope bridges, etc).</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/bullet/TestPhysicsHingeJoint.java"><param name="text" value="<html><u>TestPhysicsHingeJoint.java</u></html>"><param name="textColor" value="blue"></object></div></li></ul></div><h2><a>Overview of this Physics Application</a></h2><div><ol><li><div>Create a SimpleApplication with a <a href="/com/jme3/gde/core/docs/jme3/advanced/physics.html">BulletAppState</a></div><ul><li><div>This gives us a PhysicsSpace for PhysicsControls</div></li></ul></li><li><div>For the pendulum, we use a Spatial with a PhysicsControl, and we apply physical forces to them.</div><ul><li><div>The parts of the &quot;pendulum&quot; are Physics Control&#039;ed Spatials with Collision Shapes.</div></li><li><div>We create a fixed <code>hookNode</code> and a dynamic <code>pendulumNode</code>.</div></li></ul></li><li><div>We can &quot;crank the handle&quot; and rotate the joint like a hinge, or we can let loose and expose the joints freely to gravity.</div><ul><li><div>For physical forces we will use the method <code>joint.enableMotor();</code></div></li></ul></li></ol></div><h2><a>Creating a Fixed Node</a></h2><div><p>The hookNode is the fixed point from which the pendulum hangs. It has no mass.</p><pre>Node hookNode=PhysicsTestHelper.createPhysicsTestNode&#40;
assetManager, new BoxCollisionShape&#40;new Vector3f&#40; .1f, .1f, .1f&#41;&#41;,0&#41;;
hookNode.getControl&#40;RigidBodyControl.class&#41;.setPhysicsLocation&#40;new Vector3f&#40;0f,0,0f&#41;&#41;;
&nbsp;
rootNode.attachChild&#40;hookNode&#41;;
getPhysicsSpace&#40;&#41;.add&#40;hookNode&#41;;</pre>
<p>
For a rope bridge, there would be two fixed nodes where the bridge is attached to the mountainside.
</p>
</div>
<h2><a>Creating a Dynamic Node</a></h2>
<div>
<p>
The pendulumNode is the dynamic part of the construction. It has a mass.
</p>
<pre>Node pendulumNode=PhysicsTestHelper.createPhysicsTestNode&#40;
getPhysicsSpace&#40;&#41;.add&#40;hookNode&#41;;</pre><p>For a rope bridge, there would be two fixed nodes where the bridge is attached to the mountainside.</p></div><h2><a>Creating a Dynamic Node</a></h2><div><p>The pendulumNode is the dynamic part of the construction. It has a mass.</p><pre>Node pendulumNode=PhysicsTestHelper.createPhysicsTestNode&#40;
assetManager, new BoxCollisionShape&#40;new Vector3f&#40; .3f, .3f, .3f&#41;&#41;,1&#41;;
pendulumNode.getControl&#40;RigidBodyControl.class&#41;.setPhysicsLocation&#40;new Vector3f&#40;0f,-1,0f&#41;&#41;;
rootNode.attachChild&#40;pendulumNode&#41;;
getPhysicsSpace&#40;&#41;.add&#40;pendulumNode&#41;;</pre>
<p>
For a rope bridge, each set of planks would be one dynamic node.
</p>
</div>
<h2><a>Understanding DOF, Joints, and Hinges</a></h2>
<div>
<p>
A PhysicsHingeJoint is an invisible connection between two nodes – here between the pendulum body and the hook. Why are hinges and joints represented by the same class? Hinges and joints have something in common: They constrain the <em>mechanical degree of freedom</em> (DOF) of another object.
getPhysicsSpace&#40;&#41;.add&#40;pendulumNode&#41;;</pre><p>For a rope bridge, each set of planks would be one dynamic node.</p></div><h2><a>Understanding DOF, Joints, and Hinges</a></h2><div><p>A PhysicsHingeJoint is an invisible connection between two nodes – here between the pendulum body and the hook. Why are hinges and joints represented by the same class? Hinges and joints have something in common: They constrain the <em>mechanical degree of freedom</em> (DOF) of another object.
</p>
<p>
@ -125,7 +35,7 @@ Now consider some examples of objects with joints:
<p>
You&#039;ll understand that, when creating any type of joint, it is important to correctly specify the DOFs that the joint restricts, and the DOFs that the joint allows. For the typical DOF of a <a href="/com/jme3/gde/core/docs/jme3/advanced/ragdoll.html">ragDoll</a> character&#039;s limbs, jME even offers a special joint, <code>PhysicsConeJoint</code>.
You&#039;ll understand that, when creating any type of joint, it is important to correctly specify the DOFs that the joint restricts, and the DOFs that the joint allows. For the typical DOF of a <a href="/com/jme3/gde/core/docs/jme3/advanced/ragdoll.html">ragDoll</a> character&#039;s limbs, jME even offers a special joint, <code>ConeJoint</code>.
</p>
</div>
@ -135,7 +45,7 @@ You&#039;ll understand that, when creating any type of joint, it is important to
<p>
You create the PhysicsHingeJoint after you have created the nodes that are to be chained together. In the code snippet you see that the PhysicsHingeJoint constructor requires the two node objects. You also have to specify axes and pivots – they are the degrees of freedom that you just heard about.
You create the HingeJoint after you have created the nodes that are to be chained together. In the code snippet you see that the HingeJoint constructor requires the two node objects. You also have to specify axes and pivots – they are the degrees of freedom that you just heard about.
</p>
<pre>private HingeJoint joint;
...

@ -1,22 +1,4 @@
<h1><a>Saving and Loading Materials with .j3m Files</a></h1>
<div>
<p>
In the <a href="/com/jme3/gde/core/docs/jme3/advanced/material_definitions.html">Material Definitions</a> article you learned how to configure <a href="/com/jme3/gde/core/docs/jme3/advanced/materials_overview.html">Materials</a> programmatically in Java code. If you have certain commonly used Materials that never change, you can clean up the amount of Java code that clutters your init method, by moving material settings into .j3m files. Then later in your code, you only need to call one setter instead of several to apply the material.
</p>
</div>
<h2><a>Writing the .j3m File</a></h2>
<div>
<ol>
<li><div> For every Material, create a file and give it a name that describes it: e.g. <code>SimpleBump.j3m</code></div>
</li>
<li><div> Place the file in your project&#039;s <code>assets/Materials/</code> directory, e.g. <code>MyGame/src/assets/Materials/SimpleBump.j3m</code></div>
</li>
<li><div> Edit the file and add content using the following Syntax, e.g.:<pre>Material shiny bumpy rock : Common/MatDefs/Light/Lighting.j3md {
<h1><a>Saving and Loading Materials with .j3m Files</a></h1><div><p>In the <a href="/com/jme3/gde/core/docs/jme3/advanced/material_definitions.html">Material Definitions</a> article you learned how to configure <a href="/com/jme3/gde/core/docs/jme3/advanced/materials_overview.html">Materials</a> programmatically in Java code. If you have certain commonly used Materials that never change, you can clean up the amount of Java code that clutters your init method, by moving material settings into .j3m files. Then later in your code, you only need to call one setter instead of several to apply the material.</p></div><h2><a>Writing the .j3m File</a></h2><div><ol><li><div>For every Material, create a file and give it a name that describes it: e.g. <code>SimpleBump.j3m</code></div></li><li><div>Place the file in your project&#039;s <code>assets/Materials/</code> directory, e.g. <code>MyGame/src/assets/Materials/SimpleBump.j3m</code></div></li><li><div>Edit the file and add content using the following Syntax, e.g.:<pre>Material shiny bumpy rock : Common/MatDefs/Light/Lighting.j3md {
MaterialParameters {
Shininess: 8.0
NormalMap: Textures/bump_rock_normal.png
@ -25,21 +7,7 @@ In the <a href="/com/jme3/gde/core/docs/jme3/advanced/material_definitions.html"
Diffuse : 1.0 1.0 1.0 1.0
Specular : 0.0 0.0 0.0 1.0
}
}</pre>
</div>
</li>
</ol>
<p>
How to this file is structured:
</p>
<ol>
<li><div> Header</div>
<ol>
<li><div> <code>Material</code> is a fixed keyword, keep it.</div>
</li>
<li><div> <code>shiny bumpy rock</code> is a descriptive string that you can make up. Choose a name to help you remember for what you intend to use this material.</div>
}</pre></div></li></ol><p>How to this file is structured:</p><ol><li><div>Header</div><ol><li><div><code>Material</code> is a fixed keyword, keep it.</div></li><li><div><code>shiny bumpy rock</code> is a descriptive string that you can make up. Choose a name to help you remember for what you intend to use this material.</div>
</li>
<li><div> After the colon, specify on which <a href="/com/jme3/gde/core/docs/jme3/advanced/materials_overview.html">Material</a> definition you base this Material.</div>
</li>

@ -1,36 +1,4 @@
<h3><a>Nifty Loading Screen (Progress Bar)</a></h3>
<div>
<p>
There is a good tutorial about creating a nifty progress bar here:
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Create_your_own_Control_%28A_Nifty_Progressbar%29"><param name="text" value="<html><u>http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Create_your_own_Control_%28A_Nifty_Progressbar%29</u></html>"><param name="textColor" value="blue"></object>
</p>
<p>
This example will use the existing hello terrain as an example.
It will require these 2 images inside Assets/Interface/ (save them as border.png and inner.png respectively)
</p>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/inner1.png">
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/border1.png">
</p>
<p>
This is the progress bar at 90%:
</p>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/loadingscreen.png">
</p>
<p>
nifty_loading.xml
</p>
<pre><span>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span>
<h3><a>Nifty Loading Screen (Progress Bar)</a></h3><div><p>There is a good tutorial about creating a nifty progress bar here: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Create_your_own_Control_%28A_Nifty_Progressbar%29"><param name="text" value="<html><u>http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Create_your_own_Control_%28A_Nifty_Progressbar%29</u></html>"><param name="textColor" value="blue"></object></p><p>This example will use the existing hello terrain as an example. It will require these 2 images inside Assets/Interface/ (save them as border.png and inner.png respectively)</p><p><img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/inner1.png"> <img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/border1.png"></p><p>This is the progress bar at 90%:</p><p><img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/loadingscreen.png"></p><p>nifty_loading.xml</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;useStyles filename=&quot;nifty-default-styles.xml&quot; /&gt;</span>
<span>&lt;useControls filename=&quot;nifty-default-controls.xml&quot; /&gt;</span>
@ -67,32 +35,13 @@ nifty_loading.xml
<span>&lt;screen id=&quot;end&quot; controller = &quot;jme3test.TestLoadingScreen&quot;&gt;</span>
<span><span>&lt;/screen&gt;</span></span>
&nbsp;
<span><span>&lt;/nifty&gt;</span></span></pre>
</div>
<h4><a>Understanding Nifty XML</a></h4>
<div>
<p>
The progress bar and text is done statically using nifty <acronym title="Extensible Markup Language">XML</acronym>.
A custom control is created, which represents the progress bar.
</p>
<pre> <span>&lt;controlDefinition name = &quot;loadingbar&quot; controller = &quot;jme3test.TestLoadingScreen&quot;&gt;</span>
<span><span>&lt;/nifty&gt;</span></span></pre></div><h4><a>Understanding Nifty XML</a></h4><div><p>The progress bar and text is done statically using nifty <acronym title="Extensible Markup Language">XML</acronym>. A custom control is created, which represents the progress bar.</p><pre> <span>&lt;controlDefinition name = &quot;loadingbar&quot; controller = &quot;jme3test.TestLoadingScreen&quot;&gt;</span>
<span>&lt;image filename=&quot;Interface/border.png&quot; childLayout=&quot;absolute&quot; </span>
<span> imageMode=&quot;resize:15,2,15,15,15,2,15,2,15,2,15,15&quot;&gt;</span>
<span>&lt;image id=&quot;progressbar&quot; x=&quot;0&quot; y=&quot;0&quot; filename=&quot;Interface/inner.png&quot; width=&quot;32px&quot; height=&quot;100%&quot;</span>
<span> imageMode=&quot;resize:15,2,15,15,15,2,15,2,15,2,15,15&quot;/&gt;</span>
<span><span>&lt;/image&gt;</span></span>
<span><span>&lt;/controlDefinition&gt;</span></span></pre>
<p>
This screen simply displays a button in the middle of the screen, which could be seen as a simple main menu UI.
</p>
<pre> <span>&lt;screen id=&quot;start&quot; controller = &quot;jme3test.TestLoadingScreen&quot;&gt;</span>
<span><span>&lt;/controlDefinition&gt;</span></span></pre><p>This screen simply displays a button in the middle of the screen, which could be seen as a simple main menu UI.</p><pre> <span>&lt;screen id=&quot;start&quot; controller = &quot;jme3test.TestLoadingScreen&quot;&gt;</span>
<span>&lt;layer id=&quot;layer&quot; childLayout=&quot;center&quot;&gt;</span>
<span>&lt;panel id = &quot;panel2&quot; height=&quot;30%&quot; width=&quot;50%&quot; align=&quot;center&quot; valign=&quot;center&quot; childLayout=&quot;vertical&quot;</span>
<span> visibleToMouse=&quot;true&quot;&gt;</span>
@ -101,13 +50,7 @@ This screen simply displays a button in the middle of the screen, which could be
<span><span>&lt;/control&gt;</span></span>
<span><span>&lt;/panel&gt;</span></span>
<span><span>&lt;/layer&gt;</span></span>
<span><span>&lt;/screen&gt;</span></span></pre>
<p>
This screen displays our custom progress bar control with a text control
</p>
<pre> <span>&lt;screen id=&quot;loadlevel&quot; controller = &quot;jme3test.TestLoadingScreen&quot;&gt;</span>
<span><span>&lt;/screen&gt;</span></span></pre><p>This screen displays our custom progress bar control with a text control</p><pre> <span>&lt;screen id=&quot;loadlevel&quot; controller = &quot;jme3test.TestLoadingScreen&quot;&gt;</span>
<span>&lt;layer id=&quot;loadinglayer&quot; childLayout=&quot;center&quot; backgroundColor=&quot;#000000&quot;&gt;</span>
<span>&lt;panel id = &quot;loadingpanel&quot; childLayout=&quot;vertical&quot; align=&quot;center&quot; valign=&quot;center&quot; height=&quot;32px&quot; width=&quot;400px&quot;&gt;</span>
<span>&lt;control name=&quot;loadingbar&quot; align=&quot;center&quot; valign=&quot;center&quot; width=&quot;400px&quot; height=&quot;32px&quot; /&gt;</span>
@ -115,15 +58,7 @@ This screen displays our custom progress bar control with a text control
<span> text=&quot; &quot;/&gt;</span>
<span><span>&lt;/panel&gt;</span></span>
<span><span>&lt;/layer&gt;</span></span>
<span><span>&lt;/screen&gt;</span></span></pre>
</div>
<h3><a>Creating the bindings to use the Nifty XML</a></h3>
<div>
<p>
There are 3 main ways to update a progress bar. To understand why these methods are necessary, an understanding of the graphics pipeline is needed.
<span><span>&lt;/screen&gt;</span></span></pre></div><h3><a>Creating the bindings to use the Nifty XML</a></h3><div><p>There are 3 main ways to update a progress bar. To understand why these methods are necessary, an understanding of the graphics pipeline is needed.
</p>
<p>
@ -223,7 +158,7 @@ public class TestLoadingScreen extends SimpleApplication implements ScreenContro
@Override
public void simpleUpdate&#40;float tpf&#41; &#123;
&nbsp;
if &#40;load == true&#41; &#123; //loading is done over many frames
if &#40;load&#41; &#123; //loading is done over many frames
if &#40;frameCount == 1&#41; &#123;
Element element = nifty.getScreen&#40;&quot;loadlevel&quot;&#41;.findElementByName&#40;&quot;loadingtext&quot;&#41;;
textRenderer = element.getRenderer&#40;TextRenderer.class&#41;;

@ -1,132 +1,8 @@
<h1><a>Localizing jME 3 Games</a></h1>
<div>
</div>
<h2><a>Scope</a></h2>
<div>
<p>
Localizing an application can mean several things:
</p>
<ul>
<li><div> At minimum you translate all messages and dialogs in the user interface to your target languages.</div>
</li>
<li><div> You should also translate the &quot;read me&quot;, help, and other documentation.</div>
</li>
<li><div> Also translating web content related to the application makes sure international users find out about your localized game.</div>
</li>
<li><div> If you go the whole way of internationalization, you also &quot;translate&quot; metaphors in icons or symbols used. <br/>
E.g. For localizations to right-to-left languages, you must also adjust the whole flow of the UI (order of menus and buttons).</div>
</li>
</ul>
<p>
There are tools that assist you with localizing Java Swing GUIs. jME3 applications do not typically have a Swing <acronym title="Graphical User Interface">GUI</acronym>, so those tools are not of much help. Just stick to the normal Java rules about using Bundle Properties:
</p>
</div>
<h2><a>Preparing the Localization</a></h2>
<div>
<p>
<strong>Tip:</strong> The jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> supports opening and editing Bundle.properties files. Also note the Tools &gt; Localization menu.
</p>
<p>
To prepare the application for localization, you have to first identify all hard-coded messages.
</p>
<ol>
<li><div> Find every line in your jME3 game where you hard-coded message strings, e.g. <br/>
<pre>System.out.print&#40;&quot;Hello World!&quot;&#41;;
UiText.setText&#40;&quot;Score: &quot;+score&#41;;</pre>
</div>
</li>
<li><div> Create one file named <code>Bundle.properties</code> in each directory where there are Java file that contain messages.</div>
</li>
<li><div> For every hard-coded message, you add one line to the <code>Bundle.properties</code> file: First specify a unique key that identifies this string; then an equal sign; and the literal string itself. <br/>
<pre>greeting=Hello World!
score.display=Score: </pre>
</div>
</li>
<li><div> In the source code, replace every occurence of a hard-coded message with the appropriate Resource Bundle call to its unique key: <pre>ResourceBundle.getBundle&#40;&quot;Bundle&quot;&#41;.getString&#40;&quot;greeting&quot;&#41;&#41;;
UiText.setText&#40;ResourceBundle.getBundle&#40;&quot;Bundle&quot;&#41;.getString&#40;&quot;score.display&quot;&#41;+score&#41;;</pre>
</div>
</li>
</ol>
<p>
The language used in the Bundle.properties files will be the default language for your game.
</p>
</div>
<h2><a>Translating the Messages</a></h2>
<div>
<p>
Each additional language comes in a set of files that is marked with a (usually) two-letter suffix. Common locales are de for German, en for English, fr for French, ja for Japanese, pt for Portuguese, etc.
</p>
<p>
To translate the messages to another language, for example, German:
</p>
<ol>
<li><div> Make a copy of the <code>Bundle.properties</code> files.</div>
</li>
<li><div> Name the copy <code>Bundle_de.properties</code> for German. Note the added suffix _de.</div>
</li>
<li><div> Translate all strings (text on the right side of the equal sign) in the <code>Bundle_de.properties</code> to German. <pre>greeting=Hallo Welt!
score.display=Spielstand: </pre>
<p>
<strong>Important:</strong> Do not modify any of the keys (text to the left of the equal sign)!
</p>
</div>
</li>
<li><div> To test the German localization, start the application from the command line with <code>-Duser.language=de</code>. Note the parameter <code>de</code>.</div>
</li>
</ol>
<p>
<strong>Tip:</strong> In the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>, you set this VM Option in the Project properties under Run. Here you can also save individual run configuraions for each language you want to test.
</p>
<p>
To get the full list of language suffixes use
</p>
<pre>Locale.getISOLanguages&#40;&#41;&#41;&#41;;</pre>
</div>
<h2><a>Which Strings Not to Translate</a></h2>
<div>
<p>
<strong>Important:</strong> In the Bundle.properties file, do not include any strings that are asset paths, node or geometry names, input mappings, or material layers.
</p>
<ul>
<li><div> Keep material layers: <pre>mat.setTexture&#40;&quot;ColorMap&quot;, tex&#41;;</pre>
</div>
</li>
<li><div> Keep paths: <pre>teapot = assetManager.loadModel&#40;&quot;Models/Teapot/Teapot.obj&quot;&#41;;</pre>
</div>
</li>
<li><div> Keep geometry and node names: <pre>Geometry thing=new Geometry&#40;&quot;A thing&quot;, mesh&#41;;
<h1><a>Localizing jME 3 Games</a></h1><div></div><h2><a>Scope</a></h2><div><p>Localizing an application can mean several things:</p><ul><li><div>At minimum you translate all messages and dialogs in the user interface to your target languages.</div></li><li><div>You should also translate the &quot;read me&quot;, help, and other documentation.</div></li><li><div>Also translating web content related to the application makes sure international users find out about your localized game.</div></li><li><div>If you go the whole way of internationalization, you also &quot;translate&quot; metaphors in icons or symbols used. <br/> E.g. For localizations to right-to-left languages, you must also adjust the whole flow of the UI (order of menus and buttons).</div></li></ul><p>There are tools that assist you with localizing Java Swing GUIs. jME3 applications do not typically have a Swing <acronym title="Graphical User Interface">GUI</acronym>, so those tools are not of much help. Just stick to the normal Java rules about using Bundle Properties:</p></div><h2><a>Preparing the Localization</a></h2><div><p><strong>Tip:</strong> The jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> supports opening and editing Bundle.properties files. Also note the Tools &gt; Localization menu.</p><p>To prepare the application for localization, you have to first identify all hard-coded messages.</p><ol><li><div>Find every line in your jME3 game where you hard-coded message strings, e.g. <br/><pre>System.out.print&#40;&quot;Hello World!&quot;&#41;;
UiText.setText&#40;&quot;Score: &quot;+score&#41;;</pre></div></li><li><div>Create one file named <code>Bundle.properties</code> in each directory where there are Java file that contain messages.</div></li><li><div>For every hard-coded message, you add one line to the <code>Bundle.properties</code> file: First specify a unique key that identifies this string; then an equal sign; and the literal string itself. <br/><pre>greeting=Hello World!
score.display=Score: </pre></div></li><li><div>In the source code, replace every occurence of a hard-coded message with the appropriate Resource Bundle call to its unique key:<pre>ResourceBundle.getBundle&#40;&quot;Bundle&quot;&#41;.getString&#40;&quot;greeting&quot;&#41;&#41;;
UiText.setText&#40;Translating the Messages</h2><div><p>Each additional language comes in a set of files that is marked with a (usually) two-letter suffix. Common locales are de for German, en for English, fr for French, ja for Japanese, pt for Portuguese, etc.</p><p>To translate the messages to another language, for example, German:</p><ol><li><div>Make a copy of the <code>Bundle.properties</code> files.</div></li><li><div>Name the copy <code>Bundle_de.properties</code> for German. Note the added suffix _de.</div></li><li><div>Translate all strings (text on the right side of the equal sign) in the <code>Bundle_de.properties</code> to German.<pre>greeting=Hallo Welt!
score.display=Spielstand: </pre><p><strong>Important:</strong> Do not modify any of the keys (text to the left of the equal sign)!</p></div></li><li><div>To test the German localization, start the application from the command line with <code>-Duser.language=de</code>. Note the parameter <code>de</code>.</div></li></ol><p><strong>Tip:</strong> In the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>, you set this VM Option in the Project properties under Run. Here you can also save individual run configuraions for each language you want to test.</p><p>To get the full list of language suffixes use</p><pre>Which Strings Not to Translate</h2><div><p><strong>Important:</strong> In the Bundle.properties file, do not include any strings that are asset paths, node or geometry names, input mappings, or material layers.</p><ul><li><div>Keep material layers:<pre>mat.setTexture&#40;&quot;ColorMap&quot;, tex&#41;;</pre></div></li><li><div>Keep paths:<pre>teapot = assetManager.loadModel&#40;&quot;Models/Teapot/Teapot.obj&quot;&#41;;</pre></div></li><li><div>Keep geometry and node names:<pre>Geometry thing=new Geometry&#40;&quot;A thing&quot;, mesh&#41;;
Node vehicle = new Node&#40;&quot;Vehicle&quot;&#41;;</pre>
</div>
</li>

@ -1,65 +1,6 @@
<h1><a>Logging and Monitoring</a></h1>
<div>
</div>
<h2><a>Logging Like a Newb</a></h2>
<div>
<p>
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>
</div>
<h2><a>Logging Like a Pro</a></h2>
<div>
<p>
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 &quot;tag&quot; 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>
Replace HelloWorld by the name of the class where you are using this line.
</p>
<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.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 &quot;customer facing&quot; 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.
<h1><a>Logging and Monitoring</a></h1><div></div><h2><a>Logging Like a Newb</a></h2><div><p>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></div><h2><a>Logging Like a Pro</a></h2><div><p>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 &quot;tag&quot; 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>Replace HelloWorld by the name of the class where you are using this line.</p><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.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 &quot;customer facing&quot; 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>

@ -1,51 +1,4 @@
<h1><a>Making the Camera Follow a 3rd-Person Character</a></h1>
<div>
<p>
When players steer a game character with 1st-person view, they directly steer the camera (<code>flyCam.setEnabled(true);</code>), and they never see the walking character itself. In a game with 3rd-person view, however, the players see the character walk, and you (the game developer) want to make the camera follow the character around when it walks.
</p>
<p>
There are two ways how the camera can do that:
</p>
<ul>
<li><div> Registering a chase camera to the player and the input manager.</div>
</li>
<li><div> Attaching the camera to the character using a camera node.</div>
</li>
</ul>
<p>
<strong>Important:</strong> Using third-person view requires you to deactivate the default flyCam (first-person view). This means that you have to configure your own navigation (<a href="/com/jme3/gde/core/docs/jme3/advanced/input_handling.html">key inputs and analogListener</a>) that make your player character walk. For moving a physical player character, use <code>player.setWalkDirection()</code>, for a non-pysical character you can use <code>player.move()</code>.
</p>
</div>
<h2><a>Code Samples</a></h2>
<div>
<p>
Press the WASD or arrow keys to move. Drag with the left mouse button to rotate.
</p>
<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/input/TestChaseCamera.java"><param name="text" value="<html><u>TestChaseCamera.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/trunk/engine/src/test/jme3test/input/TestCameraNode.java"><param name="text" value="<html><u>TestCameraNode.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>
</div>
<h2><a>Camera Node</a></h2>
<div>
<p>
To make the camera follow a target node, add this camera node code to your init method (e.g. <code>simpleInitApp()</code>). The <code>target</code> spatial is typically the player node.
</p>
<pre>// Disable the default flyby cam
<h1><a>Making the Camera Follow a 3rd-Person Character</a></h1><div><p>When players steer a game character with 1st-person view, they directly steer the camera (<code>flyCam.setEnabled(true);</code>), and they never see the walking character itself. In a game with 3rd-person view, however, the players see the character walk, and you (the game developer) want to make the camera follow the character around when it walks.</p><p>There are two ways how the camera can do that:</p><ul><li><div>Registering a chase camera to the player and the input manager.</div></li><li><div>Attaching the camera to the character using a camera node.</div></li></ul><p><strong>Important:</strong> Using third-person view requires you to deactivate the default flyCam (first-person view). This means that you have to configure your own navigation (<a href="/com/jme3/gde/core/docs/jme3/advanced/input_handling.html">key inputs and analogListener</a>) that make your player character walk. For moving a physical player character, use <code>player.setWalkDirection()</code>, for a non-pysical character you can use <code>player.move()</code>.</p></div><h2><a>Code Samples</a></h2><div><p>Press the WASD or arrow keys to move. Drag with the left mouse button to rotate.</p><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/input/TestChaseCamera.java"><param name="text" value="<html><u>TestChaseCamera.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/trunk/engine/src/test/jme3test/input/TestCameraNode.java"><param name="text" value="<html><u>TestCameraNode.java</u></html>"><param name="textColor" value="blue"></object></div></li></ul></div><h2><a>Camera Node</a></h2><div><p>To make the camera follow a target node, add this camera node code to your init method (e.g. <code>simpleInitApp()</code>). The <code>target</code> spatial is typically the player node.</p><pre>// Disable the default flyby cam
flyCam.setEnabled&#40;false&#41;;
//create the camera Node
camNode = new CameraNode&#40;&quot;Camera Node&quot;, cam&#41;;
@ -56,33 +9,7 @@ camNode.setLocalTranslation&#40;new Vector3f&#40;0, 5, -5&#41;&#41;;
//Rotate the camNode to look at the target:
camNode.lookAt&#40;target.getLocalTranslation&#40;&#41;, Vector3f.UNIT_Y&#41;;
//Attach the camNode to the target:
target.attachChild&#40;camNode&#41;;</pre>
<p>
<strong>Important:</strong> Where the example says <code>camNode.setLocalTranslation(new Vector3f(0, 5, -5));</code>, you have to supply your own start position for the camera. This depends on the size of your target (the player character) and its position in your particular scene. Optimally, you set this to a spot a bit behind and above the target.
</p>
<div><table>
<tr>
<th>Methods</th><th>Description</th>
</tr>
<tr>
<td>setControlDir(ControlDirection.SpatialToCamera)</td><td>User input steers the target spatial, and the camera follows the spatial.<br/>
The spatial&#039;s transformation is copied over the camera&#039;s transformation. <br/>
Example: Use with <a href="/com/jme3/gde/core/docs/jme3/advanced/physics.html">CharacterControl</a>led spatial.</td>
</tr>
<tr>
<td>setControlDir(ControlDirection.CameraToSpatial)</td><td>User input steers the camera, and the target spatial follows the camera. <br/>
The camera&#039;s transformation is copied over the spatial&#039;s transformation.</td>
</tr>
</table></div>
<!-- EDIT1 TABLE [2445-2926] -->
<p>
<strong>Code sample:</strong>
</p>
<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/input/TestCameraNode.java"><param name="text" value="<html><u>TestCameraNode.java</u></html>"><param name="textColor" value="blue"></object> – Press the WASD or arrow keys to move. Drag with the left mouse button to rotate.</div>
target.attachChild&#40;camNode&#41;;</pre><p><strong>Important:</strong> Where the example says <code>camNode.setLocalTranslation(new Vector3f(0, 5, -5));</code>, you have to supply your own start position for the camera. This depends on the size of your target (the player character) and its position in your particular scene. Optimally, you set this to a spot a bit behind and above the target.</p><div><table><tr><th>Methods</th><th>Description</th></tr><tr><td>setControlDir(ControlDirection.SpatialToCamera)</td><td>User input steers the target spatial, and the camera follows the spatial.<br/> The spatial&#039;s transformation is copied over the camera&#039;s transformation. <br/> Example: Use with <a href="/com/jme3/gde/core/docs/jme3/advanced/physics.html">CharacterControl</a>led spatial.</td></tr><tr><td>setControlDir(ControlDirection.CameraToSpatial)</td><td>User input steers the camera, and the target spatial follows the camera. <br/> The camera&#039;s transformation is copied over the spatial&#039;s transformation.</td></tr></table></div><p><strong>Code sample:</strong></p><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/input/TestCameraNode.java"><param name="text" value="<html><u>TestCameraNode.java</u></html>"><param name="textColor" value="blue"></object> – Press the WASD or arrow keys to move. Drag with the left mouse button to rotate.</div>
</li>
</ul>

File diff suppressed because one or more lines are too long

@ -1,112 +1,7 @@
<h1><a>MotionPath</a></h1>
<div>
<p>
A MotionPath describes the motion of a spatial between waypoints. The path can be linear or rounded. You use MotionPaths to remote-control a spatial, or the camera.
</p>
<p>
<strong>Tip:</strong> If you want to remote-control a whole cutscene with several spatials moving at various times, then we recommened you use MotionPaths together with <a href="/com/jme3/gde/core/docs/jme3/advanced/cinematics.html">Cinematics</a>.
</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/animation/TestMotionPath.java"><param name="text" value="<html><u>TestMotionPath.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/trunk/engine/src/test/jme3test/animation/TestCameraMotionPath.java"><param name="text" value="<html><u>TestCameraMotionPath.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>
</div>
<h2><a>What Are Way Points?</a></h2>
<div>
<p>
When shooting a movie scene, the director tells actors where to walk, for example, by drawing a series of small crosses on the floor. Cameramen often mount the camera on rails (so called dolly track) so they can follow along complex scenes more easily.
</p>
<p>
In JME3, you use MotionPaths to specify a series of positions for a character or the camera. The MotionPath automatically updates the transformation of the spatial in each frame to make it move from one point to the next.
</p>
<ul>
<li><div> <strong>A way point</strong> is one positions on a path. </div>
</li>
<li><div> <strong>A MotionPath</strong> contains a list of all way points of one path. </div>
</li>
</ul>
<p>
The final shape of the path is computed using a linear interpolation or a <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.mvps.org/directx/articles/catmull/"><param name="text" value="<html><u>Catmull-Rom</u></html>"><param name="textColor" value="blue"></object> spline interpolation on the way points.
</p>
</div>
<h2><a>Create a MotionPath</a></h2>
<div>
<p>
Create a Motionpath object and add way points to it.
</p>
<pre>MotionPath path = new MotionPath&#40;&#41;;
<h1><a>MotionPath</a></h1><div><p>A MotionPath describes the motion of a spatial between waypoints. The path can be linear or rounded. You use MotionPaths to remote-control a spatial, or the camera.</p><p><strong>Tip:</strong> If you want to remote-control a whole cutscene with several spatials moving at various times, then we recommened you use MotionPaths together with <a href="/com/jme3/gde/core/docs/jme3/advanced/cinematics.html">Cinematics</a>.</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/animation/TestMotionPath.java"><param name="text" value="<html><u>TestMotionPath.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/trunk/engine/src/test/jme3test/animation/TestCameraMotionPath.java"><param name="text" value="<html><u>TestCameraMotionPath.java</u></html>"><param name="textColor" value="blue"></object></div></li></ul></div><h2><a>What Are Way Points?</a></h2><div><p>When shooting a movie scene, the director tells actors where to walk, for example, by drawing a series of small crosses on the floor. Cameramen often mount the camera on rails (so called dolly track) so they can follow along complex scenes more easily.</p><p>In JME3, you use MotionPaths to specify a series of positions for a character or the camera. The MotionPath automatically updates the transformation of the spatial in each frame to make it move from one point to the next.</p><ul><li><div><strong>A way point</strong> is one positions on a path.</div></li><li><div><strong>A MotionPath</strong> contains a list of all way points of one path.</div></li></ul><p>The final shape of the path is computed using a linear interpolation or a <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.mvps.org/directx/articles/catmull/"><param name="text" value="<html><u>Catmull-Rom</u></html>"><param name="textColor" value="blue"></object> spline interpolation on the way points.</p></div><h2><a>Create a MotionPath</a></h2><div><p>Create a Motionpath object and add way points to it.</p><pre>MotionPath path = new MotionPath&#40;&#41;;
path.addWayPoint&#40;new Vector3f&#40;10, 3, 0&#41;&#41;;
path.addWayPoint&#40;new Vector3f&#40;8, -2, 1&#41;&#41;;
...</pre>
<p>
You can configure the path as follows.
</p>
<div><table>
<tr>
<th> MotionPath Method </th><th> Usage </th>
</tr>
<tr>
<td>path.setCycle(true)</td><td>Sets whether the motion along this path should be closed (true) or open-ended (false). </td>
</tr>
<tr>
<td>path.addWayPoint(vector)</td><td>Adds individual waypoints to this path. The order is relevant.</td>
</tr>
<tr>
<td>path.removeWayPoint(vector) <br/>
removeWayPoint(index)</td><td>Removes a way point from this path. You can specify the point that you want to remove as vector or as integer index.</td>
</tr>
<tr>
<td>path.setCurveTension(0.83f)</td><td>Sets the tension of the curve (Catmull-Rom Spline). A value of 0.0f results in a straight linear line, 1.0 a very round curve.</td>
</tr>
<tr>
<td>path.getNbWayPoints()</td><td>Returns the number of waypoints in this path.</td>
</tr>
<tr>
<td>path.enableDebugShape(assetManager,rootNode)</td><td>Shows a line that visualizes the path. Use this during development and for debugging so you see what you are doing.</td>
</tr>
<tr>
<td>path.disableDebugShape()</td><td>Hides the line that visualizes the path. Use this for the release build.</td>
</tr>
</table></div>
<!-- EDIT1 TABLE [1769-2660] -->
</div>
<h2><a>MotionPathListener</a></h2>
<div>
<p>
You can hook interactions into a playing MotionPath. Register a MotionPathListener to the MotionPath to track whether way points have been reached, and then trigger a custom action. The onWayPointReach() method of the interface gives you access to the MotionTrack object <code>control</code>, and an integer value representing the current wayPointIndex.
</p>
<p>
In this example, you just print the status at every way point. In a game you could trigger actions here: Transformations, animations, sounds, game actions (attack, open door, etc).
</p>
<pre>path.addListener&#40; new MotionPathListener&#40;&#41; &#123;
...</pre><p>You can configure the path as follows.</p><div><table><tr><th>MotionPath Method</th><th>Usage</th></tr><tr><td>path.setCycle(true)</td><td>Sets whether the motion along this path should be closed (true) or open-ended (false).</td></tr><tr><td>path.addWayPoint(vector)</td><td>Adds individual waypoints to this path. The order is relevant.</td></tr><tr><td>path.removeWayPoint(vector) <br/> removeWayPoint(index)</td><td>Removes a way point from this path. You can specify the point that you want to remove as vector or as integer index.</td></tr><tr><td>path.setCurveTension(0.83f)</td><td>Sets the tension of the curve (Catmull-Rom Spline). A value of 0.0f results in a straight linear line, 1.0 a very round curve.</td></tr><tr><td>path.getNbWayPoints()</td><td>Returns the number of waypoints in this path.</td></tr><tr><td>path.enableDebugShape(assetManager,rootNode)</td><td>Shows a line that visualizes the path. Use this during development and for debugging so you see what you are doing.</td></tr><tr><td>path.disableDebugShape()</td><td>Hides the line that visualizes the path. Use this for the release build.</td></tr></table></div></div><h2><a>MotionPathListener</a></h2><div><p>You can hook interactions into a playing MotionPath. Register a MotionPathListener to the MotionPath to track whether way points have been reached, and then trigger a custom action. The onWayPointReach() method of the interface gives you access to the MotionTrack object <code>control</code>, and an integer value representing the current wayPointIndex.</p><p>In this example, you just print the status at every way point. In a game you could trigger actions here: Transformations, animations, sounds, game actions (attack, open door, etc).</p><pre>path.addListener&#40; new MotionPathListener&#40;&#41; &#123;
public void onWayPointReach&#40;MotionTrack control, int wayPointIndex&#41; &#123;
if &#40;path.getNbWayPoints&#40;&#41; == wayPointIndex + 1&#41; &#123;
println&#40;control.getSpatial&#40;&#41;.getName&#40;&#41; + &quot; has finished moving. &quot;&#41;;
@ -114,7 +9,5 @@ In this example, you just print the status at every way point. In a game you cou
println&#40;control.getSpatial&#40;&#41;.getName&#40;&#41; + &quot; has reached way point &quot; + wayPointIndex&#41;;
&#125;
&#125;
&#125;&#41;;</pre>
</div>
&#125;&#41;;</pre></div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:motionpath?do=export_xhtmlbody">view online version</a></em></p>

@ -1,45 +1,4 @@
<h1><a>Mouse Picking</a></h1>
<div>
<p>
Mouse picking means that the user clicks an object in the scene to select it, or to interact with it otherwise. Games use picking to implement aiming and shooting, casting spells, picking up objects, selecting targets, dragging and moving objects, etc. Mouse picking can be done using fixed crosshairs, or using the mouse pointer.
</p>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/mouse-picking.png">
</p>
<p>
See <a href="/com/jme3/gde/core/docs/jme3/advanced/input_handling.html">Input Handling</a> for details on how to define the necessary input triggers, input mappings, and input listeners.
</p>
</div>
<h2><a>Pick a Target Using Fixed Crosshairs</a></h2>
<div>
<p>
The following <code>pick target</code> input mapping implements an action that determines what a user clicked. It assumes that the mouse pointer is invisible and there are crosshairs painted in the center of the screen. It assumes that the user aims the crosshairs at an object in the scene and clicks. You use Ray Casting to identify the geometry that was picked by the user. Use use this method together with a first-person flyCam.
</p>
<ol>
<li><div> Activate the first-person camera: <code>flyCam.setEnabled(true);</code></div>
</li>
<li><div> Keep mouse pointer invisible using <code>inputManager.setCursorVisible(false)</code>.</div>
</li>
<li><div> Map the <code>pick target</code> action to a MouseButtonTrigger. </div>
</li>
<li><div> Implement the action in the Listener.</div>
</li>
</ol>
<p>
The following example rotates Spatials named &quot;Red Box&quot; or &quot;Blue Box&quot; when they are clicked. Modify this code to do whatever your game needs to do with the identified target (shoot it, take it, move it, etc).
</p>
<pre> private AnalogListener analogListener = new AnalogListener&#40;&#41; &#123;
<h1><a>Mouse Picking</a></h1><div><p>Mouse picking means that the user clicks an object in the scene to select it, or to interact with it otherwise. Games use picking to implement aiming and shooting, casting spells, picking up objects, selecting targets, dragging and moving objects, etc. Mouse picking can be done using fixed crosshairs, or using the mouse pointer.</p><p><img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/mouse-picking.png"></p><p>See <a href="/com/jme3/gde/core/docs/jme3/advanced/input_handling.html">Input Handling</a> for details on how to define the necessary input triggers, input mappings, and input listeners.</p></div><h2><a>Pick a Target Using Fixed Crosshairs</a></h2><div><p>The following <code>pick target</code> input mapping implements an action that determines what a user clicked. It assumes that the mouse pointer is invisible and there are crosshairs painted in the center of the screen. It assumes that the user aims the crosshairs at an object in the scene and clicks. You use Ray Casting to identify the geometry that was picked by the user. Use use this method together with a first-person flyCam.</p><ol><li><div>Activate the first-person camera: <code>flyCam.setEnabled(true);</code></div></li><li><div>Keep mouse pointer invisible using <code>inputManager.setCursorVisible(false)</code>.</div></li><li><div>Map the <code>pick target</code> action to a MouseButtonTrigger.</div></li><li><div>Implement the action in the Listener.</div></li></ol><p>The following example rotates Spatials named &quot;Red Box&quot; or &quot;Blue Box&quot; when they are clicked. Modify this code to do whatever your game needs to do with the identified target (shoot it, take it, move it, etc).</p><pre> private AnalogListener analogListener = new AnalogListener&#40;&#41; &#123;
public void onAnalog&#40;String name, float intensity, float tpf&#41; &#123;
if &#40;name.equals&#40;&quot;pick target&quot;&#41;&#41; &#123;
// Reset results list.

@ -1,60 +1,5 @@
<h1><a>Multiple Camera Views</a></h1>
<div>
<p>
You can split the screen and look into the 3D scene from different camera angles at the same time.
</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/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>
<h2><a>How to resize and Position ViewPorts</a></h2>
<div>
<p>
The default viewPort is as big as the window. If you have several, the must be of different sizes, either overlapping or adjacent to one another. How do you tell jME which of the ViewPorts should appear where on the screen, and how big it should be?
</p>
<p>
Imagine the window as a 1.0f x 1.0f rectangle. The default cam&#039;s viewPort is set to
</p>
<pre>cam.setViewPort&#40;0f, 1f, 0f, 1f&#41;;</pre>
<p>
This setting makes the ViewPort take up the whole rectangle.
</p>
<p>
The four values are read in the following order:
</p>
<pre>cam.setViewPort&#40;x1,x2 , y1,y2&#41;;</pre>
<ul>
<li><div> <strong>X-axis</strong> from left to right</div>
</li>
<li><div> <strong>Y-axis</strong> upwards from bottom to top</div>
</li>
</ul>
<p>
Here are a few examples:
</p>
<pre>cam1.setViewPort&#40; 0.0f , 1.0f , 0.0f , 1.0f &#41;;
cam2.setViewPort&#40; 0.5f , 1.0f , 0.0f , 0.5f &#41;;</pre>
<p>
These viewport parameters are, (in this order) the left-right extend, and the bottom-top extend of a views&#039;s rectangle on the screen.
</p>
<pre>0.0 , 1.0 1.0 , 1.0
<h1><a>Multiple Camera Views</a></h1><div><p>You can split the screen and look into the 3D scene from different camera angles at the same time.</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/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><h2><a>How to resize and Position ViewPorts</a></h2><div><p>The default viewPort is as big as the window. If you have several, the must be of different sizes, either overlapping or adjacent to one another. How do you tell jME which of the ViewPorts should appear where on the screen, and how big it should be?</p><p>Imagine the window as a 1.0f x 1.0f rectangle. The default cam&#039;s viewPort is set to</p><pre>cam.setViewPort&#40;0f, 1f, 0f, 1f&#41;;</pre><p>This setting makes the ViewPort take up the whole rectangle.</p><p>The four values are read in the following order:</p><pre>cam.setViewPort&#40;x1,x2 , y1,y2&#41;;</pre><ul><li><div><strong>X-axis</strong> from left to right</div></li><li><div><strong>Y-axis</strong> upwards from bottom to top</div></li></ul><p>Here are a few examples:</p><pre>cam1.setViewPort&#40; 0.0f , 1.0f , 0.0f , 1.0f &#41;;
cam2.setViewPort&#40; 0.5f , 1.0f , 0.0f , 0.5f &#41;;</pre><p>These viewport parameters are, (in this order) the left-right extend, and the bottom-top extend of a views&#039;s rectangle on the screen.</p><pre>0.0 , 1.0 1.0 , 1.0
+-----+-----+
|cam1 |
| |
@ -62,79 +7,8 @@ These viewport parameters are, (in this order) the left-right extend, and the bo
| | |
| |cam2 |
+-----+-----+
0.0 , 0.0 1.0 , 0.0</pre>
<p>
Example: Cam2&#039;s rectangle is int he bottom right: It extends from mid (x1=0.5f) bottom (y1=0.0f), to right (x2=1.0f) mid (y2=0.5f)
</p>
<p>
<p><div>If you scale the views in a way so that the aspect ratio of a ViewPort is different than the window&#039;s aspect ratio, then the ViewPort appears distorted. In these cases, you must recreate (not clone) the ViewPort&#039;s cam object with the right aspect ratio. For example: <code>Camera cam5 = new Camera(100,100);</code>
</div></p>
</p>
</div>
<h2><a>Four-Time Split Screen</a></h2>
<div>
<p>
In this example, you create four views (2x2) with the same aspect ratio as the window, but each is only half the width and height.
</p>
</div>
<h3><a>Set up the First View</a></h3>
<div>
<p>
You use the preconfigured Camera <code>cam</code> and <code>viewPort</code> from <code>SimpleApplication</code> for the first view. It&#039;s in the bottom right.
</p>
<pre>cam.setViewPort&#40;.5f, 1f, 0f, 0.5f&#41;; // Resize the viewPort to half its size, bottom right.</pre>
<p>
Optionally, place the main camera in the scene and rotate it in its start position.
</p>
<pre>cam.setLocation&#40;new Vector3f&#40;3.32f, 4.48f, 4.28f&#41;&#41;;
cam.setRotation&#40;new Quaternion &#40;-0.07f, 0.92f, -0.25f, -0.27f&#41;&#41;;</pre>
</div>
<h3><a>Set Up Three More Views</a></h3>
<div>
<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/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>
<li><div> Clone the first cam to reuse its settings</div>
</li>
<li><div> Resize and position the cam&#039;s viewPort with setViewPort().</div>
</li>
<li><div> (Optionally) Move the cameras in the scene and rotate them so they face what you want to see.</div>
</li>
<li><div> Create a ViewPort for each camera</div>
</li>
<li><div> Reset the camera&#039;s enabled statuses</div>
</li>
<li><div> Attach the Node to be displayed to this ViewPort. <br/>
The camera doesn&#039;t have to look at the rootNode, but that is the most common use case.</div>
</li>
</ol>
<p>
Here is the abstract code sample for camera <code>n</code>:
</p>
<pre>Camera cam_n = cam.clone&#40;&#41;;
0.0 , 0.0 1.0 , 0.0</pre><p>Example: Cam2&#039;s rectangle is int he bottom right: It extends from mid (x1=0.5f) bottom (y1=0.0f), to right (x2=1.0f) mid (y2=0.5f)</p><p><p><div>If you scale the views in a way so that the aspect ratio of a ViewPort is different than the window&#039;s aspect ratio, then the ViewPort appears distorted. In these cases, you must recreate (not clone) the ViewPort&#039;s cam object with the right aspect ratio. For example: <code>Camera cam5 = new Camera(100,100);</code></div></p></p></div><h2><a>Four-Time Split Screen</a></h2><div><p>In this example, you create four views (2x2) with the same aspect ratio as the window, but each is only half the width and height.</p></div><h3><a>Set up the First View</a></h3><div><p>You use the preconfigured Camera <code>cam</code> and <code>viewPort</code> from <code>SimpleApplication</code> for the first view. It&#039;s in the bottom right.</p><pre>cam.setViewPort&#40;.5f, 1f, 0f, 0.5f&#41;; // Resize the viewPort to half its size, bottom right.</pre><p>Optionally, place the main camera in the scene and rotate it in its start position. </p><pre>cam.setLocation&#40;new Vector3f&#40;3.32f, 4.48f, 4.28f&#41;&#41;;
cam.setRotation&#40;new Quaternion &#40;-0.07f, 0.92f, -0.25f, -0.27f&#41;&#41;;</pre></div><h3><a>Set Up Three More Views</a></h3><div><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/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><li><div>Clone the first cam to reuse its settings</div></li><li><div>Resize and position the cam&#039;s viewPort with setViewPort().</div></li><li><div>(Optionally) Move the cameras in the scene and rotate them so they face what you want to see.</div></li><li><div>Create a ViewPort for each camera</div></li><li><div>Reset the camera&#039;s enabled statuses</div></li><li><div>Attach the Node to be displayed to this ViewPort. <br/> The camera doesn&#039;t have to look at the rootNode, but that is the most common use case.</div></li></ol><p>Here is the abstract code sample for camera <code>n</code>:</p><pre>Camera cam_n = cam.clone&#40;&#41;;
cam_n.setViewPort&#40;...&#41;; // resize the viewPort
cam_n.setLocation&#40;new Vector3f&#40;...&#41;&#41;;
cam_n.setRotation&#40;new Quaternion&#40;...&#41;&#41;;
@ -142,12 +16,7 @@ cam_n.setRotation&#40;new Quaternion&#40;...&#41;&#41;;
ViewPort view_n = renderManager.createMainView&#40;&quot;View of camera #n&quot;, cam_n&#41;;
view_n.setClearEnabled&#40;true&#41;;
view_n.attachScene&#40;rootNode&#41;;
view_n.setBackgroundColor&#40;ColorRGBA.Black&#41;;</pre>
<p>
To visualize what you do, use the following drawing of the viewport positions:
</p>
<pre>0.0 , 1.0 1.0 , 1.0
view_n.setBackgroundColor&#40;ColorRGBA.Black&#41;;</pre><p>To visualize what you do, use the following drawing of the viewport positions:</p><pre>0.0 , 1.0 1.0 , 1.0
+-----+-----+
| | |
|cam3 |cam4 |
@ -155,36 +24,19 @@ To visualize what you do, use the following drawing of the viewport positions:
| | |
|cam2 |cam1 |
+-----+-----+
0.0 , 0.0 1.0 , 0.0</pre>
<p>
This are the lines of code that set the four cameras to create a four-times split screen.
</p>
<pre>cam1.setViewPort&#40; 0.5f , 1.0f , 0.0f , 0.5f&#41;;
0.0 , 0.0 1.0 , 0.0</pre><p>This are the lines of code that set the four cameras to create a four-times split screen.</p><pre>cam1.setViewPort&#40; 0.5f , 1.0f , 0.0f , 0.5f&#41;;
...
cam2.setViewPort&#40; 0.0f , 0.5f , 0.0f , 0.5f&#41;;
...
cam3.setViewPort&#40; 0.0f , 0.5f , 0.5f , 1.0f&#41;;
...
cam4.setViewPort&#40; 0.5f , 1.0f , 0.5f , 1.0f&#41;;</pre>
</div>
<h2><a>Picture in Picture</a></h2>
<div>
<p>
The following code snippet sets up two views, one covers the whole screen, and the second is a small view in the top center.
</p>
<pre> +-----+-----+
cam4.setViewPort&#40; 0.5f , 1.0f , 0.5f , 1.0f&#41;;</pre></div><h2><a>Picture in Picture</a></h2><div><p>The following code snippet sets up two views, one covers the whole screen, and the second is a small view in the top center.</p><pre> +-----+-----+
| |cam| |
| | 2 | |
+ +---+ +
| |
| cam |
+-----+-----+</pre>
<pre>// Setup first full-window view
+-----+-----+</pre><pre>// Setup first full-window view
cam.setViewPort&#40;0f, 1f, 0f, 1f&#41;;
cam.setLocation&#40;new Vector3f&#40;3.32f, 4.48f, 4.28f&#41;&#41;;
cam.setRotation&#40;new Quaternion&#40;-0.07f, 0.92f, -0.25f, -0.27f&#41;&#41;;
@ -196,16 +48,7 @@ cam2.setLocation&#40;new Vector3f&#40;-0.10f, 1.57f, 4.81f&#41;&#41;;
cam2.setRotation&#40;new Quaternion&#40;0.00f, 0.99f, -0.04f, 0.02f&#41;&#41;;
ViewPort viewPort2 = renderManager.createMainView&#40;&quot;PiP&quot;, cam2&#41;;
viewPort2.setClearFlags&#40;true, true, true&#41;;
viewPort2.attachScene&#40;rootNode&#41;;</pre>
</div>
<h2><a>Settings</a></h2>
<div>
<p>
You can customize the camera and the viewPort of each view individually. For example, each view can have a different background color:
viewPort2.attachScene&#40;rootNode&#41;;</pre></div><h2><a>Settings</a></h2><div><p>You can customize the camera and the viewPort of each view individually. For example, each view can have a different background color:
</p>
<pre>viewPort.setBackgroundColor&#40;ColorRGBA.Blue&#41;;</pre>

@ -1,107 +1,10 @@
<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 (in the update 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 we recommend to use a global update loop for game logic, and do multithreading within that loop when it is appropriate. This approach scales way better to multiple cores and does not break up your code logic.
</p>
<p>
Effectively, each for-loop in the main update 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 <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>read about the concurrent package more 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 update 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:
<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 (in the update 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 we recommend to use a global update loop for game logic, and do multithreading within that loop when it is appropriate. This approach scales way better to multiple cores and does not break up your code logic.</p><p>Effectively, each for-loop in the main update 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 (supervises threads), Callable Objects (the tasks), and Future Objects (the result). You can <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>read about the concurrent package more here</u></html>"><param name="textColor" value="blue"></object>, I will give just a short introduction.</p><ul><li><div>A Callable is one of the classes that gets executed on a thread in the Executor. The object represents one of several concurrent tasks (e.g, one NPC&#039;s path finding task). Each Callable is started from the updateloop by calling a method named <code>call()</code>.</div></li><li><div>The Executor is one central object that manages all your Callables. Every time you schedule a Callable in 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 task. The Future also gives you the return value in case one is returned.</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 update 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 variable 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;
Future future = null;</pre><p>Here we also created the Future variable 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;
@ -130,48 +33,7 @@ Next let&#039;s look at the update() call of the Control where the time-intensiv
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 &quot;desired location&quot; 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:
&#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 &quot;desired location&quot; 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;

@ -1,106 +1,38 @@
<h1><a>SpiderMonkey: Multi-Player Networking</a></h1>
<div>
<p>
This document introduces you to the SpiderMonkey networking <acronym title="Application Programming Interface">API</acronym>. A multi-player game is made up of clients and a server.
</p>
<ul>
<li><div> One central server (a headless SimpleApplication) coordinates the game in the background.</div>
</li>
<li><div> Each player runs a game client (a standard SimpleApplications) and connects to the central server.</div>
</li>
</ul>
<p>
Each Client informs the Server about its player&#039;s moves and actions. The Server centrally collects the game state and broadcasts the state info back to all connected clients. This way all clients share the same game world and can display it to their players from their perspective.
</p>
</div>
<h2><a>SpiderMonkey API Overview</a></h2>
<div>
<p>
The SpiderMonkey <acronym title="Application Programming Interface">API</acronym> is 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 is 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, which is now possible).
</p>
<p>
The SpiderMonkey <acronym title="Application Programming Interface">API</acronym> assists you in creating a Server, Clients, and Messages. Once a Server instance is created and started, the Server accepts remote connections from Clients, and you can send and receive Messages. Client objects represent the client-side of the client-server connection. Within the Server, these Client objects are referred to as HostedConnections. HostedConnections can hold application-defined client-specific session attributes that the server-side listeners and services can use to track player information, etc.
</p>
<div><table>
<tr>
<th> Seen from the Client </th><th> </th><th> Seen from the Server </th>
</tr>
<tr>
<td> com.jme3.network.Client </td><td> == </td><td> com.jme3.network.HostedConnection </td>
</tr>
</table></div>
<!-- EDIT1 TABLE [1580-1698] -->
<p>
You can register several types of listeners to be notified of changes.
</p>
<ul>
<li><div> MessageListeners on both the Client and the Server are notified when new messages arrive. You can use MessageListeners to be notified about only specific types of messages.</div>
</li>
<li><div> ClientStateListeners inform the Client of changes in its connection state, e.g. when the client gets kicked from the server.</div>
</li>
<li><div> ConnectionListeners inform the Server about HostedConnection arrivals and removals, e.g. if a client joins or quits.</div>
</li>
</ul>
</div>
<h2><a>Client and Server</a></h2>
<div>
</div>
<h3><a>Creating a Server</a></h3>
<div>
<p>
A com.jme3.network.Server is a headless com.jme3.app.SimpleApplication. Headless means that the update loop runs, but the application does not open a window and does not listen to direct user input.
<h1><a>SpiderMonkey: Multi-Player Networking</a></h1><div><p>This document introduces you to the SpiderMonkey networking <acronym title="Application Programming Interface">API</acronym>. You use this <acronym title="Application Programming Interface">API</acronym> when you develop games where several players compete with one another in real time. A multi-player game is made up of several clients connecting to a server:</p><ul><li><div>The central server (one headless SimpleApplication) coordinates the game in the background.</div></li><li><div>Each player runs a game client (a standard SimpleApplications) and connects to the central server.</div></li></ul><p>Each Client keeps the the Server informed about its player&#039;s moves and actions. The Server centrally maintains the game state and broadcasts the state info back to all connected clients. This network synchronization allows all clients share the same game world. Each client then displays the game state to one player from this player&#039;s perspective.</p></div><h2><a>SpiderMonkey API Overview</a></h2><div><p>The SpiderMonkey <acronym title="Application Programming Interface">API</acronym> is 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 is 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, which is now possible).</p><p>The SpiderMonkey <acronym title="Application Programming Interface">API</acronym> assists you in creating a Server, Clients, and Messages. Once a Server instance is created and started, the Server accepts remote connections from Clients, and you can send and receive Messages. Client objects represent the client-side of the client-server connection. Within the Server, these Client objects are referred to as HostedConnections. HostedConnections can hold application-defined client-specific session attributes that the server-side listeners and services can use to track player information, etc.</p><div><table><tr><th>Seen from the Client</th><th></th><th>Seen from the Server</th></tr><tr><td>com.jme3.network.Client</td><td>==</td><td>com.jme3.network.HostedConnection</td></tr></table></div><p>You can register several types of listeners to be notified of changes.</p><ul><li><div>MessageListeners on both the Client and the Server are notified when new messages arrive. You can use MessageListeners to be notified about only specific types of messages.</div></li><li><div>ClientStateListeners inform the Client of changes in its connection state, e.g. when the client gets kicked from the server.</div></li><li><div>ConnectionListeners inform the Server about HostedConnection arrivals and removals, e.g. if a client joins or quits.</div></li></ul></div><h2><a>Client and Server</a></h2><div></div><h3><a>Creating a Server</a></h3><div><p>The game server is a &quot;headless&quot; com.jme3.app.SimpleApplication:</p><pre>public class MyGameServer extends SimpleApplication &#123;
public static void main&#40;String&#91;&#93; args&#41; &#123;
ServerMain app = new ServerMain&#40;&#41;;
app.start&#40;JmeContext.Type.Headless&#41;; // headless type for servers!
&#125;
&#125;</pre><p><p><div>A <code>Headless</code> SimpleApplication executes the simpleInitApp() method and runs the update loop normally. But the application does not open a window, and it does not listen to user input. This is the typical behavior for a server application.</div></p></p><p>Create a com.jme3.network.Server in the <code>simpleInitApp()</code> method and specify a communication port, for example 6143.</p><pre> public void simpleInitApp&#40;&#41; &#123;
...
Server myServer = Network.createServer&#40;6143&#41;;
myServer.start&#40;&#41;;
...
&#125;</pre><p>When you run this app on a host, the server is ready to accept clients. Let&#039;s create a client next.</p></div><h3><a>Creating a Client</a></h3><div><p>A game client is a standard com.jme3.app.SimpleApplication.</p><pre>public class MyGameClient extends SimpleApplication &#123;
public static void main&#40;String&#91;&#93; args&#41; &#123;
ClientMain app = new ClientMain&#40;&#41;;
app.start&#40;JmeContext.Type.Display&#41;; // standard display type
&#125;
&#125;</pre><p><p><div>A standard SimpleApplication in <code>Display</code> mode executes the simpleInitApp() method, runs the update loop, opens a window for the rendered video output, and listens to user input. This is the typical behavior for a client application.
</div></p>
</p>
<pre>ServerMain app = new ServerMain&#40;&#41;;
app.start&#40;JmeContext.Type.Headless&#41;;</pre>
<p>
Create a Server in the simpleInitApp() method and specify a communication port, for example 6143.
</p>
<pre>Server myServer = Network.createServer&#40;6143&#41;;
myServer.start&#40;&#41;;</pre>
<p>
The server is ready to accept clients. Let&#039;s create one.
Create a com.jme3.network.Client in the <code>simpleInitApp()</code> method and specify the servers IP address, and the same communication port as for the server, here 6143.
</p>
</div>
<h3><a>Creating a Client</a></h3>
<div>
<pre>public void simpleInitApp&#40;&#41; &#123;
...
Client myClient = Network.connectToServer&#40;&quot;localhost&quot;, 6143&#41;;
myClient.start&#40;&#41;;
...</pre>
<p>
A com.jme3.network.Client is a standard com.jme3.app.SimpleApplication.
The server address can be in the format &quot;localhost&quot; or &quot;127.0.0.1&quot; (for local testing), or an IP address of a remote host in the format “123.456.78.9”. In this example, we assume the server is running on the localhost.
</p>
<pre>ClientMain app = new ClientMain&#40;&#41;;
app.start&#40;JmeContext.Type.Display&#41;; // standard type</pre>
<p>
Create a Client in the simpleInitApp() method and specify the servers IP address, and the same communication port as for the server, here 6143.
</p>
<pre>Client myClient = Network.connectToServer&#40;&quot;localhost&quot;, 6143&#41;;
myClient.start&#40;&#41;;</pre>
<p>
The server address can be in the format &quot;localhost&quot;, &quot;127.0.0.1&quot; (for local testing) or “123.456.78.9” (the IP address of a real server).
When you run this client, it connects to the server.
</p>
</div>
@ -110,7 +42,7 @@ The server address can be in the format &quot;localhost&quot;, &quot;127.0.0.1&q
<p>
The server refers to a connected client as com.jme3.network.HostedConnection. The server can get info about clients as follows:
The server refers to a connected client as com.jme3.network.HostedConnection objects. The server can get info about clients as follows:
</p>
<div><table>
@ -118,19 +50,19 @@ The server refers to a connected client as com.jme3.network.HostedConnection. Th
<th>Accessor</th><th>Purpose</th>
</tr>
<tr>
<td>myServer.getConnection(0)</td><td>Server gets the first etc connected HostedConnection object.</td>
<td>myServer.getConnections()</td><td>Server gets a collection of all connected HostedConnection objects (all connected clients).</td>
</tr>
<tr>
<td>myServer.getConnections()</td><td>Server gets a collection of all connected HostedConnection objects.</td>
<td>myServer.getConnections().size()</td><td>Server gets the number of all connected HostedConnection objects (number of clients).</td>
</tr>
<tr>
<td>myServer.getConnections().size()</td><td>Server gets the number of all connected HostedConnection objects.</td>
<td>myServer.getConnection(0)</td><td>Server gets the first (0), second (1), etc, connected HostedConnection object (one client).</td>
</tr>
</table></div>
<!-- EDIT2 TABLE [3563-3867] -->
<!-- EDIT2 TABLE [4717-5096] -->
<p>
Your game can define its own player ID based on whatever user criteria you want. If the server needs to look up player/client-specific information, it can store this information directly on the HostedConnection object:
Your game can define its own game data based on whatever criteria you want, typically these include player ID and state. If the server needs to look up player/client-specific information, you can store this information directly on the HostedConnection object. The following examples read and write a custom Java object <code>MyState</code> in the HostedConnection object <code>conn</code>:
</p>
<div><table>
@ -144,7 +76,7 @@ Your game can define its own player ID based on whatever user criteria you want.
<td> MyState state = conn.getAttribute(&quot;MyState&quot;)</td><td> Server can read an attribute of the HostedConnection. </td>
</tr>
</table></div>
<!-- EDIT3 TABLE [4089-4318] -->
<!-- EDIT3 TABLE [5471-5700] -->
</div>
<h2><a>Messaging</a></h2>
@ -157,28 +89,28 @@ Your game can define its own player ID based on whatever user criteria you want.
<p>
Each message represents data you want to transmit, for instance transformation updates or game actions. For each message type, create a message class that extends com.jme3.network.AbstractMessage. Use the @Serializable annotation from com.jme3.network.serializing.Serializable and create an empty default constructor. Custom constructors, fields, and methods are up to you and depend on the message data that you want to transmit.
Each message represents data that you want to transmit between client and server. Common message examples include transformation updates or game actions. For each message type, create a message class that extends com.jme3.network.AbstractMessage. Use the @Serializable annotation from com.jme3.network.serializing.Serializable and create an empty default constructor. Custom constructors, fields, and methods are up to you and depend on the message data that you want to transmit.
</p>
<pre>@Serializable
public class HelloMessage extends AbstractMessage &#123;
private String hello; // message data
private String hello; // custom message data
public HelloMessage&#40;&#41; &#123;&#125; // empty constructor
public HelloMessage&#40;String s&#41; &#123; hello = s; &#125; // custom constructor
&#125;</pre>
<p>
Register each message type to the com.jme3.network.serializing.Serializer, in both server and client.
You must register each message type to the com.jme3.network.serializing.Serializer, in both server and client!
</p>
<pre>Serializer.registerClass&#40;HelloMessage.class&#41;;</pre>
</div>
<h3><a>Reacting to Messages</a></h3>
<h3><a>Responding to Messages</a></h3>
<div>
<p>
After a message was received, a listener responds to it. The listener can access fields of the message, and send messages back. Implement responses in the two Listeners’ messageReceived() methods for each message type.
After a Message was received, a Listener responds to it. The listener can access fields of the message, and send messages back, start new threads, etc. There are two listeners, one on the server, one on the client. For each message type, you implement the responses in either Listeners’ <code>messageReceived()</code> method.
</p>
</div>
@ -235,22 +167,35 @@ For each message type, register a server listener to the server:
<p>
A client can send a message to the server:
Let&#039;s create a new message of type HelloMessage:
</p>
<pre>Message message = new HelloMessage&#40;&quot;Hello World!&quot;&#41;;</pre>
<p>
Now the client can send this message to the server:
</p>
<pre>Message message = new HelloMessage&#40;&quot;Hello World!&quot;&#41;;
myClient.send&#40;message&#41;;</pre>
<pre>myClient.send&#40;message&#41;;</pre>
<p>
The server can broadcast a message to all HostedConnection (clients):
Or the server can broadcast this message to all HostedConnection (clients):
</p>
<pre>Message message = new HelloMessage&#40;&quot;Welcome!&quot;&#41;;
myServer.broadcast&#40;message&#41;;</pre>
<p>
Using com.jme3.network.Filters, the server can send a message to specific HostedConnection (conn1, conn2, conn3), or to all but a few HostedConnections (not to conn4).
Or the server can send the message to a specific subset of clients (e.g. to HostedConnection conn1, conn2, and conn3):
</p>
<pre>myServer.broadcast&#40; Filters.in&#40; conn1, conn2, conn3 &#41;, message &#41;;</pre>
<p>
Or the server can send the message to all but a few selected clients (e.g. to all HostedConnections but conn4):
</p>
<pre>myServer.broadcast&#40; Filters.notEqualTo&#40; conn4 &#41;, message &#41;;</pre>
<p>
The last two broadcasting methods use com.jme3.network.Filters to select a subset of recipients. If you know the exact list of recipients, always send the messages directly to them using the Filters; avoid floodig the network with unnessary broadcasts to all.
</p>
<pre>myServer.broadcast&#40; Filters.in&#40; conn1, conn2, conn3 &#41;, message &#41;;
myServer.broadcast&#40; Filters.notEqualTo&#40; conn4 &#41;, message &#41;;</pre>
</div>
@ -264,7 +209,7 @@ The ID of the Client and HostedConnection are the same at both ends of a connect
<pre>... myClient.getId&#40;&#41; ...</pre>
<p>
A server has a game version and game name. Each client expects to communicate with a server with a certain game name and version. Test first whether the game name matches, and then whether game version matches, before sending any messages! If they do not match, you should refuse to connect, because the client and server will not be able to communicate.
A server has a game version and game name property. Each client expects to communicate with a server with a certain game name and version. Test first whether the game name matches, and then whether game version matches, before sending any messages! If they do not match, you should refuse to connect, because unmatched clients and servers will likely miscommunicate.
</p>
<div><table>
@ -272,22 +217,23 @@ A server has a game version and game name. Each client expects to communicate wi
<th>Accessor</th><th>Purpose</th>
</tr>
<tr>
<td> myServer.setName() </td><td> Specify the game name (free-form String) </td>
<td> myServer.setName() </td><td> Specify the game name of the Server (a free-form String) </td>
</tr>
<tr>
<td> myServer.setVersion() </td><td> Specify the game version (int) </td>
<td> myServer.setVersion() </td><td> Specify the game version of the Server (an integer number) </td>
</tr>
<tr>
<td> myClient.getGameName() </td><td> Client gets the name of the server it is connected to. </td>
<td> myClient.getGameName() </td><td> Client queries the name of the server it is connected to. </td>
</tr>
<tr>
<td> myClient.getVersion() </td><td> Client gets the version of the server it is connected to. </td>
<td> myClient.getVersion() </td><td> Client queries the version of the server it is connected to. </td>
</tr>
</table></div>
<!-- EDIT4 TABLE [8113-8426] -->
<!-- EDIT4 TABLE [10101-10470] -->
<p>
<strong>Tip:</strong> Your game defines its own attributs, such as player ID, based on whatever criteria you want. If you want to look up player/client-specific information, you can set this information directly on the Client/HostedConnection (see Getting Info About a Client).
<p><div>Typically, your networked game defines its own attributes (such as player ID) based on whatever criteria you want. If you want to look up player/client-specific information beyond the game version, you can set this information directly on the Client/HostedConnection object (see Getting Info About a Client).
</div></p>
</p>
</div>
@ -306,6 +252,7 @@ You must override the client&#039;s destroy() method to close the connection cle
</p>
<pre> @Override
public void destroy&#40;&#41; &#123;
... // custom code
myClient.close&#40;&#41;;
super.destroy&#40;&#41;;
&#125;</pre>
@ -321,6 +268,7 @@ You must override the server&#039;s destroy() method to close the connection whe
</p>
<pre> @Override
public void destroy&#40;&#41; &#123;
... // custom code
myServer.close&#40;&#41;;
super.destroy&#40;&#41;;
&#125;</pre>
@ -332,7 +280,7 @@ You must override the server&#039;s destroy() method to close the connection whe
<p>
The server can kick a HostedConnection to make it disconnect. You should provide a String with further info (an explanation to the user what happened) for the server to send along. This info message can be used (displayed to the user) by a ClientStateListener. (See below)
The server can kick a HostedConnection to make it disconnect. You should provide a String with further info (an explanation to the user what happened, e.g. &quot;Shutting down for maintenance&quot;) for the server to send along. This info message can be used (displayed to the user) by a ClientStateListener. (See below)
</p>
<pre>conn.close&#40;&quot;We kick cheaters.&quot;&#41;;</pre>
@ -352,24 +300,25 @@ The server and clients are notified about connection changes.
<div>
<p>
The com.jme3.network.ClientStateListener notifies the Client when the Client has fully connected to the server (including any internal handshaking), and when the Client is kicked (disconnected) from the server.
</p>
<div><table>
<tr>
<th> ClientStateListener interface </th><th> Purpose </th>
<th> ClientStateListener interface method </th><th> Purpose </th>
</tr>
<tr>
<td> clientConnected(Client c) </td><td> Implement here what happens as soon as this clients has fully connected to the server. </td>
<td> public void clientConnected(Client c){} </td><td> Implement here what happens as soon as this clients has fully connected to the server. </td>
</tr>
<tr>
<td> clientDisconnected(Client c, DisconnectInfo info) </td><td> Implement here what happens after the server kicks this client. For example, display the DisconnectInfo to the user. </td>
<td> public void clientDisconnected(Client c, DisconnectInfo info){} </td><td> Implement here what happens after the server kicks this client. For example, display the DisconnectInfo to the user. </td>
</tr>
</table></div>
<!-- EDIT5 TABLE [9930-10265] -->
<!-- EDIT5 TABLE [12124-12494] -->
<p>
Implement the ClientStateListener interface in the Client, and then register it:
First implement the ClientStateListener interface in the Client class. Then register it to myClient in MyGameClient&#039;s simeplInitApp() method:
</p>
<pre>myClient.addClientStateListener&#40;this&#41;;</pre>
@ -385,19 +334,20 @@ The com.jme3.network.ConnectionListener notifies the Server whenever new HostedC
</p>
<div><table>
<tr>
<th> ConnectionListener interface </th><th> Purpose </th>
<th> ConnectionListener interface method </th><th> Purpose </th>
</tr>
<tr>
<td> connectionAdded(Server s, HostedConnection c) </td><td> Implemenent here what happens after a new HostedConnection has joined the Server. </td>
<td> public void connectionAdded(Server s, HostedConnection c){} </td><td> Implemenent here what happens after a new HostedConnection has joined the Server. </td>
</tr>
<tr>
<td> connectionRemoved(Server s, HostedConnection c) </td><td> Implement here what happens after a HostedConnection has left. E.g. a player has quit the game and the server removes his character. </td>
<td> public void connectionRemoved(Server s, HostedConnection c){} </td><td> Implement here what happens after a HostedConnection has left. E.g. a player has quit the game and the server removes his character. </td>
</tr>
</table></div>
<!-- EDIT6 TABLE [10672-11035] -->
<!-- EDIT6 TABLE [12962-13360] -->
<p>
Implement the ConnectionListener in the Server, and register it.
First implement the ConnectionListener interface in the Server class. Then register it to myServer in MyGameServer&#039;s simpleInitApp() method.
</p>
<pre>myServer.addConnectionListener&#40;this&#41;;</pre>
@ -426,13 +376,21 @@ message2.setReliable&#40;false&#41;; // UDP</pre>
<p>
You cannot modify the scenegraph in the NetworkThread. You have to create a Callable, enqueue the Callable in the OpenGLThread, and the callable makes the modification in the correct moment. A Callable is a Java class representing a (possibly time-intensive), self-contained task.
<p><div><strong>You cannot modify the scenegraph directly from the network thread.</strong> A common example for such a modification is when you synchronize the player&#039;s position in the scene. You have to use Java Multithreading.
</div></p>
</p>
<p>
Multithreading means that you create a Callable. A Callable is a Java class representing any (possibly time-intensive) self-contained task that has an impact on the scene graph (such as positioning the player). You enqueue the Callable in the Executor of the client&#039;s OpenGL thread. The Callable ensures to executes the modification in sync with the update loop.
</p>
<pre>app.enqueue&#40;callable&#41;;</pre>
<p>
Learn more about using <a href="/com/jme3/gde/core/docs/jme3/advanced/multithreading.html">multithreading</a> in jME3 here.
</p>
Learn more about <a href="/com/jme3/gde/core/docs/jme3/advanced/multithreading.html">multithreading</a> here.
<p>
For general advice, see the articles <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking"><param name="text" value="<html><u>MultiPlayer Networking</u></html>"><param name="textColor" value="blue"></object> and <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="https://developer.valvesoftware.com/wiki/Latency_Compensating_Methods_in_Client/Server_In-game_Protocol_Design_and_Optimization"><param name="text" value="<html><u>Latency Compensating Methods in Client/Server In-game Protocol Design and Optimization</u></html>"><param name="textColor" value="blue"></object> by the Valve Developer Community.
</p>
</div>
@ -442,7 +400,7 @@ Learn more about <a href="/com/jme3/gde/core/docs/jme3/advanced/multithreading.h
<p>
If you have set up a server in your home network, and the game clients cannot reach it from the outside, it&#039;s time to learn about <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://portforward.com/"><param name="text" value="<html><u>port forwarding</u></html>"><param name="textColor" value="blue"></object>.
If you have set up a server in your home network, and the game clients cannot reach the server from the outside, it&#039;s time to learn about <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://portforward.com/"><param name="text" value="<html><u>port forwarding</u></html>"><param name="textColor" value="blue"></object>.
</p>
<div><span>
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>,

@ -1,21 +1,4 @@
<h1><a>Creating User Interfaces with Nifty GUI</a></h1>
<div>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/nifty-gui-13.png">
</p>
<p>
You may want your players to press a button to save a game, you want a scrolling text field for highscores, a text label to display the score, drop-downs to select keymap preferences, or checkboxes to specify multi-media options. Usually you solve these tasks by using Swing controls. 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>, a 3D game typically runs full-screen, or in a window of its own.
</p>
<p>
This document 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 building interactive graphical user interfaces (GUIs) for games or similar applications. Nifty <acronym title="Graphical User Interface">GUI</acronym> (the <code>de.lessvoid.nifty</code> package) is well integrated with jME3 through the <code>com.jme3.niftygui</code> package. You define the base <acronym title="Graphical User Interface">GUI</acronym> layout in <acronym title="Extensible Markup Language">XML</acronym>, and control it dynamically from your Java code. The necessary JAR libraries are included in your jME3 download, you do not need to install anything extra. (Just make sure they are on the classpath.)
</p>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://vimeo.com/25637085"><param name="text" value="<html><u>Video demo of Nifty GUI 1.3</u></html>"><param name="textColor" value="blue"></object> </div>
<h1><a>Creating User Interfaces with Nifty GUI</a></h1><div><p><img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/nifty-gui-13.png"></p><p>You may want your players to press a button to save a game, you want a scrolling text field for highscores, a text label to display the score, drop-downs to select keymap preferences, or checkboxes to specify multi-media options. Usually you solve these tasks by using Swing controls. 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>, a 3D game typically runs full-screen, or in a window of its own.</p><p>This document 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 building interactive graphical user interfaces (GUIs) for games or similar applications. Nifty <acronym title="Graphical User Interface">GUI</acronym> (the <code>de.lessvoid.nifty</code> package) is well integrated with jME3 through the <code>com.jme3.niftygui</code> package. You define the base <acronym title="Graphical User Interface">GUI</acronym> layout in <acronym title="Extensible Markup Language">XML</acronym>, and control it dynamically from your Java code. The necessary JAR libraries are included in your jME3 download, you do not need to install anything extra. (Just make sure they are on the classpath.)</p><ul><li><div><object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://vimeo.com/25637085"><param name="text" value="<html><u>Video demo of Nifty GUI 1.3</u></html>"><param name="textColor" value="blue"></object> </div>
</li>
</ul>

@ -1,36 +1,4 @@
<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.html">Nifty GUI Concepts</a></div>
</li>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_xml_layout.html">Nifty GUI XML Layout</a> or <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_java_layout.html">Nifty GUI Java 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>
In the previous parts of the tutorial, you created a two-screen user interface. But it is still static, and when you click the buttons, nothing happens yet. The purpose of the <acronym title="Graphical User Interface">GUI</acronym> is to communicate with your Java classes: Your game needs to know what the users clicked, which settings they chose, which values they entered into a field, etc. Similarly, the user needs to know what the currently game state is (score, health, etc).
</p>
</div>
<h2><a>Connect GUI to Java Controller</a></h2>
<div>
<p>
To let a Nifty screen communicate with the Java application, you register a <code>ScreenController</code> to every NiftyGUI screen. You create a ScreenController by creating a Java class that implements the <code>de.lessvoid.nifty.screen.ScreenController</code> interface and its abtract methods.
</p>
<p>
<strong>Pro Tip:</strong> Since you are writing a jME3 application, you can additionally make the ScreenController class extend the <a href="/com/jme3/gde/core/docs/jme3/advanced/application_states.html">AbstractAppState</a> class! This gives the ScreenController access to the application object and to the update loop!
</p>
<pre>package tutorial;
<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.html">Nifty GUI Concepts</a></div></li><li><div><a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_xml_layout.html">Nifty GUI XML Layout</a> or <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_java_layout.html">Nifty GUI Java 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>In the previous parts of the tutorial, you created a two-screen user interface. But it is still static, and when you click the buttons, nothing happens yet. The purpose of the <acronym title="Graphical User Interface">GUI</acronym> is to communicate with your Java classes: Your game needs to know what the users clicked, which settings they chose, which values they entered into a field, etc. Similarly, the user needs to know what the currently game state is (score, health, etc).</p></div><h2><a>Connect GUI to Java Controller</a></h2><div><p>To let a Nifty screen communicate with the Java application, you register a <code>ScreenController</code> to every NiftyGUI screen. You create a ScreenController by creating a Java class that implements the <code>de.lessvoid.nifty.screen.ScreenController</code> interface and its abtract methods.</p><p><strong>Pro Tip:</strong> Since you are writing a jME3 application, you can additionally make the ScreenController class extend the <a href="/com/jme3/gde/core/docs/jme3/advanced/application_states.html">AbstractAppState</a> class! This gives the ScreenController access to the application object and to the update loop!</p><pre>package tutorial;
&nbsp;
import com.jme3.app.Application;
import com.jme3.app.SimpleApplication;
@ -76,44 +44,12 @@ public class MyStartScreen extends AbstractAppState implements ScreenController
/** jME update loop! */
&#125;
&nbsp;
&#125;</pre>
<p>
The name and package of your custom ScreenController class (here <code>tutorial.MyStartScreen</code>) goes into the controller parameter of the respective <acronym title="Extensible Markup Language">XML</acronym> screen it belongs to. For example:
</p>
<pre><span><span>&lt;nifty&gt;</span></span>
&#125;</pre><p>The name and package of your custom ScreenController class (here <code>tutorial.MyStartScreen</code>) goes into the controller parameter of the respective <acronym title="Extensible Markup Language">XML</acronym> screen it belongs to. For example:</p><pre><span><span>&lt;nifty&gt;</span></span>
<span>&lt;screen id=&quot;start&quot; controller=&quot;tutorial.MyStartScreen&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>
Or the same in a Java syntax, respectively:
</p>
<pre> nifty.addScreen&#40;&quot;start&quot;, new ScreenBuilder&#40;&quot;start&quot;&#41; &#123;&#123;
controller&#40;new tutorial.MyStartScreen&#40;&#41;&#41;;</pre>
<p>
Now the Java class <code>MyStartScreen</code> and this <acronym title="Graphical User Interface">GUI</acronym> screen (<code>start</code>) are connected. For this example you can also connect the <code>hud</code> screen to MyStartScreen.
</p>
</div>
<h2><a>Make GUI and Java Interact</a></h2>
<div>
<p>
In most cases, you will want to pass game data in and out of the ScreenController. Note that you can pass any custom arguments from your Java class into your ScreenController constructor (<code>public MyStartScreen(GameData data) {}</code>).
</p>
<p>
Use any combination of the three following approaches to make Java classes interact with the <acronym title="Graphical User Interface">GUI</acronym>.
</p>
</div>
<h3><a>GUI Calls a Void Java Method</a></h3>
<span><span>&lt;/nifty&gt;</span></span></pre><p>Or the same in a Java syntax, respectively:</p><pre> nifty.addScreen&#40;&quot;start&quot;, new ScreenBuilder&#40;&quot;start&quot;&#41; &#123;&#123;
controller&#40;new tutorial.MyStartScreen&#40;&#41;&#41;;</pre><p>Now the Java class <code>MyStartScreen</code> and this <acronym title="Graphical User Interface">GUI</acronym> screen (<code>start</code>) are connected. For this example you can also connect the <code>hud</code> screen to MyStartScreen.</p></div><h2><a>Make GUI and Java Interact</a></h2><div><p>In most cases, you will want to pass game data in and out of the ScreenController. Note that you can pass any custom arguments from your Java class into your ScreenController constructor (<code>public MyStartScreen(GameData data) {}</code>).</p><p>Use any combination of the three following approaches to make Java classes interact with the <acronym title="Graphical User Interface">GUI</acronym>.</p></div><h3><a>GUI Calls a Void Java Method</a></h3>
<div>
<p>

@ -1,50 +1,4 @@
<h1><a>Integrating Nifty GUI: Overlay</a></h1>
<div>
<ol>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui.html">Nifty GUI Concepts</a></div>
</li>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_xml_layout.html">Nifty GUI XML Layout</a> or <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_java_layout.html">Nifty GUI Java 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>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/nifty-gui-example.png">
</p>
<p>
Typically, you define a key (for example escape) that switches the <acronym title="Graphical User Interface">GUI</acronym> on and off. The <acronym title="Graphical User Interface">GUI</acronym> can be a StartScreen, OptionsScreen, CharacterCreationScreen, etc. While the <acronym title="Graphical User Interface">GUI</acronym> is up, you pause the running game, and then overlay the <acronym title="Graphical User Interface">GUI</acronym>. You also must switch to a different set of user inputs while the game is paused, so the player can use the mouse pointer and keyboard to interact with the <acronym title="Graphical User Interface">GUI</acronym>.
</p>
<p>
You can also <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_projection.html">project</a> the <acronym title="Graphical User Interface">GUI</acronym> as a texture onto a mesh texture (but then you cannot click to select).
On this page, we look at the overlay variant, which is more commonly used in games.
</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;
<h1><a>Integrating Nifty GUI: Overlay</a></h1><div><ol><li><div><a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui.html">Nifty GUI Concepts</a></div></li><li><div><a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_xml_layout.html">Nifty GUI XML Layout</a> or <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_java_layout.html">Nifty GUI Java 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><img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/nifty-gui-example.png"></p><p>Typically, you define a key (for example escape) that switches the <acronym title="Graphical User Interface">GUI</acronym> on and off. The <acronym title="Graphical User Interface">GUI</acronym> can be a StartScreen, OptionsScreen, CharacterCreationScreen, etc. While the <acronym title="Graphical User Interface">GUI</acronym> is up, you pause the running game, and then overlay the <acronym title="Graphical User Interface">GUI</acronym>. You also must switch to a different set of user inputs while the game is paused, so the player can use the mouse pointer and keyboard to interact with the <acronym title="Graphical User Interface">GUI</acronym>.</p><p>You can also <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_projection.html">project</a> the <acronym title="Graphical User Interface">GUI</acronym> as a texture onto a mesh texture (but then you cannot click to select). On this page, we look at the overlay variant, which is more commonly used in games.</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;;
/** Create a new NiftyGUI object */
Nifty nifty = niftyDisplay.getNifty&#40;&#41;;

@ -1,53 +1,4 @@
<h1><a>Integrating Nifty GUI: Projection</a></h1>
<div>
<ol>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui.html">Nifty GUI Concepts</a></div>
</li>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_xml_layout.html">Nifty GUI XML Layout</a> or <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_java_layout.html">Nifty GUI Java 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>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/nifty-gui.png">
</p>
<p>
Typically you define a key (for example escape) to switch the <acronym title="Graphical User Interface">GUI</acronym> on and off. Then you <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).
</p>
<p>
Alternatively, you can also project the <acronym title="Graphical User Interface">GUI</acronym> as a texture onto a mesh textures inside the game. Allthough this looks cool and &quot;immersive&quot;, this approach is rarely used since it is difficult to record clicks this way. You can only interact with this projected <acronym title="Graphical User Interface">GUI</acronym> by keyboard, or programmatically. You can select input fields using the arrow keys, and trigger actions using the return key.
</p>
<p>
This <acronym title="Graphical User Interface">GUI</acronym> projection variant is less commonly used than the <acronym title="Graphical User Interface">GUI</acronym> overlay variant. Usecases for <acronym title="Graphical User Interface">GUI</acronym> projection are, for example, a player avatar using an in-game computer screen.
</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 Geometry (Quads or Boxes are best).
</p>
<pre>/** Create a special viewport for the Nifty GUI */
<h1><a>Integrating Nifty GUI: Projection</a></h1><div><ol><li><div><a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui.html">Nifty GUI Concepts</a></div></li><li><div><a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_xml_layout.html">Nifty GUI XML Layout</a> or <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_java_layout.html">Nifty GUI Java 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><img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/nifty-gui.png"></p><p>Typically you define a key (for example escape) to switch the <acronym title="Graphical User Interface">GUI</acronym> on and off. Then you <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).</p><p>Alternatively, you can also project the <acronym title="Graphical User Interface">GUI</acronym> as a texture onto a mesh textures inside the game. Allthough this looks cool and &quot;immersive&quot;, this approach is rarely used since it is difficult to record clicks this way. You can only interact with this projected <acronym title="Graphical User Interface">GUI</acronym> by keyboard, or programmatically. You can select input fields using the arrow keys, and trigger actions using the return key.</p><p>This <acronym title="Graphical User Interface">GUI</acronym> projection variant is less commonly used than the <acronym title="Graphical User Interface">GUI</acronym> overlay variant. Usecases for <acronym title="Graphical User Interface">GUI</acronym> projection are, for example, a player avatar using an in-game computer screen.</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 Geometry (Quads or Boxes are best).</p><pre>/** Create a special viewport for the Nifty GUI */
ViewPort niftyView = renderManager.createPreView&#40;&quot;NiftyView&quot;, new Camera&#40;1024, 768&#41;&#41;;
niftyView.setClearEnabled&#40;true&#41;;
/** Create a new NiftyJmeDisplay for the integration */
@ -73,36 +24,5 @@ Geometry geom = new Geometry&#40;&quot;Box&quot;, b&#41;;
Material mat = new Material&#40;assetManager, &quot;Common/MatDefs/Misc/Unshaded.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>
The MySettingsScreen class is a custom de.lessvoid.nifty.screen.ScreenController in which you implement your <acronym title="Graphical User Interface">GUI</acronym> behaviour. The variable <code>data</code> contains an object that you use to exchange state info with the game. See <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_java_interaction.html">Nifty GUI Java Interaction</a> for details on how to create this class.
</p>
<p>
Run the code sample. You select buttons on this <acronym title="Graphical User Interface">GUI</acronym> with the arrow keys and then press return. Note that clicking on the texture will not work!
</p>
</div>
<h2><a>Next Steps</a></h2>
<div>
<p>
Now that you have layed out and integrated the <acronym title="Graphical User Interface">GUI</acronym> in your app, you want to respond to user input and display the current game.
</p>
<ul>
<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>
<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:nifty?do=showtag&amp;tag=tag%3Anifty">nifty</a>,
<a href="/wiki/doku.php/tag:hud?do=showtag&amp;tag=tag%3Ahud">hud</a>,
<a href="/wiki/doku.php/tag:texture?do=showtag&amp;tag=tag%3Atexture">texture</a>
</span></div>
</div>
rootNode.attachChild&#40;geom&#41;;</pre><p>The MySettingsScreen class is a custom de.lessvoid.nifty.screen.ScreenController in which you implement your <acronym title="Graphical User Interface">GUI</acronym> behaviour. The variable <code>data</code> contains an object that you use to exchange state info with the game. See <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_java_interaction.html">Nifty GUI Java Interaction</a> for details on how to create this class.</p><p>Run the code sample. You select buttons on this <acronym title="Graphical User Interface">GUI</acronym> with the arrow keys and then press return. Note that clicking on the texture will not work!</p></div><h2><a>Next Steps</a></h2><div><p>Now that you have layed out and integrated the <acronym title="Graphical User Interface">GUI</acronym> in your app, you want to respond to user input and display the current game.</p><ul><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><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:nifty?do=showtag&amp;tag=tag%3Anifty">nifty</a>, <a href="/wiki/doku.php/tag:hud?do=showtag&amp;tag=tag%3Ahud">hud</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>

@ -1,101 +1,4 @@
<h1><a>Laying out the GUI in XML</a></h1>
<div>
<ol>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui.html">Nifty GUI Concepts</a></div>
</li>
<li><div> <strong>Nifty <acronym title="Graphical User Interface">GUI</acronym> <acronym title="Extensible Markup Language">XML</acronym> Layout</strong> or <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_java_layout.html">Nifty GUI Java 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> <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>
You can &quot;draw&quot; the <acronym title="Graphical User Interface">GUI</acronym> to the screen by writing <acronym title="Extensible Markup Language">XML</acronym> code (alternatively you can also use Java).
</p>
</div>
<h2><a>Plan Your GUI Layout</a></h2>
<div>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/gui-layout-draft.png">
</p>
<p>
In this tutorial, you want to create two game screens: An out-of-game StartScreen that the players see before the game starts; and an in-game <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> that displays info during the game. Before writing code, you plan the <acronym title="Graphical User Interface">GUI</acronym> layout, either on paper or in a graphic application.
</p>
<p>
The StartScreen contains:
</p>
<ul>
<li><div> The background layer has a centered layout and contains an image.</div>
</li>
<li><div> The top layer has a vertical layout, containing 3 panels: </div>
<ul>
<li><div> The top panel contains a label with the game title, </div>
</li>
<li><div> The middle panel contains a text field with the game description. </div>
</li>
<li><div> The bottom panel has a horizontal layout and contains two more panels:</div>
<ul>
<li><div> The left panel contains a Start button.</div>
</li>
<li><div> The right panel contains a Quit button.</div>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>
The HUD contains:
</p>
<ul>
<li><div> The background layer has a centered layout, and contains a the partially transparent HUD image.</div>
</li>
<li><div> The top layer has a horizontal layout, containing 2 panels: </div>
<ul>
<li><div> The left panel as transparent spacer.</div>
</li>
<li><div> The right panel has a vertical layout containing 2 panels, a label and an image.</div>
</li>
</ul>
</li>
</ul>
</div>
<h2><a>Implement Your GUI Layout</a></h2>
<div>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/nifty-screen-layer-panel.png">
</p>
<p>
Create an empty screen.xml file in the <code>assets/Interfaces/</code> directory of your project. One <acronym title="Extensible Markup Language">XML</acronym> file can contain several, or even all screens. As a reminder: Nifty displays one screen at a time; a screen contains several layers on top of one another; each layer contains panels that are embedded into another; the panels contain the actual content (text, images, or controls).
</p>
</div>
<h3><a>Make Screens</a></h3>
<div>
<p>
The following minimal <acronym title="Extensible Markup Language">XML</acronym> file contains a start screen and a HUD screen. (Neither has been defined yet.)
</p>
<pre><span>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span>
<h1><a>Laying out the GUI in XML</a></h1><div><ol><li><div><a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui.html">Nifty GUI Concepts</a></div></li><li><div><strong>Nifty <acronym title="Graphical User Interface">GUI</acronym> <acronym title="Extensible Markup Language">XML</acronym> Layout</strong> or <a href="/com/jme3/gde/core/docs/jme3/advanced/nifty_gui_java_layout.html">Nifty GUI Java 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><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>You can &quot;draw&quot; the <acronym title="Graphical User Interface">GUI</acronym> to the screen by writing <acronym title="Extensible Markup Language">XML</acronym> code (alternatively you can also use Java).</p></div><h2><a>Plan Your GUI Layout</a></h2><div><p><img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/gui-layout-draft.png"></p><p>In this tutorial, you want to create two game screens: An out-of-game StartScreen that the players see before the game starts; and an in-game <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> that displays info during the game. Before writing code, you plan the <acronym title="Graphical User Interface">GUI</acronym> layout, either on paper or in a graphic application.</p><p>The StartScreen contains:</p><ul><li><div>The background layer has a centered layout and contains an image.</div></li><li><div>The top layer has a vertical layout, containing 3 panels:</div><ul><li><div>The top panel contains a label with the game title,</div></li><li><div>The middle panel contains a text field with the game description.</div></li><li><div>The bottom panel has a horizontal layout and contains two more panels:</div><ul><li><div>The left panel contains a Start button.</div></li><li><div>The right panel contains a Quit button.</div></li></ul></li></ul></li></ul><p>The HUD contains:</p><ul><li><div>The background layer has a centered layout, and contains a the partially transparent HUD image.</div></li><li><div>The top layer has a horizontal layout, containing 2 panels:</div><ul><li><div>The left panel as transparent spacer.</div></li><li><div>The right panel has a vertical layout containing 2 panels, a label and an image.</div></li></ul></li></ul></div><h2><a>Implement Your GUI Layout</a></h2><div><p><img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/nifty-screen-layer-panel.png"></p><p>Create an empty screen.xml file in the <code>assets/Interfaces/</code> directory of your project. One <acronym title="Extensible Markup Language">XML</acronym> file can contain several, or even all screens. As a reminder: Nifty displays one screen at a time; a screen contains several layers on top of one another; each layer contains panels that are embedded into another; the panels contain the actual content (text, images, or controls).</p></div><h3><a>Make Screens</a></h3><div><p>The following minimal <acronym title="Extensible Markup Language">XML</acronym> file contains a start screen and a HUD screen. (Neither has been defined yet.)</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; 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>
<span>&lt;screen id=&quot;start&quot;&gt;</span>
@ -104,26 +7,7 @@ The following minimal <acronym title="Extensible Markup Language">XML</acronym>
<span>&lt;screen id=&quot;hud&quot;&gt;</span>
&lt;!-- ... --&gt;
<span><span>&lt;/screen&gt;</span></span>
<span><span>&lt;/nifty&gt;</span></span></pre>
<p>
Every Nifty <acronym title="Graphical User Interface">GUI</acronym> must have a start screen. The others (in this example, the HUD screen) are optional.
</p>
<p>
<strong>Note:</strong> In the following examples, the <acronym title="Extensible Markup Language">XML</acronym> schema header is abbreviated to just <code>&lt;nifty&gt;</code>.
</p>
</div>
<h3><a>Make Layers</a></h3>
<div>
<p>
The following minimal <acronym title="Extensible Markup Language">XML</acronym> file shows how we added layers to the start screen and HUD screen:
</p>
<pre><span><span>&lt;nifty&gt;</span></span>
<span><span>&lt;/nifty&gt;</span></span></pre><p>Every Nifty <acronym title="Graphical User Interface">GUI</acronym> must have a start screen. The others (in this example, the HUD screen) are optional.</p><p><strong>Note:</strong> In the following examples, the <acronym title="Extensible Markup Language">XML</acronym> schema header is abbreviated to just <code>&lt;nifty&gt;</code>.</p></div><h3><a>Make Layers</a></h3><div><p>The following minimal <acronym title="Extensible Markup Language">XML</acronym> file shows how we added layers to the start screen and HUD screen:</p><pre><span><span>&lt;nifty&gt;</span></span>
<span>&lt;screen id=&quot;start&quot;&gt;</span>
<span>&lt;layer id=&quot;background&quot; backgroundColor=&quot;#000f&quot;&gt;</span>
&lt;!-- ... --&gt;
@ -140,22 +24,7 @@ The following minimal <acronym title="Extensible Markup Language">XML</acronym>
&lt;!-- ... --&gt;
<span><span>&lt;/layer&gt;</span></span>
<span><span>&lt;/screen&gt;</span></span>
<span><span>&lt;/nifty&gt;</span></span></pre>
<p>
In a layer, you can now add panels and arrange them. Panels are containers that mark the areas where you want to display text, images, or controls (buttons etc) later.
</p>
</div>
<h3><a>Make Panels</a></h3>
<div>
<p>
A panel is the inner-most container (that will contain the actual content: text, images, or controls). You place panels inside layers. The following panels go into in the <code>start</code> screen&#039;s <code>foreground</code> layer:
</p>
<pre> <span>&lt;panel id=&quot;panel_top&quot; height=&quot;25%&quot; width=&quot;75%&quot; align=&quot;center&quot; childLayout=&quot;center&quot;</span>
<span><span>&lt;/nifty&gt;</span></span></pre><p>In a layer, you can now add panels and arrange them. Panels are containers that mark the areas where you want to display text, images, or controls (buttons etc) later.</p></div><h3><a>Make Panels</a></h3><div><p>A panel is the inner-most container (that will contain the actual content: text, images, or controls). You place panels inside layers. The following panels go into in the <code>start</code> screen&#039;s <code>foreground</code> layer:</p><pre> <span>&lt;panel id=&quot;panel_top&quot; height=&quot;25%&quot; width=&quot;75%&quot; align=&quot;center&quot; childLayout=&quot;center&quot;</span>
<span> backgroundColor=&quot;#f008&quot;&gt;</span>
<span><span>&lt;/panel&gt;</span></span>
<span>&lt;panel id=&quot;panel_mid&quot; height=&quot;50%&quot; width=&quot;75%&quot; align=&quot;center&quot; childLayout=&quot;center&quot;</span>
@ -169,12 +38,7 @@ A panel is the inner-most container (that will contain the actual content: text,
<span>&lt;panel id=&quot;panel_bottom_right&quot; height=&quot;50%&quot; width=&quot;50%&quot; valign=&quot;center&quot; childLayout=&quot;center&quot;</span>
<span> backgroundColor=&quot;#88f8&quot;&gt;</span>
<span><span>&lt;/panel&gt;</span></span>
<span><span>&lt;/panel&gt;</span></span></pre>
<p>
The following panels go into in the <code>hud</code> screen&#039;s <code>foreground</code> layer:
</p>
<pre> <span>&lt;panel id=&quot;panel_left&quot; width=&quot;80%&quot; height=&quot;100%&quot; childLayout=&quot;vertical&quot; </span>
<span><span>&lt;/panel&gt;</span></span></pre><p>The following panels go into in the <code>hud</code> screen&#039;s <code>foreground</code> layer:</p><pre> <span>&lt;panel id=&quot;panel_left&quot; width=&quot;80%&quot; height=&quot;100%&quot; childLayout=&quot;vertical&quot; </span>
<span> backgroundColor=&quot;#0f08&quot;&gt;</span>
&lt;!-- spacer --&gt;
<span><span>&lt;/panel&gt;</span></span>
@ -189,148 +53,33 @@ The following panels go into in the <code>hud</code> screen&#039;s <code>foregro
<span>&lt;panel id=&quot;panel_bot_right&quot; width=&quot;100%&quot; height=&quot;70%&quot; valign=&quot;center&quot;</span>
<span> backgroundColor=&quot;#88f8&quot;&gt;</span>
<span><span>&lt;/panel&gt;</span></span>
<span><span>&lt;/panel&gt;</span></span></pre>
<p>
The result should look as follows:
</p>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/nifty-gui-panels.png">
</p>
</div>
<h2><a>Adding Content to Panels</a></h2>
<div>
<p>
See also <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>Layout Introduction</u></html>"><param name="textColor" value="blue"></object> on the Nifty <acronym title="Graphical User Interface">GUI</acronym> site.
</p>
</div>
<h3><a>Add Images</a></h3>
<div>
<p>
The start-background.png image is a fullscreen background picture. In the <code>start</code> screen, add the following image element:
</p>
<pre> <span>&lt;layer id=&quot;background&quot; childLayout=&quot;center&quot;&gt;</span>
<span><span>&lt;/panel&gt;</span></span></pre><p>The result should look as follows:</p><p><img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/nifty-gui-panels.png"></p></div><h2><a>Adding Content to Panels</a></h2><div><p>See also <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>Layout Introduction</u></html>"><param name="textColor" value="blue"></object> on the Nifty <acronym title="Graphical User Interface">GUI</acronym> site.</p></div><h3><a>Add Images</a></h3><div><p>The start-background.png image is a fullscreen background picture. In the <code>start</code> screen, add the following image element:</p><pre> <span>&lt;layer id=&quot;background&quot; childLayout=&quot;center&quot;&gt;</span>
<span>&lt;image filename=&quot;Interface/tutorial/step2/start-background.png&quot;&gt;<span>&lt;/image&gt;</span></span>
<span><span>&lt;/layer&gt;</span></span></pre>
<p>
The hud-frame.png image is a transparent frame that we use as HUD decoration. In the <code>hud</code> screen, add the following image element:
</p>
<pre> <span>&lt;layer id=&quot;background&quot; childLayout=&quot;center&quot;&gt;</span>
<span><span>&lt;/layer&gt;</span></span></pre><p>The hud-frame.png image is a transparent frame that we use as HUD decoration. In the <code>hud</code> screen, add the following image element:</p><pre> <span>&lt;layer id=&quot;background&quot; childLayout=&quot;center&quot;&gt;</span>
<span>&lt;image filename=&quot;Interface/tutorial/step2/hud-frame.png&quot;&gt;<span>&lt;/image&gt;</span></span>
<span><span>&lt;/layer&gt;</span></span></pre>
<p>
In order to make the hud-frame.png independent of the screen resolution you are using, you could use the <code>imageMode</code> attribute on the image element <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Resizable_Images_(ImageMode%3Dresize)_explained"><param name="text" value="<html><u> Resizable Images (ImageMode=resize) explained</u></html>"><param name="textColor" value="blue"></object>
</p>
<pre> <span>&lt;layer id=&quot;background&quot; childLayout=&quot;center&quot;&gt;</span>
<span><span>&lt;/layer&gt;</span></span></pre><p>In order to make the hud-frame.png independent of the screen resolution you are using, you could use the <code>imageMode</code> attribute on the image element <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Resizable_Images_(ImageMode%3Dresize)_explained"><param name="text" value="<html><u>Resizable Images (ImageMode=resize) explained</u></html>"><param name="textColor" value="blue"></object></p><pre> <span>&lt;layer id=&quot;background&quot; childLayout=&quot;center&quot;&gt;</span>
<span>&lt;image filename=&quot;Interface/tutorial/step2/hud-frame.png&quot; imageMode=&quot;resize:40,490,110,170,40,560,40,270,40,560,40,40&quot; width=&quot;100%&quot; height=&quot;100%&quot;/&gt;</span>
<span><span>&lt;/layer&gt;</span></span></pre>
<p>
The face1.png image is an image that you want to use as a status icon.
In the <code>hud</code> screen&#039;s <code>foreground</code> layer, add the following image element:
</p>
<pre> <span>&lt;panel id=&quot;panel_bottom_left&quot; height=&quot;75%&quot; width=&quot;20%&quot; valign=&quot;center&quot; childLayout=&quot;center&quot;&gt;</span>
<span><span>&lt;/layer&gt;</span></span></pre><p>The face1.png image is an image that you want to use as a status icon. In the <code>hud</code> screen&#039;s <code>foreground</code> layer, add the following image element:</p><pre> <span>&lt;panel id=&quot;panel_bottom_left&quot; height=&quot;75%&quot; width=&quot;20%&quot; valign=&quot;center&quot; childLayout=&quot;center&quot;&gt;</span>
<span>&lt;image filename=&quot;Interface/tutorial/step2/face1.png&quot; </span>
<span> valign=&quot;center&quot; align=&quot;center&quot; height=&quot;50%&quot; width=&quot;30%&quot; &gt;</span>
<span><span>&lt;/image&gt;</span></span>
<span><span>&lt;/panel&gt;</span></span></pre>
<p>
This image is scaled to use 50% of the height and 30% of the width of its container.
</p>
</div>
<h3><a>Add Static Text</a></h3>
<div>
<p>
The game title is a typical exmaple of static text. In the <code>start</code> screen, add the following text element:
</p>
<pre> <span>&lt;panel id=&quot;panel_top&quot; height=&quot;25%&quot; width=&quot;75%&quot; align=&quot;center&quot; childLayout=&quot;center&quot;&gt;</span>
<span><span>&lt;/panel&gt;</span></span></pre><p>This image is scaled to use 50% of the height and 30% of the width of its container.</p></div><h3><a>Add Static Text</a></h3><div><p>The game title is a typical exmaple of static text. In the <code>start</code> screen, add the following text element:</p><pre> <span>&lt;panel id=&quot;panel_top&quot; height=&quot;25%&quot; width=&quot;75%&quot; align=&quot;center&quot; childLayout=&quot;center&quot;&gt;</span>
<span>&lt;text text=&quot;My Cool Game&quot; font=&quot;Interface/Fonts/Default.fnt&quot; width=&quot;100%&quot; height=&quot;100%&quot; /&gt;</span>
<span><span>&lt;/panel&gt;</span></span></pre>
<p>
For longer pieces of static text, such as an introduction, you can use wrap=&quot;true&quot;. Add the following text element to the <code>Start screen</code>:
</p>
<pre> <span>&lt;panel id=&quot;panel_mid&quot; height=&quot;50%&quot; width=&quot;75%&quot; align=&quot;center&quot; childLayout=&quot;center&quot;&gt;</span>
<span><span>&lt;/panel&gt;</span></span></pre><p>For longer pieces of static text, such as an introduction, you can use wrap=&quot;true&quot;. Add the following text element to the <code>Start screen</code>:</p><pre> <span>&lt;panel id=&quot;panel_mid&quot; height=&quot;50%&quot; width=&quot;75%&quot; align=&quot;center&quot; childLayout=&quot;center&quot;&gt;</span>
<span>&lt;text text=&quot;Here goes some text describing the game and the rules and stuff. Incidentally,
the text is quite long and needs to wrap at the end of lines. ...&quot; </span>
<span> font=&quot;Interface/Fonts/Default.fnt&quot; width=&quot;100%&quot; height=&quot;100%&quot; wrap=&quot;true&quot; /&gt;</span>
<span><span>&lt;/panel&gt;</span></span></pre>
<p>
The font used is jME3&#039;s default font &quot;Interface/Fonts/Default.fnt&quot; which is included in the jMonkeyEngine.JAR. You can add your own fonts to your own <code>assets/Interface</code> directory.
</p>
</div>
<h3><a>Add Controls</a></h3>
<div>
<p>
Before you can use any control, you must load a Control Definition first. Add the following two lines <em>before</em> your screen definitions:
</p>
<pre> <span>&lt;useControls filename=&quot;nifty-default-controls.xml&quot; /&gt;</span>
<span>&lt;useStyles filename=&quot;nifty-default-styles.xml&quot; /&gt;</span></pre>
</div>
<h4><a>Label Control</a></h4>
<div>
<p>
Use label controls for text that you want to edit dynamically from Java. One example for this is the score display.
In the <code>hud</code> screen&#039;s <code>foreground</code> layer, add the following text element:
</p>
<pre> <span>&lt;panel id=&quot;panel_top_right&quot; height=&quot;100%&quot; width=&quot;15%&quot; childLayout=&quot;center&quot;&gt;</span>
<span><span>&lt;/panel&gt;</span></span></pre><p>The font used is jME3&#039;s default font &quot;Interface/Fonts/Default.fnt&quot; which is included in the jMonkeyEngine.JAR. You can add your own fonts to your own <code>assets/Interface</code> directory.</p></div><h3><a>Add Controls</a></h3><div><p>Before you can use any control, you must load a Control Definition first. Add the following two lines <em>before</em> your screen definitions:</p><pre> <span>&lt;useControls filename=&quot;nifty-default-controls.xml&quot; /&gt;</span>
<span>&lt;useStyles filename=&quot;nifty-default-styles.xml&quot; /&gt;</span></pre></div><h4><a>Label Control</a></h4><div><p>Use label controls for text that you want to edit dynamically from Java. One example for this is the score display. In the <code>hud</code> screen&#039;s <code>foreground</code> layer, add the following text element:</p><pre> <span>&lt;panel id=&quot;panel_top_right&quot; height=&quot;100%&quot; width=&quot;15%&quot; childLayout=&quot;center&quot;&gt;</span>
<span>&lt;control name=&quot;label&quot; color=&quot;#000&quot; text=&quot;123&quot; width=&quot;100%&quot; height=&quot;100%&quot; /&gt;</span>
<span><span>&lt;/panel&gt;</span></span></pre>
<p>
Note that the width and height do not scale the bitmap font, but the make indirectly certain it is centered. If you want a different size for the font, you need to provide an extra bitmap font (they come with fixes sizes and don&#039;t scale well).
</p>
</div>
<h4><a>Button Control</a></h4>
<div>
<p>
Our <acronym title="Graphical User Interface">GUI</acronym> plan asks for two buttons on the start screen. You add the Start and Quit buttons to the bottom panel of the <code>start</code> screen using the <code>&lt;control&gt;</code> element:
</p>
<pre> <span>&lt;panel id=&quot;panel_bottom_left&quot; height=&quot;50%&quot; width=&quot;50%&quot; valign=&quot;center&quot; childLayout=&quot;center&quot;&gt;</span>
<span><span>&lt;/panel&gt;</span></span></pre><p>Note that the width and height do not scale the bitmap font, but the make indirectly certain it is centered. If you want a different size for the font, you need to provide an extra bitmap font (they come with fixes sizes and don&#039;t scale well).</p></div><h4><a>Button Control</a></h4><div><p>Our <acronym title="Graphical User Interface">GUI</acronym> plan asks for two buttons on the start screen. You add the Start and Quit buttons to the bottom panel of the <code>start</code> screen using the <code>&lt;control&gt;</code> element:</p><pre> <span>&lt;panel id=&quot;panel_bottom_left&quot; height=&quot;50%&quot; width=&quot;50%&quot; valign=&quot;center&quot; childLayout=&quot;center&quot;&gt;</span>
<span>&lt;control name=&quot;button&quot; label=&quot;Start&quot; id=&quot;StartButton&quot; align=&quot;center&quot; valign=&quot;center&quot;&gt;</span>
<span><span>&lt;/control&gt;</span></span>
<span><span>&lt;/panel&gt;</span></span>
<span>&lt;panel id=&quot;panel_bottom_right&quot; height=&quot;50%&quot; width=&quot;50%&quot; valign=&quot;center&quot; childLayout=&quot;center&quot;&gt;</span>
<span>&lt;control name=&quot;button&quot; label=&quot;Quit&quot; id=&quot;QuitButton&quot; align=&quot;center&quot; valign=&quot;center&quot;&gt;</span>
<span><span>&lt;/control&gt;</span></span>
<span><span>&lt;/panel&gt;</span></span></pre>
<p>
Note that these controls don&#039;t do anything yet – we&#039;ll get to that soon.
<span><span>&lt;/panel&gt;</span></span></pre><p>Note that these controls don&#039;t do anything yet – we&#039;ll get to that soon.
</p>
</div>

File diff suppressed because one or more lines are too long

@ -1,82 +1,6 @@
<h1><a>Particle Emmitter Settings</a></h1>
<div>
<p>
You cannot create a 3D model for delicate things like fire, smoke, or explosions. Particle Emitters are quite an efficient solution to create these kinds of effects: The emitter renders a series of flat orthogonal images and manipulates them in a way that creates the illusion of a anything from a delicate smoke cloud to individual flames, etc.
Creating an effect involves some trial and error to get the settings <em>just right</em>, and it&#039;s worth exploring the expressiveness of the options described below.
</p>
<p>
<p><div>Use the <a href="/com/jme3/gde/core/docs/sdk/scene_explorer.html">Scene Explorer</a> in the <a href="/com/jme3/gde/core/docs/sdk.html">SDK</a> to design and preview effects.
</div></p>
</p>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/explosion-5.png"> <img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/particle.png"> <img src="nbdocs:/com/jme3/gde/core/docs/jme3/beginner/beginner-effect-fire.png"> <img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/butterfly-particle-emitter.png">
</p>
</div>
<h2><a>Create an Emitter</a></h2>
<div>
<ol>
<li><div> Create one emitter for each effect: <pre>ParticleEmitter explosion = new ParticleEmitter&#40;
&quot;My explosion effect&quot;, ParticleMesh.Type.Triangle, 30&#41;;</pre>
</div>
</li>
<li><div> Attach the emitter to the rootNode and position it in the scene: <pre>rootNode.attachChild&#40;explosion&#41;;
explosion.setLocalTranslation&#40;bomb.getLocalTranslation&#40;&#41;&#41;;</pre>
</div>
</li>
<li><div> Trigger the effect by calling <pre>explosion.emitAllParticles&#40;&#41;</pre>
</div>
</li>
<li><div> End the effect by calling <pre>explosion.killAllParticles&#40;&#41;</pre>
</div>
</li>
</ol>
<p>
Choose one of the following mesh shapes
</p>
<ul>
<li><div> ParticleMesh.Type.Triangle</div>
</li>
<li><div> ParticleMesh.Type.Point</div>
</li>
</ul>
</div>
<h2><a>Configure Parameters</a></h2>
<div>
<p>
Not all of these parameters are required for all kinds of effects. If you don&#039;t specify one of them, a default value will be used.
</p>
<div><table>
<tr>
<th> Parameter </th><th> Method </th><th> Default </th><th> Description </th>
</tr>
<tr>
<td> number </td><td> <code>setNumParticles()</code> </td><td> </td><td> The maximum number of particles visible at the same time. Specified by user in constructor. </td>
</tr>
<tr>
<td> emission rate </td><td> <code>setParticlesPerSec()</code> </td><td> 20 </td><td> Density of the effect, how many new particles are emitted per second. <br/>
Set to zero to control the start/end of the effect. <br/>
Set to a number for a constantly running effect. </td>
</tr>
<tr>
<td> size </td><td> <code>setStartSize()</code>, <code>setEndSize()</code> </td><td> 0.2f, 2f </td><td> The radius of the scaled sprite image. Set both to same value for constant size effect. <br/>
Set to different values for shrink/grow effect. </td>
</tr>
<tr>
<td> color </td><td> <code>setStartColor()</code>, <code>setEndColor()</code> </td><td> gray </td><td> Controls how the opaque (non-black) parts of the texture are colorized. <br/>
Set both to the same color for single-colored effects (e.g. fog, debris). <br/>
Set both to different colors for a gradient effect (e.g. fire). </td>
</tr>
<h1><a>Particle Emmitter Settings</a></h1><div><p>You cannot create a 3D model for delicate things like fire, smoke, or explosions. Particle Emitters are quite an efficient solution to create these kinds of effects: The emitter renders a series of flat orthogonal images and manipulates them in a way that creates the illusion of a anything from a delicate smoke cloud to individual flames, etc. Creating an effect involves some trial and error to get the settings <em>just right</em>, and it&#039;s worth exploring the expressiveness of the options described below.</p><p><p><div>Use the <a href="/com/jme3/gde/core/docs/sdk/scene_explorer.html">Scene Explorer</a> in the <a href="/com/jme3/gde/core/docs/sdk.html">SDK</a> to design and preview effects.</div></p></p><p><img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/explosion-5.png"> <img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/particle.png"> <img src="nbdocs:/com/jme3/gde/core/docs/jme3/beginner/beginner-effect-fire.png"> <img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/butterfly-particle-emitter.png"></p></div><h2><a>Create an Emitter</a></h2><div><ol><li><div>Create one emitter for each effect:<pre>ParticleEmitter explosion = new ParticleEmitter&#40;
&quot;My explosion effect&quot;, ParticleMesh.Type.Triangle, 30&#41;;</pre></div></li><li><div>Attach the emitter to the rootNode and position it in the scene:<pre>rootNode.attachChild&#40;explosion&#41;;
explosion.setLocalTranslation&#40;bomb.getLocalTranslation&#40;&#41;&#41;;</pre></div></li><li><div>Trigger the effect by calling<pre>explosion.emitAllParticles&#40;&#41;</pre></div></li><li><div>End the effect by calling<pre>explosion.killAllParticles&#40;&#41;</pre></div></li></ol><p>Choose one of the following mesh shapes</p><ul><li><div>ParticleMesh.Type.Triangle</div></li><li><div>ParticleMesh.Type.Point</div></li></ul></div><h2><a>Configure Parameters</a></h2><div><p>Not all of these parameters are required for all kinds of effects. If you don&#039;t specify one of them, a default value will be used.</p><div><table><tr><th>Parameter</th><th>Method</th><th>Default</th><th>Description</th></tr><tr><td>number</td><td><code>setNumParticles()</code></td><td></td><td>The maximum number of particles visible at the same time. Specified by user in constructor.</td></tr><tr><td>emission rate</td><td><code>setParticlesPerSec()</code></td><td>20</td><td>Density of the effect, how many new particles are emitted per second. <br/> Set to zero to control the start/end of the effect. <br/> Set to a number for a constantly running effect.</td></tr><tr><td>size</td><td><code>setStartSize()</code>, <code>setEndSize()</code></td><td>0.2f, 2f</td><td>The radius of the scaled sprite image. Set both to same value for constant size effect. <br/> Set to different values for shrink/grow effect.</td></tr><tr><td>color</td><td><code>setStartColor()</code>, <code>setEndColor()</code></td><td>gray</td><td>Controls how the opaque (non-black) parts of the texture are colorized. <br/> Set both to the same color for single-colored effects (e.g. fog, debris). <br/> Set both to different colors for a gradient effect (e.g. fire).</td></tr>
<tr>
<td> direction/velocity </td><td> <code>getParticleInfluencer(). setInitialVelocity(initialVelocity)</code> </td><td> Vector3f(0,0,0) </td><td> A vector specifying the initial direction and speed of particles. The longer the vector, the faster. </td>
</tr>
@ -195,7 +119,7 @@ The following effect textures are available by default from <code>test-data.jar<
<td> Effects/Smoke/Smoke.png </td><td> 1*15 </td><td> <img src="/wiki/lib/exe/fetch.php"> </td>
</tr>
</table></div>
<!-- EDIT2 TABLE [7235-8512] -->
<!-- EDIT2 TABLE [7231-8476] -->
<p>
<strong>Tip:</strong> Use the <code>setStartColor()</code>/<code>setEndColor()</code> settings described above to colorize the white and gray parts of textures.

@ -1,166 +1,7 @@
<h1><a>Physics: Gravity, Collisions, Forces</a></h1>
<div>
<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.
</p>
<p>
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>
<h2><a>Technical Overview</a></h2>
<div>
<p>
Bullet physics runs internally at 60fps by default. This rate is not dependent on the actual framerate and it does not lock the framerate at 60fps. Instead, when the actual fps is higher than the physics framerate the system will display interpolated positions for the physics entities. When the framerate is lower than the physics framerate the physics space will be stepped multiple times per frame to make up for the missing calculations.
</p>
<p>
A bullet physics space can be created with a BulletAppState. The updating and syncing of the actual physics entities happens in the following way:
</p>
<p>
A &quot;normal&quot; update loop with physics looks like this:
</p>
<ol>
<li><div> collision callbacks (BulletAppState.update())</div>
</li>
<li><div> user update (simpleUpdate / update)</div>
</li>
<li><div> physics to scenegraph syncing/applying (updateLogicalState())</div>
</li>
<li><div> stepping physics (before / in parallel to Application.render())</div>
</li>
</ol>
<p>
When you use physics, 1 unit (1.0f) equals 1 meter, weight is expressed in kilograms, most torque and rotation values are expressed in radians.
</p>
</div>
<h2><a>Sample Code</a></h2>
<div>
<p>
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/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/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/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/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>
</div>
<h2><a>Physics Application</a></h2>
<div>
<p>
A short overview of how to write a jME application with Physics capabilities:
</p>
<p>
Do the following once per application to gain access to the <code>physicsSpace</code> object:
</p>
<ol>
<li><div> Make you application extend <code>com.jme3.app.SimpleApplication</code>.</div>
</li>
<li><div> Create a BulletAppState field: <pre>private BulletAppState bulletAppState;</pre>
</div>
</li>
<li><div> Initialize your bulletAppState and attach it to the state manager: <pre>public void simpleInitApp&#40;&#41; &#123;
<h1><a>Physics: Gravity, Collisions, Forces</a></h1><div><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.</p><p>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><h2><a>Technical Overview</a></h2><div><p>Bullet physics runs internally at 60fps by default. This rate is not dependent on the actual framerate and it does not lock the framerate at 60fps. Instead, when the actual fps is higher than the physics framerate the system will display interpolated positions for the physics entities. When the framerate is lower than the physics framerate the physics space will be stepped multiple times per frame to make up for the missing calculations.</p><p>A bullet physics space can be created with a BulletAppState. The updating and syncing of the actual physics entities happens in the following way:</p><p>A &quot;normal&quot; update loop with physics looks like this:</p><ol><li><div>collision callbacks (BulletAppState.update())</div></li><li><div>user update (simpleUpdate / update)</div></li><li><div>physics to scenegraph syncing/applying (updateLogicalState())</div></li><li><div>stepping physics (before / in parallel to Application.render())</div></li></ol><p>When you use physics, 1 unit (1.0f) equals 1 meter, weight is expressed in kilograms, most torque and rotation values are expressed in radians.</p></div><h2><a>Sample Code</a></h2><div><p>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/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/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/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/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></div><h2><a>Physics Application</a></h2><div><p>A short overview of how to write a jME application with Physics capabilities:</p><p>Do the following once per application to gain access to the <code>physicsSpace</code> object:</p><ol><li><div>Make you application extend <code>com.jme3.app.SimpleApplication</code>.</div></li><li><div>Create a BulletAppState field:<pre>private BulletAppState bulletAppState;</pre></div></li><li><div>Initialize your bulletAppState and attach it to the state manager:<pre>public void simpleInitApp&#40;&#41; &#123;
bulletAppState = new BulletAppState&#40;&#41;;
stateManager.attach&#40;bulletAppState&#41;;
...</pre>
</div>
</li>
</ol>
<p>
You can also access the BulletAppState via the state manager:
</p>
<pre>stateManager.getState&#40;BulletAppState.class&#41;</pre>
<p>
For each Spatial that you want to be physical:
</p>
<ol>
<li><div> Create a CollisionShape.</div>
</li>
<li><div> Create a PhysicsControl by supplying the CollisionShape and mass.</div>
<ul>
<li><div> E.g. <code>com.jme3.bullet.control.RigidBodyControl</code></div>
</li>
</ul>
</li>
<li><div> Add the PhysicsControl to the Spatial.</div>
</li>
<li><div> Add the PhysicsControl to the physicsSpace object.</div>
</li>
<li><div> Attach the Spatial to the rootNode, as usual.</div>
</li>
<li><div> (Optional) Implement the <code>PhysicsCollisionListener</code> interface to respond to <code>PhysicsCollisionEvent</code>s if desired.</div>
</li>
</ol>
</div>
<h3><a>Collision Shapes</a></h3>
<div>
<p>
A Collision Shape is a simplified shape for which physics are easier to calculate than for the true shape of the model. This simplication approach speeds up the simulation greatly.
</p>
<p>
Before you can create a Physics Control, you must create a Collision Shape from the <code>com.jme3.bullet.collision.shapes</code> package. (Read the tip under &quot;PhysicsControls Code Samples&quot; to learn how to use default CollisionShapes for Boxes and Spheres.)
</p>
<div><table>
<tr>
<th> Shape </th><th> Usage </th><th> Examples </th>
</tr>
<tr>
<td> BoxCollisionShape </td><td> Box shaped entities Does not roll.</td><td> Bricks, crates, simple oblong entities. </td>
</tr>
<tr>
<td> SphereCollisionShape </td><td> Spherical entities. Can roll. </td><td> Balls, simple compact entities. </td>
</tr>
<tr>
<td> CylinderCollisionShape </td><td> Tube-shaped and disc-shaped entities. Can roll on one side. </td><td> Pillars, wheels. </td>
</tr>
<tr>
<td> CapsuleCollisionShape </td><td> A compound of a cylinder plus two spheres at the top and bottom. Is locked to stay upright, does not roll. </td><td> Optimized for CharacterControls: A cylinder-shaped body does not get stuck at corners and vertical obstacles; the rounded top and bottom do not get stuck on stair steps and ground obstacles. </td>
</tr>
<tr>
<td> CompoundCollisionShape </td><td> A CompoundCollisionShape allows custom combinations of box/sphere/cylinder shapes to form another more complex shape. </td><td> Complex shapes. </td>
</tr>
<tr>
<td> MeshCollisionShape </td><td> A free-form mesh-accurate shape that wraps itself around a static entity. <br/>
<strong>Limitations:</strong> Only non-mesh collision shapes (sphere, box, cylinder, compound) can collide with mesh-accurate collision shapes. Only works for static obstacles. </td><td> A whole static game level model. </td>
</tr>
<tr>
<td> GImpactCollisionShape </td><td> This free-form Mesh Collision Shape that wraps itself around dynamically moving entities. Uses <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://gimpact.sourceforge.net/"><param name="text" value="<html><u>http://gimpact.sourceforge.net/</u></html>"><param name="textColor" value="blue"></object>. <br/>
...</pre></div></li></ol><p>You can also access the BulletAppState via the state manager:</p><pre>stateManager.getState&#40;BulletAppState.class&#41;</pre><p>For each Spatial that you want to be physical:</p><ol><li><div>Create a CollisionShape.</div></li><li><div>Create a PhysicsControl by supplying the CollisionShape and mass.</div><ul><li><div>E.g. <code>com.jme3.bullet.control.RigidBodyControl</code></div></li></ul></li><li><div>Add the PhysicsControl to the Spatial.</div></li><li><div>Add the PhysicsControl to the physicsSpace object.</div></li><li><div>Attach the Spatial to the rootNode, as usual.</div></li><li><div>(Optional) Implement the <code>PhysicsCollisionListener</code> interface to respond to <code>PhysicsCollisionEvent</code>s if desired.</div></li></ol></div><h3><a>Collision Shapes</a></h3><div><p>A Collision Shape is a simplified shape for which physics are easier to calculate than for the true shape of the model. This simplication approach speeds up the simulation greatly.</p><p>Before you can create a Physics Control, you must create a Collision Shape from the <code>com.jme3.bullet.collision.shapes</code> package. (Read the tip under &quot;PhysicsControls Code Samples&quot; to learn how to use default CollisionShapes for Boxes and Spheres.)</p><div><table><tr><th>Shape</th><th>Usage</th><th>Examples</th></tr><tr><td>BoxCollisionShape</td><td>Box shaped entities Does not roll.</td><td>Bricks, crates, simple oblong entities.</td></tr><tr><td>SphereCollisionShape</td><td>Spherical entities. Can roll.</td><td>Balls, simple compact entities.</td></tr><tr><td>CylinderCollisionShape</td><td>Tube-shaped and disc-shaped entities. Can roll on one side.</td><td>Pillars, wheels.</td></tr><tr><td>CapsuleCollisionShape</td><td>A compound of a cylinder plus two spheres at the top and bottom. Is locked to stay upright, does not roll.</td><td>Optimized for CharacterControls: A cylinder-shaped body does not get stuck at corners and vertical obstacles; the rounded top and bottom do not get stuck on stair steps and ground obstacles.</td></tr><tr><td>CompoundCollisionShape</td><td>A CompoundCollisionShape allows custom combinations of box/sphere/cylinder shapes to form another more complex shape.</td><td>Complex shapes.</td></tr><tr><td>MeshCollisionShape</td><td>A free-form mesh-accurate shape that wraps itself around a static entity. <br/> <strong>Limitations:</strong> Only non-mesh collision shapes (sphere, box, cylinder, compound) can collide with mesh-accurate collision shapes. Only works for static obstacles.</td><td>A whole static game level model.</td></tr><tr><td>GImpactCollisionShape</td><td>This free-form Mesh Collision Shape that wraps itself around dynamically moving entities. Uses <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://gimpact.sourceforge.net/"><param name="text" value="<html><u>http://gimpact.sourceforge.net/</u></html>"><param name="textColor" value="blue"></object>. <br/>
<strong>Limitations:</strong> CPU intensive, use sparingly! We recommend using HullCollisionShapes or CompoundShapes made of simple shapes if you need improved performance. </td><td> Physics simulation of a complex object. </td>
</tr>
<tr>
@ -430,8 +271,8 @@ setLocalRotation();</td><td>setPhysicsLocation(); <br/>
<tr>
<th> How to activate? </th><td>setMass(0f); <br/>
setKinematic(false); </td><td>setMass(1f); <br/>
setKinematic(false);</td><td>setMass(1f); <br/>
setKinematic(true);</td>
setKinematic(true);</td><td>setMass(1f); <br/>
setKinematic(false);</td>
</tr>
</table></div>
<!-- EDIT5 TABLE [14499-15521] -->

@ -1,79 +1,12 @@
<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.
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.
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
<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. 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. 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 &quot;Balls rolling, bricks falling&quot; you do not need a listener.
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:
&#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 &quot;Balls rolling, bricks falling&quot; you do not need a listener. 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>

@ -1,34 +1,4 @@
<h1><a>Remote-Controlling the Camera</a></h1>
<div>
</div>
<h2><a>Positioning the Camera</a></h2>
<div>
<p>
You can steer the camera using <a href="/com/jme3/gde/core/docs/jme3/advanced/cinematics.html">Cinematics</a>:
</p>
<ol>
<li><div> Create a Cinematic.</div>
</li>
<li><div> Create a CameraNode and bind the camera object to the Cinematic. Note that we also give the camera node a name in this step. <pre>CameraNode camNode = cinematic.bindCamera&#40;&quot;topView&quot;, cam&#41;;</pre>
</div>
</li>
<li><div> Position the camera node in its start location.</div>
</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 &quot;topView&quot;, 6 seconds after the start of the cinematic, you&#039;d write <pre>cinematic.activateCamera&#40;6, &quot;topView&quot;&#41;;</pre>
</div>
</li>
</ol>
</div>
<h3><a>Code Sample</a></h3>
<div>
<pre>flyCam.setEnabled&#40;false&#41;;
<h1><a>Remote-Controlling the Camera</a></h1><div></div><h2><a>Positioning the Camera</a></h2><div><p>You can steer the camera using <a href="/com/jme3/gde/core/docs/jme3/advanced/cinematics.html">Cinematics</a>:</p><ol><li><div>Create a Cinematic.</div></li><li><div>Create a CameraNode and bind the camera object to the Cinematic. Note that we also give the camera node a name in this step.<pre>CameraNode camNode = cinematic.bindCamera&#40;&quot;topView&quot;, cam&#41;;</pre></div></li><li><div>Position the camera node in its start location.</div></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 &quot;topView&quot;, 6 seconds after the start of the cinematic, you&#039;d write<pre>cinematic.activateCamera&#40;6, &quot;topView&quot;&#41;;</pre></div></li></ol></div><h3><a>Code Sample</a></h3><div><pre>flyCam.setEnabled&#40;false&#41;;
Cinematic cinematic = new Cinematic&#40;rootNode, 20&#41;;
&nbsp;
CameraNode camNodeTop = cinematic.bindCamera&#40;&quot;topView&quot;, cam&#41;;
@ -37,17 +7,5 @@ camNodeTop.getControl&#40;0&#41;.setEnabled&#40;false&#41;;
&nbsp;
CameraNode camNodeSide = cinematic.bindCamera&#40;&quot;sideView&quot;, cam&#41;;
camNodeSide.setControlDir&#40;ControlDirection.CameraToSpatial&#41;;
camNodeSide.getControl&#40;0&#41;.setEnabled&#40;false&#41;;</pre>
</div>
<h2><a>Moving the Camera</a></h2>
<div>
<p>
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>.
</p>
</div>
camNodeSide.getControl&#40;0&#41;.setEnabled&#40;false&#41;;</pre></div><h2><a>Moving the Camera</a></h2><div><p>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>.</p></div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:remote-controlling_the_camera?do=export_xhtmlbody">view online version</a></em></p>

@ -1,26 +1,4 @@
<h1><a>Saving and Loading Games</a></h1>
<div>
<p>
You can save and load scenes and individual Nodes using com.jme3.export.binary.BinaryExporter and com.jme3.export.binary.BinaryImporter. Use standard Java serialization to load game data or use the Savable interface. The jMonkeyEngine binary file format is .j3o. You can open, view, and edit .j3o files in the jMonkeyEngine <a href="/com/jme3/gde/core/docs/jme3/advanced/sdk.html">SDK</a>.
</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/tools/TestSaveGame.java"><param name="text" value="<html><u>TestSaveGame.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>
</div>
<h2><a>Saving a Node</a></h2>
<div>
<pre> @Override
<h1><a>Saving and Loading Games</a></h1><div><p>You can save and load scenes and individual Nodes using com.jme3.export.binary.BinaryExporter and com.jme3.export.binary.BinaryImporter. Use standard Java serialization to load game data or use the Savable interface. The jMonkeyEngine binary file format is .j3o. You can open, view, and edit .j3o files in the jMonkeyEngine <a href="/com/jme3/gde/core/docs/jme3/advanced/sdk.html">SDK</a>.</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/tools/TestSaveGame.java"><param name="text" value="<html><u>TestSaveGame.java</u></html>"><param name="textColor" value="blue"></object></div></li></ul></div><h2><a>Saving a Node</a></h2><div><pre> @Override
public void destroy&#40;&#41; &#123;
System.getProperty&#40;&quot;user.home&quot;&#41;;
BinaryExporter exporter = BinaryExporter.getInstance&#40;&#41;;
@ -31,13 +9,7 @@ You can save and load scenes and individual Nodes using com.jme3.export.binary.B
Logger.getLogger&#40;Main.class.getName&#40;&#41;&#41;.log&#40;Level.SEVERE, &quot;Failed to save node!&quot;, ex&#41;;
&#125;
super.destroy&#40;&#41;;
&#125;</pre>
</div>
<h2><a>Loading a Node</a></h2>
<div>
<pre> @Override
&#125;</pre></div><h2><a>Loading a Node</a></h2><div><pre> @Override
public void simpleInitApp&#40;&#41; &#123;
System.getProperty&#40;&quot;user.home&quot;&#41;;
BinaryImporter importer = BinaryImporter.getInstance&#40;&#41;;
@ -51,18 +23,7 @@ You can save and load scenes and individual Nodes using com.jme3.export.binary.B
Logger.getLogger&#40;Main.class.getName&#40;&#41;&#41;.log&#40;Level.SEVERE, &quot;No saved node loaded.&quot;, ex&#41;;
&#125;
...
&nbsp;</pre>
</div>
<h2><a>Custom Savable</a></h2>
<div>
<p>
If you have a custom class that you want to save or assign using <code>setUserData()</code>, the class must implement the <code>com.jme3.export.Savable</code> interface.
</p>
<pre>import com.jme3.export.InputCapsule;
&nbsp;</pre></div><h2><a>Custom Savable</a></h2><div><p>If you have a custom class that you want to save or assign using <code>setUserData()</code>, the class must implement the <code>com.jme3.export.Savable</code> interface.</p><pre>import com.jme3.export.InputCapsule;
import com.jme3.export.JmeExporter;
import com.jme3.export.JmeImporter;
import com.jme3.export.OutputCapsule;

@ -1,95 +1,5 @@
<h1><a>How to add a Sky to your Scene</a></h1>
<div>
<p>
<br/>
</p>
<p>
Here is an example for how you add a static horizon (a background landscape and a sky) to a scene.
Having a discernable horizon with a suitable landscape (or space, or ocean, or whatever) in the background makes scenes look more realistic than just a single-colored &quot;sky&quot; background.
</p>
</div>
<h2><a>Adding the Sky</a></h2>
<div>
<p>
Adding a sky is extremely easy using the <code>com.jme3.util.SkyFactory</code>.
</p>
<pre>rootNode.attachChild&#40;SkyFactory.createSky&#40;
assetManager, &quot;Textures/Sky/Bright/BrightSky.dds&quot;, false&#41;&#41;;</pre>
<p>
To add a sky you need to supply:
</p>
<ol>
<li><div> The assetManager object to use</div>
</li>
<li><div> A cube or sphere map texture of the sky</div>
</li>
<li><div> Set the boolean to true if you are using a sphere map texture. For a cube map, use false. <br/>
Tip: Cube map is the default. You would know if you had created a sphere map.</div>
</li>
</ol>
<p>
Internally, the SkyFactory calls the following methods:
</p>
<ol>
<li><div> <code>sky.setQueueBucket(Bucket.Sky);</code> makes certain the sky is rendered in the right order, behind everything else.</div>
</li>
<li><div> <code>sky.setCullHint(Spatial.CullHint.Never);</code> makes certain that the sky is never culled.</div>
</li>
<li><div> The SkyFactory uses the internal jME3 material definition <code>Sky.j3md</code>. This Material definition works with sphere and cube maps. </div>
</li>
</ol>
</div>
<h2><a>Creating the Textures</a></h2>
<div>
<p>
As the sky texture we use the sample BrightSky.dds file from jme3test-test-data.
</p>
<p>
How to create a sky textures?
</p>
<ul>
<li><div> There are many tools out there that generate cube and sphere maps. <br/>
Examples for landscape texture generators are Terragen or Bryce.</div>
</li>
<li><div> The actual texture size does not matter, as long as you add the Sky Geometry to the Sky bucket: Everything in the sky bucket will always be infinitely far away behind everything else, and never intersect with your scene. <br/>
Of course the higher the resolution, the better it will look. On the other hand, if the graphic is too big, it will slow the game down. </div>
</li>
<li><div> A box or sphere map is the simplest solution. But you can use any Node as sky, even complex sets of geometries and quads with animated clouds, blinking stars, city skylines, etc.</div>
</li>
<li><div> JME3 supports cube maps in <acronym title="Portable Network Graphics">PNG</acronym>, <acronym title="Joint Photographics Experts Group">JPG</acronym>, or (compressed) DDS format.</div>
</li>
</ul>
<p>
Box or Sphere?
</p>
<ul>
<li><div> If you have access to cube map textures, then use a SkyBox</div>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://1.bp.blogspot.com/_uVsWqMqIGQU/SN0IZEE117I/AAAAAAAAAPs/4lfHx1Erdqg/s1600/skybox"><param name="text" value="<html><u>SkyBox examples</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>
</li>
<li><div> If you have access to sphere map textures – specially projected sky images that fit inside a sphere – then you use a SkySphere or SkyDome. </div>
<h1><a>How to add a Sky to your Scene</a></h1><div><p><br/></p><p>Here is an example for how you add a static horizon (a background landscape and a sky) to a scene. Having a discernable horizon with a suitable landscape (or space, or ocean, or whatever) in the background makes scenes look more realistic than just a single-colored &quot;sky&quot; background.</p></div><h2><a>Adding the Sky</a></h2><div><p>Adding a sky is extremely easy using the <code>com.jme3.util.SkyFactory</code>.</p><pre>rootNode.attachChild&#40;SkyFactory.createSky&#40;
assetManager, &quot;Textures/Sky/Bright/BrightSky.dds&quot;, false&#41;&#41;;</pre><p>To add a sky you need to supply:</p><ol><li><div>The assetManager object to use</div></li><li><div>A cube or sphere map texture of the sky</div></li><li><div>Set the boolean to true if you are using a sphere map texture. For a cube map, use false. <br/> Tip: Cube map is the default. You would know if you had created a sphere map.</div></li></ol><p>Internally, the SkyFactory calls the following methods:</p><ol><li><div><code>sky.setQueueBucket(Bucket.Sky);</code> makes certain the sky is rendered in the right order, behind everything else.</div></li><li><div><code>sky.setCullHint(Spatial.CullHint.Never);</code> makes certain that the sky is never culled.</div></li><li><div>The SkyFactory uses the internal jME3 material definition <code>Sky.j3md</code>. This Material definition works with sphere and cube maps.</div></li></ol></div><h2><a>Creating the Textures</a></h2><div><p>As the sky texture we use the sample BrightSky.dds file from jme3test-test-data.</p><p>How to create a sky textures?</p><ul><li><div>There are many tools out there that generate cube and sphere maps. <br/> Examples for landscape texture generators are Terragen or Bryce.</div></li><li><div>The actual texture size does not matter, as long as you add the Sky Geometry to the Sky bucket: Everything in the sky bucket will always be infinitely far away behind everything else, and never intersect with your scene. <br/> Of course the higher the resolution, the better it will look. On the other hand, if the graphic is too big, it will slow the game down.</div></li><li><div>A box or sphere map is the simplest solution. But you can use any Node as sky, even complex sets of geometries and quads with animated clouds, blinking stars, city skylines, etc.</div></li><li><div>JME3 supports cube maps in <acronym title="Portable Network Graphics">PNG</acronym>, <acronym title="Joint Photographics Experts Group">JPG</acronym>, or (compressed) DDS format.</div></li></ul><p>Box or Sphere?</p><ul><li><div>If you have access to cube map textures, then use a SkyBox</div><ul><li><div><object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://1.bp.blogspot.com/_uVsWqMqIGQU/SN0IZEE117I/AAAAAAAAAPs/4lfHx1Erdqg/s1600/skybox"><param name="text" value="<html><u>SkyBox examples</u></html>"><param name="textColor" value="blue"></object></div></li></ul></li><li><div>If you have access to sphere map textures – specially projected sky images that fit inside a sphere – then you use a SkySphere or SkyDome. </div>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://wiki.delphigl.com/index.php/Datei:Skysphere.jpg"><param name="text" value="<html><u>SkySphere example</u></html>"><param name="textColor" value="blue"></object></div>
</li>

@ -1,39 +1,4 @@
<h1><a>Spatial</a></h1>
<div>
<p>
This is an introduction to the concept of Spatials, the elements of the 3D scene graph. The scene graph is a data structure that manages all objects in your 3D world. For example, the scene graph keeps track of the 3D models that you load and position. When you extend a Java class from com.jme3.app.SimpleApplication, you automatically inherit the scene graph and its rootNode.
</p>
<p>
The rootNode is the central element of the scene graph. Even if the scenegraph is empty, it always has at least its rootNode. All other Spatials are <em>attached</em> to the rootNode in a parent-child relationship. If you think you need to understand the scene graph concept better, please read <a href="/com/jme3/gde/core/docs/jme3/scenegraph_for_dummies.html">Scenegraph for dummies</a> first.
</p>
</div>
<h2><a>Node versus Geometry</a></h2>
<div>
<p>
In your Java code, a Spatial is either a com.jme3.scene.Node or a com.jme3.scene.Geometry. You use the two for different purposes:
</p>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/intermediate/scene-graph.png">
</p>
<div><table>
<tr>
<td> </td><th>com.jme3.scene.Spatial </th>
</tr>
<tr>
<th> Purpose: </th><td> A Spatial is an abstract data structure that stores transformations (translation, rotation, scale) of elements of the scene graph. Spatials can be saved and loaded using the AssetManager. </td>
</tr>
<tr>
<td> </td><th> com.jme3.scene.Geometry </th><th> com.jme3.scene.Node </th>
<h1><a>Spatial</a></h1><div><p>This is an introduction to the concept of Spatials, the elements of the 3D scene graph. The scene graph is a data structure that manages all objects in your 3D world. For example, the scene graph keeps track of the 3D models that you load and position. When you extend a Java class from com.jme3.app.SimpleApplication, you automatically inherit the scene graph and its rootNode.</p><p>The rootNode is the central element of the scene graph. Even if the scenegraph is empty, it always has at least its rootNode. All other Spatials are <em>attached</em> to the rootNode in a parent-child relationship. If you think you need to understand the scene graph concept better, please read <a href="/com/jme3/gde/core/docs/jme3/scenegraph_for_dummies.html">Scenegraph for dummies</a> first.</p></div><h2><a>Node versus Geometry</a></h2><div><p>In your Java code, a Spatial is either a com.jme3.scene.Node or a com.jme3.scene.Geometry. You use the two for different purposes:</p><p><img src="nbdocs:/com/jme3/gde/core/docs/jme3/intermediate/scene-graph.png"></p><div><table><tr><td></td><th>com.jme3.scene.Spatial</th></tr><tr><th>Purpose:</th><td>A Spatial is an abstract data structure that stores transformations (translation, rotation, scale) of elements of the scene graph. Spatials can be saved and loaded using the AssetManager.</td></tr><tr><td></td><th>com.jme3.scene.Geometry</th><th>com.jme3.scene.Node </th>
</tr>
<tr>
<th> Visibility: </th><td> A Geometry represents a visible 3-D object in the scene graph. </td><td> A Node is an invisible &quot;handle&quot; for a group of objects in the scene graph. </td>

File diff suppressed because one or more lines are too long

@ -1,17 +1,4 @@
<h2><a>Terrain Collision</a></h2>
<div>
<p>
This tutorial expands the HelloTerrain tutorial and makes the terrain solid. You combine what you learned in <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_terrain.html">Hello Terrain</a> and <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_collision.html">Hello Collision</a> and add a CollisionShape to the terrain. The terrain&#039;s CollisionShape lets the first-person player (who is also a CollisionShape) collide with the terrain, i.e. walk on it and stand on it.
</p>
</div>
<h2><a>Sample Code</a></h2>
<div>
<pre>package jme3test.helloworld;
<h2><a>Terrain Collision</a></h2><div><p>This tutorial expands the HelloTerrain tutorial and makes the terrain solid. You combine what you learned in <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_terrain.html">Hello Terrain</a> and <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_collision.html">Hello Collision</a> and add a CollisionShape to the terrain. The terrain&#039;s CollisionShape lets the first-person player (who is also a CollisionShape) collide with the terrain, i.e. walk on it and stand on it.</p></div><h2><a>Sample Code</a></h2><div><pre>package jme3test.helloworld;
&nbsp;
import com.jme3.app.SimpleApplication;
import com.jme3.bullet.BulletAppState;

@ -1,112 +1,5 @@
<h1><a>Controlling a Physical Vehicle</a></h1>
<div>
<p>
For physical vehicles, jME&#039;s uses the jBullet ray-cast vehicle. In this vehicle implementation, the physical chassis &#039;floats&#039; along on four non-physical vertical rays.
</p>
<p>
Internally, each wheel casts a ray down, and using the ray&#039;s intersection point, jBullet calculates the suspension length, and the suspension force. The suspension force is applied to the chassis, keeping it from hitting the ground. The friction force is calculated for each wheel where the ray intersects with the ground. Friction is applied as a sideways and forwards force. <sup><a href="#fn__1">1)</a></sup>
</p>
<p>
This article shows how you use this vehicle implementation in a jME3 application.
</p>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/physics-vehicle.png">
</p>
</div>
<h2><a>Sample Code</a></h2>
<div>
<p>
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/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/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>
</div>
<h2><a>Overview of this Physics Application</a></h2>
<div>
<p>
The goal is to create a physical vehicle with wheels that can be steered and that interacts (collides with) with the floor and obstacles.
</p>
<ol>
<li><div> Create a SimpleApplication with a <a href="/com/jme3/gde/core/docs/jme3/advanced/physics.html">BulletAppState</a> </div>
<ul>
<li><div> This gives us a PhysicsSpace for PhysicsNodes</div>
</li>
</ul>
</li>
<li><div> Create a VehicleControl + CompoundCollisionShape for the physical vehicle behaviour</div>
<ol>
<li><div> Set physical properties of the vehicle, such as suspension.</div>
</li>
</ol>
</li>
<li><div> Create a VehicleNode for the car model</div>
<ol>
<li><div> Create a box plus 4 cylinders as wheels (using <code>vehicle.addWheel()</code>).</div>
</li>
<li><div> Add the VehicleControl behaviour to the VehicleNode geometry.</div>
</li>
</ol>
</li>
<li><div> Create a RigidBodyControl and CollisionShape for the floor</div>
</li>
<li><div> Map key triggers and add input listeners</div>
<ul>
<li><div> Navigational commands Left, Right, Foward, Brake.</div>
</li>
</ul>
</li>
<li><div> Define the steering actions to be triggered by the key events.</div>
<ul>
<li><div> <code>vehicle.steer()</code></div>
</li>
<li><div> <code>vehicle.accelerate()</code></div>
</li>
<li><div> <code>vehicle.brake()</code></div>
</li>
</ul>
</li>
</ol>
</div>
<h2><a>Creating the Vehicle Chassis</a></h2>
<div>
<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/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 &quot;box on wheels&quot;, 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>
Every physical object must have a collision shape, that we prepare first. For the vehicle, we choose a compound collision shape that is made up of a box-shaped body of the right size for the vehicle. We will add the wheels later.
</p>
<pre>CompoundCollisionShape compoundShape = new CompoundCollisionShape&#40;&#41;;
BoxCollisionShape box = new BoxCollisionShape&#40;new Vector3f&#40;1.2f, 0.5f, 2.4f&#41;&#41;;</pre>
<p>
<strong>Best Practice:</strong> We attach the BoxCollisionShape (the vehicle body) to the CompoundCollisionShape at a Vector of (0,1,0): This shifts the effective center of mass of the BoxCollisionShape downwards to 0,-1,0 and makes a moving vehicle more stable!
</p>
<pre>compoundShape.addChildShape&#40;box, new Vector3f&#40;0, 1, 0&#41;&#41;;</pre>
<h1><a>Controlling a Physical Vehicle</a></h1><div><p>For physical vehicles, jME&#039;s uses the jBullet ray-cast vehicle. In this vehicle implementation, the physical chassis &#039;floats&#039; along on four non-physical vertical rays.</p><p>Internally, each wheel casts a ray down, and using the ray&#039;s intersection point, jBullet calculates the suspension length, and the suspension force. The suspension force is applied to the chassis, keeping it from hitting the ground. The friction force is calculated for each wheel where the ray intersects with the ground. Friction is applied as a sideways and forwards force. <sup><a href="#fn__1">1)</a></sup></p><p>This article shows how you use this vehicle implementation in a jME3 application.</p><p><img src="nbdocs:/com/jme3/gde/core/docs/jme3/advanced/physics-vehicle.png"></p></div><h2><a>Sample Code</a></h2><div><p>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/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/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></div><h2><a>Overview of this Physics Application</a></h2><div><p>The goal is to create a physical vehicle with wheels that can be steered and that interacts (collides with) with the floor and obstacles.</p><ol><li><div>Create a SimpleApplication with a <a href="/com/jme3/gde/core/docs/jme3/advanced/physics.html">BulletAppState</a></div><ul><li><div>This gives us a PhysicsSpace for PhysicsNodes</div></li></ul></li><li><div>Create a VehicleControl + CompoundCollisionShape for the physical vehicle behaviour</div><ol><li><div>Set physical properties of the vehicle, such as suspension.</div></li></ol></li><li><div>Create a VehicleNode for the car model</div><ol><li><div>Create a box plus 4 cylinders as wheels (using <code>vehicle.addWheel()</code>).</div></li><li><div>Add the VehicleControl behaviour to the VehicleNode geometry.</div></li></ol></li><li><div>Create a RigidBodyControl and CollisionShape for the floor</div></li><li><div>Map key triggers and add input listeners</div><ul><li><div>Navigational commands Left, Right, Foward, Brake.</div></li></ul></li><li><div>Define the steering actions to be triggered by the key events.</div><ul><li><div><code>vehicle.steer()</code></div></li><li><div><code>vehicle.accelerate()</code></div></li><li><div><code>vehicle.brake()</code></div></li></ul></li></ol></div><h2><a>Creating the Vehicle Chassis</a></h2><div><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/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 &quot;box on wheels&quot;, 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>Every physical object must have a collision shape, that we prepare first. For the vehicle, we choose a compound collision shape that is made up of a box-shaped body of the right size for the vehicle. We will add the wheels later.</p><pre>CompoundCollisionShape compoundShape = new CompoundCollisionShape&#40;&#41;;
BoxCollisionShape box = new BoxCollisionShape&#40;new Vector3f&#40;1.2f, 0.5f, 2.4f&#41;&#41;;</pre><p><strong>Best Practice:</strong> We attach the BoxCollisionShape (the vehicle body) to the CompoundCollisionShape at a Vector of (0,1,0): This shifts the effective center of mass of the BoxCollisionShape downwards to 0,-1,0 and makes a moving vehicle more stable!</p><pre>compoundShape.addChildShape&#40;box, new Vector3f&#40;0, 1, 0&#41;&#41;;</pre>
<p>
Any kind of geometry can make up the visible part of the vehicle, here we use a wireframe box. We create a node that we use to group the geometry.

@ -1,56 +1,4 @@
<h1><a>Walking Character</a></h1>
<div>
<p>
In the <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_collision.html">Hello Collision</a> tutorial and 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/TestQ3.java"><param name="text" value="<html><u>TestQ3.java</u></html>"><param name="textColor" value="blue"></object> code sample you have seen how to create collidable landscapes and walk around in a first-person perspective. The first-person camera is enclosed by a collision shape and is steered by a CharacterControl.
</p>
<p>
Other games however require a third-person perspective of the character: In these cases you use a CharacterControl on a Spatial. This example also shows how to set up custom navigation constrols, so you can press WASD to make the third-person character walk, and drag the mouse to rotate.
</p>
</div>
<h3><a>Why use CharacterControl instead of RigidBodyControl?</a></h3>
<div>
<p>
When you load a character model with a RigidBodyControl, and use forces to push it around, you do not get the desired effect: RigidBodyControl&#039;ed objects can tip over when pushed, and that is not what you expect of a walking character. jMonkeyEngine offers a special CharacterControl with a special walking methods to implement characters that walk upright.
</p>
</div>
<h3><a>Sample Code</a></h3>
<div>
<p>
The several related code samples 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/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/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/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>
<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/helloworld/HelloCollision.java"><param name="text" value="<html><u>HelloCollision.java</u></html>"><param name="textColor" value="blue"></object> (first-person view)</div>
</li>
</ul>
<p>
The code in this tutorial is a combination of these samples.
</p>
</div>
<h3><a>Code Skeleton</a></h3>
<div>
<pre>public class WalkingCharacterDemo extends SimpleApplication
<h1><a>Walking Character</a></h1><div><p>In the <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_collision.html">Hello Collision</a> tutorial and 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/TestQ3.java"><param name="text" value="<html><u>TestQ3.java</u></html>"><param name="textColor" value="blue"></object> code sample you have seen how to create collidable landscapes and walk around in a first-person perspective. The first-person camera is enclosed by a collision shape and is steered by a CharacterControl.</p><p>Other games however require a third-person perspective of the character: In these cases you use a CharacterControl on a Spatial. This example also shows how to set up custom navigation constrols, so you can press WASD to make the third-person character walk, and drag the mouse to rotate.</p></div><h3><a>Why use CharacterControl instead of RigidBodyControl?</a></h3><div><p>When you load a character model with a RigidBodyControl, and use forces to push it around, you do not get the desired effect: RigidBodyControl&#039;ed objects can tip over when pushed, and that is not what you expect of a walking character. jMonkeyEngine offers a special CharacterControl with a special walking methods to implement characters that walk upright.</p></div><h3><a>Sample Code</a></h3><div><p>The several related code samples 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/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/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/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><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/helloworld/HelloCollision.java"><param name="text" value="<html><u>HelloCollision.java</u></html>"><param name="textColor" value="blue"></object> (first-person view)</div></li></ul><p>The code in this tutorial is a combination of these samples.</p></div><h3><a>Code Skeleton</a></h3><div><pre>public class WalkingCharacterDemo extends SimpleApplication
implements ActionListener, AnimEventListener &#123;
public static void main&#40;String&#91;&#93; args&#41; &#123;
WalkingCharacterDemo app = new WalkingCharacterDemo&#40;&#41;;
@ -60,67 +8,18 @@ The code in this tutorial is a combination of these samples.
public void simpleUpdate&#40;float tpf&#41; &#123; &#125;
public void onAction&#40;String name, boolean isPressed, float tpf&#41; &#123; &#125;
public void onAnimCycleDone&#40;AnimControl control, AnimChannel channel, String animName&#41; &#123; &#125;
public void onAnimChange&#40;AnimControl control, AnimChannel channel, String animName&#41; &#123; &#125;</pre>
</div>
<h3><a>Overview</a></h3>
<div>
<ol>
<li><div> Activate physics by adding a <a href="/com/jme3/gde/core/docs/jme3/advanced/physics.html">BulletAppState</a>.</div>
</li>
<li><div> Init the scene by loading a game level model (terrain or floor/buildings) and giving it a MeshCollisionShape.</div>
</li>
<li><div> Create the animated character</div>
<ol>
<li><div> Load an animated character model.</div>
</li>
<li><div> Add a CharacterControl to the model.</div>
</li>
</ol>
</li>
<li><div> Set up animation channel and controllers.</div>
</li>
<li><div> Add a ChaseCam or CameraNode.</div>
</li>
<li><div> Handle navigational inputs</div>
</li>
</ol>
</div>
<h2><a>Activate Physics</a></h2>
<div>
<pre>private BulletAppState bulletAppState;
public void onAnimChange&#40;AnimControl control, AnimChannel channel, Activate Physics</h2><div><pre>private BulletAppState bulletAppState;
...
public void simpleInitApp&#40;&#41; &#123;
bulletAppState = new BulletAppState&#40;&#41;;
//bulletAppState.setThreadingType(BulletAppState.ThreadingType.PARALLEL);
stateManager.attach&#40;bulletAppState&#41;;
...
&#125;</pre>
</div>
<h2><a>Initialize the Scene</a></h2>
<div>
<p>
In the simpleInitApp() method you initialize the scene and give it a MeshCollisionShape. The sample in the jme3 sources uses a custom helper class that simply creates a flat floor and drops some cubes and spheres on it:
</p>
<pre>public void simpleInitApp&#40;&#41; &#123;
&#125;</pre></div><h2><a>Initialize the Scene</a></h2><div><p>In the simpleInitApp() method you initialize the scene and give it a MeshCollisionShape. The sample in the jme3 sources uses a custom helper class that simply creates a flat floor and drops some cubes and spheres on it:</p><pre>public void simpleInitApp&#40;&#41; &#123;
...
PhysicsTestHelper.createPhysicsTestWorld&#40;rootNode,
assetManager, bulletAppState.getPhysicsSpace&#40;&#41;&#41;;
...</pre>
<p>
In a real game, you would load a scene model here instead of a test world. You can load a model from a local or remote zip file, and scale and position it:
</p>
<pre>private Node gameLevel;
...</pre><p>In a real game, you would load a scene model here instead of a test world. You can load a model from a local or remote zip file, and scale and position it:</p><pre>private Node gameLevel;
..
public void simpleInitApp&#40;&#41; &#123;
...
@ -136,40 +35,9 @@ public void simpleInitApp&#40;&#41; &#123;
gameLevel.addControl&#40;new RigidBodyControl&#40;0&#41;&#41;;
rootNode.attachChild&#40;gameLevel&#41;;
bulletAppState.getPhysicsSpace&#40;&#41;.addAll&#40;gameLevel&#41;;
...</pre>
<p>
Also, add a light source to be able to see the scene.
</p>
<pre> AmbientLight light = new AmbientLight&#40;&#41;;
...</pre><p>Also, add a light source to be able to see the scene.</p><pre> AmbientLight light = new AmbientLight&#40;&#41;;
light.setColor&#40;ColorRGBA.White.mult&#40;2&#41;&#41;;
rootNode.addLight&#40;light&#41;;</pre>
</div>
<h2><a>Create the Animated Character</a></h2>
<div>
<p>
You create an animated model, such as Oto.mesh.xml.
</p>
<ol>
<li><div> Place the &quot;Oto&quot; model into the <code>assets/Models/Oto/</code> directory of your project.</div>
</li>
<li><div> Create the CollisionShape and adjust the capsule radius and height to fit your character model.</div>
</li>
<li><div> Create the CharacterControl and adjust the stepheight (here 0.05f) to the height that the character can climb up without jumping.</div>
</li>
<li><div> Load the visible model. Make sure its start position does not overlap with scene objects.</div>
</li>
<li><div> Add the CharacterControl to the model and register it to the physicsSpace.</div>
</li>
<li><div> Attach the visible model to the rootNode.</div>
</li>
</ol>
<pre>private CharacterControl character;
rootNode.addLight&#40;light&#41;;</pre></div><h2><a>Create the Animated Character</a></h2><div><p>You create an animated model, such as Oto.mesh.xml.</p><ol><li><div>Place the &quot;Oto&quot; model into the <code>assets/Models/Oto/</code> directory of your project.</div></li><li><div>Create the CollisionShape and adjust the capsule radius and height to fit your character model.</div></li><li><div>Create the CharacterControl and adjust the stepheight (here 0.05f) to the height that the character can climb up without jumping.</div></li><li><div>Load the visible model. Make sure its start position does not overlap with scene objects.</div></li><li><div>Add the CharacterControl to the model and register it to the physicsSpace.</div></li><li><div>Attach the visible model to the rootNode.</div></li></ol><pre>private CharacterControl character;
private Node model;
...
public void simpleInitApp&#40;&#41; &#123;
@ -181,26 +49,7 @@ public void simpleInitApp&#40;&#41; &#123;
model.addControl&#40;character&#41;;
bulletAppState.getPhysicsSpace&#40;&#41;.add&#40;character&#41;;
rootNode.attachChild&#40;model&#41;;
...</pre>
<p>
<br/>
<strong>Did you know?</strong> A CapsuleCollisionShape is a cylinder with rounded top and bottom. A capsule rotated upright is a good collision shape for a humanoid character since its roundedness reduces the risk of getting stuck on obstacles.
</p>
</div>
<h3><a>Set Up AnimControl and AnimChannels</a></h3>
<div>
<p>
Create several AnimChannels, one for each animation that can happen simultaneously. In this example, you create one channel for walking and one for attacking. (Because the character can attack with its arms and walk with the rest of the body at the same time.)
</p>
<pre>private AnimChannel animationChannel;
...</pre><p><br/> <strong>Did you know?</strong> A CapsuleCollisionShape is a cylinder with rounded top and bottom. A capsule rotated upright is a good collision shape for a humanoid character since its roundedness reduces the risk of getting stuck on obstacles.</p></div><h3><a>Set Up AnimControl and AnimChannels</a></h3><div><p>Create several AnimChannels, one for each animation that can happen simultaneously. In this example, you create one channel for walking and one for attacking. (Because the character can attack with its arms and walk with the rest of the body at the same time.)</p><pre>private AnimChannel animationChannel;
private AnimChannel attackChannel;
private AnimControl animationControl;
...
@ -213,36 +62,13 @@ public void simpleInitApp&#40;&#41; &#123;
attackChannel.addBone&#40;animationControl.getSkeleton&#40;&#41;.getBone&#40;&quot;uparm.right&quot;&#41;&#41;;
attackChannel.addBone&#40;animationControl.getSkeleton&#40;&#41;.getBone&#40;&quot;arm.right&quot;&#41;&#41;;
attackChannel.addBone&#40;animationControl.getSkeleton&#40;&#41;.getBone&#40;&quot;hand.right&quot;&#41;&#41;;
...</pre>
<p>
The attackChannel only controls one arm, while the walking channels controls the whole character.
</p>
</div>
<h2><a>Add ChaseCam / CameraNode</a></h2>
<div>
<pre>private ChaseCamera chaseCam;
...</pre><p>The attackChannel only controls one arm, while the walking channels controls the whole character.</p></div><h2><a>Add ChaseCam / CameraNode</a></h2><div><pre>private ChaseCamera chaseCam;
...
public void simpleInitApp&#40;&#41; &#123;
...
flyCam.setEnabled&#40;false&#41;;
chaseCam = new ChaseCamera&#40;cam, model, inputManager&#41;;
...</pre>
</div>
<h2><a>Handle navigational inputs</a></h2>
<div>
<p>
Configure custom key bindings for WASD keys that you will use to make the character walk.
</p>
<pre>private boolean left = false, right = false, up = false, down = false;
...</pre></div><h2><a>Handle navigational inputs</a></h2><div><p>Configure custom key bindings for WASD keys that you will use to make the character walk.</p><pre>private boolean left = false, right = false, up = false, down = false;
...
public void simpleInitApp&#40;&#41; &#123;
...
@ -256,14 +82,7 @@ public void simpleInitApp&#40;&#41; &#123;
inputManager.addListener&#40;this, &quot;CharForward&quot;, &quot;CharBackward&quot;&#41;;
inputManager.addListener&#40;this, &quot;CharJump&quot;, &quot;CharAttack&quot;&#41;;
...
&#125;</pre>
<p>
Respond to the key bindings by setting variables that track in which direction you will go. (No actual walking happens here yet)
</p>
<pre>@Override
&#125;</pre><p>Respond to the key bindings by setting variables that track in which direction you will go. (No actual walking happens here yet)</p><pre>@Override
public void onAction&#40;String binding, boolean value, float tpf&#41; &#123;
if &#40;binding.equals&#40;&quot;CharLeft&quot;&#41;&#41; &#123;
if &#40;value&#41; left = true;
@ -281,24 +100,10 @@ public void onAction&#40;String binding, boolean value, float tpf&#41; &#123;
character.jump&#40;&#41;;
if &#40;binding.equals&#40;&quot;CharAttack&quot;&#41;&#41;
attack&#40;&#41;;
&#125;</pre>
<p>
The player can attack and walk at the same time. Attack() is a custom method that triggers an attack animation in the arms. Here you should also add custom code to play an effect and sound, and to determine whether the hit was successful.
</p>
<pre>private void attack&#40;&#41; &#123;
&#125;</pre><p>The player can attack and walk at the same time. Attack() is a custom method that triggers an attack animation in the arms. Here you should also add custom code to play an effect and sound, and to determine whether the hit was successful.</p><pre>private void attack&#40;&#41; &#123;
attackChannel.setAnim&#40;&quot;Dodge&quot;, 0.1f&#41;;
attackChannel.setLoopMode&#40;LoopMode.DontLoop&#41;;
&#125;</pre>
<p>
The update loop looks at the directional variables and moves the character accordingly. Since it&#039;s a physical character, we use setWalkDirection(). The variable airTime tracks how long the character is off the ground (e.g. when jumping or falling) and adjusts the walk and stand animations acccordingly.
</p>
<pre>private Vector3f walkDirection = new Vector3f&#40;0,0,0&#41;;
&#125;</pre><p>The update loop looks at the directional variables and moves the character accordingly. Since it&#039;s a physical character, we use setWalkDirection(). The variable airTime tracks how long the character is off the ground (e.g. when jumping or falling) and adjusts the walk and stand animations acccordingly.</p><pre>private Vector3f walkDirection = new Vector3f&#40;0,0,0&#41;;
private float airTime = 0;
public void simpleUpdate&#40;float tpf&#41; &#123;
Vector3f camDir = cam.getDirection&#40;&#41;.clone&#40;&#41;.multLocal&#40;0.25f&#41;;
@ -330,26 +135,8 @@ public void simpleUpdate&#40;float tpf&#41; &#123;
&#125;
&#125;
character.setWalkDirection&#40;walkDirection&#41;;
&#125;</pre>
<p>
This method resets the walk animation.
</p>
<pre>public void onAnimCycleDone&#40;AnimControl control, AnimChannel channel, String animName&#41; &#123;
&#125;</pre><p>This method resets the walk animation.</p><pre>public void onAnimCycleDone&#40;AnimControl control, AnimChannel channel, String animName&#41; &#123;
if &#40;channel == attackChannel&#41; channel.setAnim&#40;&quot;stand&quot;&#41;;
&#125;
public void onAnimChange&#40;AnimControl control, AnimChannel channel, String animName&#41; &#123; &#125;</pre>
<div><span>
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>,
<a href="/wiki/doku.php/tag:physics?do=showtag&amp;tag=tag%3Aphysics">physics</a>,
<a href="/wiki/doku.php/tag:input?do=showtag&amp;tag=tag%3Ainput">input</a>,
<a href="/wiki/doku.php/tag:animation?do=showtag&amp;tag=tag%3Aanimation">animation</a>,
<a href="/wiki/doku.php/tag:character?do=showtag&amp;tag=tag%3Acharacter">character</a>,
<a href="/wiki/doku.php/tag:npc?do=showtag&amp;tag=tag%3Anpc">NPC</a>,
<a href="/wiki/doku.php/tag:collision?do=showtag&amp;tag=tag%3Acollision">collision</a>
</span></div>
</div>
public void onAnimChange&#40;AnimControl control, AnimChannel channel, collision </span></div></div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:walking_character?do=export_xhtmlbody">view online version</a></em></p>

@ -1,37 +1,4 @@
<h1><a>Simple Water</a></h1>
<div>
<p>
Here is some background info for JME3&#039;s basic water implementation:
</p>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.jmonkeyengine.com/forum/index.php?topic=14740.0"><param name="text" value="<html><u>http://www.jmonkeyengine.com/forum/index.php?topic=14740.0</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://www.bonzaisoftware.com/water_tut.html"><param name="text" value="<html><u>http://www.bonzaisoftware.com/water_tut.html</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://www.gametutorials.com/Articles/RealisticWater.pdf"><param name="text" value="<html><u>http://www.gametutorials.com/Articles/RealisticWater.pdf</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>
<p>
<img src="/wiki/lib/exe/fetch.php">
</p>
</div>
<h2><a>SimpleWaterProcessor</a></h2>
<div>
<p>
A JME3 scene with water can use a <code>com.jme3.water.SimpleWaterProcessor</code> (which implements the SceneProcessor interface).
</p>
<p>
To achieve a water effect, JME3 uses shaders and a special material, <code>Common/MatDefs/Water/SimpleWater.j3md</code>. The water surface is a quad, and we use normal map and dU/dV map texturing to simulate the waves.
<h1><a>Simple Water</a></h1><div><p>Here is some background info for JME3&#039;s basic water implementation:</p><ul><li><div><object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.jmonkeyengine.com/forum/index.php?topic=14740.0"><param name="text" value="<html><u>http://www.jmonkeyengine.com/forum/index.php?topic=14740.0</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://www.bonzaisoftware.com/water_tut.html"><param name="text" value="<html><u>http://www.bonzaisoftware.com/water_tut.html</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://www.gametutorials.com/Articles/RealisticWater.pdf"><param name="text" value="<html><u>http://www.gametutorials.com/Articles/RealisticWater.pdf</u></html>"><param name="textColor" value="blue"></object></div></li></ul><p><img src="/wiki/lib/exe/fetch.php"></p></div><h2><a>SimpleWaterProcessor</a></h2><div><p>A JME3 scene with water can use a <code>com.jme3.water.SimpleWaterProcessor</code> (which implements the SceneProcessor interface).</p><p>To achieve a water effect, JME3 uses shaders and a special material, <code>Common/MatDefs/Water/SimpleWater.j3md</code>. The water surface is a quad, and we use normal map and dU/dV map texturing to simulate the waves.
</p>
<ol>

@ -1,25 +1,4 @@
<h1><a>JME 3 Tutorial (7) - Hello Animation</a></h1>
<div>
<p>
Previous: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_material.html">Hello Material</a>,
Next: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_picking.html">Hello Picking</a>
</p>
<p>
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.
</p>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/beginner/beginner-animation.png">
</p>
</div>
<h2><a>Sample Code</a></h2>
<div>
<pre>package jme3test.helloworld;
<h1><a>JME 3 Tutorial (7) - Hello Animation</a></h1><div><p>Previous: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_material.html">Hello Material</a>, Next: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_picking.html">Hello Picking</a></p><p>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.</p><p><img src="nbdocs:/com/jme3/gde/core/docs/jme3/beginner/beginner-animation.png"></p></div><h2><a>Sample Code</a></h2><div><pre>package jme3test.helloworld;
&nbsp;
import com.jme3.animation.AnimChannel;
import com.jme3.animation.AnimControl;
@ -89,22 +68,7 @@ public class HelloAnimation extends SimpleApplication
&#125;
&#125;
&#125;;
&#125;</pre>
</div>
<h2><a>Creating and Loading Animated Models</a></h2>
<div>
<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/trunk/engine/src/test-data/Models/Oto/"><param name="text" value="<html><u>Oto Golem</u></html>"><param name="textColor" value="blue"></object>, and <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>
Loading an animated model is pretty straight-forward, just as you have learned in the previous chapters. Animated Ogre models come as a set of files: The model is in <code>Oto.mesh.xml</code>, and the animation details are in <code>Oto.skeleton.xml</code>, plus the usual files for materials and textures. Check that all files of the model are together in the same <code>Model</code> subdirectory.
</p>
<pre> public void simpleInitApp&#40;&#41; &#123;
&#125;</pre></div><h2><a>Creating and Loading Animated Models</a></h2><div><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/trunk/engine/test-data/Models/Oto/"><param name="text" value="<html><u>Oto Golem</u></html>"><param name="textColor" value="blue"></object>, and <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.googlecode.com/svn/trunk/engine/test-data/Models/Ninja/"><param name="text" value="<html><u>Ninja</u></html>"><param name="textColor" value="blue"></object>).</p><p>Loading an animated model is pretty straight-forward, just as you have learned in the previous chapters. Animated Ogre models come as a set of files: The model is in <code>Oto.mesh.xml</code>, and the animation details are in <code>Oto.skeleton.xml</code>, plus the usual files for materials and textures. Check that all files of the model are together in the same <code>Model</code> subdirectory.</p><pre> public void simpleInitApp&#40;&#41; &#123;
/* Displaying the model requires a light source */
DirectionalLight dl = new DirectionalLight&#40;&#41;;
dl.setDirection&#40;new Vector3f&#40;-0.1f, -1f, -1&#41;.normalizeLocal&#40;&#41;&#41;;
@ -114,30 +78,7 @@ Loading an animated model is pretty straight-forward, just as you have learned i
player.setLocalScale&#40;0.5f&#41;; // resize
rootNode.attachChild&#40;player&#41;;
...
&#125;</pre>
<p>
Don&#039;t forget to add a light source to make the material visible.
</p>
</div>
<h2><a>Animation Controler and Channel</a></h2>
<div>
<p>
After you load the animated model, you register it to the Animation Controller.
</p>
<ul>
<li><div> The controller object gives you access to the available animation sequences.</div>
</li>
<li><div> The controller can have several channels, each channel can run one animation sequence at a time.</div>
</li>
<li><div> To run several sequences, you create several channels, and set them each to their animation.</div>
</li>
</ul>
<pre> private AnimChannel channel;
&#125;</pre><p>Don&#039;t forget to add a light source to make the material visible.</p></div><h2><a>Animation Controler and Channel</a></h2><div><p>After you load the animated model, you register it to the Animation Controller.</p><ul><li><div>The controller object gives you access to the available animation sequences.</div></li><li><div>The controller can have several channels, each channel can run one animation sequence at a time.</div></li><li><div>To run several sequences, you create several channels, and set them each to their animation.</div></li></ul><pre> private AnimChannel channel;
private AnimControl control;
&nbsp;
public void simpleInitApp&#40;&#41; &#123;
@ -148,18 +89,7 @@ After you load the animated model, you register it to the Animation Controller.
control.addListener&#40;this&#41;;
channel = control.createChannel&#40;&#41;;
channel.setAnim&#40;&quot;stand&quot;&#41;;
...</pre>
</div>
<h2><a>Responding to Animation Events</a></h2>
<div>
<p>
Add <code>implements AnimEventListener</code> to the class declaration. This interface gives you access to events that notify you when a sequence is done, or when you change from one sequence to another, so you can respond to it. In this example, you reset the character to a standing position after a <code>Walk</code> cycle is done.
</p>
<pre>public class HelloAnimation extends SimpleApplication
...</pre></div><h2><a>Responding to Animation Events</a></h2><div><p>Add <code>implements AnimEventListener</code> to the class declaration. This interface gives you access to events that notify you when a sequence is done, or when you change from one sequence to another, so you can respond to it. In this example, you reset the character to a standing position after a <code>Walk</code> cycle is done.</p><pre>public class HelloAnimation extends SimpleApplication
implements AnimEventListener &#123;
...
&nbsp;
@ -173,54 +103,10 @@ Add <code>implements AnimEventListener</code> to the class declaration. This int
&#125;
public void onAnimChange&#40;AnimControl control, AnimChannel channel, String animName&#41; &#123;
// unused
&#125;</pre>
</div>
<h2><a>Trigger Animations After User Input</a></h2>
<div>
<p>
There are ambient animations like animals or trees that you may want to trigger in the main event loop. In other cases, animations are triggered by user interaction, such as key input. You want to play the Walk animation when the player presses a certain key (here the spacebar), at the same time as the avatar performs the walk action and changes its location.
</p>
<ol>
<li><div> Initialize a new input controller (in <code>simpleInitApp()</code>).</div>
<ul>
<li><div> Write the <code>initKey()</code> convenience method and call it from <code>simpleInitApp()</code>.</div>
</li>
</ul>
</li>
<li><div> Add a key mapping with the name as the action you want to trigger.</div>
<ul>
<li><div> Here for example, you map <code>Walk</code> to the Spacebar key.</div>
</li>
</ul>
</li>
<li><div> Add an input listener for the <code>Walk</code> action.</div>
</li>
</ol>
<pre> private void initKeys&#40;&#41; &#123;
&#125;</pre></div><h2><a>Trigger Animations After User Input</a></h2><div><p>There are ambient animations like animals or trees that you may want to trigger in the main event loop. In other cases, animations are triggered by user interaction, such as key input. You want to play the Walk animation when the player presses a certain key (here the spacebar), at the same time as the avatar performs the walk action and changes its location.</p><ol><li><div>Initialize a new input controller (in <code>simpleInitApp()</code>).</div><ul><li><div>Write the <code>initKey()</code> convenience method and call it from <code>simpleInitApp()</code>.</div></li></ul></li><li><div>Add a key mapping with the name as the action you want to trigger.</div><ul><li><div>Here for example, you map <code>Walk</code> to the Spacebar key.</div></li></ul></li><li><div>Add an input listener for the <code>Walk</code> action.</div></li></ol><pre> private void initKeys&#40;&#41; &#123;
inputManager.addMapping&#40;&quot;Walk&quot;, new KeyTrigger&#40;KeyInput.KEY_SPACE&#41;&#41;;
inputManager.addListener&#40;actionListener, &quot;Walk&quot;&#41;;
&#125;</pre>
<p>
To use the input controller, you need to implement the actionLister:
Test for each action by name, and set the channel to the corresponding animation to run.
</p>
<ul>
<li><div> The second parameter of setAnim() is the blendTime (how long the current animation should overlap with the last one).</div>
</li>
<li><div> LoopMode can be Loop (repeat), Cycle (forward then backward), and DontLoop (only once).</div>
</li>
<li><div> If needed, use channel.setSpeed() to set the speed of this animation.</div>
</li>
<li><div> Optionally, use channel.setTime() to Fast-forward or rewind to a certain moment in time of this animation.</div>
</li>
</ul>
<pre> private ActionListener&#40;&#41; &#123;
&#125;</pre><p>To use the input controller, you need to implement the actionLister: Test for each action by name, and set the channel to the corresponding animation to run.</p><ul><li><div>The second parameter of setAnim() is the blendTime (how long the current animation should overlap with the last one).</div></li><li><div>LoopMode can be Loop (repeat), Cycle (forward then backward), and DontLoop (only once).</div></li><li><div>If needed, use channel.setSpeed() to set the speed of this animation.</div></li><li><div>Optionally, use channel.setTime() to Fast-forward or rewind to a certain moment in time of this animation.</div></li></ul><pre> private ActionListener&#40;&#41; &#123;
public void onAction&#40;String name, boolean keyPressed, float tpf&#41; &#123;
if &#40;name.equals&#40;&quot;Walk&quot;&#41; &amp;&amp; !keyPressed&#41; &#123;
if &#40;!channel.getAnimationName&#40;&#41;.equals&#40;&quot;Walk&quot;&#41;&#41;&#123;
@ -229,40 +115,7 @@ Test for each action by name, and set the channel to the corresponding animation
&#125;
&#125;
&#125;
&#125;;</pre>
</div>
<h2><a>Exercises</a></h2>
<div>
</div>
<h4><a>Exercise 1: Two Animations</a></h4>
<div>
<p>
Make a mouse click trigger another animation sequence!
</p>
<ol>
<li><div> Create a second channel in the controller</div>
</li>
<li><div> Create a new key trigger mapping and action (see: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_input_system.html">Hello Input</a>)</div>
</li>
<li><div> Tip: Do you want to find out what animation sequences are available in the model? Use: <pre>for &#40;System.out.println&#40;anim&#41;; &#125;</pre>
</div>
</li>
</ol>
</div>
<h4><a>Exercise 2: Revealing the Skeleton (1)</a></h4>
<div>
<p>
Open the <code>skeleton.xml</code> file in a text editor of your choice. You don&#039;t have to be able to read or write these xml files (Blender does that for you) – but it is good to know how skeletons work. &quot;There&#039;s no magic to it!&quot;
&#125;;</pre></div><h2><a>Exercises</a></h2><div></div><h4><a>Exercise 1: Two Animations</a></h4><div><p>Make a mouse click trigger another animation sequence!</p><ol><li><div>Create a second channel in the controller</div></li><li><div>Create a new key trigger mapping and action (see: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_input_system.html">Hello Input</a>)</div></li><li><div>Tip: Do you want to find out what animation sequences are available in the model? Use:<pre>for &#40;Exercise 2: Revealing the Skeleton (1)</h4><div><p>Open the <code>skeleton.xml</code> file in a text editor of your choice. You don&#039;t have to be able to read or write these xml files (Blender does that for you) – but it is good to know how skeletons work. &quot;There&#039;s no magic to it!&quot;
</p>
<ul>
<li><div> Note how the bones are numbered and named. All names of animated models follow a naming scheme.</div>

@ -1,31 +1,4 @@
<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 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.
</p>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/beginner/beginner-assets-models.png">
</p>
<p>
<p><div>To use the example assets in a new jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> project, right-click your project, select &quot;Properties&quot;, go to &quot;Libraries&quot;, press &quot;Add Library&quot; and add the &quot;jme3-test-data&quot; library.
</div></p>
</p>
</div>
<h2><a>Code Sample</a></h2>
<div>
<pre>package jme3test.helloworld;
<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 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.</p><p><img src="nbdocs:/com/jme3/gde/core/docs/jme3/beginner/beginner-assets-models.png"></p><p><p><div>To use the example assets in a new jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> project, right-click your project, select &quot;Properties&quot;, go to &quot;Libraries&quot;, press &quot;Add Library&quot; and add the &quot;jme3-test-data&quot; library.</div></p></p></div><h2><a>Code Sample</a></h2><div><pre>package jme3test.helloworld;
&nbsp;
import com.jme3.app.SimpleApplication;
import com.jme3.font.BitmapText;
@ -86,36 +59,7 @@ public class HelloAssets extends SimpleApplication &#123;
rootNode.addLight&#40;sun&#41;;
&nbsp;
&#125;
&#125;</pre>
<p>
Build and run the code sample. You should see a green Ninja with a colorful teapot standing behind a wall. The text on the screen should say &quot;Hello World&quot;.
</p>
</div>
<h2><a>The Asset Manager</a></h2>
<div>
<p>
JME3 comes with a handy asset manager that helps you keep your assets organized. Project assets are media files such as models, materials, textures, scenes, shaders, sounds, and fonts.
The Asset manager can load files from:
</p>
<ul>
<li><div> the current classpath (the top level of your project directory), </div>
</li>
<li><div> the <code>assets</code> directory of your project, and</div>
</li>
<li><div> optionally, custom paths.</div>
</li>
</ul>
<p>
This is our recommended directory structure for storing assets:
</p>
<pre>MyGame/assets/Interface/
&#125;</pre><p>Build and run the code sample. You should see a green Ninja with a colorful teapot standing behind a wall. The text on the screen should say &quot;Hello World&quot;.</p></div><h2><a>The Asset Manager</a></h2><div><p>JME3 comes with a handy asset manager that helps you keep your assets organized. Project assets are media files such as models, materials, textures, scenes, shaders, sounds, and fonts. The Asset manager can load files from:</p><ul><li><div>the current classpath (the top level of your project directory),</div></li><li><div>the <code>assets</code> directory of your project, and</div></li><li><div>optionally, custom paths.</div></li></ul><p>This is our recommended directory structure for storing assets:</p><pre>MyGame/assets/Interface/
MyGame/assets/MatDefs/
MyGame/assets/Materials/
MyGame/assets/Models/
@ -125,22 +69,7 @@ MyGame/assets/Sounds/
MyGame/assets/Textures/
MyGame/build.xml
MyGame/src/...
MyGame/...</pre>
<p>
This is just a suggested best practice, you can name the directories in the assets directory what ever you like.
</p>
</div>
<h3><a>Loading Textures</a></h3>
<div>
<p>
Place your textures in a subdirectory of <code>assets/Textures/</code>. Load the texture into the material before you set the Material. The following code sample is from the <code>simpleInitApp()</code> method and loads a simple wall model:
</p>
<pre>// Create a wall with a simple texture from test_data
MyGame/...</pre><p>This is just a suggested best practice, you can name the directories in the assets directory what ever you like.</p></div><h3><a>Loading Textures</a></h3><div><p>Place your textures in a subdirectory of <code>assets/Textures/</code>. Load the texture into the material before you set the Material. The following code sample is from the <code>simpleInitApp()</code> method and loads a simple wall model:</p><pre>// Create a wall with a simple texture from test_data
Box&#40;Vector3f.ZERO, 2.5f,2.5f,1.0f&#41;;
Spatial wall = new Geometry&#40;&quot;Box&quot;, box &#41;;
Material mat_brick = new Material&#40;

@ -1,20 +1,4 @@
<h1><a>JME 3 Tutorial (11) - Hello Audio</a></h1>
<div>
<p>
Previous: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_terrain.html">Hello Terrain</a>, Next: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_effects.html">Hello Effects</a>
</p>
<p>
This tutorial explains how to add 3D sound to a game, and how make sounds play together with events, such as clicking. You learn how to use an Audio Listener and Audio Nodes. You also make use of an Action Listener and a MouseButtonTrigger from the previous <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_input_system.html">Hello Input</a> tutorial to make a mouse click trigger a gun shot sound.
</p>
</div>
<h2><a>Sample Code</a></h2>
<div>
<pre>package jme3test.helloworld;
<h1><a>JME 3 Tutorial (11) - Hello Audio</a></h1><div><p>Previous: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_terrain.html">Hello Terrain</a>, Next: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_effects.html">Hello Effects</a></p><p>This tutorial explains how to add 3D sound to a game, and how make sounds play together with events, such as clicking. You learn how to use an Audio Listener and Audio Nodes. You also make use of an Action Listener and a MouseButtonTrigger from the previous <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_input_system.html">Hello Input</a> tutorial to make a mouse click trigger a gun shot sound.</p></div><h2><a>Sample Code</a></h2><div><pre>package jme3test.helloworld;
&nbsp;
import com.jme3.app.SimpleApplication;
import com.jme3.audio.AudioNode;

@ -1,41 +1,8 @@
<h1><a>JME 3 Tutorial (9) - Hello Collision</a></h1>
<div>
<p>
Previous: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_picking.html">Hello Picking</a>,
Next: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_terrain.html">Hello Terrain</a>
</p>
<p>
This tutorial demonstrates how you load a scene model and give it solid walls and floors for a character to walk around.
You use a <code>RigidBodyControl</code> for the static collidable scene, and a <code>CharacterControl</code> for the mobile first-person character. You also learn how to set up the default first-person camera to work with physics-controlled navigation.
You can use the solution shown here for first-person shooters, mazes, and similar games.
</p>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/beginner/beginner-scene.png">
</p>
</div>
<h2><a>Sample Code</a></h2>
<div>
<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/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
<h1><a>JME 3 Tutorial (9) - Hello Collision</a></h1><div><p>Previous: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_picking.html">Hello Picking</a>, Next: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_terrain.html">Hello Terrain</a></p><p>This tutorial demonstrates how you load a scene model and give it solid walls and floors for a character to walk around. You use a <code>RigidBodyControl</code> for the static collidable scene, and a <code>CharacterControl</code> for the mobile first-person character. You also learn how to set up the default first-person camera to work with physics-controlled navigation. You can use the solution shown here for first-person shooters, mazes, and similar games.</p><p><img src="nbdocs:/com/jme3/gde/core/docs/jme3/beginner/beginner-scene.png"></p></div><h2><a>Sample Code</a></h2><div><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/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/
build.xml
town.zip
src/</pre>
<p>
Place town.zip in the root directory of your JME3 project. Here is the code:
</p>
<pre>package jme3test.helloworld;
src/</pre><p>Place town.zip in the root directory of your JME3 project. Here is the code:</p><pre>package jme3test.helloworld;
&nbsp;
import com.jme3.app.SimpleApplication;
import com.jme3.asset.plugins.ZipLocator;
@ -180,70 +147,16 @@ public class HelloCollision extends SimpleApplication
player.setWalkDirection&#40;walkDirection&#41;;
cam.setLocation&#40;player.getPhysicsLocation&#40;&#41;&#41;;
&#125;
&#125;</pre>
<p>
Run the sample. You should see a town square with houses and a monument. Use the WASD keys and the mouse to navigate around with a first-person perspective. Run forward and jump by pressing W and Space. Note how you step over the sidewalk, and up the steps to the monument. You can walk in the alleys between the houses, but the walls are solid. Don&#039;t walk over the edge of the world! <img src="/wiki/lib/images/smileys/icon_smile.gif" class="middle" alt=":-)" />
</p>
</div>
<h2><a>Understanding the Code</a></h2>
<div>
<p>
Let&#039;s start with the class declaration:
</p>
<pre>public class HelloCollision extends SimpleApplication
implements ActionListener &#123; ... &#125;</pre>
<p>
You already know that SimpleApplication is the base class for all jME3 games. You make this class implement the <code>ActionListener</code> interface because you want to customize the navigational inputs later.
</p>
<pre> private Spatial sceneModel;
&#125;</pre><p>Run the sample. You should see a town square with houses and a monument. Use the WASD keys and the mouse to navigate around with a first-person perspective. Run forward and jump by pressing W and Space. Note how you step over the sidewalk, and up the steps to the monument. You can walk in the alleys between the houses, but the walls are solid. Don&#039;t walk over the edge of the world! <img src="/wiki/lib/images/smileys/icon_smile.gif" class="middle" alt=":-)" /></p></div><h2><a>Understanding the Code</a></h2><div><p>Let&#039;s start with the class declaration:</p><pre>public class HelloCollision extends SimpleApplication
implements ActionListener &#123; ... &#125;</pre><p>You already know that SimpleApplication is the base class for all jME3 games. You make this class implement the <code>ActionListener</code> interface because you want to customize the navigational inputs later.</p><pre> private Spatial sceneModel;
private BulletAppState bulletAppState;
private RigidBodyControl landscape;
private CharacterControl player;
private Vector3f walkDirection = new Vector3f&#40;&#41;;
private boolean left = false, right = false, up = false, down = false;</pre>
<p>
You initialize a few private fields:
</p>
<ul>
<li><div> The BulletAppState gives this SimpleApplication access to physics features (such as collision detection) supplied by jME3&#039;s jBullet integration</div>
</li>
<li><div> The Spatial sceneModel is for loading an OgreXML model of a town.</div>
</li>
<li><div> You need a RigidBodyControl to make the town model solid.</div>
</li>
<li><div> The (invisible) first-person player is represented by a CharacterControl object.</div>
</li>
<li><div> The fields <code>walkDirection</code> and the four Booleans are used for physics-controlled navigation.</div>
</li>
</ul>
<p>
Let&#039;s have a look at all the details:
</p>
</div>
<h2><a>Initializing the Game</a></h2>
<div>
<p>
As usual, you initialize the game in the <code>simpleInitApp()</code> method.
</p>
<pre> viewPort.setBackgroundColor&#40;new ColorRGBA&#40;0.7f,0.8f,1f,1f&#41;&#41;;
private boolean left = false, right = false, up = false, down = false;</pre><p>You initialize a few private fields:</p><ul><li><div>The BulletAppState gives this SimpleApplication access to physics features (such as collision detection) supplied by jME3&#039;s jBullet integration</div></li><li><div>The Spatial sceneModel is for loading an OgreXML model of a town.</div></li><li><div>You need a RigidBodyControl to make the town model solid.</div></li><li><div>The (invisible) first-person player is represented by a CharacterControl object.</div></li><li><div>The fields <code>walkDirection</code> and the four Booleans are used for physics-controlled navigation.</div></li></ul><p>Let&#039;s have a look at all the details:</p></div><h2><a>Initializing the Game</a></h2><div><p>As usual, you initialize the game in the <code>simpleInitApp()</code> method.</p><pre> viewPort.setBackgroundColor&#40;new ColorRGBA&#40;0.7f,0.8f,1f,1f&#41;&#41;;
flyCam.setMoveSpeed&#40;100&#41;;
setUpKeys&#40;&#41;;
setUpLight&#40;&#41;;</pre>
<ol>
<li><div> You set the background color to light blue, since this is a scene with a sky.</div>
setUpLight&#40;&#41;;</pre><ol><li><div> You set the background color to light blue, since this is a scene with a sky.</div>
</li>
<li><div> You repurpose the default camera control &quot;flyCam&quot; as first-person camera and set its speed.</div>
</li>

@ -1,56 +1,4 @@
<h1><a>JME 3 Tutorial (12) - Hello Effects</a></h1>
<div>
<p>
Previous: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_audio.html">Hello Audio</a>,
Next: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_physics.html">Hello Physics</a>
</p>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/beginner/beginner-effect-fire.png">
</p>
<p>
When you see one of the following in a game, then a particle system is likely behind it:
</p>
<ul>
<li><div> Fire, flames, sparks;</div>
</li>
<li><div> Rain, snow, waterfalls, leaves;</div>
</li>
<li><div> Explosions, debris, shockwaves;</div>
</li>
<li><div> Dust, fog, clouds, smoke;</div>
</li>
<li><div> Insects swarms, meteor showers;</div>
</li>
<li><div> Magic spells.</div>
</li>
</ul>
<p>
These scene elements cannot be modeled by meshes. In very simple terms:
</p>
<ul>
<li><div> The difference between an explosion and a dust cloud is the speed of the particle effect. </div>
</li>
<li><div> The difference between flames and a waterfall is the direction and the color of the particle effect. </div>
</li>
</ul>
<p>
Particle effects can be animated (e.g. sparks, drops) and static (strands of grass, hair). Non-particle effects include bloom/glow, and motion blur/afterimage. In this tutorial you learn how to make animated particles (com.jme3.effect).
</p>
</div>
<h2><a>Sample Code</a></h2>
<div>
<pre>package jme3test.helloworld;
<h1><a>JME 3 Tutorial (12) - Hello Effects</a></h1><div><p>Previous: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_audio.html">Hello Audio</a>, Next: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_physics.html">Hello Physics</a></p><p><img src="nbdocs:/com/jme3/gde/core/docs/jme3/beginner/beginner-effect-fire.png"></p><p>When you see one of the following in a game, then a particle system is likely behind it:</p><ul><li><div>Fire, flames, sparks;</div></li><li><div>Rain, snow, waterfalls, leaves;</div></li><li><div>Explosions, debris, shockwaves;</div></li><li><div>Dust, fog, clouds, smoke;</div></li><li><div>Insects swarms, meteor showers;</div></li><li><div>Magic spells.</div></li></ul><p>These scene elements cannot be modeled by meshes. In very simple terms:</p><ul><li><div>The difference between an explosion and a dust cloud is the speed of the particle effect.</div></li><li><div>The difference between flames and a waterfall is the direction and the color of the particle effect.</div></li></ul><p>Particle effects can be animated (e.g. sparks, drops) and static (strands of grass, hair). Non-particle effects include bloom/glow, and motion blur/afterimage. In this tutorial you learn how to make animated particles (com.jme3.effect).</p></div><h2><a>Sample Code</a></h2><div><pre>package jme3test.helloworld;
&nbsp;
import com.jme3.app.SimpleApplication;
import com.jme3.effect.ParticleEmitter;
@ -108,31 +56,7 @@ public class HelloEffects extends SimpleApplication &#123;
rootNode.attachChild&#40;debris&#41;;
debris.emitAllParticles&#40;&#41;;
&#125;
&#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/trunk/engine/src/test/jme3test/effect/"><param name="text" value="<html><u>More example code is here.</u></html>"><param name="textColor" value="blue"></object>
</p>
</div>
<h3><a>Texture Animation and Variation</a></h3>
<div>
<p>
<img src="/wiki/lib/exe/fetch.php">
</p>
<p>
Start by choosing a material texture for your effect. If you provide the emitter with a set of textures (see image), it can use them either for variation (random order), or as animation steps (fixed order).
</p>
<p>
Setting emitter textures works just as you have already learned in previous chapters. This time you base the material on the <code>Particle.j3md</code> material definition. Let&#039;s have a closer look at the material for the Debris effect.
</p>
<pre> ParticleEmitter debris =
&#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/trunk/engine/src/test/jme3test/effect/"><param name="text" value="<html><u>More example code is here.</u></html>"><param name="textColor" value="blue"></object></p></div><h3><a>Texture Animation and Variation</a></h3><div><p><img src="/wiki/lib/exe/fetch.php"></p><p>Start by choosing a material texture for your effect. If you provide the emitter with a set of textures (see image), it can use them either for variation (random order), or as animation steps (fixed order).</p><p>Setting emitter textures works just as you have already learned in previous chapters. This time you base the material on the <code>Particle.j3md</code> material definition. Let&#039;s have a closer look at the material for the Debris effect.</p><pre> ParticleEmitter debris =
new ParticleEmitter&#40;&quot;Debris&quot;, ParticleMesh.Type.Triangle, 10&#41;;
Material debris_mat = new Material&#40;assetManager,
&quot;Common/MatDefs/Misc/Particle.j3md&quot;&#41;;
@ -142,73 +66,7 @@ Setting emitter textures works just as you have already learned in previous chap
debris.setImagesX&#40;3&#41;;
debris.setImagesY&#40;3&#41;; // 3x3 texture animation
debris.setSelectRandomImage&#40;true&#41;;
...</pre>
<ol>
<li><div> Create a material and load the texture.</div>
</li>
<li><div> Tell the Emitter into how many animation steps (x*y) the texture is divided. <br/>
The debris texture has 3x3 frames.</div>
</li>
<li><div> Optionally, tell the Emitter whether the animation steps are to be at random, or in order. <br/>
For the debris, the frames play at random.</div>
</li>
</ol>
<p>
As you see in the debris example, texture animations improve effects because each &quot;flame&quot; or &quot;piece of debris&quot; now looks different. Also think of electric or magic effects, where you can create very interesting animations by using an ordered morphing series of lightning bolts; or flying leaves or snow flakes, for instance.
</p>
<p>
The fire material is created the same way, just using &quot;Effects/Explosion/flame.png&quot; texture, which has with 2x2 ordered animation steps.
</p>
</div>
<h3><a>Default Particle Textures</a></h3>
<div>
<p>
The following particle textures included in <code>test-data.jar</code>. You can copy and use them in your own effects.
</p>
<div><table>
<tr>
<th> Texture Path </th><th> Dimension </th><th> Preview </th>
</tr>
<tr>
<td> Effects/Explosion/Debris.png </td><td> 3*3 </td><td> <img src="/wiki/lib/exe/fetch.php"> </td>
</tr>
<tr>
<td> Effects/Explosion/flame.png </td><td> 2*2 </td><td> <img src="/wiki/lib/exe/fetch.php"> </td>
</tr>
<tr>
<td> Effects/Explosion/shockwave.png </td><td> 1*1 </td><td> <img src="/wiki/lib/exe/fetch.php"> </td>
</tr>
<tr>
<td> Effects/Explosion/smoketrail.png </td><td> 1*3 </td><td> <img src="/wiki/lib/exe/fetch.php"> </td>
</tr>
<tr>
<td> Effects/Smoke/Smoke.png </td><td> 1*15 </td><td> <img src="/wiki/lib/exe/fetch.php"> </td>
</tr>
</table></div>
<!-- EDIT1 TABLE [5323-6142] -->
<p>
Copy them into you <code>assets/Effects</code> directory to use them.
</p>
</div>
<h2><a>Creating Custom Textures</a></h2>
<div>
<p>
For your game, you will likely create custom particle textures. Look at the fire example again.
</p>
<pre> ParticleEmitter fire =
...</pre><ol><li><div>Create a material and load the texture.</div></li><li><div>Tell the Emitter into how many animation steps (x*y) the texture is divided. <br/> The debris texture has 3x3 frames.</div></li><li><div>Optionally, tell the Emitter whether the animation steps are to be at random, or in order. <br/> For the debris, the frames play at random.</div></li></ol><p>As you see in the debris example, texture animations improve effects because each &quot;flame&quot; or &quot;piece of debris&quot; now looks different. Also think of electric or magic effects, where you can create very interesting animations by using an ordered morphing series of lightning bolts; or flying leaves or snow flakes, for instance.</p><p>The fire material is created the same way, just using &quot;Effects/Explosion/flame.png&quot; texture, which has with 2x2 ordered animation steps.</p></div><h3><a>Default Particle Textures</a></h3><div><p>The following particle textures included in <code>test-data.jar</code>. You can copy and use them in your own effects.</p><div><table><tr><th>Texture Path</th><th>Dimension</th><th>Preview</th></tr><tr><td>Effects/Explosion/Debris.png</td><td>3*3</td><td><img src="/wiki/lib/exe/fetch.php"></td></tr><tr><td>Effects/Explosion/flame.png</td><td>2*2</td><td><img src="/wiki/lib/exe/fetch.php"></td></tr><tr><td>Effects/Explosion/shockwave.png</td><td>1*1</td><td><img src="/wiki/lib/exe/fetch.php"></td></tr><tr><td>Effects/Explosion/smoketrail.png</td><td>1*3</td><td><img src="/wiki/lib/exe/fetch.php"></td></tr><tr><td>Effects/Smoke/Smoke.png</td><td>1*15</td><td><img src="/wiki/lib/exe/fetch.php"></td></tr></table></div><p>Copy them into you <code>assets/Effects</code> directory to use them.</p></div><h2><a>Creating Custom Textures</a></h2><div><p>For your game, you will likely create custom particle textures. Look at the fire example again.</p><pre> ParticleEmitter fire =
new ParticleEmitter&#40;&quot;Emitter&quot;, ParticleMesh.Type.Triangle, 30&#41;;
Material mat_red = new Material&#40;assetManager,
&quot;Common/MatDefs/Misc/Particle.j3md&quot;&#41;;
@ -219,10 +77,7 @@ For your game, you will likely create custom particle textures. Look at the fire
fire.setImagesY&#40;2&#41;; // 2x2 texture animation
fire.setEndColor&#40; new ColorRGBA&#40;1f, 0f, 0f, 1f&#41;&#41;; // red
fire.setStartColor&#40;new ColorRGBA&#40;1f, 1f, 0f, 0.5f&#41;&#41;; // yellow
&nbsp;</pre>
<p>
<img src="/wiki/lib/exe/fetch.php">
&nbsp;</pre><p><img src="/wiki/lib/exe/fetch.php">
</p>
<p>
@ -318,7 +173,7 @@ Vector3f.NAN <br/>
<td> gravity </td><td> <code>setGravity()</code> </td><td> 0,1,0 </td><td> Whether particles fall down (positive) or fly up (negative). Set to 0f for a zero-g effect where particles keep flying. </td>
</tr>
</table></div>
<!-- EDIT2 TABLE [8178-9650] -->
<!-- EDIT2 TABLE [8150-9622] -->
<p>
You can find details about <a href="/com/jme3/gde/core/docs/jme3/advanced/particle_emitters#configure_parameters.html">effect parameters</a> here.

@ -1,26 +1,4 @@
<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 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>
<p>
Every game has its custom keybindings, and this tutorial explains how you define them. We first define the key presses and mouse events, and then we define the actions they should trigger.
</p>
</div>
<h2><a>Sample Code</a></h2>
<div>
<pre>package jme3test.helloworld;
<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 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><p>Every game has its custom keybindings, and this tutorial explains how you define them. We first define the key presses and mouse events, and then we define the actions they should trigger.</p></div><h2><a>Sample Code</a></h2><div><pre>package jme3test.helloworld;
&nbsp;
import com.jme3.app.SimpleApplication;
import com.jme3.material.Material;
@ -97,73 +75,12 @@ public class HelloInput extends SimpleApplication &#123;
&#125;
&#125;
&#125;;
&#125;</pre>
<p>
Build and run the example.
</p>
<ul>
<li><div> Press the Spacebar or click to rotate the cube. </div>
</li>
<li><div> Press the J and K keys to move the cube.</div>
</li>
<li><div> Press P to pause and unpause the game. While paused, the game should not respond to any input, other than <code>P</code>.</div>
</li>
</ul>
</div>
<h2><a>Defining Mappings and Triggers</a></h2>
<div>
<p>
First you register each mapping name with its trigger(s). Remember the following:
</p>
<ul>
<li><div> An input trigger can be a key press or mouse action. <br/>
For example a mouse movement, a mouse click, or pressing the letter &quot;P&quot;.</div>
</li>
<li><div> The mapping name is a string that you can choose. <br/>
The name should describe the action (e.g. &quot;Rotate&quot;), and not the trigger. Because the trigger can change.</div>
</li>
<li><div> One named mapping can have several triggers. <br/>
For example, the &quot;Rotate&quot; action can be triggered by a click and by pressing the spacebar.</div>
</li>
</ul>
<p>
Have a look at the code:
</p>
<ol>
<li><div> You register the mapping named &quot;Rotate&quot; to the Spacebar key trigger. <br/>
<code>new KeyTrigger(KeyInput.KEY_SPACE)</code>). </div>
</li>
<li><div> In the same line, you also register &quot;Rotate&quot; to an alternative mouse click trigger. <br/>
<code>new MouseButtonTrigger(MouseInput.BUTTON_LEFT)</code></div>
</li>
<li><div> You map the <code>Pause</code>, <code>Left</code>, <code>Right</code> mappings to the P, J, K keys, respectively. </div>
</li>
</ol>
<pre> // You can map one or several inputs to one named action
&#125;</pre><p>Build and run the example.</p><ul><li><div>Press the Spacebar or click to rotate the cube.</div></li><li><div>Press the J and K keys to move the cube.</div></li><li><div>Press P to pause and unpause the game. While paused, the game should not respond to any input, other than <code>P</code>.</div></li></ul></div><h2><a>Defining Mappings and Triggers</a></h2><div><p>First you register each mapping name with its trigger(s). Remember the following:</p><ul><li><div>An input trigger can be a key press or mouse action. <br/> For example a mouse movement, a mouse click, or pressing the letter &quot;P&quot;.</div></li><li><div>The mapping name is a string that you can choose. <br/> The name should describe the action (e.g. &quot;Rotate&quot;), and not the trigger. Because the trigger can change.</div></li><li><div>One named mapping can have several triggers. <br/> For example, the &quot;Rotate&quot; action can be triggered by a click and by pressing the spacebar.</div></li></ul><p>Have a look at the code:</p><ol><li><div>You register the mapping named &quot;Rotate&quot; to the Spacebar key trigger. <br/> <code>new KeyTrigger(KeyInput.KEY_SPACE)</code>).</div></li><li><div>In the same line, you also register &quot;Rotate&quot; to an alternative mouse click trigger. <br/> <code>new MouseButtonTrigger(MouseInput.BUTTON_LEFT)</code></div></li><li><div>You map the <code>Pause</code>, <code>Left</code>, <code>Right</code> mappings to the P, J, K keys, respectively.</div></li></ol><pre> // You can map one or several inputs to one named action
inputManager.addMapping&#40;&quot;Pause&quot;, new KeyTrigger&#40;KeyInput.KEY_P&#41;&#41;;
inputManager.addMapping&#40;&quot;Left&quot;, new KeyTrigger&#40;KeyInput.KEY_J&#41;&#41;;
inputManager.addMapping&#40;&quot;Right&quot;, new KeyTrigger&#40;KeyInput.KEY_K&#41;&#41;;
inputManager.addMapping&#40;&quot;Rotate&quot;, new KeyTrigger&#40;KeyInput.KEY_SPACE&#41;,
new MouseButtonTrigger&#40;MouseInput.BUTTON_LEFT&#41;&#41;;</pre>
<p>
Now you need to register your trigger mappings.
</p>
<ol>
<li><div> You register the pause action to the ActionListener, because it is an &quot;on/off&quot; action.</div>
</li>
<li><div> You register the movement actions to the AnalogListener, because they are gradual actions.</div>
</li>
</ol>
<pre> // Add the names to the action listener.
new MouseButtonTrigger&#40;MouseInput.BUTTON_LEFT&#41;&#41;;</pre><p>Now you need to register your trigger mappings.</p><ol><li><div>You register the pause action to the ActionListener, because it is an &quot;on/off&quot; action.</div></li><li><div>You register the movement actions to the AnalogListener, because they are gradual actions.</div></li></ol><pre> // Add the names to the action listener.
inputManager.addListener&#40;actionListener, new String&#91;&#93;&#123;&quot;Pause&quot;&#125;&#41;;
inputManager.addListener&#40;analogListener, new String&#91;&#93;&#123;&quot;Left&quot;, &quot;Right&quot;, &quot;Rotate&quot;&#125;&#41;;</pre>

@ -1,22 +1,4 @@
<h1><a>JME 3 Tutorial (4) - Hello Update Loop</a></h1>
<div>
<p>
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>
</p>
<p>
Now that you know how to load assets, such as 3D models, you want to implement some gameplay that uses these assets. In this tutorial we look at the update loop. The update loop of your game is where the action happens.
</p>
</div>
<h2><a>Code Sample</a></h2>
<div>
<pre>package jme3test.helloworld;
<h1><a>JME 3 Tutorial (4) - Hello Update Loop</a></h1><div><p>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></p><p>Now that you know how to load assets, such as 3D models, you want to implement some gameplay that uses these assets. In this tutorial we look at the update loop. The update loop of your game is where the action happens.</p></div><h2><a>Code Sample</a></h2><div><pre>package jme3test.helloworld;
&nbsp;
import com.jme3.app.SimpleApplication;
import com.jme3.material.Material;

@ -1,22 +1,4 @@
<h1><a>JME 3 Tutorial (6) - Hello Materials</a></h1>
<div>
<p>
Previous: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_input_system.html">Hello Input System</a>,
Next: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_animation.html">Hello Animation</a>
</p>
<p>
The term Material includes everything that influences what the surface of a 3D model looks like: The color, texture, shininess, and opacity/transparency. Plain 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>. In this tutorial you learn to create and use custom JME3 Material Definitions.
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/beginner/beginner-materials.png">
</p>
</div>
<h2><a>Sample Code</a></h2>
<div>
<pre>package jme3test.helloworld;
<h1><a>JME 3 Tutorial (6) - Hello Materials</a></h1><div><p>Previous: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_input_system.html">Hello Input System</a>, Next: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_animation.html">Hello Animation</a></p><p>The term Material includes everything that influences what the surface of a 3D model looks like: The color, texture, shininess, and opacity/transparency. Plain 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>. In this tutorial you learn to create and use custom JME3 Material Definitions. <img src="nbdocs:/com/jme3/gde/core/docs/jme3/beginner/beginner-materials.png"></p></div><h2><a>Sample Code</a></h2><div><pre>package jme3test.helloworld;
&nbsp;
import com.jme3.app.SimpleApplication;
import com.jme3.light.DirectionalLight;
@ -295,7 +277,7 @@ DiffuseMap, NormalMap, SpecularMap : Texture2D <br/>
Shininess : Float </td>
</tr>
</table></div>
<!-- EDIT1 TABLE [11037-11507] -->
<!-- EDIT1 TABLE [11029-11499] -->
<p>
For a game, you create custom Materials based on these existing MaterialDefintions – as you have just seen in the example with the shiny rock&#039;s material.

@ -1,46 +1,4 @@
<h1><a>JME 3 Tutorial (2) - Hello Node</a></h1>
<div>
<p>
Previous: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_simpleapplication.html">Hello SimpleApplication</a>,
Next: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_asset.html">Hello Assets</a>.
</p>
<p>
In this tutorial we will have a look at the creation of a 3D scene.
</p>
<ul>
<li><div> This tutorial assumes that you know what <a href="/com/jme3/gde/core/docs/jme3/the_scene_graph.html">the Scene Graph</a> is.</div>
</li>
<li><div> For a visual introduction, check out <a href="/com/jme3/gde/core/docs/jme3/scenegraph_for_dummies.html">Scene Graph for Dummies</a>.</div>
</li>
</ul>
<p>
When creating a 3D game
</p>
<ol>
<li><div> You create some scene objects like players, buildings, etc. </div>
</li>
<li><div> You add the objects to the scene.</div>
</li>
<li><div> You move, resize, rotate, color, and animate them. </div>
</li>
</ol>
<p>
You will learn that the scene graph represents the 3D world, and why the rootNode is important. You will learn how to create simple objects, how to let them carry custom data (such as health points), and how to &quot;transform&quot; them by moving, scaling, and rotating. You will understand the difference between the two types of &quot;Spatials&quot; in the scene graph: Nodes and Geometries.
</p>
</div>
<h2><a>Code Sample</a></h2>
<div>
<pre>package jme3test.helloworld;
<h1><a>JME 3 Tutorial (2) - Hello Node</a></h1><div><p>Previous: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_simpleapplication.html">Hello SimpleApplication</a>, Next: <a href="/com/jme3/gde/core/docs/jme3/beginner/hello_asset.html">Hello Assets</a>.</p><p>In this tutorial we will have a look at the creation of a 3D scene.</p><ul><li><div>This tutorial assumes that you know what <a href="/com/jme3/gde/core/docs/jme3/the_scene_graph.html">the Scene Graph</a> is.</div></li><li><div>For a visual introduction, check out <a href="/com/jme3/gde/core/docs/jme3/scenegraph_for_dummies.html">Scene Graph for Dummies</a>.</div></li></ul><p>When creating a 3D game</p><ol><li><div>You create some scene objects like players, buildings, etc.</div></li><li><div>You add the objects to the scene.</div></li><li><div>You move, resize, rotate, color, and animate them.</div></li></ol><p>You will learn that the scene graph represents the 3D world, and why the rootNode is important. You will learn how to create simple objects, how to let them carry custom data (such as health points), and how to &quot;transform&quot; them by moving, scaling, and rotating. You will understand the difference between the two types of &quot;Spatials&quot; in the scene graph: Nodes and Geometries.</p></div><h2><a>Code Sample</a></h2><div><pre>package jme3test.helloworld;
&nbsp;
import com.jme3.app.SimpleApplication;
import com.jme3.material.Material;
@ -89,51 +47,7 @@ public class HelloNode extends SimpleApplication &#123;
/** Rotate the pivot node: Note that both boxes have rotated! */
pivot.rotate&#40;.4f,.4f,0f&#41;;
&#125;
&#125;</pre>
<p>
Build and run the code sample. You should see two colored boxes tilted at the same angle.
</p>
</div>
<h2><a>Understanding the Terminology</a></h2>
<div>
<p>
In this tutorial, you learn some new terms:
</p>
<div><table>
<tr>
<th>What you want to do</th><th>How you say it in JME3 terminology</th>
</tr>
<tr>
<td>Lay out the 3D scene</td><td>Populate the scene graph</td>
</tr>
<tr>
<td>Create scene objects</td><td>Create Spatials (e.g. create Geometries)</td>
</tr>
<tr>
<td>Make an object appear in the scene</td><td>Attach a Spatial to the rootNode</td>
</tr>
<tr>
<td>Make an object disappear from the scene</td><td>Detach the Spatial from the rootNode</td>
</tr>
<tr>
<td>Position/move, turn, or resize an object</td><td>Translate, rotate, scale an object. Transform an object.</td>
</tr>
</table></div>
<!-- EDIT1 TABLE [3079-3496] -->
<p>
Every JME3 application has a rootNode: Your game automatically inherits the <code>rootNode</code> object from SimpleApplication. Everything attached to the rootNode is part of the scene graph. The elements of the scene graph are Spatials.
</p>
<ul>
<li><div> A Spatial contains the location, rotation, and scale of an object.</div>
</li>
<li><div> A Spatial can be loaded, transformed, and saved.</div>
&#125;</pre><p>Build and run the code sample. You should see two colored boxes tilted at the same angle.</p></div><h2><a>Understanding the Terminology</a></h2><div><p>In this tutorial, you learn some new terms:</p><div><table><tr><th>What you want to do</th><th>How you say it in JME3 terminology</th></tr><tr><td>Lay out the 3D scene</td><td>Populate the scene graph</td></tr><tr><td>Create scene objects</td><td>Create Spatials (e.g. create Geometries)</td></tr><tr><td>Make an object appear in the scene</td><td>Attach a Spatial to the rootNode</td></tr><tr><td>Make an object disappear from the scene</td><td>Detach the Spatial from the rootNode</td></tr><tr><td>Position/move, turn, or resize an object</td><td>Translate, rotate, scale an object. Transform an object.</td></tr></table></div><p>Every JME3 application has a rootNode: Your game automatically inherits the <code>rootNode</code> object from SimpleApplication. Everything attached to the rootNode is part of the scene graph. The elements of the scene graph are Spatials.</p><ul><li><div>A Spatial contains the location, rotation, and scale of an object.</div></li><li><div> A Spatial can be loaded, transformed, and saved.</div>
</li>
<li><div> There are two types of Spatials: Nodes and Geometries.</div>
</li>

@ -83,8 +83,7 @@ public class HelloTerrain extends SimpleApplication &#123;
AbstractHeightMap heightmap = null;
Texture heightMapImage = assetManager.loadTexture&#40;
&quot;Textures/Terrain/splat/mountains512.png&quot;&#41;;
heightmap = new ImageBasedHeightMap&#40;
ImageToAwt.convert&#40;heightMapImage.getImage&#40;&#41;, false, true, 0&#41;&#41;;
heightmap = new ImageBasedHeightMap&#40;heightMapImage.getImage&#40;&#41;&#41;;
heightmap.load&#40;&#41;;
&nbsp;
<span>/** 3. We have prepared material and heightmap.
@ -105,9 +104,7 @@ public class HelloTerrain extends SimpleApplication &#123;
rootNode.attachChild&#40;terrain&#41;;
&nbsp;
/** 5. The LOD (level of detail) depends on were the camera is: */
List&lt;Camera&gt; cameras = new ArrayList&lt;Camera&gt;&#40;&#41;;
cameras.add&#40;getCamera&#40;&#41;&#41;;
TerrainLodControl control = new TerrainLodControl&#40;terrain, cameras&#41;;
TerrainLodControl control = new TerrainLodControl&#40;terrain, getCamera&#40;&#41;&#41;;
terrain.addControl&#40;control&#41;;
&#125;
&#125;</pre>
@ -214,15 +211,7 @@ Here is how you create the heightmap object in your jME code:
<li><div> Load your prepared heightmap image into the texture object.</div>
</li>
<li><div> Create an AbstractHeightmap object from an ImageBasedHeightMap. <br/>
ImageBasedHeightMap expects the following parameters:</div>
<ol>
<li><div> An <code>ImageToAwt.convert()</code>ed image file.</div>
</li>
<li><div> A boolean whether you are using 16-bit – here: false, this image is 8-bit.</div>
</li>
<li><div> A boolean whether you are using an alphamap – here: true, you will use one.</div>
</li>
</ol>
It requires an image from a JME Texture.</div>
</li>
<li><div> Load the heightmap.</div>
</li>
@ -230,8 +219,7 @@ ImageBasedHeightMap expects the following parameters:</div>
<pre>AbstractHeightMap heightmap = null;
Texture heightMapImage = assetManager.loadTexture&#40;
&quot;Textures/Terrain/splat/mountains512.png&quot;&#41;;
heightmap = new ImageBasedHeightMap&#40;
ImageToAwt.convert&#40;heightMapImage.getImage&#40;&#41;, false, true, 0&#41;&#41;;
heightmap = new ImageBasedHeightMap&#40;heightMapImage.getImage&#40;&#41;&#41;;
heightmap.load&#40;&#41;;</pre>
</div>
@ -440,9 +428,7 @@ You have created the terrain object.
JME3 includes an optimization that adjusts the level of detail (LOD) of the rendered terrain depending on how close or far the camera is.
</p>
<pre> List&lt;Camera&gt; cameras = new ArrayList&lt;Camera&gt;&#40;&#41;;
cameras.add&#40;getCamera&#40;&#41;&#41;;
TerrainLodControl control = new TerrainLodControl&#40;terrain, cameras&#41;;
<pre> TerrainLodControl control = new TerrainLodControl&#40;terrain, getCamera&#40;&#41;&#41;;
terrain.addControl&#40;control&#41;;</pre>
<p>

@ -1,56 +1,2 @@
<h1><a>Building jMonkeyEngine 3 from the Sources</a></h1>
<div>
<p>
We recommend downloading the <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/downloads/list"><param name="text" value="<html><u>jMonkeyEngine SDK</u></html>"><param name="textColor" value="blue"></object> - but of course you can also build the jMonkeyEngine yourself from the sources. In this case, you need the <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://subversion.tigris.org"><param name="text" value="<html><u>Subversion</u></html>"><param name="textColor" value="blue"></object> file version system installed (svn).
</p>
<ol>
<li><div> <strong>Checkout:</strong> Checkout the Subversion repository. <pre>svn checkout http://jmonkeyengine.googlecode.com/svn/trunk/engine jme3</pre>
</div>
<ul>
<li><div> You can leave login and password empty</div>
</li>
</ul>
</li>
<li><div> <strong>Build:</strong> Execute <code>ant jar</code></div>
<ul>
<li><div> This compiles the JAR files in <code>dist/libs/*</code></div>
</li>
</ul>
</li>
<li><div> <strong>Javadoc:</strong> Execute <code>ant javadoc</code> </div>
<ul>
<li><div> This generates javadocs in the <code>dist/javadoc</code> directory.</div>
</li>
</ul>
</li>
<li><div> <strong>Run:</strong> Execute <code>ant run</code></div>
<ul>
<li><div> This runs the TestChooser where you can browse examples.</div>
</li>
</ul>
</li>
<li><div> <strong>Use:</strong> Create a Java SE project and place all JARs from the <code>dist/lib</code> directory on the classpath.</div>
<ul>
<li><div> You can now extend your first game from <code>com.jme3.app.SimpleApplication</code>. </div>
</li>
</ul>
</li>
</ol>
<hr />
<p>
Learn more about:
</p>
<ul>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/simpleapplication_from_the_commandline.html">Setting up JME3 on the commandline (generic)</a>.</div>
</li>
<li><div> <a href="/com/jme3/gde/core/docs/jme3/build_jme3_sources_with_netbeans.html">Building JME3 from the sources with NetBeans</a> </div>
</li>
</ul>
</div>
<h1><a>Building jMonkeyEngine 3 from the Sources</a></h1><div><p>We recommend downloading the <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/downloads/list"><param name="text" value="<html><u>jMonkeyEngine SDK</u></html>"><param name="textColor" value="blue"></object> - but of course you can also build the jMonkeyEngine yourself from the sources. In this case, you need the <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://subversion.tigris.org"><param name="text" value="<html><u>Subversion</u></html>"><param name="textColor" value="blue"></object> file version system installed (svn).</p><ol><li><div><strong>Checkout:</strong> Checkout the Subversion repository.<pre>svn checkout http://jmonkeyengine.googlecode.com/svn/trunk/engine jme3</pre></div><ul><li><div>You can leave login and password empty</div></li></ul></li><li><div><strong>Build:</strong> Execute <code>ant jar</code></div><ul><li><div>This compiles the JAR files in <code>dist/libs/*</code></div></li></ul></li><li><div><strong>Javadoc:</strong> Execute <code>ant javadoc</code></div><ul><li><div>This generates javadocs in the <code>dist/javadoc</code> directory.</div></li></ul></li><li><div><strong>Run:</strong> Execute <code>ant run</code></div><ul><li><div>This runs the TestChooser where you can browse examples.</div></li></ul></li><li><div><strong>Use:</strong> Create a Java SE project and place all JARs from the <code>dist/lib</code> directory on the classpath.</div><ul><li><div>You can now extend your first game from <code>com.jme3.app.SimpleApplication</code>.</div></li></ul></li></ol><hr /><p>Learn more about:</p><ul><li><div><a href="/com/jme3/gde/core/docs/jme3/simpleapplication_from_the_commandline.html">Setting up JME3 on the commandline (generic)</a>.</div></li><li><div><a href="/com/jme3/gde/core/docs/jme3/build_jme3_sources_with_netbeans.html">Building JME3 from the sources with NetBeans</a></div></li></ul></div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:build_from_sources?do=export_xhtmlbody">view online version</a></em></p>

File diff suppressed because one or more lines are too long

@ -1,21 +1,4 @@
<h1><a>jME3 Application Display Settings</a></h1>
<div>
<p>
Every class that extends jme3.app.SimpleApplication has properties that can be configured by customizing a <code>com.jme3.system.AppSettings</code> object. Configure the settings before you call <code>app.start()</code> on the application object. If you change display settings during runtime, call <code>app.restart()</code> to make them take effect.
</p>
<p>
<strong>Note:</strong> Other runtime settings are covered in <a href="/com/jme3/gde/core/docs/jme3/intermediate/simpleapplication.html">SimpleApplication</a>.
</p>
</div>
<h2><a>Code Sample</a></h2>
<div>
<pre>public static void main&#40;String&#91;&#93; args&#41; &#123;
<h1><a>jME3 Application Display Settings</a></h1><div><p>Every class that extends jme3.app.SimpleApplication has properties that can be configured by customizing a <code>com.jme3.system.AppSettings</code> object. Configure the settings before you call <code>app.start()</code> on the application object. If you change display settings during runtime, call <code>app.restart()</code> to make them take effect.</p><p><strong>Note:</strong> Other runtime settings are covered in <a href="/com/jme3/gde/core/docs/jme3/intermediate/simpleapplication.html">SimpleApplication</a>.</p></div><h2><a>Code Sample</a></h2><div><pre>public static void main&#40;String&#91;&#93; args&#41; &#123;
AppSettings settings = new AppSettings&#40;true&#41;;
settings.setResolution&#40;640,480&#41;;
... // other properties see below
@ -23,86 +6,7 @@ Every class that extends jme3.app.SimpleApplication has properties that can be c
MyGame app = new MyGame&#40;&#41;; // or Main or whatever you called your SimpleApplication
app.setSettings&#40;settings&#41;;
app.start&#40;&#41;;
&#125;</pre>
<p>
Set the boolean in the AppSettings contructor to true if you want to keep the default settings for everything that you do not specify. Set this parameter to false if you want to change some of the settings, but otherwise want the application to load user settings from previous launches.
</p>
<p>
<p><div>Use <code>app.setShowSettings(true);</code> to present the user with a splashscreen and display settings dialog when starting the game, or <code>app.setShowSettings(false);</code> to hide the custom splashscreen. Set this boolean before calling <code>app.start()</code> on the SimpleApplication.
</div></p>
</p>
</div>
<h2><a>Properties</a></h2>
<div>
<div><table>
<tr>
<th>Settings Property (Video)</th><th>Description</th><th>Default</th>
</tr>
<tr>
<td>setRenderer(AppSettings.LWJGL_OPENGL1) <br/>
setRenderer(AppSettings.LWJGL_OPENGL2) <br/>
setRenderer(AppSettings.LWJGL_OPENGL3)</td><td>Switch Video Renderer to OpenGL 1.1, OpenGL 2, or OpenGL 3.3. If your graphic card does not support all OpenGL2 features (<code>UnsupportedOperationException: GLSL and OpenGL2 is required for the LWJGL renderer</code>), then you can force your SimpleApplication to use OpenGL1 compatibility. (Then you still can&#039;t use special OpenGL2 features, but at least the error goes away and you can continue with the rest.) </td><td> OpenGL 2 </td>
</tr>
<tr>
<td>setBitsPerPixel(32)</td><td>Set the color depth. <br/>
1 bpp = black and white, 2 bpp = gray, <br/>
4 bpp = 16 colors, 8 bpp = 256 colors, 24 or 32 bpp = &quot;truecolor&quot;.</td><td>24</td>
</tr>
<tr>
<td>setFramerate(60)</td><td>How often per second the engine should try to refresh the frame. For the release, usually 60 fps. Can be lower (30) if you need to free up the CPU for other applications. No use setting it to a higher value than the screen frequency! If the framerate goes below 30 fps, viewers start to notice choppiness or flickering.</td><td>-1 (unlimited)</td>
</tr>
<tr>
<td>setFullscreen(true)</td><td>Set this to true to make the game window fill the whole screen; you need to provide a key that calls app.stop() to exit the fullscreen view gracefully (default: escape). <br/>
Set this to false to play the game in a normal window of its own.</td><td>False (windowed)</td>
</tr>
<tr>
<td>setHeight(480), setWidth(640) <br/>
setResolution(640,480)</td><td>Two equivalent ways of setting the display resolution.</td><td>640x480 pixels</td>
</tr>
<tr>
<td>setSamples(4)</td><td>Set multisampling to 0 to switch antialiasing off (harder edges, faster.) <br/>
Set multisampling to 2 or 4 to activate antialising (softer edges, may be slower.) <br/>
Depending on your graphic card, you may be able to set multisampling to higher values such as 8, 16, or 32 samples.</td><td>0</td>
</tr>
<tr>
<td>setVSync(true) <br/>
setFrequency(60)</td><td>Set vertical syncing to true to time the frame buffer to coincide with the refresh frequency of the screen. VSync prevents ugly page tearing artefacts, but is a bit slower; recommened for release build. <br/>
Set VSync to false to deactivate vertical syncing (faster, but possible page tearing artifacts); can remain deactivated during development or for slower PCs.</td><td>false <br/>
60 fps</td>
</tr>
</table></div>
<!-- EDIT1 TABLE [1406-3627] --><div><table>
<tr>
<th>Settings Property (Input)</th><th>Description</th><th>Default</th>
</tr>
<tr>
<td>setUseInput(false)</td><td>Respond to user input by mouse and keyboard. Can be deactivated for use cases where you only display a 3D scene on the canvas without any interaction.</td><td>true</td>
</tr>
<tr>
<td>setUseJoysticks(true)</td><td>Activate optional joystick support</td><td>false</td>
</tr>
</table></div>
<!-- EDIT2 TABLE [3629-3918] --><div><table>
<tr>
<th>Settings Property (Audio)</th><th>Description</th><th>Default</th>
</tr>
<tr>
<td>setAudioRenderer(AppSettings.LWJGL_OPENAL)</td><td>Switch Audio Renderer. Currently there is only one option. </td><td>OpenAL</td>
</tr>
<tr>
<td>setStereo3D(true)</td><td>Enable 3D stereo. This feature requires hardware support from the GPU driver. See <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikipedia.org/wiki/Quad_buffering"><param name="text" value="<html><u>Quad Buffering</u></html>"><param name="textColor" value="blue"></object>. Currently, your everday user&#039;s hardware does not support this, so you can ignore it for now.</td><td>false</td>
</tr>
</table></div>
<!-- EDIT3 TABLE [3920-4344] --><div><table>
<tr>
<th>Settings Property (Branding)</th><th>Description</th><th>Default</th>
</tr>
<tr>
<td>setTitle(&quot;My Game&quot;)</td><td>This string will be visible in the titlebar, unless the window is fullscreen.</td><td>&quot;jMonkey Engine 3.0&quot;</td>
&#125;</pre><p>Set the boolean in the AppSettings contructor to true if you want to keep the default settings for everything that you do not specify. Set this parameter to false if you want to change some of the settings, but otherwise want the application to load user settings from previous launches.</p><p><p><div>Use <code>app.setShowSettings(true);</code> to present the user with a splashscreen and display settings dialog when starting the game, or <code>app.setShowSettings(false);</code> to hide the custom splashscreen. Set this boolean before calling <code>app.start()</code> on the SimpleApplication.</div></p></p></div><h2><a>Properties</a></h2><div><div><table><tr><th>Settings Property (Video)</th><th>Description</th><th>Default</th></tr><tr><td>setRenderer(AppSettings.LWJGL_OPENGL1) <br/> setRenderer(AppSettings.LWJGL_OPENGL2) <br/> setRenderer(AppSettings.LWJGL_OPENGL3)</td><td>Switch Video Renderer to OpenGL 1.1, OpenGL 2, or OpenGL 3.3. If your graphic card does not support all OpenGL2 features (<code>UnsupportedOperationException: GLSL and OpenGL2 is required for the LWJGL renderer</code>), then you can force your SimpleApplication to use OpenGL1 compatibility. (Then you still can&#039;t use special OpenGL2 features, but at least the error goes away and you can continue with the rest.)</td><td>OpenGL 2</td></tr><tr><td>setBitsPerPixel(32)</td><td>Set the color depth. <br/> 1 bpp = black and white, 2 bpp = gray, <br/> 4 bpp = 16 colors, 8 bpp = 256 colors, 24 or 32 bpp = &quot;truecolor&quot;.</td><td>24</td></tr><tr><td>setFramerate(60)</td><td>How often per second the engine should try to refresh the frame. For the release, usually 60 fps. Can be lower (30) if you need to free up the CPU for other applications. No use setting it to a higher value than the screen frequency! If the framerate goes below 30 fps, viewers start to notice choppiness or flickering.</td><td>-1 (unlimited)</td></tr><tr><td>setFullscreen(true)</td><td>Set this to true to make the game window fill the whole screen; you need to provide a key that calls app.stop() to exit the fullscreen view gracefully (default: escape). <br/> Set this to false to play the game in a normal window of its own.</td><td>False (windowed)</td></tr><tr><td>setHeight(480), setWidth(640) <br/> setResolution(640,480)</td><td>Two equivalent ways of setting the display resolution.</td><td>640x480 pixels</td></tr><tr><td>setSamples(4)</td><td>Set multisampling to 0 to switch antialiasing off (harder edges, faster.) <br/> Set multisampling to 2 or 4 to activate antialising (softer edges, may be slower.) <br/> Depending on your graphic card, you may be able to set multisampling to higher values such as 8, 16, or 32 samples.</td><td>0</td></tr><tr><td>setVSync(true) <br/> setFrequency(60)</td><td>Set vertical syncing to true to time the frame buffer to coincide with the refresh frequency of the screen. VSync prevents ugly page tearing artefacts, but is a bit slower; recommened for release build. <br/> Set VSync to false to deactivate vertical syncing (faster, but possible page tearing artifacts); can remain deactivated during development or for slower PCs.</td><td>false <br/> 60 fps</td></tr></table></div><div><table><tr><th>Settings Property (Input)</th><th>Description</th><th>Default</th></tr><tr><td>setUseInput(false)</td><td>Respond to user input by mouse and keyboard. Can be deactivated for use cases where you only display a 3D scene on the canvas without any interaction.</td><td>true</td></tr><tr><td>setUseJoysticks(true)</td><td>Activate optional joystick support</td><td>false</td></tr></table></div><div><table><tr><th>Settings Property (Audio)</th><th>Description</th><th>Default</th></tr><tr><td>setAudioRenderer(AppSettings.LWJGL_OPENAL)</td><td>Switch Audio Renderer. Currently there is only one option.</td><td>OpenAL</td></tr><tr><td>setStereo3D(true)</td><td>Enable 3D stereo. This feature requires hardware support from the GPU driver. See <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikipedia.org/wiki/Quad_buffering"><param name="text" value="<html><u>Quad Buffering</u></html>"><param name="textColor" value="blue"></object>. Currently, your everday user&#039;s hardware does not support this, so you can ignore it for now.</td><td>false</td></tr></table></div><div><table><tr><th>Settings Property (Branding)</th><th>Description</th><th>Default</th></tr><tr><td>setTitle(&quot;My Game&quot;)</td><td>This string will be visible in the titlebar, unless the window is fullscreen.</td><td>&quot;jMonkey Engine 3.0&quot;</td>
</tr>
<tr>
<td>setIcons(new BufferedImage[]{ <br/>

@ -1,48 +1,4 @@
<h1><a>Best Practices For jME3 Developers</a></h1>
<div>
<p>
A collection of recommendations and expert tips. Feel free to add your own!
If you are a beginner, you should first <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.hobbygamedev.com/digests/?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>
<h2><a>Requirements Gathering</a></h2>
<div>
<p>
As a quick overview, answer yourself the following questions:
</p>
<ul>
<li><div> Motivation</div>
<ul>
<li><div> Sum up your game idea in one sentence. If you can&#039;t, it&#039;s too complicated.</div>
</li>
<li><div> Who&#039;s the target group? Why would they choose your game over the million others that exist?</div>
</li>
</ul>
</li>
<li><div> Game type</div>
<ul>
<li><div> Point of view (camera)? What character(s) does the player control (if any)?</div>
</li>
<li><div> Time- or turn-based?</div>
</li>
<li><div> Genre, setting, background story? (If applicable)</div>
</li>
</ul>
</li>
<li><div> Gameplay</div>
<ul>
<li><div> What is the start state, what is the end state?</div>
</li>
<li><div> What resources does the player manage? How are resources gained, transformed, spent? E.g. speed, gold, health, &quot;points&quot;.</div>
</li>
<li><div> How does the player interact? I.e. rules, challenges, game mechanics.</div>
<h1><a>Best Practices For jME3 Developers</a></h1><div><p>A collection of recommendations and expert tips. Feel free to add your own! If you are a beginner, you should first <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.hobbygamedev.com/digests/?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> Requirements Gathering</h2><div><p>As a quick overview, answer yourself the following questions:</p><ul><li><div>Motivation</div><ul><li><div>Sum up your game idea in one sentence. If you can&#039;t, it&#039;s too complicated.</div></li><li><div>Who&#039;s the target group? Why would they choose your game over the million others that exist?</div></li></ul></li><li><div>Game type</div><ul><li><div>Point of view (camera)? What character(s) does the player control (if any)?</div></li><li><div>Time- or turn-based?</div></li><li><div>Genre, setting, background story? (If applicable)</div></li></ul></li><li><div>Gameplay</div><ul><li><div>What is the start state, what is the end state?</div></li><li><div>What resources does the player manage? How are resources gained, transformed, spent? E.g. speed, gold, health, &quot;points&quot;.</div></li><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>

@ -1,78 +1,2 @@
<h1><a>jMonkeyEngine3 Supported File Types</a></h1>
<div>
</div>
<h2><a>jMonkeyEngine3 File Formats</a></h2>
<div>
<div><table>
<tr>
<th>Suffix</th><th>Usage</th><th>Learn more</th>
</tr>
<tr>
<td>.j3o</td><td>Binary 3D model or scene. At the latest from the Beta release of your game on, you should convert all models to .j3o format. <br/>
During alpha and earlier development phases (when models still change a lot) you can alternatively load OgreXML/OBJ models directly.</td><td><a href="/com/jme3/gde/core/docs/sdk/model_loader_and_viewer.html">Model Loader and Viewer</a> </td>
</tr>
<tr>
<td>.j3m</td><td>A custom Material. You can create a .j3m file to store a Material configuration for a Geometry (e.g. 3D model).</td><td><a href="/com/jme3/gde/core/docs/jme3/advanced/materials_overview.html">Materials Overview</a> <br/>
<a href="/com/jme3/gde/core/docs/sdk/material_editing.html">Material Editing</a> </td>
</tr>
<tr>
<td>.j3md</td><td>A Material definition. These are pre-defined templates for shader-based Materials. <br/>
Each custom .j3m Material is based on a material definition. Advanced users can create their own material definitions. </td><td> <a href="/com/jme3/gde/core/docs/jme3/advanced/materials_overview.html">Materials Overview</a> </td>
</tr>
<tr>
<td>.j3f</td><td>A custom post-processor filter configuration. You can create a .j3f file to store a FilterPostProcessor with a set of preconfigured filters. </td><td> <a href="/com/jme3/gde/core/docs/sdk/filters.html">Filters</a> <br/>
<a href="/com/jme3/gde/core/docs/jme3/advanced/effects_overview.html">Effects Overview</a> </td>
</tr>
</table></div>
<!-- EDIT1 TABLE [93-1068] -->
</div>
<h2><a>Supported External File Types</a></h2>
<div>
<div><table>
<tr>
<th>File Suffix</th><th>Type</th><th>Description</th>
</tr>
<tr>
<td>.mesh.xml, .meshxml</td><td>3D model</td><td>Ogre Mesh <acronym title="Extensible Markup Language">XML</acronym> </td>
</tr>
<tr>
<td>.scene</td><td>3D scene</td><td>Ogre DotScene </td>
</tr>
<tr>
<td>.OBJ, .MTL</td><td>3D model</td><td>Wavefront</td>
</tr>
<tr>
<td>.blend</td><td>3D model</td><td>Blender version 2.49 or 2.5x</td>
</tr>
<tr>
<td>.<acronym title="Joint Photographics Experts Group">JPG</acronym>, .<acronym title="Portable Network Graphics">PNG</acronym>, .<acronym title="Graphics Interchange Format">GIF</acronym></td><td>image</td><td>Textures, icons</td>
</tr>
<tr>
<td>.DDS</td><td>image</td><td>Direct Draw Surface texture</td>
</tr>
<tr>
<td>.HDR</td><td>image</td><td>High Dynamic Range texture</td>
</tr>
<tr>
<td>.TGA</td><td>image</td><td>Targa Image File texture</td>
</tr>
<tr>
<td>.PFM</td><td>image</td><td>Portable Float Map texture</td>
</tr>
<tr>
<td>.fnt</td><td>bitmap font</td><td>AngelCode font for <acronym title="Graphical User Interface">GUI</acronym> and HUD</td>
</tr>
<tr>
<td>.WAV</td><td>audio</td><td>Wave music and sounds</td>
</tr>
<tr>
<td>.OGG</td><td>audio</td><td>OGG Vorbis music and sounds</td>
</tr>
</table></div>
<!-- EDIT2 TABLE [1113-1628] -->
</div>
<h1><a>jMonkeyEngine3 Supported File Types</a></h1><div></div><h2><a>jMonkeyEngine3 File Formats</a></h2><div><div><table><tr><th>Suffix</th><th>Usage</th><th>Learn more</th></tr><tr><td>.j3o</td><td>Binary 3D model or scene. At the latest from the Beta release of your game on, you should convert all models to .j3o format. <br/> During alpha and earlier development phases (when models still change a lot) you can alternatively load OgreXML/OBJ models directly.</td><td><a href="/com/jme3/gde/core/docs/sdk/model_loader_and_viewer.html">Model Loader and Viewer</a></td></tr><tr><td>.j3m</td><td>A custom Material. You can create a .j3m file to store a Material configuration for a Geometry (e.g. 3D model).</td><td><a href="/com/jme3/gde/core/docs/jme3/advanced/materials_overview.html">Materials Overview</a> <br/> <a href="/com/jme3/gde/core/docs/sdk/material_editing.html">Material Editing</a></td></tr><tr><td>.j3md</td><td>A Material definition. These are pre-defined templates for shader-based Materials. <br/> Each custom .j3m Material is based on a material definition. Advanced users can create their own material definitions.</td><td><a href="/com/jme3/gde/core/docs/jme3/advanced/materials_overview.html">Materials Overview</a></td></tr><tr><td>.j3f</td><td>A custom post-processor filter configuration. You can create a .j3f file to store a FilterPostProcessor with a set of preconfigured filters.</td><td><a href="/com/jme3/gde/core/docs/sdk/filters.html">Filters</a> <br/> <a href="/com/jme3/gde/core/docs/jme3/advanced/effects_overview.html">Effects Overview</a></td></tr></table></div></div><h2><a>Supported External File Types</a></h2><div><div><table><tr><th>File Suffix</th><th>Type</th><th>Description</th></tr><tr><td>.mesh.xml, .meshxml</td><td>3D model</td><td>Ogre Mesh <acronym title="Extensible Markup Language">XML</acronym></td></tr><tr><td>.scene</td><td>3D scene</td><td>Ogre DotScene</td></tr><tr><td>.OBJ, .MTL</td><td>3D model</td><td>Wavefront</td></tr><tr><td>.blend</td><td>3D model</td><td>Blender version 2.49 or 2.5x</td></tr><tr><td>.<acronym title="Joint Photographics Experts Group">JPG</acronym>, .<acronym title="Portable Network Graphics">PNG</acronym>, .<acronym title="Graphics Interchange Format">GIF</acronym></td><td>image</td><td>Textures, icons</td></tr><tr><td>.DDS</td><td>image</td><td>Direct Draw Surface texture</td></tr><tr><td>.HDR</td><td>image</td><td>High Dynamic Range texture</td></tr><tr><td>.TGA</td><td>image</td><td>Targa Image File texture</td></tr><tr><td>.PFM</td><td>image</td><td>Portable Float Map texture</td></tr><tr><td>.fnt</td><td>bitmap font</td><td>AngelCode font for <acronym title="Graphical User Interface">GUI</acronym> and HUD</td></tr><tr><td>.WAV</td><td>audio</td><td>Wave music and sounds</td></tr><tr><td>.OGG</td><td>audio</td><td>OGG Vorbis music and sounds</td></tr></table></div></div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:intermediate:file_types?do=export_xhtmlbody">view online version</a></em></p>

File diff suppressed because one or more lines are too long

@ -1,47 +1,4 @@
<h1><a>Optimization reference</a></h1>
<div>
<p>
This page is intended as a reference collection of optimization tricks that can be used to speed up JME3 applications.
</p>
</div>
<h2><a>Maintain low Geometry count</a></h2>
<div>
<p>
The more Geometry objects are added to the scene, the harder it gets to handle them in a speedy fashion.
The reason for this is, that for every object a render command must be done, here is a bottleneck between the CPU and the graphics card.
</p>
<p>
<strong>Possible optimization techniques</strong>
</p>
<ul>
<li><div> Use GeometryBatchFactory.optimize(node) to merge the meshes of the geometries contained in the given node into fewer batches (based on common Material used). You can do this using the SceneComposer in the <acronym title="Software Development Kit">SDK</acronym> as well, just right-click a node and select &quot;Optimize Geometry&quot;</div>
</li>
</ul>
<p>
<strong>Side-effects</strong>
</p>
<ul>
<li><div> Using GeometryBatchFactory merges individual Geometries into a single mesh. Thereby it becomes hard to apply specific Materials or to remove a single Geometry. Therefore it should be used for static Geometry only that does not require frequent changes or individual materials/texturing.</div>
</li>
<li><div>Using Texture atlases might be a way to provide a limited individual texturing.</div>
</li>
</ul>
</div>
<h2><a>Avoid creating new objects</a></h2>
<div>
<p>
When you use math operations like vectorA.mult(vectorB); new objects are created that have to be garbage collected when you don&#039;t use them anymore. Check your math operations for opportunities to use the local version of the math operations, e.g. vectorA.multLocal(vectorB). This way the result is stored in vectorA and no new object needs to be created.
<h1><a>Optimization reference</a></h1><div><p>This page is intended as a reference collection of optimization tricks that can be used to speed up JME3 applications.</p></div><h2><a>Maintain low Geometry count</a></h2><div><p>The more Geometry objects are added to the scene, the harder it gets to handle them in a speedy fashion. The reason for this is, that for every object a render command must be done, here is a bottleneck between the CPU and the graphics card.</p><p><strong>Possible optimization techniques</strong></p><ul><li><div>Use GeometryBatchFactory.optimize(node) to merge the meshes of the geometries contained in the given node into fewer batches (based on common Material used). You can do this using the SceneComposer in the <acronym title="Software Development Kit">SDK</acronym> as well, just right-click a node and select &quot;Optimize Geometry&quot;</div></li></ul><p><strong>Side-effects</strong></p><ul><li><div>Using GeometryBatchFactory merges individual Geometries into a single mesh. Thereby it becomes hard to apply specific Materials or to remove a single Geometry. Therefore it should be used for static Geometry only that does not require frequent changes or individual materials/texturing.</div></li><li><div>Using Texture atlases might be a way to provide a limited individual texturing.</div></li></ul></div><h2><a>Avoid creating new objects</a></h2><div><p>When you use math operations like vectorA.mult(vectorB); new objects are created that have to be garbage collected when you don&#039;t use them anymore. Check your math operations for opportunities to use the local version of the math operations, e.g. vectorA.multLocal(vectorB). This way the result is stored in vectorA and no new object needs to be created.
</p>

@ -1,20 +1,4 @@
<h1><a>SimpleApplication and Application</a></h1>
<div>
<p>
The base class of the jMonkeyEngine3 is <code>com.jme3.app.SimpleApplication</code>. Your first game&#039;s Main class extends SimpleApplication directly. When you feel confident you understand the features, you will typically extend SimpleApplication to create a custom base class for the type of games that you want to develop.
</p>
<p>
SimpleApplication offers standard game features such as a scene graph, input handling, and a fly-by camera. You call app.start() and app.stop() on your game instance to start or quit the application.
</p>
<p>
The following code sample shows the typical base structure of a jME3 game:
</p>
<pre>import com.jme3.app.SimpleApplication;
<h1><a>SimpleApplication and Application</a></h1><div><p>The base class of the jMonkeyEngine3 is <code>com.jme3.app.SimpleApplication</code>. Your first game&#039;s Main class extends SimpleApplication directly. When you feel confident you understand the features, you will typically extend SimpleApplication to create a custom base class for the type of games that you want to develop.</p><p>SimpleApplication offers standard game features such as a scene graph, input handling, and a fly-by camera. You call app.start() and app.stop() on your game instance to start or quit the application.</p><p>The following code sample shows the typical base structure of a jME3 game:</p><pre>import com.jme3.app.SimpleApplication;
&nbsp;
public class MyBaseGame extends SimpleApplication &#123;
&nbsp;
@ -37,29 +21,7 @@ public class MyBaseGame extends SimpleApplication &#123;
public void simpleRender&#40;RenderManager rm&#41; &#123;
/* (optional) Make advanced modifications to frameBuffer and scene graph. */
&#125;
&#125;</pre>
<p>
Let&#039;s have a look at the <acronym title="Application Programming Interface">API</acronym> of the base class.
</p>
</div>
<h2><a>Application Class</a></h2>
<div>
<p>
Internally, com.jme3.app.SimpleApplication extends com.jme3.app.Application. The Application class represents a generic real-time 3D rendering jME3 application (i.e., not necessarily a game). Typically, you do not extend com.jme3.app.Application directly to create a game.
</p>
<div><table>
<tr>
<th>Application class fields</th><th>Purpose</th>
</tr>
<tr>
<td>viewPort <br/>
getViewPort()</td><td>The view object for the default camera. You can register advanced <a href="/com/jme3/gde/core/docs/jme3/advanced/effects_overview.html">post-processor filters</a> here.</td>
&#125;</pre><p>Let&#039;s have a look at the <acronym title="Application Programming Interface">API</acronym> of the base class.</p></div><h2><a>Application Class</a></h2><div><p>Internally, com.jme3.app.SimpleApplication extends com.jme3.app.Application. The Application class represents a generic real-time 3D rendering jME3 application (i.e., not necessarily a game). Typically, you do not extend com.jme3.app.Application directly to create a game.</p><div><table><tr><th>Application class fields</th><th>Purpose</th></tr><tr><td>viewPort <br/> getViewPort()</td><td>The view object for the default camera. You can register advanced <a href="/com/jme3/gde/core/docs/jme3/advanced/effects_overview.html">post-processor filters</a> here.</td>
</tr>
<tr>
<td>settings <br/>

@ -1,148 +1,5 @@
<h1><a>Introduction to Mathematical Functionality</a></h1>
<div>
<p>
It&#039;s a fact of life, math is hard. Unfortunately, 3D graphics require a fair bit of knowledge about the subject. Fortunately, jME is able to hide the majority of the details away from the user. Vectors are the fundamental type in the 3D environment, and it is used extensively. Matrices are also a basic necessity of 3D for representing linear systems. Quaternions are perhaps the most complicated of the basic types and are used for rotation in jME.
</p>
<p>
I&#039;ll discuss how these are used in the system for the core functionality. Including Transforming, Visibility Determination, Collision Detection, and the Coordinate System. Note, that these are low level details. Further chapters will discuss how to use these various systems from a high level perspective.
</p>
<p>
To get a visual introduction to math in jME3 for the absolute beginner, check out our <a href="/com/jme3/gde/core/docs/jme3/math_for_dummies.html">Math for Dummies</a> introduction class.
</p>
</div>
<h2><a>Coordinate System</a></h2>
<div>
</div>
<h3><a>Definition</a></h3>
<div>
<p>
A <em>coordinate system</em> consists of an origin (single point in space) and three coordinate axes that are each unit length and mutually perpendicular. The axes can be written as the column of a Matrix, R = [U1|U2|U3]. In fact, this is exactly how CameraNode works. The coordinate system defined by Camera is stored in a Matrix.
</p>
<p>
jME uses a Right-Handed coordinate system (as OpenGL does).
</p>
<p>
The definition of a coordinate system is defined in jME by the properties sent to Camera. There are no error checks to insure that: 1) the coordinate system is right-handed and 2) The axes are mutually perpendicular. Therefore, if the user sets the axes incorrectly, they are going to experience very odd rendering artifacts (random culling, etc).
</p>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/intermediate/coordinate-system.png">
</p>
</div>
<h2><a>Transformations</a></h2>
<div>
<p>
Transformations define an operation that converts points from one coordinate system to another. This includes translation, rotation and scaling. In jME, local transforms are used to represent the positioning of objects relative to a parent coordinate system. While, world transforms are used to represent the positioning of objects in a global coordinate system.
</p>
</div>
<h2><a>Visibility Determination</a></h2>
<div>
<p>
Visibility Determination concerns itself with minimizing the amount of data that is sent to the graphics card for rendering. Specifically, we do not want to send data that will not be seen. Data not sent to the graphics card is said to be culled. The primary focus of this section is Frustum Culling based on the Camera&#039;s view frustum. In essence, this frustum creates six standard view planes. The BoundingVolume of an object is tested against the frustum planes to determine if it is contained in the frustum. If at any point the object&#039;s bounding is outside of the plane, it is tossed out and no longer processed for rendering. This also includes any children that it managed, allowing fast culling of large sections of the scene.
</p>
</div>
<h1><a>Fundamental Types</a></h1>
<div>
</div>
<h2><a>ColorRGBA</a></h2>
<div>
</div>
<h3><a>Definition</a></h3>
<div>
<p>
ColorRGBA defines a color value in the jME library. The color value is made of three components, red, green and blue. A fourth component defines the alpha value (transparent) of the color. Every value is set between [0, 1]. Anything less than 0 will be clamped to 0 and anything greater than 1 will be clamped to 1.
</p>
<p>
<strong>Note:</strong> If you would like to &quot;convert&quot; an ordinary RGB value (0-255) to the format used here (0-1), simply multiply it with: 1/255.
</p>
</div>
<h3><a>jME Class</a></h3>
<div>
<p>
ColorRGBA defines a few static color values for ease of use. That is, rather than:
</p>
<pre>ColorRGBA red = new ColorRGBA&#40;1,0,0,1&#41;;
object.setSomeColor&#40;red&#41;;</pre>
<p>
you can simply say:
</p>
<pre>object.setSomeColor&#40;ColorRGBA.red&#41;</pre>
<p>
ColorRGBA will also handle interpolation between two colors. Given a second color and a value between 0 and 1, a the owning ColorRGBA object will have its color values altered to this new interpolated color.
</p>
</div>
<h2><a>Matrix</a></h2>
<div>
<p>
See <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.jmonkeyengine.com/doc/com/jme/math/Matrix3f.html"><param name="text" value="<html><u>Javadoc of Matrix3f</u></html>"><param name="textColor" value="blue"></object><br/>
and <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.jmonkeyengine.com/doc/com/jme/math/Matrix4f.html"><param name="text" value="<html><u>Javadoc of Matrix4f</u></html>"><param name="textColor" value="blue"></object>
</p>
</div>
<h3><a>Definition</a></h3>
<div>
<p>
A Matrix is typically used as a <em>linear transformation</em> to map vectors to vectors. That is: Y = MX where X is a Vector and M is a Matrix applying any or all transformations (scale, rotate, translate).
</p>
<p>
There are a few special matrices:
</p>
<p>
<em>zero matrix</em> is the Matrix with all zero entries.
</p>
<div><table>
<tr>
<td>0</td><td>0</td><td>0</td>
</tr>
<tr>
<td>0</td><td>0</td><td>0</td>
<h1><a>Introduction to Mathematical Functionality</a></h1><div><p>It&#039;s a fact of life, math is hard. Unfortunately, 3D graphics require a fair bit of knowledge about the subject. Fortunately, jME is able to hide the majority of the details away from the user. Vectors are the fundamental type in the 3D environment, and it is used extensively. Matrices are also a basic necessity of 3D for representing linear systems. Quaternions are perhaps the most complicated of the basic types and are used for rotation in jME.</p><p>I&#039;ll discuss how these are used in the system for the core functionality. Including Transforming, Visibility Determination, Collision Detection, and the Coordinate System. Note, that these are low level details. Further chapters will discuss how to use these various systems from a high level perspective.</p><p>To get a visual introduction to math in jME3 for the absolute beginner, check out our <a href="/com/jme3/gde/core/docs/jme3/math_for_dummies.html">Math for Dummies</a> introduction class.</p></div><h2><a>Coordinate System</a></h2><div></div><h3><a>Definition</a></h3><div><p>A <em>coordinate system</em> consists of an origin (single point in space) and three coordinate axes that are each unit length and mutually perpendicular. The axes can be written as the column of a Matrix, R = [U1|U2|U3]. In fact, this is exactly how CameraNode works. The coordinate system defined by Camera is stored in a Matrix.</p><p>jME uses a Right-Handed coordinate system (as OpenGL does).</p><p>The definition of a coordinate system is defined in jME by the properties sent to Camera. There are no error checks to insure that: 1) the coordinate system is right-handed and 2) The axes are mutually perpendicular. Therefore, if the user sets the axes incorrectly, they are going to experience very odd rendering artifacts (random culling, etc).</p><p><img src="nbdocs:/com/jme3/gde/core/docs/jme3/intermediate/coordinate-system.png"></p></div><h2><a>Transformations</a></h2><div><p>Transformations define an operation that converts points from one coordinate system to another. This includes translation, rotation and scaling. In jME, local transforms are used to represent the positioning of objects relative to a parent coordinate system. While, world transforms are used to represent the positioning of objects in a global coordinate system.</p></div><h2><a>Visibility Determination</a></h2><div><p>Visibility Determination concerns itself with minimizing the amount of data that is sent to the graphics card for rendering. Specifically, we do not want to send data that will not be seen. Data not sent to the graphics card is said to be culled. The primary focus of this section is Frustum Culling based on the Camera&#039;s view frustum. In essence, this frustum creates six standard view planes. The BoundingVolume of an object is tested against the frustum planes to determine if it is contained in the frustum. If at any point the object&#039;s bounding is outside of the plane, it is tossed out and no longer processed for rendering. This also includes any children that it managed, allowing fast culling of large sections of the scene.</p></div><h1><a>Fundamental Types</a></h1><div></div><h2><a>ColorRGBA</a></h2><div></div><h3><a>Definition</a></h3><div><p>ColorRGBA defines a color value in the jME library. The color value is made of three components, red, green and blue. A fourth component defines the alpha value (transparent) of the color. Every value is set between [0, 1]. Anything less than 0 will be clamped to 0 and anything greater than 1 will be clamped to 1.</p><p><strong>Note:</strong> If you would like to &quot;convert&quot; an ordinary RGB value (0-255) to the format used here (0-1), simply multiply it with: 1/255.</p></div><h3><a>jME Class</a></h3><div><p>ColorRGBA defines a few static color values for ease of use. That is, rather than:</p><pre>ColorRGBA red = new ColorRGBA&#40;1,0,0,1&#41;;
object.setSomeColor&#40;red&#41;;</pre><p>you can simply say:</p><pre>object.setSomeColor&#40;ColorRGBA.red&#41;</pre><p>ColorRGBA will also handle interpolation between two colors. Given a second color and a value between 0 and 1, a the owning ColorRGBA object will have its color values altered to this new interpolated color.</p></div><h2><a>Matrix</a></h2><div><p>See <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.jmonkeyengine.com/doc/com/jme/math/Matrix3f.html"><param name="text" value="<html><u>Javadoc of Matrix3f</u></html>"><param name="textColor" value="blue"></object><br/> and <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.jmonkeyengine.com/doc/com/jme/math/Matrix4f.html"><param name="text" value="<html><u>Javadoc of Matrix4f</u></html>"><param name="textColor" value="blue"></object></p></div><h3><a>Definition</a></h3><div><p>A Matrix is typically used as a <em>linear transformation</em> to map vectors to vectors. That is: Y = MX where X is a Vector and M is a Matrix applying any or all transformations (scale, rotate, translate).</p><p>There are a few special matrices:</p><p><em>zero matrix</em> is the Matrix with all zero entries.</p><div><table><tr><td>0</td><td>0</td><td>0</td></tr><tr><td>0</td><td>0</td><td>0</td>
</tr>
<tr>
<td>0</td><td>0</td><td>0</td>

@ -1,21 +1,4 @@
<h1><a>Starting a JME3 application from the Commandline</a></h1>
<div>
<p>
Although we recommend the jMonkeyEngine <a href="/com/jme3/gde/core/docs/sdk.html">SDK</a> for developing JME3 games, you can use any IDE (integrated development environment) such as <a href="/com/jme3/gde/core/docs/jme3/setting_up_netbeans_and_jme3.html">NetBeans</a> or <a href="/com/jme3/gde/core/docs/jme3/setting_up_jme3_in_eclipse.html">Eclipse</a>, and even work freely from the commandline. Here is a generic IDE-independent &quot;getting started&quot; tutorial.
</p>
<p>
This example shows how to set up and run a simple application (HelloJME3) that depends on the jMonkeyEngine3 libraries.
</p>
<p>
The directory structure will look as follows:
</p>
<pre>jme3/
<h1><a>Starting a JME3 application from the Commandline</a></h1><div><p>Although we recommend the jMonkeyEngine <a href="/com/jme3/gde/core/docs/sdk.html">SDK</a> for developing JME3 games, you can use any IDE (integrated development environment) such as <a href="/com/jme3/gde/core/docs/jme3/setting_up_netbeans_and_jme3.html">NetBeans</a> or <a href="/com/jme3/gde/core/docs/jme3/setting_up_jme3_in_eclipse.html">Eclipse</a>, and even work freely from the commandline. Here is a generic IDE-independent &quot;getting started&quot; tutorial.</p><p>This example shows how to set up and run a simple application (HelloJME3) that depends on the jMonkeyEngine3 libraries.</p><p>The directory structure will look as follows:</p><pre>jme3/
jme3/lib
jme3/src
...
@ -23,76 +6,18 @@ HelloJME3/
HelloJME3/lib
HelloJME3/assets
HelloJME3/src
...</pre>
</div>
<h2><a>Installing the JME3 Framework</a></h2>
<div>
<p>
To install the development version of jme3, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.jmonkeyengine.com/nightly/"><param name="text" value="<html><u>download the nightly build</u></html>"><param name="textColor" value="blue"></object>, unzip the folder into a directory named <code>jme3</code>. The filenames here are just an example, but they will always be something like <code>jME3_xx-xx-2011</code>.
</p>
<pre>mkdir jme3
...</pre></div><h2><a>Installing the JME3 Framework</a></h2><div><p>To install the development version of jme3, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.jmonkeyengine.com/nightly/"><param name="text" value="<html><u>download the nightly build</u></html>"><param name="textColor" value="blue"></object>, unzip the folder into a directory named <code>jme3</code>. The filenames here are just an example, but they will always be something like <code>jME3_xx-xx-2011</code>.</p><pre>mkdir jme3
cd jme3
unzip jME3_01-18-2011.zip</pre>
<p>
Alternatively, you can build JME3 from the sources. (Recommended for JME3 developers.)
</p>
<pre>svn checkout https://jmonkeyengine.googlecode.com/svn/trunk/engine jme3
unzip jME3_01-18-2011.zip</pre><p>Alternatively, you can build JME3 from the sources. (Recommended for JME3 developers.)</p><pre>svn checkout https://jmonkeyengine.googlecode.com/svn/trunk/engine jme3
cd jme3
ant run
cd ..</pre>
<p>
If you see a Test Chooser open now, the build was successful. <strong>Tip:</strong> Use <code>ant</code> to build the libraries without running the demos.
</p>
</div>
<h2><a>Sample Project Directory Structure</a></h2>
<div>
<p>
First we set up the directory and source package structure for your game project. Note that the game project directory <code>HelloJME3</code> is on the same level as your <code>jme3</code> checkout. In this example, we create a Java package that we call <code>hello</code> in the source directory.
</p>
<pre>mkdir HelloJME3
cd ..</pre><p>If you see a Test Chooser open now, the build was successful. <strong>Tip:</strong> Use <code>ant</code> to build the libraries without running the demos.</p></div><h2><a>Sample Project Directory Structure</a></h2><div><p>First we set up the directory and source package structure for your game project. Note that the game project directory <code>HelloJME3</code> is on the same level as your <code>jme3</code> checkout. In this example, we create a Java package that we call <code>hello</code> in the source directory.</p><pre>mkdir HelloJME3
mkdir HelloJME3/src
mkdir HelloJME3/src/hello</pre>
</div>
<h2><a>Libraries</a></h2>
<div>
<p>
Next you copy the necessary JAR libraries from the download to your project. You only have to do this set of steps once every time you download a new JME3 build.
</p>
<pre>mkdir HelloJME3/build
mkdir HelloJME3/src/hello</pre></div><h2><a>Libraries</a></h2><div><p>Next you copy the necessary JAR libraries from the download to your project. You only have to do this set of steps once every time you download a new JME3 build.</p><pre>mkdir HelloJME3/build
mkdir HelloJME3/lib
cp jme3/lib/*.* HelloJME3/lib</pre>
<p>
If you have built JME3 from the sources, then the copy paths are different:
</p>
<pre>mkdir HelloJME3/build
cp jme3/lib/*.* HelloJME3/lib</pre><p>If you have built JME3 from the sources, then the copy paths are different:</p><pre>mkdir HelloJME3/build
mkdir HelloJME3/lib
cp jme3/dist/*.* HelloJME3/lib</pre>
</div>
<h3><a>Sample Code</a></h3>
<div>
<p>
To test your setup, create the file <code>HelloJME3/src/hello/HelloJME3.java</code> with any text editor, paste the following sample code, and save.
</p>
<pre>package hello;
cp jme3/dist/*.* HelloJME3/lib</pre></div><h3><a>Sample Code</a></h3><div><p>To test your setup, create the file <code>HelloJME3/src/hello/HelloJME3.java</code> with any text editor, paste the following sample code, and save.</p><pre>package hello;
&nbsp;
import com.jme3.app.SimpleApplication;
import com.jme3.material.Material;

@ -1,118 +1,4 @@
<h1><a>3D Game Development Terminology</a></h1>
<div>
<p>
Before you start, make certain you are familiar with the following concepts and terminology.
</p>
</div>
<h1><a>3D Graphics and Audio</a></h1>
<div>
<p>
<strong>OpenGL</strong> is the Open Graphics Library, a platform-independent specification for rendering 2D/3D computer graphics. For Java, there are two implementations of OpenGL-based renderers:
</p>
<ol>
<li><div> Lightweight Java Game Library (LWJGL)</div>
</li>
<li><div> Java OpenGL (JOGL)</div>
</li>
</ol>
<p>
<strong>OpenAL</strong> is the Open Audio Library, a platform-independent 3D audio <acronym title="Application Programming Interface">API</acronym>.
</p>
</div>
<h1><a>Context, Display, Renderer</a></h1>
<div>
<p>
The <strong>jME Context</strong> makes settings, renderer, timer, input and event listeners, display system, accessible to a JME game.
</p>
<ul>
<li><div> The <strong>jME Display System</strong> is what draws the custom JME window (instead of Java Swing).</div>
</li>
<li><div> The <strong>input system</strong> is what lets you respond to user input via mouse, keyboard, and joystick.</div>
</li>
<li><div> The <strong>renderer</strong> is what does all the work of calculating how to draw the 3D scenegraph to the 2D screen.</div>
<ul>
<li><div> The <strong>Shader</strong> is a programmable part of the rendering pipeline. The jME3 game engine uses it to offer advanced customizable materials.</div>
</li>
</ul>
</li>
</ul>
</div>
<h1><a>Geometry</a></h1>
<div>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/intermediate/coordinate-system.png">
</p>
</div>
<h2><a>Coordinates</a></h2>
<div>
<p>
Coordinates represent a location in a coordinate system. Coordinates are relative to the origin at (0,0,0). In 3D space, you need to specify three coordinate values to locate a point: X (right), Y (up), Z (towards you).
In contrast to a vector (which looks similar), a coordinate is a location, not a direction.
</p>
</div>
<h3><a>The Origin</a></h3>
<div>
<p>
The origin is the central point in the 3D world, where the three axes meet. It&#039;s at the coordinates (0,0,0).
</p>
<p>
<strong>Example:</strong> <code>Vector3f origin = new Vector3f( Vector3f.ZERO );</code>
</p>
</div>
<h2><a>Vectors</a></h2>
<div>
<p>
A vector has a length and a direction, like an arrow in 3D space. A vector starts at the origin (0,0,0), and ends at the target coordinate (x,y,z). Backwards directions are expressed with negative values.
</p>
<p>
<strong>Example:</strong> <code>Vector3f v = new Vector3f( 17 , -4 , 0 );</code>
</p>
</div>
<h3><a>Unit Vectors</a></h3>
<div>
<p>
A <em>unit vector</em> is a basic vector with a length of 1 world unit. Since its length is fixed (and it thus can only point at one location anyway), the only interesting thing about this vector is its direction.
</p>
<ul>
<li><div> <code>Vector3f.UNIT_X</code> = ( 1, 0, 0) = right</div>
</li>
<li><div> <code>Vector3f.UNIT_Y</code> = ( 0, 1, 0) = up</div>
</li>
<li><div> <code>Vector3f.UNIT_Z</code> = ( 0, 0, 1) = forwards</div>
</li>
<li><div> <code>Vector3f.UNIT_XYZ</code> = 1 wu diagonal right-up-forewards</div>
<h1><a>3D Game Development Terminology</a></h1><div><p>Before you start, make certain you are familiar with the following concepts and terminology.</p></div><h1><a>3D Graphics and Audio</a></h1><div><p><strong>OpenGL</strong> is the Open Graphics Library, a platform-independent specification for rendering 2D/3D computer graphics. For Java, there are two implementations of OpenGL-based renderers:</p><ol><li><div>Lightweight Java Game Library (LWJGL)</div></li><li><div>Java OpenGL (JOGL)</div></li></ol><p><strong>OpenAL</strong> is the Open Audio Library, a platform-independent 3D audio <acronym title="Application Programming Interface">API</acronym>.</p></div><h1><a>Context, Display, Renderer</a></h1><div><p>The <strong>jME Context</strong> makes settings, renderer, timer, input and event listeners, display system, accessible to a JME game.</p><ul><li><div>The <strong>jME Display System</strong> is what draws the custom JME window (instead of Java Swing).</div></li><li><div>The <strong>input system</strong> is what lets you respond to user input via mouse, keyboard, and joystick.</div></li><li><div>The <strong>renderer</strong> is what does all the work of calculating how to draw the 3D scenegraph to the 2D screen.</div><ul><li><div>The <strong>Shader</strong> is a programmable part of the rendering pipeline. The jME3 game engine uses it to offer advanced customizable materials.</div></li></ul></li></ul></div><h1><a>Geometry</a></h1><div><p><img src="nbdocs:/com/jme3/gde/core/docs/jme3/intermediate/coordinate-system.png"></p></div><h2><a>Coordinates</a></h2><div><p>Coordinates represent a location in a coordinate system. Coordinates are relative to the origin at (0,0,0). In 3D space, you need to specify three coordinate values to locate a point: X (right), Y (up), Z (towards you). In contrast to a vector (which looks similar), a coordinate is a location, not a direction.</p></div><h3><a>The Origin</a></h3><div><p>The origin is the central point in the 3D world, where the three axes meet. It&#039;s at the coordinates (0,0,0).</p><p><strong>Example:</strong> <code>Vector3f origin = new Vector3f( Vector3f.ZERO );</code></p></div><h2><a>Vectors</a></h2><div><p>A vector has a length and a direction, like an arrow in 3D space. A vector starts at the origin (0,0,0), and ends at the target coordinate (x,y,z). Backwards directions are expressed with negative values.</p><p><strong>Example:</strong> <code>Vector3f v = new Vector3f( 17 , -4 , 0 );</code></p></div><h3><a>Unit Vectors</a></h3><div><p>A <em>unit vector</em> is a basic vector with a length of 1 world unit. Since its length is fixed (and it thus can only point at one location anyway), the only interesting thing about this vector is its direction.</p><ul><li><div><code>Vector3f.UNIT_X</code> = ( 1, 0, 0) = right</div></li><li><div><code>Vector3f.UNIT_Y</code> = ( 0, 1, 0) = up</div></li><li><div><code>Vector3f.UNIT_Z</code> = ( 0, 0, 1) = forwards</div></li><li><div><code>Vector3f.UNIT_XYZ</code> = 1 wu diagonal right-up-forewards</div>
</li>
</ul>

@ -1,100 +1,4 @@
<h1><a>The Scene Graph and Other jME3 Terminology</a></h1>
<div>
<p>
Before you start making games, make sure you understand general <a href="/com/jme3/gde/core/docs/jme3/terminology.html">3D Gaming terminology</a>.
</p>
<p>
Second, if you are a beginner, we recommend our <a href="/com/jme3/gde/core/docs/jme3/scenegraph_for_dummies.html">Scene Graph for Dummies</a> presentation for a visual introduction to the concept of a scene graph.
</p>
<p>
Then continue learning about jME3 concepts here.
</p>
</div>
<h2><a>Coordinate System</a></h2>
<div>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/intermediate/coordinate-system.png">
</p>
<p>
The jMonkeyEngine uses a right-handed coordinate system, just as OpenGL does.
</p>
<p>
The coordinate system consists of:
</p>
<ul>
<li><div> The origin, a single point in space.</div>
<ul>
<li><div> This point is always at coordinate (0,0,0)</div>
</li>
</ul>
</li>
<li><div> Three coordinate axes that are mutually perpendicular, and meet in the origin. </div>
<ul>
<li><div> The X axis is &quot;right/left&quot;</div>
</li>
<li><div> The Y axis is &quot;up/down&quot;</div>
</li>
<li><div> The Z axis is &quot;towards you/away from you&quot;</div>
</li>
</ul>
</li>
</ul>
<p>
Every point in 3D space is defined by its (x,y,z) coordinates. The data type for vectors is com.jme3.math.Vector3f.
</p>
<p>
For your orientation, the default camera&#039;s location is (0.0f,0.0f,10.0f), and it is looking in the direction described by the unit vector (0.0f, 0.0f, -1.0f). This means your point of view is on the positive side of the Z axis, looking towards the origin, down the Z axis.
</p>
<p>
The unit of meassurement is <code>world unit</code> (wu). Typically, 1 wu is considered to be one meter. All scales, vectors and points are relative to this coordinate system.
</p>
</div>
<h2><a>Scene Graph and RootNode</a></h2>
<div>
<p>
The scene graph represents your 3D world. Objects in the jME3 scene graph are called <a href="/com/jme3/gde/core/docs/jme3/advanced/spatial.html">Spatial</a>s. Everything attached to the <em>rootNode</em> is part of the scene graph. <em>Attaching</em> a Spatial to the rootNode (or other nodes) adds the Spatial to the scene; <em>detaching</em> removes it.
</p>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/jme3/intermediate/scene-graph.png">
</p>
</div>
<h2><a>Spatials: Node vs Geometry</a></h2>
<div>
<p>
A Spatial can be transformed, loaded and saved. There are two types of Spatials, <em>Nodes</em> and <em>Geometries</em>.
</p>
<div><table>
<tr>
<td> </td><th> Spatial </th>
</tr>
<tr>
<th> Purpose: </th><td> A Spatial is an abstract data structure that stores transformations (translation, rotation, scale). </td>
<h1><a>The Scene Graph and Other jME3 Terminology</a></h1><div><p>Before you start making games, make sure you understand general <a href="/com/jme3/gde/core/docs/jme3/terminology.html">3D Gaming terminology</a>.</p><p>Second, if you are a beginner, we recommend our <a href="/com/jme3/gde/core/docs/jme3/scenegraph_for_dummies.html">Scene Graph for Dummies</a> presentation for a visual introduction to the concept of a scene graph.</p><p>Then continue learning about jME3 concepts here.</p></div><h2><a>Coordinate System</a></h2><div><p><img src="nbdocs:/com/jme3/gde/core/docs/jme3/intermediate/coordinate-system.png"></p><p>The jMonkeyEngine uses a right-handed coordinate system, just as OpenGL does.</p><p>The coordinate system consists of:</p><ul><li><div>The origin, a single point in space.</div><ul><li><div>This point is always at coordinate (0,0,0)</div></li></ul></li><li><div>Three coordinate axes that are mutually perpendicular, and meet in the origin.</div><ul><li><div>The X axis is &quot;right/left&quot;</div></li><li><div>The Y axis is &quot;up/down&quot;</div></li><li><div>The Z axis is &quot;towards you/away from you&quot;</div></li></ul></li></ul><p>Every point in 3D space is defined by its (x,y,z) coordinates. The data type for vectors is com.jme3.math.Vector3f.</p><p>For your orientation, the default camera&#039;s location is (0.0f,0.0f,10.0f), and it is looking in the direction described by the unit vector (0.0f, 0.0f, -1.0f). This means your point of view is on the positive side of the Z axis, looking towards the origin, down the Z axis.</p><p>The unit of meassurement is <code>world unit</code> (wu). Typically, 1 wu is considered to be one meter. All scales, vectors and points are relative to this coordinate system.</p></div><h2><a>Scene Graph and RootNode</a></h2><div><p>The scene graph represents your 3D world. Objects in the jME3 scene graph are called <a href="/com/jme3/gde/core/docs/jme3/advanced/spatial.html">Spatial</a>s. Everything attached to the <em>rootNode</em> is part of the scene graph. <em>Attaching</em> a Spatial to the rootNode (or other nodes) adds the Spatial to the scene; <em>detaching</em> removes it.</p><p><img src="nbdocs:/com/jme3/gde/core/docs/jme3/intermediate/scene-graph.png"></p></div><h2><a>Spatials: Node vs Geometry</a></h2><div><p>A Spatial can be transformed, loaded and saved. There are two types of Spatials, <em>Nodes</em> and <em>Geometries</em>.</p><div><table><tr><td></td><th>Spatial</th></tr><tr><th>Purpose:</th><td>A Spatial is an abstract data structure that stores transformations (translation, rotation, scale). </td>
</tr>
<tr>
<td> </td><th> Geometry </th><th> Node </th>

@ -1,60 +1,4 @@
<h1><a>WebStart (JNLP) Deployment</a></h1>
<div>
<p>
When you <a href="/com/jme3/gde/core/docs/sdk/application_deployment.html">use the jMonkeyEngine SDK 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>
</div>
<h2><a>Problem Statement</a></h2>
<div>
<p>
<strong>Problem:</strong>
</p>
<p>
When running under WebStart, jMonkeyEngine may not have permission to extract the native libraries to the current directory.
</p>
<p>
<strong>Solution: </strong>
</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>
You can import the LWJGL JNLP extension directly into your extension, however be aware that your application will break whenever they update their jars. Simply add this line to your JNLP:
</p>
<pre><span>&lt;extension name=&quot;lwjgl&quot; href=&quot;http://lwjgl.org/webstart/2.7.1/extension.jnlp&quot; /&gt;</span></pre>
</div>
<h2><a>Reliable way</a></h2>
<div>
</div>
<h3><a>Native jars</a></h3>
<div>
<p>
You can download the LWJGL native jars from their site, or to ensure you&#039;re using the exact same version as bundled with your jME3 release, make your own:
</p>
<pre>mkdir tmp
<h1><a>WebStart (JNLP) Deployment</a></h1><div><p>When you <a href="/com/jme3/gde/core/docs/sdk/application_deployment.html">use the jMonkeyEngine SDK 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></div><h2><a>Problem Statement</a></h2><div><p><strong>Problem:</strong></p><p>When running under WebStart, jMonkeyEngine may not have permission to extract the native libraries to the current directory.</p><p><strong>Solution: </strong></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>You can import the LWJGL JNLP extension directly into your extension, however be aware that your application will break whenever they update their jars. Simply add this line to your JNLP:</p><pre><span>&lt;extension name=&quot;lwjgl&quot; href=&quot;http://lwjgl.org/webstart/2.7.1/extension.jnlp&quot; /&gt;</span></pre></div><h2><a>Reliable way</a></h2><div></div><h3><a>Native jars</a></h3><div><p>You can download the LWJGL native jars from their site, or to ensure you&#039;re using the exact same version as bundled with your jME3 release, make your own:</p><pre>mkdir tmp
cd tmp
jar xfv ../jME3-lwjgl-natives.jar
cd native
@ -62,12 +6,7 @@ for i in *; do
cd $i
jar cfv ../../native_$i.jar .
cd ..
done</pre>
<p>
For Windows:
</p>
<pre>@echo off
done</pre><p>For Windows:</p><pre>@echo off
md tmp
cd tmp
&quot;%JDK_HOME%\bin\jar&quot; -xfv ..\jME3-lwjgl-natives.jar
@ -77,22 +16,7 @@ for /D %%i in (&quot;*&quot;) do (
&quot;%JDK_HOME%\bin\jar&quot; -cfv ..\..\native_%%i%.jar .
cd ..
)
cd ..</pre>
<p>
Remember to sign all the jar files and move them into the right place from the tmp directory.
</p>
</div>
<h3><a>JNLP file</a></h3>
<div>
<p>
Add the following to your JNLP file:
</p>
<pre> <span>&lt;resources os=&quot;Windows&quot;&gt;</span>
cd ..</pre><p>Remember to sign all the jar files and move them into the right place from the tmp directory.</p></div><h3><a>JNLP file</a></h3><div><p>Add the following to your JNLP file:</p><pre> <span>&lt;resources os=&quot;Windows&quot;&gt;</span>
<span>&lt;j2se version=&quot;1.4+&quot;/&gt;</span>
<span>&lt;nativelib href=&quot;native_windows.jar&quot;/&gt;</span>
<span><span>&lt;/resources&gt;</span></span>
@ -107,22 +31,9 @@ Add the following to your JNLP file:
<span>&lt;resources os=&quot;SunOS&quot; arch=&quot;x86&quot;&gt;</span>
<span>&lt;j2se version=&quot;1.4+&quot;/&gt;</span>
<span>&lt;nativelib href=&quot;native_solaris.jar&quot;/&gt;</span>
<span><span>&lt;/resources&gt;</span></span></pre>
</div>
<h3><a>Set low-permissions mode</a></h3>
<div>
<p>
In your main() method, if running under WebStart, tell jME3 it is running in a low-permission environment so that it doesn&#039;t try to load the natives itself:
</p>
<pre> public static void main&#40;String&#91;&#93; args&#41;
<span><span>&lt;/resources&gt;</span></span></pre></div><h3><a>Set low-permissions mode</a></h3><div><p>In your main() method, if running under WebStart, tell jME3 it is running in a low-permission environment so that it doesn&#039;t try to load the natives itself:</p><pre> public static void main&#40;String&#91;&#93; args&#41;
&#123;
if &#40;System.getProperty&#40;&quot;javawebstart.version&quot;&#41; != null&#41; &#123;
JmeSystem.setLowPermissions&#40;true&#41;;
&#125;</pre>
</div>
&#125;</pre></div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:webstart?do=export_xhtmlbody">view online version</a></em></p>

@ -1,48 +1,4 @@
<h1><a>jMonkeyEngine SDK: Application Deployment</a></h1>
<div>
<p>
After you have written and tested your game, you want to brand it and distribute it to your users. If you use the build script provided by the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>&#039;s BaseGame, you have the following deployment options:
</p>
<ul>
<li><div> Desktop application (.JAR)</div>
</li>
<li><div> WebStart from <acronym title="Uniform Resource Locator">URL</acronym> (.JNLP + .JAR)</div>
</li>
<li><div> Applet in web browser (.JNLP + .JAR)</div>
</li>
<li><div> Android mobile device (.APK)</div>
</li>
</ul>
</div>
<h2><a>Requirements</a></h2>
<div>
<p>
Since JAR files are platform independent, your customers can play your jMonkeyEngine application on Windows, Mac <acronym title="Operating System">OS</acronym>, or Linux. The only requirement is that the user has the free Java 5 or 6 Runtime (or browser plugin) installed. For more information see <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://java.com"><param name="text" value="<html><u>http://java.com</u></html>"><param name="textColor" value="blue"></object>.
</p>
</div>
<h2><a>Branding</a></h2>
<div>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/sdk/jmonkey-branding.png">
Make your game unique and recognizable:
</p>
<ol>
<li><div> Open your game project in the <acronym title="Software Development Kit">SDK</acronym>&#039;s Projects window.</div>
</li>
<li><div> Right-click the project and open the Properties</div>
</li>
<li><div> Open the Properties → Application section. Here you configure your branding:</div>
<h1><a>jMonkeyEngine SDK: Application Deployment</a></h1><div><p>After you have written and tested your game, you want to brand it and distribute it to your users. If you use the build script provided by the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>&#039;s BaseGame, you have the following deployment options:</p><ul><li><div>Desktop application (.JAR)</div></li><li><div>WebStart from <acronym title="Uniform Resource Locator">URL</acronym> (.JNLP + .JAR)</div></li><li><div>Applet in web browser (.JNLP + .JAR)</div></li><li><div>Android mobile device (.APK)</div></li></ul></div><h2><a>Requirements</a></h2><div><p>Since JAR files are platform independent, your customers can play your jMonkeyEngine application on Windows, Mac <acronym title="Operating System">OS</acronym>, or Linux. The only requirement is that the user has the free Java 5 or 6 Runtime (or browser plugin) installed. For more information see <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://java.com"><param name="text" value="<html><u>http://java.com</u></html>"><param name="textColor" value="blue"></object>.</p></div><h2><a>Branding</a></h2><div><p><img src="nbdocs:/com/jme3/gde/core/docs/sdk/jmonkey-branding.png"> Make your game unique and recognizable:</p><ol><li><div>Open your game project in the <acronym title="Software Development Kit">SDK</acronym>&#039;s Projects window.</div></li><li><div>Right-click the project and open the Properties</div></li><li><div> Open the Properties → Application section. Here you configure your branding:</div>
<ol>
<li><div> Title: Enter the game&#039;s name</div>
</li>

@ -1,27 +1,4 @@
<h1><a>jMonkeyEngine SDK AssetPacks</a></h1>
<div>
<p>
AssetPacks are a way to package jME3 compatible assets like models, textures, sounds and whole scenes into a package that contains publisher info, license info, descriptions etc. for all of the assets. An AssetPack basically consists of an <code>assetpack.xml</code> file that describes the content and an <code>assets</code> folder that contains the content. The integrated browser in the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> allows you to add the assets of installed AssetPacks to any project you are doing.
</p>
</div>
<h2><a>The AssetPack Browser</a></h2>
<div>
<p>
<img src="/wiki/lib/exe/fetch.php">
</p>
<p>
The AssetPack browser in jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> makes browsing the installed AssetPacks easy. Browse categories, search for tags and find the right asset for your project. When you have found it, you can add it with one click to your current scene. The AssetPack manager will automagically copy all needed textures, sounds etc. to your projects assets folder.
</p>
<p>
You can also browse a selection of online assetpacks that are available on jMonkeyEngine.org for download and install them to your jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>&#039;s AssetPack browser.
<h1><a>jMonkeyEngine SDK AssetPacks</a></h1><div><p>AssetPacks are a way to package jME3 compatible assets like models, textures, sounds and whole scenes into a package that contains publisher info, license info, descriptions etc. for all of the assets. An AssetPack basically consists of an <code>assetpack.xml</code> file that describes the content and an <code>assets</code> folder that contains the content. The integrated browser in the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> allows you to add the assets of installed AssetPacks to any project you are doing.</p></div><h2><a>The AssetPack Browser</a></h2><div><p><img src="/wiki/lib/exe/fetch.php"></p><p>The AssetPack browser in jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> makes browsing the installed AssetPacks easy. Browse categories, search for tags and find the right asset for your project. When you have found it, you can add it with one click to your current scene. The AssetPack manager will automagically copy all needed textures, sounds etc. to your projects assets folder.</p><p>You can also browse a selection of online assetpacks that are available on jMonkeyEngine.org for download and install them to your jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>&#039;s AssetPack browser.
</p>
<p>

@ -1,44 +1,4 @@
<h1><a>Blender importer for jMonkeyEngine 3</a></h1>
<div>
</div>
<h2><a>Introduction</a></h2>
<div>
<p>
Importing models to any game engine is as important as using them. The quality of the models depends on the abilities of the people who create it and on the tools they use.
Blender is one of the best free tools for creating 3D enviroments. Its high amount of features attract many model designers.
So far jMonkeyEngine used Ogre mesh files to import 3D data. These files were created by the python script that exported data from blender.
It was important to have always the lates version of the script that is compatible with the version of blender and to use it before importing data to jme.
Now we have an opportunity to simplify the import process by loading data directly from blender binary files: *.blend.
</p>
</div>
<h2><a>Usage</a></h2>
<div>
<p>
To use it in your game or the <acronym title="Software Development Kit">SDK</acronym> you should follow the standard asset loading instructions.
By default a BlenderModelLoader is registered with your assetManager to load blend files. This means you can load and convert .blend model files to .j3o format, just like any other supported model format.
</p>
</div>
<h2><a>Currently supported features</a></h2>
<div>
<ol>
<li><div> Loading scene (only the current scene is loaded and imported as a node)</div>
</li>
<li><div> Loading mesh objects.</div>
<ul>
<li><div> Meshes are split into several geometries when they have several materials applied.</div>
</li>
<li><div> All faces are stored as triangles (even if blender uses quads).</div>
</li>
<li><div> The mesh is &#039;Smooth&#039; aware.</div>
<h1><a>Blender importer for jMonkeyEngine 3</a></h1><div></div><h2><a>Introduction</a></h2><div><p>Importing models to any game engine is as important as using them. The quality of the models depends on the abilities of the people who create it and on the tools they use. Blender is one of the best free tools for creating 3D enviroments. Its high amount of features attract many model designers. So far jMonkeyEngine used Ogre mesh files to import 3D data. These files were created by the python script that exported data from blender. It was important to have always the lates version of the script that is compatible with the version of blender and to use it before importing data to jme. Now we have an opportunity to simplify the import process by loading data directly from blender binary files: *.blend.</p></div><h2><a>Usage</a></h2><div><p>To use it in your game or the <acronym title="Software Development Kit">SDK</acronym> you should follow the standard asset loading instructions. By default a BlenderModelLoader is registered with your assetManager to load blend files. This means you can load and convert .blend model files to .j3o format, just like any other supported model format.</p></div><h2><a>Currently supported features</a></h2><div><ol><li><div>Loading scene (only the current scene is loaded and imported as a node)</div></li><li><div>Loading mesh objects.</div><ul><li><div>Meshes are split into several geometries when they have several materials applied.</div></li><li><div>All faces are stored as triangles (even if blender uses quads).</div></li><li><div>The mesh is &#039;Smooth&#039; aware.</div>
</li>
<li><div> User defined UV coordinates are read.</div>
</li>

@ -1,94 +1,4 @@
<h1><a>jMonkeyEngine SDK: Code Editor and Palette</a></h1>
<div>
<p>
The Source Code Editor is the central part of the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>. This documentation shows you how to make the most of the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>&#039;s assistive features.
</p>
<p>
Note: Since the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> is based on the NetBeans Platform framework, you can learn about certain jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> features by reading the corresponding NetBeans IDE tutorials (in the &quot;see also links&quot;).
</p>
</div>
<h2><a>Code Completion and Code Generation</a></h2>
<div>
<p>
While typing Java code in the source code editor, you will see popups that help you to write more quickly by completing keywords, and generating code snippets. Additionally, they will let you see the javadoc for the classes you are working with.
</p>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/sdk/netbeans_code_completion.png">
</p>
<p>
Code Completion
</p>
<ul>
<li><div> Complete keyword / method / variable: <strong>Ctrl-Space</strong> (Alternatively use <strong>Ctrl-\</strong>)</div>
<ul>
<li><div> Customize Code Completion options: Tools &gt; Options &gt; Editor &gt; Code Completion </div>
</li>
</ul>
</li>
<li><div> Show expected parameters of this method in a tooltip: <strong>Ctrl-P</strong> </div>
</li>
<li><div> Complete any string (even non-Java) that has been used before: <strong>(Shift-)Ctrl-K</strong></div>
</li>
</ul>
<p>
Code Generation
</p>
<ul>
<li><div> Auto-fix import statements: <strong>Ctrl-Shift-I</strong></div>
</li>
<li><div> Auto-generate getters/setters, try/catch, equals/hashCode: <strong>Alt-Insert</strong></div>
<ul>
<li><div> Customize code completion: Choose Tools &gt; Options &gt; Editor &gt; Code Completion</div>
</li>
</ul>
</li>
<li><div> Auto-generate common code snippets such as loops, declarations, println, by typing the <strong>template name + TabKey</strong> </div>
<ul>
<li><div> Customize code templates: Choose Tools &gt; Options &gt; Editor &gt; Code Templates</div>
</li>
</ul>
</li>
<li><div> Rename, move, or introduce methods, fields, and variables, without breaking the project: <strong>Refactoring menu</strong></div>
</li>
</ul>
</div>
<h2><a>Semantic and Syntactic Coloring</a></h2>
<div>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/sdk/jmonkeyplatform-docu-5.png">
</p>
<p>
The text color in the editor gives you important hints how the compiler will interpret what you typed, even before you compiled it.
</p>
<p>
Examples:
</p>
<ul>
<li><div> Java keywords are <strong>blue</strong>, variables and fields are <strong>green</strong>, parameters are <strong>orange</strong>. </div>
</li>
<li><div> <del>Strikethrough</del> means deprecated method or field. </div>
</li>
<li><div> <em>Gray underline</em> means unused variable or method.</div>
</li>
<li><div> Place the caret in a method or variable and all its ocurrences are marked <strong>tan</strong>.</div>
<h1><a>jMonkeyEngine SDK: Code Editor and Palette</a></h1><div><p>The Source Code Editor is the central part of the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>. This documentation shows you how to make the most of the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>&#039;s assistive features.</p><p>Note: Since the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> is based on the NetBeans Platform framework, you can learn about certain jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> features by reading the corresponding NetBeans IDE tutorials (in the &quot;see also links&quot;).</p></div><h2><a>Code Completion and Code Generation</a></h2><div><p>While typing Java code in the source code editor, you will see popups that help you to write more quickly by completing keywords, and generating code snippets. Additionally, they will let you see the javadoc for the classes you are working with.</p><p><img src="nbdocs:/com/jme3/gde/core/docs/sdk/netbeans_code_completion.png"></p><p>Code Completion</p><ul><li><div>Complete keyword / method / variable: <strong>Ctrl-Space</strong> (Alternatively use <strong>Ctrl-\</strong>)</div><ul><li><div>Customize Code Completion options: Tools &gt; Options &gt; Editor &gt; Code Completion</div></li></ul></li><li><div>Show expected parameters of this method in a tooltip: <strong>Ctrl-P</strong></div></li><li><div>Complete any string (even non-Java) that has been used before: <strong>(Shift-)Ctrl-K</strong></div></li></ul><p>Code Generation</p><ul><li><div>Auto-fix import statements: <strong>Ctrl-Shift-I</strong></div></li><li><div>Auto-generate getters/setters, try/catch, equals/hashCode: <strong>Alt-Insert</strong></div><ul><li><div>Customize code completion: Choose Tools &gt; Options &gt; Editor &gt; Code Completion</div></li></ul></li><li><div>Auto-generate common code snippets such as loops, declarations, println, by typing the <strong>template name + TabKey</strong></div><ul><li><div>Customize code templates: Choose Tools &gt; Options &gt; Editor &gt; Code Templates</div></li></ul></li><li><div>Rename, move, or introduce methods, fields, and variables, without breaking the project: <strong>Refactoring menu</strong></div></li></ul></div><h2><a>Semantic and Syntactic Coloring</a></h2><div><p><img src="nbdocs:/com/jme3/gde/core/docs/sdk/jmonkeyplatform-docu-5.png"></p><p>The text color in the editor gives you important hints how the compiler will interpret what you typed, even before you compiled it.</p><p>Examples:</p><ul><li><div>Java keywords are <strong>blue</strong>, variables and fields are <strong>green</strong>, parameters are <strong>orange</strong>.</div></li><li><div><del>Strikethrough</del> means deprecated method or field.</div></li><li><div><em>Gray underline</em> means unused variable or method.</div></li><li><div>Place the caret in a method or variable and all its ocurrences are marked <strong>tan</strong>.</div>
</li>
<li><div> Place the caret in a method&#039;s return type to highlight all exit points</div>
</li>

@ -1,40 +1,4 @@
<h1><a>jMonkeyEngine SDK: Debugging, Profiling, Testing</a></h1>
<div>
<p>
Debugging, testing and profiling are important parts of the development cycle. This documentation shows you how to make the most of the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>&#039;s assistive features.
</p>
<p>
<strong>Note:</strong> Since the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> is based on the NetBeans Platform framework, you can learn about certain jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> features by reading the corresponding NetBeans IDE tutorials (in the &quot;see also links&quot;).
</p>
</div>
<h2><a>Testing</a></h2>
<div>
<p>
The jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> supports the JUnit testing framework. It is a good practice to write tests (assertions) for each of your classes. Each test makes certain this &quot;unit&quot; (e.g. method) meets its design and behaves as intended. Run your tests after each major change and you immediately see if you broke something.
</p>
</div>
<h4><a>Creating Tests</a></h4>
<div>
<ol>
<li><div> Right-click a Java file in the Projects window and choose Tools &gt; Create JUnit Tests.</div>
</li>
<li><div> Click OK. The jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> creates a JUnit test skeleton in the Test Package directory.</div>
</li>
<li><div> The body of each generated test method is provided solely as a guide. In their place, you need to write your actual test cases!</div>
</li>
<li><div> You can use tests such as <code>assertTrue(), assertFalse(), assertEquals()</code>, or <code>assert()</code>.</div>
<ul>
<li><div> The following example assertions test an addition method: <code>assert( add(1, 1) == 2); assertTrue( add(7,-5) == add(-5,7) )…</code></div>
<h1><a>jMonkeyEngine SDK: Debugging, Profiling, Testing</a></h1><div><p>Debugging, testing and profiling are important parts of the development cycle. This documentation shows you how to make the most of the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>&#039;s assistive features.</p><p><strong>Note:</strong> Since the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> is based on the NetBeans Platform framework, you can learn about certain jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> features by reading the corresponding NetBeans IDE tutorials (in the &quot;see also links&quot;).</p></div><h2><a>Testing</a></h2><div><p>The jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> supports the JUnit testing framework. It is a good practice to write tests (assertions) for each of your classes. Each test makes certain this &quot;unit&quot; (e.g. method) meets its design and behaves as intended. Run your tests after each major change and you immediately see if you broke something.</p></div><h4><a>Creating Tests</a></h4><div><ol><li><div>Right-click a Java file in the Projects window and choose Tools &gt; Create JUnit Tests.</div></li><li><div>Click OK. The jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> creates a JUnit test skeleton in the Test Package directory.</div></li><li><div>The body of each generated test method is provided solely as a guide. In their place, you need to write your actual test cases!</div></li><li><div>You can use tests such as <code>assertTrue(), assertFalse(), assertEquals()</code>, or <code>assert()</code>.</div><ul><li><div> The following example assertions test an addition method: <code>assert( add(1, 1) == 2); assertTrue( add(7,-5) == add(-5,7) )…</code></div>
</li>
</ul>
</li>

@ -1,62 +1,4 @@
<h2><a>Developing for jMonkeyEngine SDK</a></h2>
<div>
<p>
<em>Note that all info is subject to change while jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> is still in beta!</em>
</p>
<p>
In general, developing plugins for jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> is not much different than creating plugins for the NetBeans Platform which in turn is not much different than creating Swing applications. You can use jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> to develop plugins, be it for personal use or to contribute to the community.
</p>
<p>
If you feel like you want to make an addition to jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>, don&#039;t hesitate to contact the jme team regardless of your knowledge in NetBeans platform development. For new plugins, the basic project creation and layout of the plugin can always be handled by a core developer and you can go on from there fleshing out the plugin. By using the Platform functions, your plugin feels more like a Platform application (global save button, file type support etc.).
</p>
</div>
<h4><a>Creating plugins and components</a></h4>
<div>
<ul>
<li><div> <a href="/com/jme3/gde/core/docs/sdk/development/setup.html">Creating a plugin</a></div>
</li>
<li><div> <a href="/com/jme3/gde/core/docs/sdk/development/general.html">Creating components</a></div>
</li>
</ul>
</div>
<h4><a>Extending jMonkeyEngine SDK</a></h4>
<div>
<ul>
<li><div> <a href="/com/jme3/gde/core/docs/sdk/development/scene.html">The Main Scene</a></div>
</li>
<li><div> <a href="/com/jme3/gde/core/docs/sdk/development/sceneexplorer.html">The Scene Explorer</a></div>
</li>
<li><div> <a href="/com/jme3/gde/core/docs/sdk/development/projects_assets.html">Projects and Assets</a></div>
</li>
</ul>
</div>
<h4><a>Recipes</a></h4>
<div>
<ul>
<li><div> <a href="/com/jme3/gde/core/docs/sdk/development/extension_library.html">Create a library plugin from a jar file</a></div>
</li>
<li><div> <a href="/com/jme3/gde/core/docs/sdk/development/model_loader.html">Create a new or custom model filetype and loader</a></div>
</li>
</ul>
</div>
<h4><a>General Notes</a></h4>
<div>
<ul>
<li><div> <strong>Remember the scene runs on the render thread and most everything you do in the plugin (button events etc.) runs on the AWT thread, always encapsulate calls to either side correctly via Callables/Runnables or register as an AppState to the SceneApplication to have an update() call by the render thread.</strong></div>
</li>
<li><div> Although the scene can be accessed at any time via SceneApplication.getApplication() it is not recommended to modify the scene like that. Other plugins might be accessing the scene and updates will not be properly recognized. Use the sceneRequest object and the lookup of selected nodes and files to access things like the assetManager etc.</div>
<h2><a>Developing for jMonkeyEngine SDK</a></h2><div><p><em>Note that all info is subject to change while jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> is still in beta!</em></p><p>In general, developing plugins for jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> is not much different than creating plugins for the NetBeans Platform which in turn is not much different than creating Swing applications. You can use jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> to develop plugins, be it for personal use or to contribute to the community.</p><p>If you feel like you want to make an addition to jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>, don&#039;t hesitate to contact the jme team regardless of your knowledge in NetBeans platform development. For new plugins, the basic project creation and layout of the plugin can always be handled by a core developer and you can go on from there fleshing out the plugin. By using the Platform functions, your plugin feels more like a Platform application (global save button, file type support etc.).</p></div><h4><a>Creating plugins and components</a></h4><div><ul><li><div><a href="/com/jme3/gde/core/docs/sdk/development/setup.html">Creating a plugin</a></div></li><li><div><a href="/com/jme3/gde/core/docs/sdk/development/general.html">Creating components</a></div></li></ul></div><h4><a>Extending jMonkeyEngine SDK</a></h4><div><ul><li><div><a href="/com/jme3/gde/core/docs/sdk/development/scene.html">The Main Scene</a></div></li><li><div><a href="/com/jme3/gde/core/docs/sdk/development/sceneexplorer.html">The Scene Explorer</a></div></li><li><div><a href="/com/jme3/gde/core/docs/sdk/development/projects_assets.html">Projects and Assets</a></div></li></ul></div><h4><a>Recipes</a></h4><div><ul><li><div><a href="/com/jme3/gde/core/docs/sdk/development/extension_library.html">Create a library plugin from a jar file</a></div></li><li><div><a href="/com/jme3/gde/core/docs/sdk/development/model_loader.html">Create a new or custom model filetype and loader</a></div></li></ul></div><h4><a>General Notes</a></h4><div><ul><li><div><strong>Remember the scene runs on the render thread and most everything you do in the plugin (button events etc.) runs on the AWT thread, always encapsulate calls to either side correctly via Callables/Runnables or register as an AppState to the SceneApplication to have an update() call by the render thread.</strong></div></li><li><div>Although the scene can be accessed at any time via SceneApplication.getApplication() it is not recommended to modify the scene like that. Other plugins might be accessing the scene and updates will not be properly recognized. Use the sceneRequest object and the lookup of selected nodes and files to access things like the assetManager etc.</div>
</li>
<li><div> It became a standard in jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> to start the name of methods that execute directly on the OpenGL thread with &quot;do&quot; e.g &quot;doMoveSpatial&quot;, this makes identifying threading issues easier.</div>
</li>

@ -1,30 +1,2 @@
<h1><a>Creating a model importer</a></h1>
<div>
<ol>
<li><div> Create plugin</div>
</li>
<li><div> Add importer jar file (wrap jar file)</div>
</li>
<li><div> Add filetype (Template)</div>
</li>
<li><div> Change DataObject to extend SpatialAssetDataObject</div>
</li>
<li><div> Implement loadAsset method in DataObject (if necessary, most model formats should load normally via the loader)</div>
</li>
<li><div> Create AssetManagerConfigurator \</div>
</li>
</ol>
<p>
See also:
</p>
<ul>
<li><div> <a href="/com/jme3/gde/core/docs/sdk/development/projects_assets.html">Projects and Assets</a></div>
</li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://platform.netbeans.org/tutorials/nbm-filetype.html"><param name="text" value="<html><u>http://platform.netbeans.org/tutorials/nbm-filetype.html</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>
</div>
<h1><a>Creating a model importer</a></h1><div><ol><li><div>Create plugin</div></li><li><div>Add importer jar file (wrap jar file)</div></li><li><div>Add filetype (Template)</div></li><li><div>Change DataObject to extend SpatialAssetDataObject</div></li><li><div>Implement loadAsset method in DataObject (if necessary, most model formats should load normally via the loader)</div></li><li><div>Create AssetManagerConfigurator \</div></li></ol><p>See also:</p><ul><li><div><a href="/com/jme3/gde/core/docs/sdk/development/projects_assets.html">Projects and Assets</a></div></li><li><div><object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://platform.netbeans.org/tutorials/nbm-filetype.html"><param name="text" value="<html><u>http://platform.netbeans.org/tutorials/nbm-filetype.html</u></html>"><param name="textColor" value="blue"></object></div></li></ul></div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/sdk:development:model_loader?do=export_xhtmlbody">view online version</a></em></p>

@ -1,45 +1,4 @@
<h1><a>Projects and Assets</a></h1>
<div>
<p>
The <acronym title="Software Development Kit">SDK</acronym> heavily uses the systems provided by the base platform for the handling of assets and projects and extends the system with jME3 specific features.
</p>
</div>
<h2><a>ProjectAssetManager</a></h2>
<div>
<p>
All AssetDataObjects and SceneExplorerNodes allow access to the ProjectAssetManager of the project they were loaded from.
</p>
<pre>ProjectAssetManager pm = node.getLookup&#40;&#41;.lookup&#40;ProjectAssetManager.class&#41;</pre>
<p>
The ProjectAssetManager is basically a normal DesktopAssetManager for each project with some added functionality:
</p>
<ul>
<li><div> Access to the FileObject of the assets folder of the project to load and save data</div>
</li>
<li><div> Convert absolute file paths to relative asset paths and vice versa</div>
</li>
<li><div> Get lists of all textures, materials etc. in the project</div>
</li>
<li><div> more convenient stuff.. :)</div>
</li>
</ul>
</div>
<h2><a>AssetDataObject</a></h2>
<div>
<p>
Most &quot;files&quot; that you encounter in the <acronym title="Software Development Kit">SDK</acronym> come in the form of AssetDataObjects. All Nodes that you encounter contain the AssetDataObject they were loaded from. It provides not just access to the FileObject of the specific file but also an AssetData object that allows access to jME specific properties and data. The AssetData object also allows loading the object via the jME3 assetManager. It is accessible via the lookup of the Node or AssetDataObject:
<h1><a>Projects and Assets</a></h1><div><p>The <acronym title="Software Development Kit">SDK</acronym> heavily uses the systems provided by the base platform for the handling of assets and projects and extends the system with jME3 specific features.</p></div><h2><a>ProjectAssetManager</a></h2><div><p>All AssetDataObjects and SceneExplorerNodes allow access to the ProjectAssetManager of the project they were loaded from.</p><pre>ProjectAssetManager pm = node.getLookup&#40;&#41;.lookup&#40;ProjectAssetManager.class&#41;</pre><p>The ProjectAssetManager is basically a normal DesktopAssetManager for each project with some added functionality:</p><ul><li><div>Access to the FileObject of the assets folder of the project to load and save data</div></li><li><div>Convert absolute file paths to relative asset paths and vice versa</div></li><li><div>Get lists of all textures, materials etc. in the project</div></li><li><div>more convenient stuff.. :)</div></li></ul></div><h2><a>AssetDataObject</a></h2><div><p>Most &quot;files&quot; that you encounter in the <acronym title="Software Development Kit">SDK</acronym> come in the form of AssetDataObjects. All Nodes that you encounter contain the AssetDataObject they were loaded from. It provides not just access to the FileObject of the specific file but also an AssetData object that allows access to jME specific properties and data. The AssetData object also allows loading the object via the jME3 assetManager. It is accessible via the lookup of the Node or AssetDataObject:
</p>
<pre>assetDataObject.getLookup&#40;&#41;.lookup&#40;AssetData.class&#41;</pre>

@ -1,42 +1,4 @@
<h1><a>jMonkeyEngine SDK -- The Scene</a></h1>
<div>
<p>
To reduce system overhead the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> Core supplies one scene/jme3 application that is shared between plugins. Furthermore there&#039;s the &quot;SceneExplorer&quot; that shows a visual representation of the scenegraph and its objects properties across plugins.
</p>
</div>
<h2><a>How to access the Scene</a></h2>
<div>
<p>
There are several ways for your plugin to interact with the Scene:
</p>
<ul>
<li><div> It listens for selected spatials / objects and offers options for those</div>
</li>
<li><div> It requests the whole scene for itself and loads/arranges the content in it (e.g. a terrain editor or model animation plugin).</div>
</li>
</ul>
</div>
<h2><a>Listening for Node selection</a></h2>
<div>
<p>
In the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>, all objects are wrapped into NetBeans &quot;Nodes&quot; (different thing than jme Nodes!). Such nodes can have properties and icons and can be displayed and selected in the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> UI. The SceneExplorer shows a tree of Nodes that wrap the Spatials of the current scene and allows manipulating their properties on selection. A jME &quot;Spatial&quot; is wrapped by a &quot;JmeSpatial&quot; node, for example. One advantage of these Nodes is that one can manipulate properties of Spatials directly from the AWT thread.
</p>
<p>
To listen to the current selection, implement org.openide.util.LookupListener and register like this:
</p>
<pre>private final Result&lt;JmeSpatial&gt; result;
<h1><a>jMonkeyEngine SDK -- The Scene</a></h1><div><p>To reduce system overhead the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> Core supplies one scene/jme3 application that is shared between plugins. Furthermore there&#039;s the &quot;SceneExplorer&quot; that shows a visual representation of the scenegraph and its objects properties across plugins.</p></div><h2><a>How to access the Scene</a></h2><div><p>There are several ways for your plugin to interact with the Scene:</p><ul><li><div>It listens for selected spatials / objects and offers options for those</div></li><li><div>It requests the whole scene for itself and loads/arranges the content in it (e.g. a terrain editor or model animation plugin).</div></li></ul></div><h2><a>Listening for Node selection</a></h2><div><p>In the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>, all objects are wrapped into NetBeans &quot;Nodes&quot; (different thing than jme Nodes!). Such nodes can have properties and icons and can be displayed and selected in the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> UI. The SceneExplorer shows a tree of Nodes that wrap the Spatials of the current scene and allows manipulating their properties on selection. A jME &quot;Spatial&quot; is wrapped by a &quot;JmeSpatial&quot; node, for example. One advantage of these Nodes is that one can manipulate properties of Spatials directly from the AWT thread.</p><p>To listen to the current selection, implement org.openide.util.LookupListener and register like this:</p><pre>private final Result&lt;JmeSpatial&gt; result;
&nbsp;
//method to register the listener;
private void registerListener&#40;&#41;&#123;
@ -52,12 +14,7 @@ public void resultChanged&#40;LookupEvent ev&#41; &#123;
spatial.getPropertySets&#40;&#41;&#91;0&#93;.setValue&#40;&quot;Local Translation&quot;, Vector3f.ZERO&#41;;
return;
&#125;
&#125;</pre>
<p>
You can also access the &quot;real&quot; spatial but since its part of the scenegraph you will have to modify it on that thread:
</p>
<pre>//retrieve the &quot;real&quot; spatial class from the JmeNode
&#125;</pre><p>You can also access the &quot;real&quot; spatial but since its part of the scenegraph you will have to modify it on that thread:</p><pre>//retrieve the &quot;real&quot; spatial class from the JmeNode
for &#40;JmeSpatial jmeSpatial : items&#41; &#123;
//the spatial is stored inside the JmeSpatials &quot;Lookup&quot;, a general container for Objects
final Spatial realSpatial = jmeSpatial.getLookup&#40;&#41;.lookup&#40;Spatial.class&#41;;
@ -69,24 +26,7 @@ for &#40;JmeSpatial jmeSpatial : items&#41; &#123;
&#125;
&#125;&#41;;
return;
&#125;</pre>
</div>
<h2><a>Requesting the Scene</a></h2>
<div>
<p>
If your plugin wants to use the scene by itself, it first has to implement SceneListener and register at the scene and then send a SceneRequest to the SceneApplication. When the SceneRequest has been approved and the current Scene has been closed, the SceneListener (your class) is called with its own SceneRequest as a parameter. When another plugin sends a SceneRequest it is also reported to you and its a hint that your RootNode has been removed from the Scene and you are no longer in control of it. You could also hook into the SceneRequests of other plugins to see if/when they are activated to display add-on plugins for that plugin.
</p>
<p>
<br/>
The SceneRequest object has to contain several things. A thing that you must supply is a jme &quot;Node&quot; wrapped into a &quot;JmeNode&quot; object. This is your rootNode that you use to display and build your scene. As soon as you control the scene, you will have to control the camera etc. yourself.
</p>
<pre>com.jme3.scene.Node rootNode = new com.jme3.scene.Node&#40;&quot;MyRootNode&quot;&#41;;
&#125;</pre></div><h2><a>Requesting the Scene</a></h2><div><p>If your plugin wants to use the scene by itself, it first has to implement SceneListener and register at the scene and then send a SceneRequest to the SceneApplication. When the SceneRequest has been approved and the current Scene has been closed, the SceneListener (your class) is called with its own SceneRequest as a parameter. When another plugin sends a SceneRequest it is also reported to you and its a hint that your RootNode has been removed from the Scene and you are no longer in control of it. You could also hook into the SceneRequests of other plugins to see if/when they are activated to display add-on plugins for that plugin.</p><p><br/> The SceneRequest object has to contain several things. A thing that you must supply is a jme &quot;Node&quot; wrapped into a &quot;JmeNode&quot; object. This is your rootNode that you use to display and build your scene. As soon as you control the scene, you will have to control the camera etc. yourself.</p><pre>com.jme3.scene.Node rootNode = new com.jme3.scene.Node&#40;&quot;MyRootNode&quot;&#41;;
&nbsp;
private void registerSceneListener&#40;&#41;&#123;
SceneApplication.getApplication&#40;&#41;.addSceneListener&#40;this&#41;;
@ -113,27 +53,10 @@ public void sceneClosed&#40;SceneRequest request&#41; &#123;
if &#40;request.getRequester&#40;&#41; == this&#41; &#123;
//we have to close the scene, any operations on the scene have to be done via Callables
&#125;
&#125;</pre>
</div>
<h2><a>Undo/Redo support</a></h2>
<div>
<p>
The jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> has a global undo/redo queue that activates the undo/redo buttons. To use it in your TopComponent, add the following method:
</p>
<pre>@Override
&#125;</pre></div><h2><a>Undo/Redo support</a></h2><div><p>The jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> has a global undo/redo queue that activates the undo/redo buttons. To use it in your TopComponent, add the following method:</p><pre>@Override
public UndoRedo getUndoRedo&#40;&#41; &#123;
return Lookup.getDefault&#40;&#41;.lookup&#40;SceneUndoRedoManager.class&#41;;
&#125; </pre>
<p>
To add a undo/redo event that modifies objects on the Scenegraph, theres a special version of AbstractUndoableEdit which executes the undo/redo calls on the scene thread. Simply implement that class and add it to the queue like this:
</p>
<pre>Lookup.getDefault&#40;&#41;.lookup&#40;SceneUndoRedoManager.class&#41;.addEdit&#40;this, new AbstractUndoableSceneEdit&#40;&#41; &#123;
&#125; </pre><p>To add a undo/redo event that modifies objects on the Scenegraph, theres a special version of AbstractUndoableEdit which executes the undo/redo calls on the scene thread. Simply implement that class and add it to the queue like this:</p><pre>Lookup.getDefault&#40;&#41;.lookup&#40;SceneUndoRedoManager.class&#41;.addEdit&#40;this, new AbstractUndoableSceneEdit&#40;&#41; &#123;
&nbsp;
@Override
public void sceneUndo&#40;&#41; &#123;
@ -154,12 +77,5 @@ public void awtUndo&#40;&#41; &#123;
public void awtRedo&#40;&#41; &#123;
//redo stuff on awt thread here
&#125;
&#125;&#41;;</pre>
<p>
Note: Its important that you use the method addEdit(Object source, UndoableEdit edit);
</p>
</div>
&#125;&#41;;</pre><p>Note: Its important that you use the method addEdit(Object source, UndoableEdit edit);</p></div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/sdk:development:scene?do=export_xhtmlbody">view online version</a></em></p>

@ -1,44 +1,4 @@
<h1><a>The SceneExplorer</a></h1>
<div>
</div>
<h2><a>Adding Node types to SceneExplorer</a></h2>
<div>
<p>
If your plugin brings in its own SceneGraph objects you can still have them work like any other SceneExplorer item, including its special properties.
</p>
<p>
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=SceneExplorerNode.class)</pre>
<p>
above the body of 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 &quot;wrapped libraries&quot;, otherwise the IDE cannot access those classes.
</p>
<p>
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). Editors for special variable types can be added using the SceneExplorerPropertyEditor interface, which can be registered as a ServiceProvider as well.
</p>
<p>
The SceneExplorerNode can be used for Spatial and Control type objects.
</p>
<ul>
<li><div><em>Add the &quot;Nodes <acronym title="Application Programming Interface">API</acronym>&quot; and &quot;Lookup <acronym title="Application Programming Interface">API</acronym>&quot; libraries to your project when you want to use this</em></div>
</li>
</ul>
</div>
<h3><a>Spatial Example</a></h3>
<div>
<pre>@org.openide.util.lookup.ServiceProvider&#40;service=SceneExplorerNode.class&#41;
<h1><a>The SceneExplorer</a></h1><div></div><h2><a>Adding Node types to SceneExplorer</a></h2><div><p>If your plugin brings in its own SceneGraph objects you can still have them work like any other SceneExplorer item, including its special properties.</p><p>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=SceneExplorerNode.class)</pre><p>above the body of 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 &quot;wrapped libraries&quot;, otherwise the IDE cannot access those classes.</p><p>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). Editors for special variable types can be added using the SceneExplorerPropertyEditor interface, which can be registered as a ServiceProvider as well.</p><p>The SceneExplorerNode can be used for Spatial and Control type objects.</p><ul><li><div><em>Add the &quot;Nodes <acronym title="Application Programming Interface">API</acronym>&quot; and &quot;Lookup <acronym title="Application Programming Interface">API</acronym>&quot; libraries to your project when you want to use this</em></div></li></ul></div><h3><a>Spatial Example</a></h3><div><pre>@org.openide.util.lookup.ServiceProvider&#40;service=SceneExplorerNode.class&#41;
public class JmeGeometry extends JmeSpatial &#123;
&nbsp;
private static Image smallImage =
@ -98,13 +58,7 @@ public class JmeGeometry extends JmeSpatial &#123;
children.setReadOnly&#40;readOnly&#41;;
return new org.openide.nodes.Node&#91;&#93;&#123;new JmeGeometry&#40;&#40;Geometry&#41; key, children&#41;.setReadOnly&#40;readOnly&#41;&#125;;
&#125;
&#125;</pre>
</div>
<h3><a>Control Example</a></h3>
<div>
<pre>@org.openide.util.lookup.ServiceProvider&#40;service=SceneExplorerNode.class&#41;
&#125;</pre></div><h3><a>Control Example</a></h3><div><pre>@org.openide.util.lookup.ServiceProvider&#40;service=SceneExplorerNode.class&#41;
public class JmeGhostControl extends AbstractSceneExplorerNode &#123;
&nbsp;
private static Image smallImage =
@ -200,26 +154,7 @@ public class JmeGhostControl extends AbstractSceneExplorerNode &#123;
public org.openide.nodes.Node&#91;&#93; createNodes&#40;Object key, DataObject key2, boolean cookie&#41; &#123;
return new org.openide.nodes.Node&#91;&#93;&#123;new JmeGhostControl&#40;&#40;GhostControl&#41; key, key2&#41;.setReadOnly&#40;cookie&#41;&#125;;
&#125;
&#125;</pre>
</div>
<h2><a>Adding items to the add and tools menus</a></h2>
<div>
<p>
For adding Spatials, Contols and for general tools theres premade abstract classes that you can use to extend the options. Undo/Redo is handled by the abstract class. AbstractNewSpatial<strong>Wizard</strong>Action allows you to show an AWT wizard before creating the Spatial. You can also just implement the base ServiceProvider class and return any kind of action (such as a wizard), in this case you have to handle the threading yourself!
</p>
<p>
<p><div>Note that the classes you create are singletons which are used across multiple nodes and you should not store any data in local variables!
</div></p>
</p>
<p>
To add a new Tool, create a new AbstractToolAction:
</p>
<pre>@org.openide.util.lookup.ServiceProvider&#40;service = ToolAction.class&#41;
&#125;</pre></div><h2><a>Adding items to the add and tools menus</a></h2><div><p>For adding Spatials, Contols and for general tools theres premade abstract classes that you can use to extend the options. Undo/Redo is handled by the abstract class. AbstractNewSpatial<strong>Wizard</strong>Action allows you to show an AWT wizard before creating the Spatial. You can also just implement the base ServiceProvider class and return any kind of action (such as a wizard), in this case you have to handle the threading yourself!</p><p><p><div>Note that the classes you create are singletons which are used across multiple nodes and you should not store any data in local variables! </div></p></p><p>To add a new Tool, create a new AbstractToolAction:</p><pre>@org.openide.util.lookup.ServiceProvider&#40;service = ToolAction.class&#41;
public class GenerateTangentsTool extends AbstractToolAction &#123;
&nbsp;
public GenerateTangentsTool&#40;&#41; &#123;
@ -249,12 +184,7 @@ public class GenerateTangentsTool extends AbstractToolAction &#123;
return JmeGeometry.class;
&#125;
&nbsp;
&#125;</pre>
<p>
For a new Spatial or Control, use AbstractNewSpatialAction
</p>
<pre>@org.openide.util.lookup.ServiceProvider&#40;service = NewSpatialAction.class&#41;
&#125;</pre><p>For a new Spatial or Control, use AbstractNewSpatialAction</p><pre>@org.openide.util.lookup.ServiceProvider&#40;service = NewSpatialAction.class&#41;
public class NewSpecialSpatialAction extends AbstractNewSpatialAction &#123;
&nbsp;
public NewSpecialSpatialAction&#40;&#41; &#123;
@ -266,12 +196,7 @@ public class NewSpecialSpatialAction extends AbstractNewSpatialAction &#123;
Spatial spatial=new Node&#40;&#41;;
return spatial;
&#125;
&#125;</pre>
<p>
or AbstractNewControlAction:
</p>
<pre>@org.openide.util.lookup.ServiceProvider&#40;service = NewControlAction.class&#41;
&#125;</pre><p>or AbstractNewControlAction:</p><pre>@org.openide.util.lookup.ServiceProvider&#40;service = NewControlAction.class&#41;
public class NewRigidBodyAction extends AbstractNewControlAction &#123;
&nbsp;
public NewRigidBodyAction&#40;&#41; &#123;

@ -1,37 +1,4 @@
<h1><a>The Material Editor</a></h1>
<div>
<p>
If you are looking for background information, read about <a href="/com/jme3/gde/core/docs/jme3/advanced/material_definitions.html">Material Definitions</a> and <a href="/com/jme3/gde/core/docs/jme3/advanced/j3m_material_files.html">j3M Material Files</a>.
You can <a href="/com/jme3/gde/core/docs/jme3/advanced/j3m_material_files.html">write .j3m files in a text editor</a>, or <span><a href="/com/jme3/gde/core/docs/sdk/material_editing.html">use the jMonkeyEngine SDK to generate</a></span> them for you as described in this article.
</p>
</div>
<h2><a>Materials</a></h2>
<div>
<p>
The jMonkeyEngine uses a special Material format, which comes in .j3m files. You use .j3m files to store sets of material properties that you use repeatedly. This enables you write one short line of code that simply loads the presets from a custom .j3m file. Without a .j3m file you need to write several lines of material property setters every time when you want to use a non-default material.
</p>
</div>
<h2><a>Creating .j3m Materials</a></h2>
<div>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/sdk/material-editor.png">
</p>
<p>
To create new .j3m files in the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>,
</p>
<ol>
<li><div> Right-click the <code>assets/Materials</code> directory and choose New… &gt; Other.</div>
<h1><a>The Material Editor</a></h1><div><p>If you are looking for background information, read about <a href="/com/jme3/gde/core/docs/jme3/advanced/material_definitions.html">Material Definitions</a> and <a href="/com/jme3/gde/core/docs/jme3/advanced/j3m_material_files.html">j3M Material Files</a>. You can <a href="/com/jme3/gde/core/docs/jme3/advanced/j3m_material_files.html">write .j3m files in a text editor</a>, or <span><a href="/com/jme3/gde/core/docs/sdk/material_editing.html">use the jMonkeyEngine SDK to generate</a></span> them for you as described in this article.</p></div><h2><a>Materials</a></h2><div><p>The jMonkeyEngine uses a special Material format, which comes in .j3m files. You use .j3m files to store sets of material properties that you use repeatedly. This enables you write one short line of code that simply loads the presets from a custom .j3m file. Without a .j3m file you need to write several lines of material property setters every time when you want to use a non-default material.</p></div><h2><a>Creating .j3m Materials</a></h2><div><p><img src="nbdocs:/com/jme3/gde/core/docs/sdk/material-editor.png"></p><p>To create new .j3m files in the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>,</p><ol><li><div>Right-click the <code>assets/Materials</code> directory and choose New… &gt; Other.</div>
</li>
<li><div> In the New File Wizard, choose Material &gt; Empty Material File, and click Next.</div>
</li>

@ -1,49 +1,4 @@
<h1><a>jMonkeyEngine SDK: Creating Projects</a></h1>
<div>
<p>
The jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> makes it easy to get started with developing 3-D games based on the jMonkeyEngine.
</p>
</div>
<h2><a>Creating a New jMonkeyEngine Project</a></h2>
<div>
<ol>
<li><div> Choose File &gt; New Project from the main menu.</div>
</li>
<li><div> In the New Project Wizard, select the template JME3 &gt; Basic Game</div>
</li>
<li><div> Click next to specify a project name, and the path where to store your new project.</div>
</li>
<li><div> Click Finish. A skeleton application is created and opens in the Project Explorer.</div>
<ul>
<li><div> This basic jme3 application is based on the SimpleApplication class to allow an easy start with jme3.</div>
</li>
<li><div> You can click the run button to run it: You will see a jMonkey cube.</div>
</li>
</ul>
</li>
</ol>
</div>
<h4><a>Project Structure</a></h4>
<div>
<p>
<img src="nbdocs:/com/jme3/gde/core/docs/sdk/jmonkeyplatform-docu-4.png">
</p>
<p>
Let&#039;s have a look at the abstract project structure in the Project Explorer (ctrl-1).
</p>
<ul>
<li><div> <strong>Project Assets node:</strong> These directories have been created for you to store your games assets, such as fonts, materials, models, shaders, sounds, and textures. For a newly created project, these directories are empty.</div>
<h1><a>jMonkeyEngine SDK: Creating Projects</a></h1><div><p>The jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> makes it easy to get started with developing 3-D games based on the jMonkeyEngine.</p></div><h2><a>Creating a New jMonkeyEngine Project</a></h2><div><ol><li><div>Choose File &gt; New Project from the main menu.</div></li><li><div>In the New Project Wizard, select the template JME3 &gt; Basic Game</div></li><li><div>Click next to specify a project name, and the path where to store your new project.</div></li><li><div>Click Finish. A skeleton application is created and opens in the Project Explorer.</div><ul><li><div>This basic jme3 application is based on the SimpleApplication class to allow an easy start with jme3.</div></li><li><div>You can click the run button to run it: You will see a jMonkey cube.</div></li></ul></li></ol></div><h4><a>Project Structure</a></h4><div><p><img src="nbdocs:/com/jme3/gde/core/docs/sdk/jmonkeyplatform-docu-4.png"></p><p>Let&#039;s have a look at the abstract project structure in the Project Explorer (ctrl-1).</p><ul><li><div><strong>Project Assets node:</strong> These directories have been created for you to store your games assets, such as fonts, materials, models, shaders, sounds, and textures. For a newly created project, these directories are empty.</div>
</li>
<li><div> <strong>Source Packages node:</strong> This is where you manage your packages and classes. For a newly created project, it contains one package and one class, <code>Main.java</code>. Double click <code>Main.java</code> to open it in the editor.</div>
</li>

@ -1,36 +1,4 @@
<h1><a>Overview</a></h1>
<div>
<p>
The terrain editor lets you create, modify, and paint terrain.
<img src="/wiki/lib/exe/fetch.php">
</p>
</div>
<h2><a>Controls</a></h2>
<div>
<p>
Terrain controls are the same as the Scene Composer, you rotate the camera with the left mouse button and pan the camera with the right mouse button. Until you select one of the terrain tools in the toolbar, then the controls change for that tool. Then left mouse button will use that tool: painting, raising/lowering terrain, etc. The right mouse button might do something, depending on the tool.
</p>
</div>
<h2><a>Creating Terrain</a></h2>
<div>
<p>
To create terrain, first select a node (probably your root node) in your scene.<br/>
<img src="nbdocs:/com/jme3/gde/core/docs/sdk/sdk-terrain-tut-selectnode.png"><br/>
Then click the add terrain button.<br/>
<img src="nbdocs:/com/jme3/gde/core/docs/sdk/sdk-terrain-tut-addterrain.png"><br/>
This will pop up the Create Terrain wizard that will walk you through the steps for creating terrain. Make sure you decide now how large you want your terrain to be and how detailed you want the textures to be as you cannot change it later on!
<h1><a>Overview</a></h1><div><p>The terrain editor lets you create, modify, and paint terrain. <img src="/wiki/lib/exe/fetch.php"></p></div><h2><a>Controls</a></h2><div><p>Terrain controls are the same as the Scene Composer, you rotate the camera with the left mouse button and pan the camera with the right mouse button. Until you select one of the terrain tools in the toolbar, then the controls change for that tool. Then left mouse button will use that tool: painting, raising/lowering terrain, etc. The right mouse button might do something, depending on the tool.</p></div><h2><a>Creating Terrain</a></h2><div><p>To create terrain, first select a node (probably your root node) in your scene.<br/> <img src="nbdocs:/com/jme3/gde/core/docs/sdk/sdk-terrain-tut-selectnode.png"><br/> Then click the add terrain button.<br/> <img src="nbdocs:/com/jme3/gde/core/docs/sdk/sdk-terrain-tut-addterrain.png"><br/> This will pop up the Create Terrain wizard that will walk you through the steps for creating terrain. Make sure you decide now how large you want your terrain to be and how detailed you want the textures to be as you cannot change it later on!
</p>
<p>

@ -1,31 +1,2 @@
<h2><a>Troubleshooting jMonkeyEngine3 SDK</a></h2>
<div>
</div>
<h3><a>Specifying the JDK location</a></h3>
<div>
<p>
If jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> cannot find a valid <acronym title="Java Development Kit">JDK</acronym> although you have it installed you have to specify the location manually.
</p>
<p>
To do that edit the file <code>jmonkeyplatform.conf</code> in the <code>etc</code> directory of your jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> installation location.
Mac users have to right-click the application and select &quot;Show package contents&quot; and then navigate to <code>Contents/Resources/jmonkeyplatform</code>.
</p>
</div>
<h3><a>Known Issues</a></h3>
<div>
<p>
For a list of known issues and possible workarounds see the following link:
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/issues/list?can=2&amp;q=label%3AProduct-Platform+Type%3DDefect+&amp;colspec=ID+Type+Status+Component+Priority+Product+Milestone+Owner+Summary&amp;cells=tiles"><param name="text" value="<html><u>List of known issues on googlecode</u></html>"><param name="textColor" value="blue"></object>
</p>
</div>
<h2><a>Troubleshooting jMonkeyEngine3 SDK</a></h2><div></div><h3><a>Specifying the JDK location</a></h3><div><p>If jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> cannot find a valid <acronym title="Java Development Kit">JDK</acronym> although you have it installed you have to specify the location manually.</p><p>To do that edit the file <code>jmonkeyplatform.conf</code> in the <code>etc</code> directory of your jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> installation location. Mac users have to right-click the application and select &quot;Show package contents&quot; and then navigate to <code>Contents/Resources/jmonkeyplatform</code>.</p></div><h3><a>Known Issues</a></h3><div><p>For a list of known issues and possible workarounds see the following link: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/issues/list?can=2&amp;q=label%3AProduct-Platform+Type%3DDefect+&amp;colspec=ID+Type+Status+Component+Priority+Product+Milestone+Owner+Summary&amp;cells=tiles"><param name="text" value="<html><u>List of known issues on googlecode</u></html>"><param name="textColor" value="blue"></object></p></div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/sdk:troubleshooting?do=export_xhtmlbody">view online version</a></em></p>

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save