- update documentation

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@11061 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
experimental
nor..67 11 years ago
parent 826900a5d3
commit ddd12b88b8
  1. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/3d_models.html
  2. 34
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/application_states.html
  3. 31
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/audio.html
  4. 8
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/capture_audio_video_to_a_file.html
  5. 38
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/cinematics.html
  6. 29
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/custom_controls.html
  7. 26
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/debugging.html
  8. 53
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/effects_overview.html
  9. 24
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/input_handling.html
  10. 201
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/light_and_shadow.html
  11. 6
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/mouse_picking.html
  12. 32
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/multithreading.html
  13. 106
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/networking.html
  14. 14
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui.html
  15. 14
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_java_interaction.html
  16. 38
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_scenarios.html
  17. 20
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_xml_layout.html
  18. 37
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/physics.html
  19. 16
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/post-processor_water.html
  20. 24
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/terrain.html
  21. 11
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/walking_character.html
  22. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/beginner-materials.png
  23. 75
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_asset.html
  24. 53
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_audio.html
  25. 93
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_collision.html
  26. 25
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_input_system.html
  27. 46
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_main_event_loop.html
  28. 267
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_material.html
  29. 66
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_node.html
  30. 38
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_physics.html
  31. 60
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_picking.html
  32. 28
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_simpleapplication.html
  33. 98
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/build_jme3_sources_with_netbeans.html
  34. 82
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender.html
  35. 140
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/faq.html
  36. 22
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/appsettings.html
  37. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/best_practices.html
  38. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/how_to_use_materials.html
  39. 4
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/math.html
  40. 20
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/multi-media_asset_pipeline.html
  41. 36
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/optimization.html
  42. 18
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/ios.html
  43. 134
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/math.html
  44. 40
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/terminology.html
  45. 28
      sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/application_deployment.html
  46. 35
      sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/blender.html
  47. 20
      sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development.html
  48. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/material_editing.html
  49. 10
      sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/scene_explorer.html
  50. 62
      sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/troubleshooting.html
  51. 20
      sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/version_control.html
  52. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/wiki-map.xml

@ -83,7 +83,7 @@ To export your models as Ogre <acronym title="Extensible Markup Language">XML</a
<p> <p>
You can now use the <a href="/com/jme3/gde/docs/sdk.html">jMonkeyEngine SDK</a> to <a href="/com/jme3/gde/docs/sdk/model_loader_and_viewer.html">load and view models</a>. You can <a href="/com/jme3/gde/docs/sdk/scene_composer.html">create scenes</a> from them and write cde that loads them into your application. You can now use the <a href="/com/jme3/gde/docs/sdk.html">jMonkeyEngine SDK</a> to <a href="/com/jme3/gde/docs/sdk/model_loader_and_viewer.html">load and view models</a>. You can <a href="/com/jme3/gde/docs/sdk/scene_composer.html">create scenes</a> from them and write code that loads them into your application.
</p> </p>
</div> </div>

@ -4,16 +4,16 @@
<p> <p>
The <code>com.jme3.app.state.AppState</code> class is a customizable jME3 interface that allows you to control the global game logic ??? the overall game mechanics. (To control the behaviour of a Spatial, see <a href="/com/jme3/gde/docs/jme3/advanced/custom_controls.html">Custom Controls</a> instead. Controls and AppStates can be used together.) The <code>com.jme3.app.state.AppState</code> class is a customizable jME3 interface that allows you to control the global game logic, the overall game mechanics. (To control the behaviour of a Spatial, see <a href="/com/jme3/gde/docs/jme3/advanced/custom_controls.html">Custom Controls</a> instead. Controls and AppStates can be used together.)
</p> </p>
</div> </div>
<!-- EDIT1 SECTION "Application States" [1-324] --> <!-- EDIT1 SECTION "Application States" [1-322] -->
<h2><a>Overview</a></h2> <h2><a>Overview</a></h2>
<div> <div>
</div> </div>
<!-- EDIT2 SECTION "Overview" [325-346] --> <!-- EDIT2 SECTION "Overview" [323-344] -->
<h3><a>Use Case Examples</a></h3> <h3><a>Use Case Examples</a></h3>
<div> <div>
@ -56,7 +56,7 @@ You can! This is what AppStates are there for. An AppState class is subset of (o
</ul> </ul>
</div> </div>
<!-- EDIT3 SECTION "Use Case Examples" [347-2034] --> <!-- EDIT3 SECTION "Use Case Examples" [345-2032] -->
<h3><a>Supported Features</a></h3> <h3><a>Supported Features</a></h3>
<div> <div>
@ -86,7 +86,7 @@ Each AppState has its own update loop, which hooks into the main simpleUpdate()
</p> </p>
</div> </div>
<!-- EDIT4 SECTION "Supported Features" [2035-3763] --> <!-- EDIT4 SECTION "Supported Features" [2033-3761] -->
<h3><a>Usage</a></h3> <h3><a>Usage</a></h3>
<div> <div>
@ -109,7 +109,7 @@ To implement game logic:
</li> </li>
<li><div> Enable and disable (unpause and pause) the AppStates that you need during the game.</div> <li><div> Enable and disable (unpause and pause) the AppStates that you need during the game.</div>
</li> </li>
<li><div> Detach the AppState from the AppStateManager (<code>stateManager.detach(myAppState);</code>) and clean it up it.</div> <li><div> Detach the AppState from the AppStateManager (<code>stateManager.detach(myAppState);</code>) and clean it up.</div>
</li> </li>
</ol> </ol>
@ -119,7 +119,7 @@ When you add several AppStates to one Application and activate them, their initi
</p> </p>
</div> </div>
<!-- EDIT5 SECTION "Usage" [3764-4625] --> <!-- EDIT5 SECTION "Usage" [3762-4620] -->
<h3><a>Code Samples</a></h3> <h3><a>Code Samples</a></h3>
<div> <div>
@ -139,7 +139,7 @@ JME3 comes with a BulletAppState that implements Physical behaviour (using the j
</ul> </ul>
</div> </div>
<!-- EDIT6 SECTION "Code Samples" [4626-5406] --> <!-- EDIT6 SECTION "Code Samples" [4621-5401] -->
<h2><a>AppState</a></h2> <h2><a>AppState</a></h2>
<div> <div>
@ -184,9 +184,9 @@ stateDetached(asm)</td><td>The AppState knows when it is attached to, or detache
<td>postRender()</td><td>Called after all rendering commands are flushed, including your optional customizations. (Typically not used.)</td> <td>postRender()</td><td>Called after all rendering commands are flushed, including your optional customizations. (Typically not used.)</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT8 TABLE [5555-7117] --> <!-- EDIT8 TABLE [5550-7112] -->
</div> </div>
<!-- EDIT7 SECTION "AppState" [5407-7118] --> <!-- EDIT7 SECTION "AppState" [5402-7113] -->
<h2><a>AbstractAppState</a></h2> <h2><a>AbstractAppState</a></h2>
<div> <div>
@ -249,7 +249,7 @@ Definition:
&#125;</pre> &#125;</pre>
</div> </div>
<!-- EDIT9 SECTION "AbstractAppState" [7119-9291] --> <!-- EDIT9 SECTION "AbstractAppState" [7114-9286] -->
<h2><a>Pausing and Unpausing</a></h2> <h2><a>Pausing and Unpausing</a></h2>
<div> <div>
@ -259,7 +259,7 @@ You define what an AppState does when Paused or Unpaused, in the <code>setEnable
</p> </p>
</div> </div>
<!-- EDIT10 SECTION "Pausing and Unpausing" [9292-9582] --> <!-- EDIT10 SECTION "Pausing and Unpausing" [9287-9577] -->
<h2><a>AppStateManager</a></h2> <h2><a>AppStateManager</a></h2>
<div> <div>
@ -279,7 +279,7 @@ The com.jme3.app.state.AppStateManager holds the list of AppStates for an applic
<td>getState(MyAppState.class)</td><td>Returns the first attached state that is an instance of a subclass of <code>MyAppState.class</code>.</td> <td>getState(MyAppState.class)</td><td>Returns the first attached state that is an instance of a subclass of <code>MyAppState.class</code>.</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT12 TABLE [9990-10200] --> <!-- EDIT12 TABLE [9985-10195] -->
<p> <p>
The AppStateManager&#039;s <code>render(), postRender(), cleanup()</code> methods are internal, ignore them, users never call them directly. The AppStateManager&#039;s <code>render(), postRender(), cleanup()</code> methods are internal, ignore them, users never call them directly.
@ -299,12 +299,12 @@ The AppStateManager&#039;s <code>render(), postRender(), cleanup()</code> method
</ul> </ul>
</div> </div>
<!-- EDIT11 SECTION "AppStateManager" [9583-10966] --> <!-- EDIT11 SECTION "AppStateManager" [9578-10961] -->
<h2><a>Best Practices</a></h2> <h2><a>Best Practices</a></h2>
<div> <div>
</div> </div>
<!-- EDIT13 SECTION "Best Practices" [10967-10994] --> <!-- EDIT13 SECTION "Best Practices" [10962-10989] -->
<h3><a>Communication Among AppStates</a></h3> <h3><a>Communication Among AppStates</a></h3>
<div> <div>
@ -320,7 +320,7 @@ You can use custom accessors to get data from AppStates, to set data in AppState
<pre>this.app.getStateManager&#40;&#41;.getState&#40;MyAppState.class&#41;.doSomeCustomStuffInThisState&#40;&#41;;</pre> <pre>this.app.getStateManager&#40;&#41;.getState&#40;MyAppState.class&#41;.doSomeCustomStuffInThisState&#40;&#41;;</pre>
</div> </div>
<!-- EDIT14 SECTION "Communication Among AppStates" [10995-11750] --> <!-- EDIT14 SECTION "Communication Among AppStates" [10990-11745] -->
<h3><a>Initialize Familiar Class Fields</a></h3> <h3><a>Initialize Familiar Class Fields</a></h3>
<div> <div>
@ -351,5 +351,5 @@ public class MyAppState extends AbstractAppState &#123;
&#125;</pre> &#125;</pre>
</div> </div>
<!-- EDIT15 SECTION "Initialize Familiar Class Fields" [11751-] --> <!-- EDIT15 SECTION "Initialize Familiar Class Fields" [11746-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:application_states?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:application_states?do=export_xhtmlbody">view online version</a></em></p>

@ -50,7 +50,7 @@ AudioNode boom = new AudioNode&#40;assetManager, &quot;Sound/boom.wav&quot;, fal
<th>AudioNode Method</th><th>Usage</th> <th>AudioNode Method</th><th>Usage</th>
</tr> </tr>
<tr> <tr>
<td>getStatus()</td><td>Returns either Status.Playing, Status.Stopped, or Status.Paused. </td> <td>getStatus()</td><td>Returns either AudioSource.Status.Playing, AudioSource.Status.Stopped, or AudioSource.Status.Paused. </td>
</tr> </tr>
<tr> <tr>
<td>getVolume()</td><td>Returns the volume. </td> <td>getVolume()</td><td>Returns the volume. </td>
@ -59,14 +59,13 @@ AudioNode boom = new AudioNode&#40;assetManager, &quot;Sound/boom.wav&quot;, fal
<td>getPitch()</td><td>Returns the pitch. </td> <td>getPitch()</td><td>Returns the pitch. </td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT5 TABLE [1882-2054] --> <!-- EDIT5 TABLE [1882-2090] -->
<p> <p>
Note: There are other obvious getters to poll the status of all corresponding setters listed here. Note: There are other obvious getters to poll the status of all corresponding setters listed here.
</p> </p>
</div> </div>
<!-- EDIT4 SECTION "Getting AudioNode Properties" [1840-2155] --> <!-- EDIT4 SECTION "Getting AudioNode Properties" [1840-2192] -->
<h2><a>Setting AudioNode Properties</a></h2> <h2><a>Setting AudioNode Properties</a></h2>
<div> <div>
<div><table> <div><table>
@ -92,9 +91,9 @@ Note: There are other obvious getters to poll the status of all corresponding se
<td>setLooping(false)</td><td>Configures the sound so that, if it is played, it plays once and stops. No looping is the default.</td> <td>setLooping(false)</td><td>Configures the sound so that, if it is played, it plays once and stops. No looping is the default.</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT7 TABLE [2198-3327] --> <!-- EDIT7 TABLE [2235-3364] -->
</div> </div>
<!-- EDIT6 SECTION "Setting AudioNode Properties" [2156-3328] --> <!-- EDIT6 SECTION "Setting AudioNode Properties" [2193-3365] -->
<h3><a>Looping &amp; Ambient Sounds</a></h3> <h3><a>Looping &amp; Ambient Sounds</a></h3>
<div> <div>
<div><table> <div><table>
@ -110,9 +109,9 @@ setDirectional(false)</td><td>All 3D effects switched off. This sound is global
<strong>Looping does not work on streamed sounds.</strong> </td> <strong>Looping does not work on streamed sounds.</strong> </td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT9 TABLE [3365-3846] --> <!-- EDIT9 TABLE [3402-3883] -->
</div> </div>
<!-- EDIT8 SECTION "Looping & Ambient Sounds" [3329-3847] --> <!-- EDIT8 SECTION "Looping & Ambient Sounds" [3366-3884] -->
<h3><a>Positional 3D Sounds</a></h3> <h3><a>Positional 3D Sounds</a></h3>
<div> <div>
<div><table> <div><table>
@ -127,7 +126,7 @@ setLocalTranslation(???)</td><td>Activates 3D audio: The sound appears to come f
<td>setReverbEnabled(true)</td><td>Reverb is a 3D echo effect that only makes sense with positional AudioNodes. Use Audio Environments to make scenes sound as if they were &quot;outdoors&quot;, or &quot;indoors&quot; in a large or small room, etc. The reverb effect is defined by the <code>com.jme3.audio.Environment</code> that the <code>audioRenderer</code> is in. See &quot;Setting Audio Environment Properties&quot; below. </td> <td>setReverbEnabled(true)</td><td>Reverb is a 3D echo effect that only makes sense with positional AudioNodes. Use Audio Environments to make scenes sound as if they were &quot;outdoors&quot;, or &quot;indoors&quot; in a large or small room, etc. The reverb effect is defined by the <code>com.jme3.audio.Environment</code> that the <code>audioRenderer</code> is in. See &quot;Setting Audio Environment Properties&quot; below. </td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT11 TABLE [3880-4496] --> <!-- EDIT11 TABLE [3917-4533] -->
<p> <p>
<p><div>Positional 3D sounds require an <code>AudioListener</code> object in the scene (representing the player&#039;s ears). <p><div>Positional 3D sounds require an <code>AudioListener</code> object in the scene (representing the player&#039;s ears).
@ -135,7 +134,7 @@ setLocalTranslation(???)</td><td>Activates 3D audio: The sound appears to come f
</p> </p>
</div> </div>
<!-- EDIT10 SECTION "Positional 3D Sounds" [3848-4625] --> <!-- EDIT10 SECTION "Positional 3D Sounds" [3885-4662] -->
<h3><a>Directional 3D Sounds</a></h3> <h3><a>Directional 3D Sounds</a></h3>
<div> <div>
<div><table> <div><table>
@ -151,7 +150,7 @@ setDirection(???) </td><td>Activates 3D audio: This sound can only be heard from
setOuterAngle()</td><td>Set the angle in degrees for the directional audio. The angle is relative to the direction. Note: By default, both angles are 360?? and the sound can be heard from all directions!</td> setOuterAngle()</td><td>Set the angle in degrees for the directional audio. The angle is relative to the direction. Note: By default, both angles are 360?? and the sound can be heard from all directions!</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT13 TABLE [4659-5186] --> <!-- EDIT13 TABLE [4696-5223] -->
<p> <p>
<p><div>Directional 3D sounds require an AudioListener object in the scene (representing the player&#039;s ears). <p><div>Directional 3D sounds require an AudioListener object in the scene (representing the player&#039;s ears).
@ -159,7 +158,7 @@ setOuterAngle()</td><td>Set the angle in degrees for the directional audio. The
</p> </p>
</div> </div>
<!-- EDIT12 SECTION "Directional 3D Sounds" [4626-5313] --> <!-- EDIT12 SECTION "Directional 3D Sounds" [4663-5350] -->
<h2><a>Play, Pause, Stop</a></h2> <h2><a>Play, Pause, Stop</a></h2>
<div> <div>
@ -181,7 +180,7 @@ You can also start playing instances of an AudioNode. Use the <code>playInstance
<pre>myAudioNode.playInstance&#40;&#41;;</pre> <pre>myAudioNode.playInstance&#40;&#41;;</pre>
</div> </div>
<!-- EDIT14 SECTION "Play, Pause, Stop" [5314-6018] --> <!-- EDIT14 SECTION "Play, Pause, Stop" [5351-6055] -->
<h2><a>The Audio Listener</a></h2> <h2><a>The Audio Listener</a></h2>
<div> <div>
@ -197,7 +196,7 @@ The default AudioListener object <code>listener</code> in <code>SimpleApplicatio
&#125;</pre> &#125;</pre>
</div> </div>
<!-- EDIT15 SECTION "The Audio Listener" [6019-6655] --> <!-- EDIT15 SECTION "The Audio Listener" [6056-6692] -->
<h2><a>Setting Audio Environment Properties</a></h2> <h2><a>Setting Audio Environment Properties</a></h2>
<div> <div>
@ -226,7 +225,7 @@ Optionally, You can choose from the following environmental presets from <code>c
<td>Closet </td><td>1.00f</td><td>1.0f</td><td>1.0f</td><td>1.00f</td><td>0.15f</td><td>1.0f</td><td>0.600f</td><td>0.0025f</td><td>0.500f</td><td>0.0006f</td> <td>Closet </td><td>1.00f</td><td>1.0f</td><td>1.0f</td><td>1.00f</td><td>0.15f</td><td>1.0f</td><td>0.600f</td><td>0.0025f</td><td>0.500f</td><td>0.0006f</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT17 TABLE [7098-7587] --><ol> <!-- EDIT17 TABLE [7135-7624] --><ol>
<li><div> Activate a Environment preset</div> <li><div> Activate a Environment preset</div>
<ul> <ul>
<li><div> Either use a default, e.g. make you scene sounds like a dungeon environment: <pre>audioRenderer.setEnvironment&#40;new Environment&#40;Environment.Dungeon&#41;&#41;;</pre> <li><div> Either use a default, e.g. make you scene sounds like a dungeon environment: <pre>audioRenderer.setEnvironment&#40;new Environment&#40;Environment.Dungeon&#41;&#41;;</pre>
@ -266,5 +265,5 @@ Advanced users find more info about OpenAL and its features here: <object classi
</span></div> </span></div>
</div> </div>
<!-- EDIT16 SECTION "Setting Audio Environment Properties" [6656-] --> <!-- EDIT16 SECTION "Setting Audio Environment Properties" [6693-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:audio?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:audio?do=export_xhtmlbody">view online version</a></em></p>

@ -571,7 +571,7 @@ public class Advanced extends SimpleApplication &#123;
&nbsp; &nbsp;
public void simpleUpdate&#40;float tpf&#41; &#123; public void simpleUpdate&#40;float tpf&#41; &#123;
motionTimer.update&#40;&#41;; motionTimer.update&#40;&#41;;
if &#40;music.getStatus&#40;&#41; != AudioNode.Status.Playing&#41;&#123; if &#40;music.getStatus&#40;&#41; != AudioSource.Status.Playing&#41;&#123;
music.play&#40;&#41;; music.play&#40;&#41;;
&#125; &#125;
Vector3f loc = cam.getLocation&#40;&#41;; Vector3f loc = cam.getLocation&#40;&#41;;
@ -600,7 +600,7 @@ The <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param
</p> </p>
</div> </div>
<!-- EDIT6 SECTION "Advanced Example" [7328-17231] --> <!-- EDIT6 SECTION "Advanced Example" [7328-17233] -->
<h3><a>Using Advanced features to Record from more than one perspective at once</a></h3> <h3><a>Using Advanced features to Record from more than one perspective at once</a></h3>
<div> <div>
@ -621,7 +621,7 @@ The <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param
</p> </p>
</div> </div>
<!-- EDIT7 SECTION "Using Advanced features to Record from more than one perspective at once" [17232-17373] --> <!-- EDIT7 SECTION "Using Advanced features to Record from more than one perspective at once" [17234-17375] -->
<h2><a>More Information</a></h2> <h2><a>More Information</a></h2>
<div> <div>
@ -653,5 +653,5 @@ listeners can be found here.
</p> </p>
</div> </div>
<!-- EDIT8 SECTION "More Information" [17374-] --> <!-- EDIT8 SECTION "More Information" [17376-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:capture_audio_video_to_a_file?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:capture_audio_video_to_a_file?do=export_xhtmlbody">view online version</a></em></p>

@ -4,7 +4,11 @@
<p> <p>
JME3 cinematics (com.jme.cinematic) allow you to remote control nodes and cameras in a 3D game: You can script and and play cinematic scenes. You can use cinematics to create <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikipedia.org/wiki/Cutscene"><param name="text" value="<html><u>cutscenes</u></html>"><param name="textColor" value="blue"></object> and movies/trailers for your game. Internally, Cinematics are implemented as <a href="/com/jme3/gde/docs/jme3/advanced/application_states.html">AppStates</a>. JME3 cinematics (com.jme.cinematic) allow you to remote control nodes and cameras in a 3D game: You can script and and play cinematic scenes. You can use cinematics to create <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikipedia.org/wiki/Cutscene"><param name="text" value="<html><u>cutscenes</u></html>"><param name="textColor" value="blue"></object> and movies/trailers for your game. Another good use case is efficient &quot;destruction physics&quot;: Playing back prerecorded flying pieces of debris for demolitions is much faster than calculating them with live physics.
</p>
<p>
Internally, Cinematics are implemented as <a href="/com/jme3/gde/docs/jme3/advanced/application_states.html">AppStates</a>.
</p> </p>
<p> <p>
@ -24,7 +28,7 @@ This Node can be the rootNode, or a Node that is attached to the rootNode. </div
</ol> </ol>
</div> </div>
<!-- EDIT1 SECTION "JME3 Cinematics" [1-923] --> <!-- EDIT1 SECTION "JME3 Cinematics" [1-1103] -->
<h2><a>Sample Code</a></h2> <h2><a>Sample Code</a></h2>
<div> <div>
<ul> <ul>
@ -33,7 +37,7 @@ This Node can be the rootNode, or a Node that is attached to the rootNode. </div
</ul> </ul>
</div> </div>
<!-- EDIT2 SECTION "Sample Code" [924-1090] --> <!-- EDIT2 SECTION "Sample Code" [1104-1270] -->
<h2><a>How to Use a Cinematic</a></h2> <h2><a>How to Use a Cinematic</a></h2>
<div> <div>
@ -85,9 +89,9 @@ stateManager.attach&#40;cinematic&#41;;</pre>
<td>cinematic.pause()</td><td>Pauses the cinematic.</td> <td>cinematic.pause()</td><td>Pauses the cinematic.</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT4 TABLE [2182-2394] --> <!-- EDIT4 TABLE [2362-2574] -->
</div> </div>
<!-- EDIT3 SECTION "How to Use a Cinematic" [1091-2394] --> <!-- EDIT3 SECTION "How to Use a Cinematic" [1271-2574] -->
<h2><a>Events(CinematicEvents)</a></h2> <h2><a>Events(CinematicEvents)</a></h2>
<div> <div>
@ -117,7 +121,7 @@ Here is the list of available CinematicEvents that you use as events. Each track
<td>AnimationEvent</td><td>Use this to start playing a model <a href="/com/jme3/gde/docs/jme3/advanced/animation.html">animation</a> at a given time (a character walking animation for example)</td> <td>AnimationEvent</td><td>Use this to start playing a model <a href="/com/jme3/gde/docs/jme3/advanced/animation.html">animation</a> at a given time (a character walking animation for example)</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT6 TABLE [2688-3489] --> <!-- EDIT6 TABLE [2868-3669] -->
<p> <p>
Of course one can make is own event implementation, by extending the AbstractCinematicEvent. Of course one can make is own event implementation, by extending the AbstractCinematicEvent.
@ -125,7 +129,7 @@ Of course one can make is own event implementation, by extending the AbstractCin
</p> </p>
</div> </div>
<!-- EDIT5 SECTION "Events(CinematicEvents)" [2395-3583] --> <!-- EDIT5 SECTION "Events(CinematicEvents)" [2575-3763] -->
<h3><a>MotionEvent</a></h3> <h3><a>MotionEvent</a></h3>
<div> <div>
@ -189,14 +193,14 @@ To create a MotionEvent, do the following:
<td>event.setRotation(quaternion)</td><td>Sets the rotation. Use together with <code>MotionEvent.Direction.Rotation</code> or <code>MotionEvent.Direction.PathAndRotation</code>.</td> <td>event.setRotation(quaternion)</td><td>Sets the rotation. Use together with <code>MotionEvent.Direction.Rotation</code> or <code>MotionEvent.Direction.PathAndRotation</code>.</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT8 TABLE [4069-5478] --> <!-- EDIT8 TABLE [4249-5658] -->
<p> <p>
<strong>Tip:</strong> Most likely you remote-control more than one object in your scene. Give the events and paths useful names such as <code>dragonEvent</code>, <code>dragonPath</code>, <code>heroEvent</code>, <code>heroPath</code>, etc. <strong>Tip:</strong> Most likely you remote-control more than one object in your scene. Give the events and paths useful names such as <code>dragonEvent</code>, <code>dragonPath</code>, <code>heroEvent</code>, <code>heroPath</code>, etc.
</p> </p>
</div> </div>
<!-- EDIT7 SECTION "MotionEvent" [3584-5673] --> <!-- EDIT7 SECTION "MotionEvent" [3764-5853] -->
<h3><a>SoundEvent</a></h3> <h3><a>SoundEvent</a></h3>
<div> <div>
@ -223,7 +227,7 @@ Details of the constructor:
</ul> </ul>
</div> </div>
<!-- EDIT9 SECTION "SoundEvent" [5674-6204] --> <!-- EDIT9 SECTION "SoundEvent" [5854-6384] -->
<h3><a>GuiEvent</a></h3> <h3><a>GuiEvent</a></h3>
<div> <div>
@ -254,7 +258,7 @@ Details of the constructor:
</ul> </ul>
</div> </div>
<!-- EDIT10 SECTION "GuiEvent" [6205-6732] --> <!-- EDIT10 SECTION "GuiEvent" [6385-6912] -->
<h3><a>AnimationEvent</a></h3> <h3><a>AnimationEvent</a></h3>
<div> <div>
@ -281,7 +285,7 @@ Details of the constructor:
</ul> </ul>
</div> </div>
<!-- EDIT11 SECTION "AnimationEvent" [6733-7245] --> <!-- EDIT11 SECTION "AnimationEvent" [6913-7425] -->
<h3><a>Camera Management</a></h3> <h3><a>Camera Management</a></h3>
<div> <div>
@ -314,7 +318,7 @@ Then i just have to schedule its activation in the cinematic. I want it to get a
<pre> cinematic.activateCamera&#40;3,???topView???&#41;;</pre> <pre> cinematic.activateCamera&#40;3,???topView???&#41;;</pre>
</div> </div>
<!-- EDIT12 SECTION "Camera Management" [7246-8358] --> <!-- EDIT12 SECTION "Camera Management" [7426-8538] -->
<h3><a>Customizations</a></h3> <h3><a>Customizations</a></h3>
<div> <div>
@ -328,12 +332,12 @@ You can also create new CinematicEvent by extending <object classid="java:org.ne
</p> </p>
</div> </div>
<!-- EDIT13 SECTION "Customizations" [8359-9404] --> <!-- EDIT13 SECTION "Customizations" [8539-9584] -->
<h2><a>Interacting with Cinematics</a></h2> <h2><a>Interacting with Cinematics</a></h2>
<div> <div>
</div> </div>
<!-- EDIT14 SECTION "Interacting with Cinematics" [9405-9445] --> <!-- EDIT14 SECTION "Interacting with Cinematics" [9585-9625] -->
<h3><a>CinematicEventListener</a></h3> <h3><a>CinematicEventListener</a></h3>
<div> <div>
<pre>CinematicEventListener cel = new CinematicEventListener&#40;&#41; &#123; <pre>CinematicEventListener cel = new CinematicEventListener&#40;&#41; &#123;
@ -355,7 +359,7 @@ You can also create new CinematicEvent by extending <object classid="java:org.ne
cinematic.addListener&#40;cel&#41;;</pre> cinematic.addListener&#40;cel&#41;;</pre>
</div> </div>
<!-- EDIT15 SECTION "CinematicEventListener" [9446-9941] --> <!-- EDIT15 SECTION "CinematicEventListener" [9626-10121] -->
<h3><a>Physics Interaction</a></h3> <h3><a>Physics Interaction</a></h3>
<div> <div>
@ -365,5 +369,5 @@ Upcoming.
</p> </p>
</div> </div>
<!-- EDIT16 SECTION "Physics Interaction" [9942-] --> <!-- EDIT16 SECTION "Physics Interaction" [10122-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:cinematics?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:cinematics?do=export_xhtmlbody">view online version</a></em></p>

@ -3,7 +3,7 @@
<div> <div>
<p> <p>
A <code>com.jme3.scene.control.Control</code> is a customizable jME3 interface that allows you to cleanly steer the behaviour of game entities (Spatials), such as artificially intelligent behaviour in NPCs, traps, automatic alarms and doors, animals and pets, self-steering vehicles or platforms ??? anything that moves and interacts. Several instances of customs Controls together implement the behaviours of a type of Spatial. A <code>com.jme3.scene.control.Control</code> is a customizable jME3 interface that allows you to cleanly steer the behaviour of game entities (Spatials), such as artificially intelligent behaviour in NPCs, traps, automatic alarms and doors, animals and pets, self-steering vehicles or platforms ??? anything that moves and interacts. Several instances of custom Controls together implement the behaviours of a type of Spatial.
</p> </p>
<p> <p>
@ -43,7 +43,7 @@ To implement game logic for a type of spatial, you will either extend AbstractCo
</p> </p>
</div> </div>
<!-- EDIT1 SECTION "Custom Controls" [1-1747] --> <!-- EDIT1 SECTION "Custom Controls" [1-1746] -->
<h2><a>Usage</a></h2> <h2><a>Usage</a></h2>
<div> <div>
@ -91,7 +91,7 @@ The possibilities are endless. <img src="/wiki/lib/images/smileys/icon_smile.gif
</p> </p>
</div> </div>
<!-- EDIT2 SECTION "Usage" [1748-3215] --> <!-- EDIT2 SECTION "Usage" [1747-3214] -->
<h2><a>Example Code</a></h2> <h2><a>Example Code</a></h2>
<div> <div>
@ -115,7 +115,7 @@ Existing examples in the code base include:
</ul> </ul>
</div> </div>
<!-- EDIT3 SECTION "Example Code" [3216-4500] --> <!-- EDIT3 SECTION "Example Code" [3215-4499] -->
<h2><a>AbstractControl Class</a></h2> <h2><a>AbstractControl Class</a></h2>
<div> <div>
@ -155,12 +155,19 @@ Usage: Your custom subclass implements the three methods <code>controlUpdate()</
// index=i; // example // index=i; // example
&#125; &#125;
&nbsp; &nbsp;
<span>/** This is your init method. Optionally, you can modify <span>/** This method is called when the control is added to the spatial,
* the spatial from here (transform it, initialize userdata, etc). */</span> * and when the control is removed from the spatial (setting a null value).
* It can be used for both initialization and cleanup. */</span>
@Override @Override
public void setSpatial&#40;Spatial spatial&#41; &#123; public void setSpatial&#40;Spatial spatial&#41; &#123;
super.setSpatial&#40;spatial&#41;; super.setSpatial&#40;spatial&#41;;
// spatial.setUserData(&quot;index&quot;, i); // example <span>/* Example:
if (spatial != null){
// initialize
}else{
// cleanup
}
*/</span>
&#125; &#125;
&nbsp; &nbsp;
&nbsp; &nbsp;
@ -214,13 +221,13 @@ See also:
</ul> </ul>
</div> </div>
<!-- EDIT4 SECTION "AbstractControl Class" [4501-7447] --> <!-- EDIT4 SECTION "AbstractControl Class" [4500-7583] -->
<h2><a>The Control Interface</a></h2> <h2><a>The Control Interface</a></h2>
<div> <div>
<p> <p>
<p><div>In the less common case that you want to create a Control that also extends another class, create a custom interface that extends jME3&#039;s Control interface. Your class can become a Control by implement the Control interface, and at the same time extend another class. <p><div>In the less common case that you want to create a Control that also extends another class, create a custom interface that extends jME3&#039;s Control interface. Your class can become a Control by implementing the Control interface, and at the same time extending another class.
</div></p> </div></p>
</p> </p>
@ -321,7 +328,7 @@ Usage example:
&#125;</pre> &#125;</pre>
</div> </div>
<!-- EDIT5 SECTION "The Control Interface" [7448-10699] --> <!-- EDIT5 SECTION "The Control Interface" [7584-10841] -->
<h2><a>Best Practices</a></h2> <h2><a>Best Practices</a></h2>
<div> <div>
@ -387,5 +394,5 @@ vehicleSpatial.addControl&#40;new ManualVehicleControl&#40;&#41;&#41;;
c.steerX&#40;steerX&#41;;</pre> c.steerX&#40;steerX&#41;;</pre>
</div> </div>
<!-- EDIT6 SECTION "Best Practices" [10700-] --> <!-- EDIT6 SECTION "Best Practices" [10842-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:custom_controls?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:custom_controls?do=export_xhtmlbody">view online version</a></em></p>

@ -132,8 +132,24 @@ You can display a wireframe of the (usually invisible) collision shape around al
</p> </p>
<pre>physicsSpace.enableDebug&#40;assetManager&#41;;</pre> <pre>physicsSpace.enableDebug&#40;assetManager&#41;;</pre>
<p>
With debugging enabled, colors are used to indicate various types of physical objects:
</p>
<ul>
<li><div> A magenta wire mesh indicates an active rigid body.</div>
</li>
<li><div> A blue wire mesh indicates a rigid body which is either new or inactive.</div>
</li>
<li><div> A yellow wire mesh indicates a ghost.</div>
</li>
<li><div> Two green arrows indicate a joint.</div>
</li>
<li><div> A pink wire mesh indicates a character.</div>
</li>
</ul>
</div> </div>
<!-- EDIT7 SECTION "Wireframe for Physics" [4221-4567] --> <!-- EDIT7 SECTION "Wireframe for Physics" [4221-4913] -->
<h2><a>Wireframe for Animations</a></h2> <h2><a>Wireframe for Animations</a></h2>
<div> <div>
@ -150,7 +166,7 @@ Making the skeleton visible inside animated models can be handy for debugging an
player.attachChild&#40;skeletonDebug&#41;;</pre> player.attachChild&#40;skeletonDebug&#41;;</pre>
</div> </div>
<!-- EDIT8 SECTION "Wireframe for Animations" [4568-5159] --> <!-- EDIT8 SECTION "Wireframe for Animations" [4914-5505] -->
<h2><a>Example: Toggle Wireframe on Model</a></h2> <h2><a>Example: Toggle Wireframe on Model</a></h2>
<div> <div>
@ -208,7 +224,7 @@ TIP :: To set the line width of wireframe display, use mesh.setLineWidth(lineWid
</p> </p>
</div> </div>
<!-- EDIT9 SECTION "Example: Toggle Wireframe on Model" [5160-7050] --> <!-- EDIT9 SECTION "Example: Toggle Wireframe on Model" [5506-7396] -->
<h2><a>Example: Toggle Wireframe on the scene</a></h2> <h2><a>Example: Toggle Wireframe on the scene</a></h2>
<div> <div>
@ -262,7 +278,7 @@ Then attach the scene processor to the <acronym title="Graphical User Interface"
<pre>getViewPort&#40;&#41;.addProcessor&#40;new WireProcessor&#40;&#41;&#41;;</pre> <pre>getViewPort&#40;&#41;.addProcessor&#40;new WireProcessor&#40;&#41;&#41;;</pre>
</div> </div>
<!-- EDIT10 SECTION "Example: Toggle Wireframe on the scene" [7051-8424] --> <!-- EDIT10 SECTION "Example: Toggle Wireframe on the scene" [7397-8770] -->
<h2><a>See also</a></h2> <h2><a>See also</a></h2>
<div> <div>
<ul> <ul>
@ -271,5 +287,5 @@ Then attach the scene processor to the <acronym title="Graphical User Interface"
</ul> </ul>
</div> </div>
<!-- EDIT11 SECTION "See also" [8425-] --> <!-- EDIT11 SECTION "See also" [8771-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:debugging?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:debugging?do=export_xhtmlbody">view online version</a></em></p>

@ -298,6 +298,57 @@ Thanks for your awesome contributions! Keep them coming!
</ul> </ul>
<hr /> <hr />
</div>
<!-- EDIT20 SECTION "Particle Emitters: Explosions, Fire, Smoke" [8466-9440] -->
<h3><a>Creating your own Filters</a></h3>
<div>
<p>
Here is an extract taken from @nehon in the forum thread (<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://hub.jmonkeyengine.org/forum/topic/how-exactly-do-filters-work/"><param name="text" value="<html><u>http://hub.jmonkeyengine.org/forum/topic/how-exactly-do-filters-work/</u></html>"><param name="textColor" value="blue"></object>)
</p>
<p>
The methods are called in this order (pretty much the same flow as processors):
- initFilter() is called once when the FilterPostPorcessor is initialized or when the filter is added to the processor and this one as already been initialized.
</p>
<p>
for each frame the methods are called in that sequence :
- preFrame() occurs before anything happens
- postQueue() occcurs once the queues have been populated (there is one queue per bucket and 2 additional queues for the shadows, casters and recievers). Note that geometries in the queues are the one in the view frustum.
- postFrame occurs once the main frame has been rendered (the back buffer)
</p>
<p>
Those methods are optional in a filter, they are only there if you want to hook in the rendering process.
</p>
<p>
The material variable is here for convenience. You have a getMaterial method that returns the material that???s gonna be used to render the full screen quad. It just happened that in every implementation I had a material attribute in all my sub-classes, so I just put it back in the abstract class. Most of the time getMaterial returns this attribute.
</p>
<p>
Forced-technique can be any technique really, they are more related with the material system than to the filters but anyway. When you use a forced technique the renderer tries to select it on the material of each geometry, if the technique does not exists for the material the geometry is not rendered.
You assume well about the SSAO filer, the normal of the scene are rendered to a texture in a pre pass.
</p>
<p>
Passes : these are filters in filters in a way. First they are a convenient way to initialize a FrameBuffer and the associated textures it needs, then you can use them for what ever you want.
For example, a Pass can be (as in the SSAO filter) an extra render of the scene with a forced technique, and you have to handle the render yourself in the postQueue method.
It can be a post pass to do after the main filter has been rendered to screen (for example an additional blur pass used in SSAO again). You have a list of passes called postRenderPass in the Filter abstract class. If you add a pass to this list, it???ll be automatically rendered by the FilterPostProcessor during the filter chain.
</p>
<p>
The bloom Filter does an intensive use of passes.
</p>
<p>
Filters in a nutshell.
</p>
<hr />
<p> <p>
See also: See also:
</p> </p>
@ -317,5 +368,5 @@ See also:
</span></div> </span></div>
</div> </div>
<!-- EDIT20 SECTION "Particle Emitters: Explosions, Fire, Smoke" [8466-] --> <!-- EDIT21 SECTION "Creating your own Filters" [9441-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:effects_overview?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:effects_overview?do=export_xhtmlbody">view online version</a></em></p>

@ -158,15 +158,15 @@ In your IDE, use code completion to quickly look up Trigger literals. In the jMo
<td>INPUT_MAPPING_CAMERA_POS</td><td>KEY_C</td><td>Prints debug output about the camera.</td> <td>INPUT_MAPPING_CAMERA_POS</td><td>KEY_C</td><td>Prints debug output about the camera.</td>
</tr> </tr>
<tr> <tr>
<td>INPUT_MAPPING_MEMORY</td><td>KEY_M</td><td>Prints debug output for memtory usage.</td> <td>INPUT_MAPPING_MEMORY</td><td>KEY_M</td><td>Prints debug output for memory usage.</td>
</tr> </tr>
<tr> <tr>
<td>INPUT_MAPPING_EXIT</td><td>KEY_ESCAPE</td><td>Closes the application by calling <code>stop();</code>. Typically you do not remove this, unless you replace it by another way of quitting gracefully.</td> <td>INPUT_MAPPING_EXIT</td><td>KEY_ESCAPE</td><td>Closes the application by calling <code>stop();</code>. Typically you do not remove this, unless you replace it by another way of quitting gracefully.</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT6 TABLE [3701-4118] --> <!-- EDIT6 TABLE [3701-4117] -->
</div> </div>
<!-- EDIT5 SECTION "2. Remove Default Trigger Mappings" [3569-4119] --> <!-- EDIT5 SECTION "2. Remove Default Trigger Mappings" [3569-4118] -->
<h2><a>3. Add Custom Trigger Mapping</a></h2> <h2><a>3. Add Custom Trigger Mapping</a></h2>
<div> <div>
@ -192,7 +192,7 @@ inputManager.addMapping&#40;&quot;Right&quot;, new KeyTrigger&#40;KeyInput.KEY_D
...</pre> ...</pre>
</div> </div>
<!-- EDIT7 SECTION "3. Add Custom Trigger Mapping" [4120-5184] --> <!-- EDIT7 SECTION "3. Add Custom Trigger Mapping" [4119-5183] -->
<h2><a>4. Create Listeners</a></h2> <h2><a>4. Create Listeners</a></h2>
<div> <div>
@ -206,7 +206,7 @@ The jME3 input manager supports two types of event listeners for inputs: AnalogL
</p> </p>
</div> </div>
<!-- EDIT8 SECTION "4. Create Listeners" [5185-5658] --> <!-- EDIT8 SECTION "4. Create Listeners" [5184-5657] -->
<h3><a>ActionListener</a></h3> <h3><a>ActionListener</a></h3>
<div> <div>
@ -241,7 +241,7 @@ The jME3 input manager supports two types of event listeners for inputs: AnalogL
&#125;;</pre> &#125;;</pre>
</div> </div>
<!-- EDIT9 SECTION "ActionListener" [5659-6325] --> <!-- EDIT9 SECTION "ActionListener" [5658-6324] -->
<h3><a>AnalogListener</a></h3> <h3><a>AnalogListener</a></h3>
<div> <div>
@ -274,7 +274,7 @@ The jME3 input manager supports two types of event listeners for inputs: AnalogL
&#125;;</pre> &#125;;</pre>
</div> </div>
<!-- EDIT10 SECTION "AnalogListener" [6326-6962] --> <!-- EDIT10 SECTION "AnalogListener" [6325-6961] -->
<h2><a>4. Register Mappings to Listeners</a></h2> <h2><a>4. Register Mappings to Listeners</a></h2>
<div> <div>
@ -303,7 +303,7 @@ As you see, you can add several listeners in one String array. You can call the
</p> </p>
</div> </div>
<!-- EDIT11 SECTION "4. Register Mappings to Listeners" [6963-8211] --> <!-- EDIT11 SECTION "4. Register Mappings to Listeners" [6962-8210] -->
<h2><a>5. Implement Actions in Listeners</a></h2> <h2><a>5. Implement Actions in Listeners</a></h2>
<div> <div>
@ -323,7 +323,7 @@ Make use of the distinction between <code>if</code> and <code>else if</code> in
</ul> </ul>
</div> </div>
<!-- EDIT12 SECTION "5. Implement Actions in Listeners" [8212-8947] --> <!-- EDIT12 SECTION "5. Implement Actions in Listeners" [8211-8946] -->
<h3><a>ActionListener</a></h3> <h3><a>ActionListener</a></h3>
<div> <div>
@ -344,7 +344,7 @@ In the most common case, you want an action to be triggered once, in the moment
&#125;;</pre> &#125;;</pre>
</div> </div>
<!-- EDIT13 SECTION "ActionListener" [8948-9619] --> <!-- EDIT13 SECTION "ActionListener" [8947-9618] -->
<h3><a>AnalogListener</a></h3> <h3><a>AnalogListener</a></h3>
<div> <div>
@ -365,7 +365,7 @@ The following example shows how you define actions with an AnalogListener. Thies
&#125;;</pre> &#125;;</pre>
</div> </div>
<!-- EDIT14 SECTION "AnalogListener" [9620-10200] --> <!-- EDIT14 SECTION "AnalogListener" [9619-10199] -->
<h2><a>Let Users Remap Keys</a></h2> <h2><a>Let Users Remap Keys</a></h2>
<div> <div>
@ -384,5 +384,5 @@ The abstraction of separating triggers and mappings has the advantage that you c
</span></div> </span></div>
</div> </div>
<!-- EDIT15 SECTION "Let Users Remap Keys" [10201-] --> <!-- EDIT15 SECTION "Let Users Remap Keys" [10200-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:input_handling?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:input_handling?do=export_xhtmlbody">view online version</a></em></p>

@ -75,7 +75,7 @@ You can get a list of all lights added to a Spatial by calling <code>getWorldLig
</p> </p>
<p> <p>
A PointLight has a location and shines from there in all directions as far as its radius reaches. The light intensity decreases with increased distance from the light source. A PointLight can at the moment not be used for casting shadows (using the PssmShadowRenderer - read more about this below). A PointLight has a location and shines from there in all directions as far as its radius reaches. The light intensity decreases with increased distance from the light source. A PointLight can be used to cast shadows along with a PointLightShadowRenderer (see the Casting Shadows section)
</p> </p>
<p> <p>
@ -88,7 +88,7 @@ lamp_light.setPosition&#40;new Vector3f&#40;lamp_geo.getLocalTranslation&#40;&#4
rootNode.addLight&#40;lamp_light&#41;;</pre> rootNode.addLight&#40;lamp_light&#41;;</pre>
</div> </div>
<!-- EDIT3 SECTION "PointLight" [2060-2762] --> <!-- EDIT3 SECTION "PointLight" [2060-2750] -->
<h3><a>DirectionalLight</a></h3> <h3><a>DirectionalLight</a></h3>
<div> <div>
@ -110,7 +110,7 @@ sun.setDirection&#40;new Vector3f&#40;-.5f,-.5f,-.5f&#41;.normalizeLocal&#40;&#4
rootNode.addLight&#40;sun&#41;;</pre> rootNode.addLight&#40;sun&#41;;</pre>
</div> </div>
<!-- EDIT4 SECTION "DirectionalLight" [2763-3367] --> <!-- EDIT4 SECTION "DirectionalLight" [2751-3355] -->
<h3><a>SpotLight</a></h3> <h3><a>SpotLight</a></h3>
<div> <div>
@ -140,7 +140,7 @@ If you want the spotlight to follow the flycam, repeat the setDirection(???) and
</p> </p>
</div> </div>
<!-- EDIT5 SECTION "SpotLight" [3368-4502] --> <!-- EDIT5 SECTION "SpotLight" [3356-4490] -->
<h3><a>AmbientLight</a></h3> <h3><a>AmbientLight</a></h3>
<div> <div>
@ -163,7 +163,7 @@ Example: <code>mylight.setColor(ColorRGBA.White.mult(1.3f));</code>
</p> </p>
</div> </div>
<!-- EDIT6 SECTION "AmbientLight" [4503-5325] --> <!-- EDIT6 SECTION "AmbientLight" [4491-5313] -->
<h2><a>Light Follows Spatial</a></h2> <h2><a>Light Follows Spatial</a></h2>
<div> <div>
@ -181,117 +181,84 @@ Obviously, this does not apply to AmbientLights, which have no position.
</p> </p>
</div> </div>
<!-- EDIT7 SECTION "Light Follows Spatial" [5326-5891] --> <!-- EDIT7 SECTION "Light Follows Spatial" [5314-5880] -->
<h2><a>Simple Lighting</a></h2> <h2><a>BasicShadowRenderer (deprecated)</a></h2>
<div> <div>
<p> <p>
Full sample code: Full code sample
</p> </p>
<ul> <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/light/TestSimpleLighting.java"><param name="text" value="<html><u>TestSimpleLighting.java</u></html>"><param name="textColor" value="blue"></object></div> <li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/light/TestShadow.java"><param name="text" value="<html><u>TestShadow.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/light/TestLightRadius.java"><param name="text" value="<html><u>TestLightRadius.java</u></html>"><param name="textColor" value="blue"></object></div>
</li> </li>
</ul> </ul>
<p>
For Simple Lighting we use Geometries with Materials based on Lighting.j3md (learn <a href="/com/jme3/gde/docs/jme3/advanced/materials_overview.html">more about Materials</a> here). Lighting.j3md-based materials dynamically support Shininess, and Ambient, Diffuse, and Specular light if there is a light source present. Note that this lighting method alone does not make the Geometry cast a shadow onto other Geometries automatically (see below for how to add drop shadows etc).
</p>
<p>
<img src="nbdocs:/com/jme3/gde/docs/jme3/advanced/teapot-phong-illuminated.png">
</p>
<pre>Geometry teapot = &#40;Geometry&#41; assetManager.loadModel&#40;&quot;Models/Teapot/Teapot.obj&quot;&#41;;
TangentBinormalGenerator.generate&#40;teapot.getMesh&#40;&#41;, true&#41;;
Material mat = new Material&#40;assetManager, &quot;Common/MatDefs/Light/Lighting.j3md&quot;&#41;;
mat.setBoolean&#40;&quot;m_UseMaterialColors&quot;, true&#41;;
mat.setColor&#40;&quot;m_Ambient&quot;, ColorRGBA.Orange&#41;;
mat.setColor&#40;&quot;m_Diffuse&quot;, ColorRGBA.Orange&#41;;
mat.setColor&#40;&quot;m_Specular&quot;, ColorRGBA.White&#41;;
mat.setFloat&#40;&quot;m_Shininess&quot;, 12&#41;;
rootNode.attachChild&#40;teapot&#41;;</pre>
<p>
The above example uses material colors and no textures. You can of course also use Lighting.j3md to create a lit Material that uses Texture Maps. The following example uses Shininess, Diffuse Map and Normal Map (a.k.a Bump Map).
</p>
<p>
<img src="nbdocs:/com/jme3/gde/docs/jme3/advanced/bump-mapped-sphere.png">
</p>
<pre>Sphere rock = new Sphere&#40;32,32, 2f&#41;;
Geometry shiny_rock = new Geometry&#40;&quot;Shiny rock&quot;, rock&#41;;
rock.setTextureMode&#40;Sphere.TextureMode.Projected&#41;; // better quality on spheres
TangentBinormalGenerator.generate&#40;rock&#41;; // for lighting effect
Material mat_lit = new Material&#40;
assetManager, &quot;Common/MatDefs/Light/Lighting.j3md&quot;&#41;;
mat_lit.setTexture&#40;&quot;m_DiffuseMap&quot;, // surface color
assetManager.loadTexture&#40;&quot;Textures/Terrain/Pond/Pond.png&quot;&#41;&#41;;
mat_lit.setTexture&#40;&quot;m_NormalMap&quot;, // surface bumps
assetManager.loadTexture&#40;&quot;Textures/Terrain/Pond/Pond_normal.png&quot;&#41;&#41;;
mat_lit.setFloat&#40;&quot;m_Shininess&quot;, 5f&#41;; // surface smoothness [1,128]
shiny_rock.setMaterial&#40;mat_lit&#41;;
rootNode.attachChild&#40;shiny_rock&#41;;</pre>
<p>
These light effects update live when the object or light source moves. If you shine a colored PointLight at this object, you will see a light reflection tinged in the color of the PointLight.
</p>
</div> </div>
<!-- EDIT8 SECTION "Simple Lighting" [5892-8541] --> <!-- EDIT8 SECTION "BasicShadowRenderer (deprecated)" [5881-6073] -->
<h2><a>BasicShadowRenderer</a></h2> <h2><a>Casting Shadows</a></h2>
<div> <div>
<p> <p>
Full code sample For each type of non-ambient light source, JME3 implements two ways to simulate geometries casting shadows on other geometries:
</p> </p>
<ul> <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/light/TestShadow.java"><param name="text" value="<html><u>TestShadow.java</u></html>"><param name="textColor" value="blue"></object></div> <li><div> a shadow renderer (which you apply to a viewport) and</div>
</li>
<li><div> a shadow filter (which you can add to a viewport&#039;s filter post-processor).</div>
</li> </li>
</ul> </ul>
<div><table>
<tr>
<th> light source class </th><th> shadow renderer class </th><th> shadow filter class </th>
</tr>
<tr>
<td> DirectionalLight </td><td> DirectionalLightShadowRenderer </td><td> DirectionalLightShadowFilter </td>
</tr>
<tr>
<td> PointLight </td><td> PointLightShadowRenderer </td><td> PointLightShadowFilter </td>
</tr>
<tr>
<td> SpotLight </td><td> SpotLightShadowRenderer </td><td> SpotLightShadowFilter </td>
</tr>
<tr>
<td> AmbientLight </td><td> (not applicable) </td><td> (not applicable) </td>
</tr>
</table></div>
<!-- EDIT10 TABLE [6369-6708] -->
<p> <p>
Use the Shadow Renderer to make Geometries with Lighting.j3md-based Materials cast and receive basic drop shadows. This fast and simple implementation of a shadow effect is good for scenes with flat floors, but looks less realistic on uneven terrains. To use it, you add a jME SceneProcessor named com.jme3.shadow.BasicShadowRenderer to the viewPort. You only need one shadow simulation per light source: if you use shadow rendering, you won&#039;t need a shadow filter and vice versa. Which way is more efficient depends partly on the complexity of your scene. All six shadow simulation classes have similar interfaces, so once you know how to use one, you can easily figure out the rest.
</p> </p>
<p> <p>
<img src="nbdocs:/com/jme3/gde/docs/jme3/advanced/drop-shadows.png"> Shadow calculations (cast and receive) have a performance impact, so use them sparingly. With shadow renderers, you can turn off shadow casting and/or shadow receiving for individual geometries, for portions of the scene graph, or for the entire scene:
</p> </p>
<pre>BasicShadowRenderer bsr; <pre>spatial.setShadowMode&#40;ShadowMode.Inherit&#41;; // This is the default setting for new spatials.
... rootNode.setShadowMode&#40;ShadowMode.Off&#41;; // Disable shadows for the whole scene, except where overridden.
public void simpleInitApp&#40;&#41; &#123; wall.setShadowMode&#40;ShadowMode.CastAndReceive&#41;; // The wall can cast shadows and also receive them.
... floor.setShadowMode&#40;ShadowMode.Receive&#41;; // Any shadows cast by the floor would be hidden by it.
bsr = new BasicShadowRenderer&#40;assetManager, 256&#41;; airplane.setShadowMode&#40;ShadowMode.Cast&#41;; // There's nothing above the airplane to cast shadows on it.
bsr.setDirection&#40;new Vector3f&#40;-.5f,-.5f,-.5f&#41;.normalizeLocal&#40;&#41;&#41;; // light direction ghost.setShadowMode&#40;ShadowMode.Off&#41;; // The ghost is translucent: it neither casts nor receives shadows.</pre>
viewPort.addProcessor&#40;bsr&#41;;
...</pre>
<p> <p>
Shadow calculations (cast and receive) have a performance impact, therefor we recommend to use them smartly. Switch off the default shadow mode for the whole scene graph, and then specify the shadow behaviour individually for every scene node that needs shadows: You specifiy whether it casts shadows, receives shadows, both (slower), or neither (faster). Both shadow renderers and shadow filters use shadow modes to determine which objects can cast shadows. However, only the shadow renderers pay attention to shadow modes when determining which objects receive shadows. With a shadow filter, shadow modes have no effect on which objects receive shadows.
</p> </p>
<pre>rootNode.setShadowMode&#40;ShadowMode.Off&#41;; // reset all
wall.setShadowMode&#40;ShadowMode.CastAndReceive&#41;; // normal behaviour (slow)
floor.setShadowMode&#40;ShadowMode.Receive&#41;; // can't see shadow cast below floor anyway...
airplane.setShadowMode&#40;ShadowMode.Cast&#41;; // nothing casts shadows onto airplane anyway...
ghost.setShadowMode&#40;ShadowMode.Off&#41;; // ghost is translucent anyway...</pre>
</div>
<!-- EDIT9 SECTION "BasicShadowRenderer" [8542-10211] -->
<h2><a>DirectionalLightShadowRenderer</a></h2>
<div>
<p> <p>
Here&#039;s a sample application which demonstrates both DirectionalLightShadowRenderer and DirectionalLightShadowFilter:
Full sample code
</p> </p>
<ul> <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/light/TestDirectionalLightShadow.java"><param name="text" value="<html><u>TestDirectionalLightShadow.java</u></html>"><param name="textColor" value="blue"></object></div> <li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/light/TestDirectionalLightShadow.java"><param name="text" value="<html><u>TestDirectionalLightShadow.java</u></html>"><param name="textColor" value="blue"></object></div>
</li> </li>
</ul> </ul>
<p>
Here is the key code fragment:
</p>
<pre> DirectionalLight sun = new DirectionalLight&#40;&#41;; <pre> DirectionalLight sun = new DirectionalLight&#40;&#41;;
sun.setColor&#40;ColorRGBA.White&#41;; sun.setColor&#40;ColorRGBA.White&#41;;
sun.setDirection&#40;cam.getDirection&#40;&#41;&#41;; sun.setDirection&#40;cam.getDirection&#40;&#41;&#41;;
@ -310,8 +277,24 @@ Full sample code
fpp.addFilter&#40;dlsf&#41;; fpp.addFilter&#40;dlsf&#41;;
viewPort.addProcessor&#40;fpp&#41;;</pre> viewPort.addProcessor&#40;fpp&#41;;</pre>
<p>
Constructor arguments:
* your AssetManager object
* size of the rendered shadow maps, in pixels per side (512, 1024, 2048, etc???)
* the number of shadow maps rendered (more shadow maps = better quality, but slower)
</p>
<p>
Properties you can set:
* setDirection(Vector3f) ??? the direction of the light
* setLambda(0.65f) ??? to reduce the split size
* setShadowIntensity(0.7f) ??? shadow darkness (1=black, 0=invisible)
* setShadowZextend(float) ??? distance from camera to which shadows will be computed
</p>
</div> </div>
<!-- EDIT10 SECTION "DirectionalLightShadowRenderer" [10212-11184] --> <!-- EDIT9 SECTION "Casting Shadows" [6074-9825] -->
<h2><a>Parallel-Split Shadow Map (deprecated)</a></h2> <h2><a>Parallel-Split Shadow Map (deprecated)</a></h2>
<div> <div>
@ -326,10 +309,6 @@ Full sample code
<p> <p>
The more advanced PSSM shadow renderer can cast real-time shadows, even on curved surfaces such as terrains. It is a bit more resource hungry than the BasicShadowRenderer. To activate PSSM drop shadows, add a jME SceneProcessor named <code>com.jme3.shadow.PssmShadowRenderer</code> to the viewPort. PSSM stands for the Parallel-Split Shadow Map technique.
</p>
<p>
<img src="nbdocs:/com/jme3/gde/docs/jme3/advanced/shadow.png"> <img src="nbdocs:/com/jme3/gde/docs/jme3/advanced/shadow.png">
</p> </p>
<pre>private PssmShadowRenderer pssmRenderer; <pre>private PssmShadowRenderer pssmRenderer;
@ -340,42 +319,8 @@ public void simpleInitApp&#40;&#41; &#123;
pssmRenderer.setDirection&#40;new Vector3f&#40;-.5f,-.5f,-.5f&#41;.normalizeLocal&#40;&#41;&#41;; // light direction pssmRenderer.setDirection&#40;new Vector3f&#40;-.5f,-.5f,-.5f&#41;.normalizeLocal&#40;&#41;&#41;; // light direction
viewPort.addProcessor&#40;pssmRenderer&#41;;</pre> viewPort.addProcessor&#40;pssmRenderer&#41;;</pre>
<p>
The constructor expects the following values:
</p>
<ul>
<li><div> Your assetManager object</div>
</li>
<li><div> The size of the rendered shadowmaps (512, 1024, 2048, etc???)</div>
</li>
<li><div> The number of shadow maps rendered (the more shadow maps, the more quality, the less FPS).</div>
</li>
</ul>
<p>
You can set the following properties on the <code>pssmRenderer</code> object:
</p>
<ul>
<li><div> setDirection(Vector3f) ??? the direction of the light</div>
</li>
<li><div> setLambda(0.65f) ??? Factor to use to reduce the split size</div>
</li>
<li><div> setShadowIntensity(0.7f) ??? shadow darkness (1 black, 0 invisible)</div>
</li>
<li><div> setShadowZextend() ??? distance how far away from camera shadows will still be computed</div>
</li>
</ul>
<p>
As said above, it&#039;s more efficient to specify individual shadow behaviour for each Geometry.
</p>
<pre>teapot.setShadowMode&#40;ShadowMode.CastAndReceive&#41;;
terrain.setShadowMode&#40;ShadowMode.Receive&#41;; </pre>
</div> </div>
<!-- EDIT11 SECTION "Parallel-Split Shadow Map (deprecated)" [11185-12920] --> <!-- EDIT11 SECTION "Parallel-Split Shadow Map (deprecated)" [9826-10415] -->
<h2><a>Screen Space Ambient Occlusion</a></h2> <h2><a>Screen Space Ambient Occlusion</a></h2>
<div> <div>
@ -384,17 +329,21 @@ terrain.setShadowMode&#40;ShadowMode.Receive&#41;; </pre>
Full sample code Full sample code
</p> </p>
<ul> <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/post/TestSSAO.java"><param name="text" value="<html><u>jme3/src/test/jme3test/post/TestSSAO.java</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/post/TestSSAO2.java"><param name="text" value="<html><u>jme3/src/test/jme3test/post/TestSSAO2.java</u></html>"><param name="textColor" value="blue"></object> ??? Screen-Space Ambient Occlusion shadows</div> <li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/post/TestSSAO.java"><param name="text" value="<html><u>jme3/src/test/jme3test/post/TestSSAO.java</u></html>"><param name="textColor" value="blue"></object> ??? Screen-Space Ambient Occlusion shadows</div>
</li> </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/post/TestTransparentSSAO.java"><param name="text" value="<html><u>jme3/src/test/jme3test/post/TestTransparentSSAO.java</u></html>"><param name="textColor" value="blue"></object> ??? Screen-Space Ambient Occlusion shadows plus transparancy</div> <li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/post/TestTransparentSSAO.java"><param name="text" value="<html><u>jme3/src/test/jme3test/post/TestTransparentSSAO.java</u></html>"><param name="textColor" value="blue"></object> ??? Screen-Space Ambient Occlusion shadows plus transparancy</div>
</li> </li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.org/2010/08/16/screen-space-ambient-occlusion-for-jmonkeyengine-3-0/#more-321"><param name="text" value="<html><u>Screen Space Ambient Occlusion for jMonkeyEngine (article)</u></html>"><param name="textColor" value="blue"></object></div> <li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://hub.jmonkeyengine.org/2010/08/screen-space-ambient-occlusion-for-jmonkeyengine-3-0/"><param name="text" value="<html><u>Screen Space Ambient Occlusion for jMonkeyEngine (article)</u></html>"><param name="textColor" value="blue"></object></div>
</li> </li>
</ul> </ul>
<p> <p>
Ambient Occlusion refers to the shadows that nearby objects cast on each other under an ambient lighting. It???s an approximation of how light radiates in a real life scene. To activate Ambient Occlusion shadows, add a jME SceneProcessor named <code>com.jme3.post.SSAOFilter</code> to the viewPort. SSAO stands for the Screen Space Ambient Occlusion technique. Ambient Occlusion refers to the shadows which nearby objects cast on each other under an ambient lighting. Screen Space Ambient Occlusion (SSAO) approximates how light radiates in real life.
</p>
<p>
In JME3, SSAO is implemented by adding an instance of <code>com.jme3.post.SSAOFilter</code> to a viewport which already simulates shadows using another method such as DirectionalLightShadowRenderer.
</p> </p>
<pre>FilterPostProcessor fpp = new FilterPostProcessor&#40;assetManager&#41;; <pre>FilterPostProcessor fpp = new FilterPostProcessor&#40;assetManager&#41;;
SSAOFilter ssaoFilter = new SSAOFilter&#40;12.94f, 43.92f, 0.33f, 0.61f&#41;; SSAOFilter ssaoFilter = new SSAOFilter&#40;12.94f, 43.92f, 0.33f, 0.61f&#41;;
@ -407,5 +356,5 @@ viewPort.addProcessor&#40;fpp&#41;;</pre>
</p> </p>
</div> </div>
<!-- EDIT12 SECTION "Screen Space Ambient Occlusion" [12921-] --> <!-- EDIT12 SECTION "Screen Space Ambient Occlusion" [10416-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:light_and_shadow?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:light_and_shadow?do=export_xhtmlbody">view online version</a></em></p>

@ -22,7 +22,7 @@ See <a href="/com/jme3/gde/docs/jme3/advanced/input_handling.html">Input Handlin
<p> <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. 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 this method together with a first-person flyCam.
</p> </p>
<ol> <ol>
@ -72,7 +72,7 @@ The following example rotates Spatials named &quot;Red Box&quot; or &quot;Blue B
&#125;;</pre> &#125;;</pre>
</div> </div>
<!-- EDIT2 SECTION "Pick a Target Using Fixed Crosshairs" [534-3109] --> <!-- EDIT2 SECTION "Pick a Target Using Fixed Crosshairs" [534-3105] -->
<h2><a>Pick a Target Using the Mouse Pointer</a></h2> <h2><a>Pick a Target Using the Mouse Pointer</a></h2>
<div> <div>
@ -146,5 +146,5 @@ The following example rotates Spatials named &quot;Red Box&quot; or &quot;Blue B
</span></div> </span></div>
</div> </div>
<!-- EDIT3 SECTION "Pick a Target Using the Mouse Pointer" [3110-] --> <!-- EDIT3 SECTION "Pick a Target Using the Mouse Pointer" [3106-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:mouse_picking?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:mouse_picking?do=export_xhtmlbody">view online version</a></em></p>

@ -4,7 +4,7 @@
<p> <p>
jME3 is similar to Swing in that for speed and efficiency all changes to the world must be made in a single update thread. This is happening automatically if using Controls and AppSates update metod or simpleUpdate however whenever you pass work to another thread you need to hand the results back to the main jME3 thread before making any changes to the scene graph. jME3 is similar to Swing in that, for speed and efficiency, all changes to the scene graph must be made in a single update thread. If you make changes only in Control.update(), AppState.update(), or SimpleApplication.simpleUpdate(), this will happen automatically. However, if you pass work to another thread, you may need to pass results back to the main jME3 thread so that scene graph changes can take place there.
</p> </p>
<pre>public void rotateGeometry&#40;final Geometry geo, final Quaternion rot&#41; &#123; <pre>public void rotateGeometry&#40;final Geometry geo, final Quaternion rot&#41; &#123;
mainApp.enqueue&#40;new Callable&lt;Spatial&gt;&#40;&#41; &#123; mainApp.enqueue&#40;new Callable&lt;Spatial&gt;&#40;&#41; &#123;
@ -24,7 +24,7 @@ If the processing thread needs to wait or needs the return value then <code>get(
</p> </p>
</div> </div>
<!-- EDIT1 SECTION "The jME3 Threading Model" [1-1092] --> <!-- EDIT1 SECTION "The jME3 Threading Model" [1-1143] -->
<h1><a>Multithreading Optimization</a></h1> <h1><a>Multithreading Optimization</a></h1>
<div> <div>
@ -46,7 +46,7 @@ Effectively, each for-loop in the main update loop might be a chance for multith
</p> </p>
</div> </div>
<!-- EDIT2 SECTION "Multithreading Optimization" [1093-2223] --> <!-- EDIT2 SECTION "Multithreading Optimization" [1144-2274] -->
<h2><a>Java Multithreading</a></h2> <h2><a>Java Multithreading</a></h2>
<div> <div>
@ -65,7 +65,7 @@ The java.util.concurrent package provides a good foundation for multithreading a
</ul> </ul>
</div> </div>
<!-- EDIT3 SECTION "Java Multithreading" [2224-3296] --> <!-- EDIT3 SECTION "Java Multithreading" [2275-3347] -->
<h2><a>Multithreading in jME3</a></h2> <h2><a>Multithreading in jME3</a></h2>
<div> <div>
@ -83,7 +83,7 @@ To avoid slowdown, we decide to keep the pathfinding operations in the NPC Contr
</p> </p>
</div> </div>
<!-- EDIT4 SECTION "Multithreading in jME3" [3297-3969] --> <!-- EDIT4 SECTION "Multithreading in jME3" [3348-4020] -->
<h3><a>Executor</a></h3> <h3><a>Executor</a></h3>
<div> <div>
@ -110,7 +110,7 @@ In your simple application you can override the destroy method and shutdown the
&#125;</pre> &#125;</pre>
</div> </div>
<!-- EDIT5 SECTION "Executor" [3970-5045] --> <!-- EDIT5 SECTION "Executor" [4021-5096] -->
<h3><a>Control Class Fields</a></h3> <h3><a>Control Class Fields</a></h3>
<div> <div>
@ -130,7 +130,7 @@ Here we also created the Future variable to track the state of this task.
</p> </p>
</div> </div>
<!-- EDIT6 SECTION "Control Class Fields" [5046-5636] --> <!-- EDIT6 SECTION "Control Class Fields" [5097-5687] -->
<h3><a>Control Update() Method</a></h3> <h3><a>Control Update() Method</a></h3>
<div> <div>
@ -143,7 +143,7 @@ Next let&#039;s look at the update() call of the Control where the time-intensiv
//If we have no waylist and not started a callable yet, do so! //If we have no waylist and not started a callable yet, do so!
if&#40;wayList == null &amp;&amp; future == null&#41;&#123; if&#40;wayList == null &amp;&amp; future == null&#41;&#123;
//set the desired location vector, after that we should not modify it anymore //set the desired location vector, after that we should not modify it anymore
//because its being accessed on the other thread! //because it's being accessed on the other thread!
desiredLocation.set&#40;getGoodNextLocation&#40;&#41;&#41;; desiredLocation.set&#40;getGoodNextLocation&#40;&#41;&#41;;
//start the callable on the executor //start the callable on the executor
future = executor.submit&#40;findWay&#41;; // Thread starts! future = executor.submit&#40;findWay&#41;; // Thread starts!
@ -178,7 +178,7 @@ Remember not to mess with the class fields after starting the thread, because th
</p> </p>
</div> </div>
<!-- EDIT7 SECTION "Control Update() Method" [5637-7507] --> <!-- EDIT7 SECTION "Control Update() Method" [5688-7559] -->
<h3><a>The Callable</a></h3> <h3><a>The Callable</a></h3>
<div> <div>
@ -230,7 +230,17 @@ private Callable&lt;MyWayList&gt; findWay = new Callable&lt;MyWayList&gt;&#40;&#
&#125;;</pre> &#125;;</pre>
</div> </div>
<!-- EDIT8 SECTION "The Callable" [7508-9874] --> <!-- EDIT8 SECTION "The Callable" [7560-9926] -->
<h2><a>Useful Links</a></h2>
<div>
<p>
High level description which describes how to manage the game state and the rendering in different threads - <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.altdevblogaday.com/2011/07/03/threading-and-your-game-loop/"><param name="text" value="<html><u>link</u></html>"><param name="textColor" value="blue"></object>
</p>
</div>
<!-- EDIT9 SECTION "Useful Links" [9927-10143] -->
<h2><a>Conclusion</a></h2> <h2><a>Conclusion</a></h2>
<div> <div>
@ -249,5 +259,5 @@ The cool thing about this approach is that every entity creates one self-contain
</span></div> </span></div>
</div> </div>
<!-- EDIT9 SECTION "Conclusion" [9875-] --> <!-- EDIT10 SECTION "Conclusion" [10144-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:multithreading?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:multithreading?do=export_xhtmlbody">view online version</a></em></p>

@ -53,15 +53,17 @@ You can register several types of listeners to be notified of changes.
</li> </li>
<li><div> ConnectionListeners inform the Server about HostedConnection arrivals and removals, e.g. if a client joins or quits.</div> <li><div> ConnectionListeners inform the Server about HostedConnection arrivals and removals, e.g. if a client joins or quits.</div>
</li> </li>
<li><div> ErrorListeners inform the Client about network exceptions that have happened, e.g. if the server crashes, the client throws a ConnectorException, this can be picked up so that the application can do something about it.</div>
</li>
</ul> </ul>
</div> </div>
<!-- EDIT2 SECTION "SpiderMonkey API Overview" [842-2386] --> <!-- EDIT2 SECTION "SpiderMonkey API Overview" [842-2609] -->
<h2><a>Client and Server</a></h2> <h2><a>Client and Server</a></h2>
<div> <div>
</div> </div>
<!-- EDIT4 SECTION "Client and Server" [2387-2417] --> <!-- EDIT4 SECTION "Client and Server" [2610-2640] -->
<h3><a>Creating a Server</a></h3> <h3><a>Creating a Server</a></h3>
<div> <div>
@ -96,7 +98,7 @@ When you run this app on a host, the server is ready to accept clients. Let&#039
</p> </p>
</div> </div>
<!-- EDIT5 SECTION "Creating a Server" [2418-3368] --> <!-- EDIT5 SECTION "Creating a Server" [2641-3591] -->
<h3><a>Creating a Client</a></h3> <h3><a>Creating a Client</a></h3>
<div> <div>
@ -135,7 +137,7 @@ When you run this client, it connects to the server.
</p> </p>
</div> </div>
<!-- EDIT6 SECTION "Creating a Client" [3369-4534] --> <!-- EDIT6 SECTION "Creating a Client" [3592-4757] -->
<h3><a>Getting Info About a Client</a></h3> <h3><a>Getting Info About a Client</a></h3>
<div> <div>
@ -158,7 +160,7 @@ The server refers to a connected client as com.jme3.network.HostedConnection obj
<td>myServer.getConnection(0)</td><td>Server gets the first (0), second (1), etc, connected HostedConnection object (one client).</td> <td>myServer.getConnection(0)</td><td>Server gets the first (0), second (1), etc, connected HostedConnection object (one client).</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT8 TABLE [4711-5090] --> <!-- EDIT8 TABLE [4934-5313] -->
<p> <p>
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>: 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>:
@ -175,14 +177,14 @@ Your game can define its own game data based on whatever criteria you want, typi
<td> MyState state = conn.getAttribute(&quot;MyState&quot;)</td><td> Server can read an attribute of the HostedConnection. </td> <td> MyState state = conn.getAttribute(&quot;MyState&quot;)</td><td> Server can read an attribute of the HostedConnection. </td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT9 TABLE [5465-5694] --> <!-- EDIT9 TABLE [5688-5917] -->
</div> </div>
<!-- EDIT7 SECTION "Getting Info About a Client" [4535-5695] --> <!-- EDIT7 SECTION "Getting Info About a Client" [4758-5918] -->
<h2><a>Messaging</a></h2> <h2><a>Messaging</a></h2>
<div> <div>
</div> </div>
<!-- EDIT10 SECTION "Messaging" [5696-5718] --> <!-- EDIT10 SECTION "Messaging" [5919-5941] -->
<h3><a>Creating Message Types</a></h3> <h3><a>Creating Message Types</a></h3>
<div> <div>
@ -203,7 +205,7 @@ You must register each message type to the com.jme3.network.serializing.Serializ
<pre>Serializer.registerClass&#40;HelloMessage.class&#41;;</pre> <pre>Serializer.registerClass&#40;HelloMessage.class&#41;;</pre>
</div> </div>
<!-- EDIT11 SECTION "Creating Message Types" [5719-6671] --> <!-- EDIT11 SECTION "Creating Message Types" [5942-6894] -->
<h3><a>Responding to Messages</a></h3> <h3><a>Responding to Messages</a></h3>
<div> <div>
@ -260,7 +262,7 @@ For each message type, register a server listener to the server:
<pre>myServer.addMessageListener&#40;new ServerListener&#40;&#41;, HelloMessage.class&#41;;</pre> <pre>myServer.addMessageListener&#40;new ServerListener&#40;&#41;, HelloMessage.class&#41;;</pre>
</div> </div>
<!-- EDIT12 SECTION "Responding to Messages" [6672-8416] --> <!-- EDIT12 SECTION "Responding to Messages" [6895-8639] -->
<h3><a>Creating and Sending Messages</a></h3> <h3><a>Creating and Sending Messages</a></h3>
<div> <div>
@ -297,7 +299,7 @@ The last two broadcasting methods use com.jme3.network.Filters to select a subse
</p> </p>
</div> </div>
<!-- EDIT13 SECTION "Creating and Sending Messages" [8417-9506] --> <!-- EDIT13 SECTION "Creating and Sending Messages" [8640-9729] -->
<h2><a>Identification and Rejection</a></h2> <h2><a>Identification and Rejection</a></h2>
<div> <div>
@ -308,21 +310,22 @@ The ID of the Client and HostedConnection are the same at both ends of a connect
<pre>... myClient.getId&#40;&#41; ...</pre> <pre>... myClient.getId&#40;&#41; ...</pre>
<p> <p>
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. 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, SpiderMoney will reject it for you, you have no choice in the mater. This is so the client and server can avoid miscommunication.
</p> </p>
<p> <p>
<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). <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> </div></p>
</p> </p>
</div> </div>
<!-- EDIT14 SECTION "Identification and Rejection" [9507-10424] --> <!-- EDIT14 SECTION "Identification and Rejection" [9730-10680] -->
<h2><a>Closing Clients and Server Cleanly</a></h2> <h2><a>Closing Clients and Server Cleanly</a></h2>
<div> <div>
</div> </div>
<!-- EDIT15 SECTION "Closing Clients and Server Cleanly" [10425-10471] --> <!-- EDIT15 SECTION "Closing Clients and Server Cleanly" [10681-10727] -->
<h3><a>Closing a Client</a></h3> <h3><a>Closing a Client</a></h3>
<div> <div>
@ -338,7 +341,7 @@ You must override the client&#039;s destroy() method to close the connection cle
&#125;</pre> &#125;</pre>
</div> </div>
<!-- EDIT16 SECTION "Closing a Client" [10472-10747] --> <!-- EDIT16 SECTION "Closing a Client" [10728-11003] -->
<h3><a>Closing a Server</a></h3> <h3><a>Closing a Server</a></h3>
<div> <div>
@ -354,7 +357,7 @@ You must override the server&#039;s destroy() method to close the connection whe
&#125;</pre> &#125;</pre>
</div> </div>
<!-- EDIT17 SECTION "Closing a Server" [10748-11004] --> <!-- EDIT17 SECTION "Closing a Server" [11004-11260] -->
<h3><a>Kicking a Client</a></h3> <h3><a>Kicking a Client</a></h3>
<div> <div>
@ -365,7 +368,7 @@ The server can kick a HostedConnection to make it disconnect. You should provide
<pre>conn.close&#40;&quot;We kick cheaters.&quot;&#41;;</pre> <pre>conn.close&#40;&quot;We kick cheaters.&quot;&#41;;</pre>
</div> </div>
<!-- EDIT18 SECTION "Kicking a Client" [11005-11395] --> <!-- EDIT18 SECTION "Kicking a Client" [11261-11651] -->
<h2><a>Listening to Connection Notification</a></h2> <h2><a>Listening to Connection Notification</a></h2>
<div> <div>
@ -375,13 +378,18 @@ The server and clients are notified about connection changes.
</p> </p>
</div> </div>
<!-- EDIT19 SECTION "Listening to Connection Notification" [11396-11507] --> <!-- EDIT19 SECTION "Listening to Connection Notification" [11652-11763] -->
<h3><a>ClientStateListener</a></h3> <h3><a>ClientStateListener</a></h3>
<div> <div>
<p> <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. 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>
<p>
<p><div>The ClientStateListener when it receives a network exception applies the default close action. This just stops the client and you&#039;ll have to build around it so your application knows what to do. If you need more control when a network exception happens and the client closes, you may want to investigate in a ErrorListener.
</div></p>
</p> </p>
<div><table> <div><table>
@ -395,7 +403,7 @@ The com.jme3.network.ClientStateListener notifies the Client when the Client has
<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> <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> </tr>
</table></div> </table></div>
<!-- EDIT21 TABLE [11750-12119] --> <!-- EDIT21 TABLE [12348-12717] -->
<p> <p>
First implement the ClientStateListener interface in the Client class. Then register it to myClient in MyGameClient&#039;s simpleInitApp() method: First implement the ClientStateListener interface in the Client class. Then register it to myClient in MyGameClient&#039;s simpleInitApp() method:
@ -403,7 +411,7 @@ First implement the ClientStateListener interface in the Client class. Then regi
<pre>myClient.addClientStateListener&#40;this&#41;;</pre> <pre>myClient.addClientStateListener&#40;this&#41;;</pre>
</div> </div>
<!-- EDIT20 SECTION "ClientStateListener" [11508-12321] --> <!-- EDIT20 SECTION "ClientStateListener" [11764-12918] -->
<h3><a>ConnectionListener</a></h3> <h3><a>ConnectionListener</a></h3>
<div> <div>
@ -423,7 +431,7 @@ The com.jme3.network.ConnectionListener notifies the Server whenever new HostedC
<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> <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> </tr>
</table></div> </table></div>
<!-- EDIT23 TABLE [12587-12985] --> <!-- EDIT23 TABLE [13184-13582] -->
<p> <p>
First implement the ConnectionListener interface in the Server class. Then register it to myServer in MyGameServer&#039;s simpleInitApp() method. First implement the ConnectionListener interface in the Server class. Then register it to myServer in MyGameServer&#039;s simpleInitApp() method.
@ -432,7 +440,55 @@ First implement the ConnectionListener interface in the Server class. Then regis
<pre>myServer.addConnectionListener&#40;this&#41;;</pre> <pre>myServer.addConnectionListener&#40;this&#41;;</pre>
</div> </div>
<!-- EDIT22 SECTION "ConnectionListener" [12322-13185] --> <!-- EDIT22 SECTION "ConnectionListener" [12919-13782] -->
<h3><a>ErrorListener</a></h3>
<div>
<p>
The com.jme3.network.ErrorListener is a listener for when network exception happens. This listener is built so that you can override the default actions when a network exception happens.
</p>
<p>
<p><div>If you intend on using the default network mechanics, <strong>don&#039;t</strong> use this!
If you do override this, make sure you add a mechanic that can close the client otherwise your client will get stuck open and cause errors.
</div></p>
</p>
<div><table>
<tr>
<th> ErrorListener interface method </th><th> Purpose </th>
</tr>
<tr>
<td> public void handleError(Client c, Throwable t){} </td><td> Implemenent here what happens after a exception affects the network . </td>
</tr>
</table></div>
<!-- EDIT25 TABLE [14233-14402] -->
<p>
<p><div>This interface was built for the client and server, but the code has never been put on the server to handle this listener.
</div></p>
</p>
<p>
First implement the ErrorListener interface in the client class. Then you need to register it to myClient in MyGameClients&#039;s simpleInitApp() method.
</p>
<pre>myClient.addErrorListener&#40;this&#41;;</pre>
<p>
In the class that implements the ErrorListener, a method would of been added call handleError(Client s, Throwable t). Inside this method to get you started, you going to want to listen for an error. To do this you&#039;re going to want a bit of code like this.
</p>
<pre>if&#40;t instanceof exception&#41; &#123;
//Add your own code here
&#125;</pre>
<p>
Replace <strong>exception</strong> part in the <strong>if</strong> statement for the type of exception that you would like it to handle.
</p>
</div>
<!-- EDIT24 SECTION "ErrorListener" [13783-15194] -->
<h2><a>UDP versus TCP</a></h2> <h2><a>UDP versus TCP</a></h2>
<div> <div>
@ -450,7 +506,7 @@ message2.setReliable&#40;false&#41;; // UDP</pre>
</ul> </ul>
</div> </div>
<!-- EDIT24 SECTION "UDP versus TCP" [13186-13856] --> <!-- EDIT26 SECTION "UDP versus TCP" [15195-15865] -->
<h2><a>Important: Use Multi-Threading</a></h2> <h2><a>Important: Use Multi-Threading</a></h2>
<div> <div>
@ -474,7 +530,7 @@ For general advice, see the articles <object classid="java:org.netbeans.modules.
</p> </p>
</div> </div>
<!-- EDIT25 SECTION "Important: Use Multi-Threading" [13857-15003] --> <!-- EDIT27 SECTION "Important: Use Multi-Threading" [15866-17012] -->
<h2><a>Troubleshooting</a></h2> <h2><a>Troubleshooting</a></h2>
<div> <div>
@ -489,5 +545,5 @@ If you have set up a server in your home network, and the game clients cannot re
</span></div> </span></div>
</div> </div>
<!-- EDIT26 SECTION "Troubleshooting" [15004-] --> <!-- EDIT28 SECTION "Troubleshooting" [17013-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:networking?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:networking?do=export_xhtmlbody">view online version</a></em></p>

@ -154,10 +154,16 @@ Learn more from the NiftyGUI page:
</li> </li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.org/groups/gui/forum/topic/anyone-succeeded-in-changing-text-in-nifty-programatically/#post-109510"><param name="text" value="<html><u>Forum post: Changing Text in Nifty GUIs programmatically</u></html>"><param name="textColor" value="blue"></object></div> <li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.org/groups/gui/forum/topic/anyone-succeeded-in-changing-text-in-nifty-programatically/#post-109510"><param name="text" value="<html><u>Forum post: Changing Text in Nifty GUIs programmatically</u></html>"><param name="textColor" value="blue"></object></div>
</li> </li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:nifty_gui:editor"><param name="text" value="<html><u>Official Nifty GUI Editor</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://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:nifty_gui:new_editor"><param name="text" value="<html><u>New Nifty GUI Editor</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://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:nifty_gui:groovy"><param name="text" value="<html><u>Nifty GUI with Groovy</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul> </ul>
</div> </div>
<!-- EDIT6 SECTION "External Documentation" [3741-4357] --> <!-- EDIT6 SECTION "External Documentation" [3741-4677] -->
<h2><a>Next Steps</a></h2> <h2><a>Next Steps</a></h2>
<div> <div>
@ -170,10 +176,12 @@ Now that you understand the concepts and know where to find more information, le
</li> </li>
<li><div> <a href="/com/jme3/gde/docs/jme3/advanced/nifty_gui_java_layout.html">Lay out the GUI in Java</a> (optional)</div> <li><div> <a href="/com/jme3/gde/docs/jme3/advanced/nifty_gui_java_layout.html">Lay out the GUI in Java</a> (optional)</div>
</li> </li>
<li><div> <a href="/com/jme3/gde/docs/jme3/advanced/nifty_gui_editor.html">Lay out the GUI in Editor</a> (experimental)</div>
</li>
</ul> </ul>
</div> </div>
<!-- EDIT7 SECTION "Next Steps" [4358-4717] --> <!-- EDIT7 SECTION "Next Steps" [4678-5117] -->
<h2><a>Nifty Logging (Nifty 1.3.1)</a></h2> <h2><a>Nifty Logging (Nifty 1.3.1)</a></h2>
<div> <div>
@ -191,5 +199,5 @@ Logger.getLogger(&quot;NiftyInputEventHandlingLog&quot;).setLevel(Level.SEVERE);
</span></div> </span></div>
</div> </div>
<!-- EDIT8 SECTION "Nifty Logging (Nifty 1.3.1)" [4718-] --> <!-- EDIT8 SECTION "Nifty Logging (Nifty 1.3.1)" [5118-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:nifty_gui?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:nifty_gui?do=export_xhtmlbody">view online version</a></em></p>

@ -26,7 +26,7 @@ In the previous parts of the tutorial, you created a two-screen user interface.
<p> <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. 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 abstract methods.
</p> </p>
<p> <p>
@ -100,7 +100,7 @@ Now the Java class <code>MyStartScreen</code> and this <acronym title="Graphical
</p> </p>
</div> </div>
<!-- EDIT2 SECTION "Connect GUI to Java Controller" [792-3174] --> <!-- EDIT2 SECTION "Connect GUI to Java Controller" [792-3175] -->
<h2><a>Make GUI and Java Interact</a></h2> <h2><a>Make GUI and Java Interact</a></h2>
<div> <div>
@ -114,7 +114,7 @@ Use any combination of the three following approaches to make Java classes inter
</p> </p>
</div> </div>
<!-- EDIT3 SECTION "Make GUI and Java Interact" [3175-3547] --> <!-- EDIT3 SECTION "Make GUI and Java Interact" [3176-3548] -->
<h3><a>GUI Calls a Void Java Method</a></h3> <h3><a>GUI Calls a Void Java Method</a></h3>
<div> <div>
@ -214,7 +214,7 @@ The quitGame() example shows that you have access to the application <code>app</
</p> </p>
</div> </div>
<!-- EDIT4 SECTION "GUI Calls a Void Java Method" [3548-6724] --> <!-- EDIT4 SECTION "GUI Calls a Void Java Method" [3549-6725] -->
<h3><a>GUI Gets Return Value from Java Method</a></h3> <h3><a>GUI Gets Return Value from Java Method</a></h3>
<div> <div>
@ -253,7 +253,7 @@ You can use this for Strings and numeric values (e.g. when you read settings fro
</p> </p>
</div> </div>
<!-- EDIT5 SECTION "GUI Gets Return Value from Java Method" [6725-7912] --> <!-- EDIT5 SECTION "GUI Gets Return Value from Java Method" [6726-7913] -->
<h3><a>Java Modifies Nifty Elements and Events</a></h3> <h3><a>Java Modifies Nifty Elements and Events</a></h3>
<div> <div>
@ -293,7 +293,7 @@ For this to work, there already needs to be a (possibly inactive) <code>&lt;inte
<pre><span>&lt;interact onClick=&quot;doNothing()&quot;/&gt;</span></pre> <pre><span>&lt;interact onClick=&quot;doNothing()&quot;/&gt;</span></pre>
</div> </div>
<!-- EDIT6 SECTION "Java Modifies Nifty Elements and Events" [7913-9329] --> <!-- EDIT6 SECTION "Java Modifies Nifty Elements and Events" [7914-9330] -->
<h2><a>Next Steps</a></h2> <h2><a>Next Steps</a></h2>
<div> <div>
@ -317,5 +317,5 @@ You&#039;re done with the basic Nifty <acronym title="Graphical User Interface">
</span></div> </span></div>
</div> </div>
<!-- EDIT7 SECTION "Next Steps" [9330-] --> <!-- EDIT7 SECTION "Next Steps" [9331-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:nifty_gui_java_interaction?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:nifty_gui_java_interaction?do=export_xhtmlbody">view online version</a></em></p>

@ -104,8 +104,22 @@ public StartScreenState&#40;SimpleApplication app&#41;&#123;
&nbsp; &nbsp;
&#125;</pre> &#125;</pre>
<p>
<p><div>It is not sufficient to just inherit from AbstractAppState. You need to instantiate your controller class, register it with app&#039;s stateManager and then pass it to nifty. See code sample below.
</div></p>
</p>
<pre>public class TestNiftyGui extends SimpleApplication &#123;
public void simpleInitApp&#40;&#41; &#123;
StartScreenState startScreenState = new StartScreenState&#40;this&#41;;
stateManager.attach&#40;startScreenState&#41;;
// [...] boilerplate init nifty omitted
nifty.fromXml&#40;&quot;Interface/myGui.xml&quot;, &quot;start&quot;, startScreenState&#41;; //one of the XML screen elements needs to reference StartScreenState controller class
&#125;
&#125;</pre>
</div> </div>
<!-- EDIT3 SECTION "Get Access to Application and Update Loop" [2044-3599] --> <!-- EDIT3 SECTION "Get Access to Application and Update Loop" [2044-4243] -->
<h2><a>Know Your Variables</a></h2> <h2><a>Know Your Variables</a></h2>
<div> <div>
<div><table> <div><table>
@ -125,14 +139,14 @@ public StartScreenState&#40;SimpleApplication app&#41;&#123;
<td>${PROP.key}</td><td> looks up <code>key</code> in the Nifty properties. Use Nifty.setGlobalproperties(properties) and Nifty.getGlobalproperties(&quot;key&quot;). Or SystemGetProperties(key);</td> <td>${PROP.key}</td><td> looks up <code>key</code> in the Nifty properties. Use Nifty.setGlobalproperties(properties) and Nifty.getGlobalproperties(&quot;key&quot;). Or SystemGetProperties(key);</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT5 TABLE [3632-4163] --> <!-- EDIT5 TABLE [4276-4807] -->
<p> <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=MarkUp"><param name="text" value="<html><u>http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=MarkUp</u></html>"><param name="textColor" value="blue"></object> See also: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=MarkUp"><param name="text" value="<html><u>http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=MarkUp</u></html>"><param name="textColor" value="blue"></object>
</p> </p>
</div> </div>
<!-- EDIT4 SECTION "Know Your Variables" [3600-4246] --> <!-- EDIT4 SECTION "Know Your Variables" [4244-4890] -->
<h2><a>Use ScreenControllers for Mutally Exclusive Functionality</a></h2> <h2><a>Use ScreenControllers for Mutally Exclusive Functionality</a></h2>
<div> <div>
@ -152,7 +166,7 @@ For example, create a <code>MyHudScreen.java</code> for the <code>hud</code> scr
</ul> </ul>
</div> </div>
<!-- EDIT6 SECTION "Use ScreenControllers for Mutally Exclusive Functionality" [4247-5629] --> <!-- EDIT6 SECTION "Use ScreenControllers for Mutally Exclusive Functionality" [4891-6273] -->
<h2><a>Create a &quot;Loading...&quot; Screen</a></h2> <h2><a>Create a &quot;Loading...&quot; Screen</a></h2>
<div> <div>
@ -162,7 +176,7 @@ Get the full <a href="/com/jme3/gde/docs/jme3/advanced/loading_screen.html">Load
</p> </p>
</div> </div>
<!-- EDIT7 SECTION "Create a Loading... Screen" [5630-5734] --> <!-- EDIT7 SECTION "Create a Loading... Screen" [6274-6378] -->
<h2><a>Create a Popup Menu</a></h2> <h2><a>Create a Popup Menu</a></h2>
<div> <div>
@ -172,7 +186,7 @@ Get the full <a href="/com/jme3/gde/docs/jme3/advanced/nifty_gui_popup_menu.html
</p> </p>
</div> </div>
<!-- EDIT8 SECTION "Create a Popup Menu" [5735-5837] --> <!-- EDIT8 SECTION "Create a Popup Menu" [6379-6481] -->
<h2><a>Add Visual Effects</a></h2> <h2><a>Add Visual Effects</a></h2>
<div> <div>
@ -206,7 +220,7 @@ Learn more from the NiftyGUI page:
</ul> </ul>
</div> </div>
<!-- EDIT9 SECTION "Add Visual Effects" [5838-6550] --> <!-- EDIT9 SECTION "Add Visual Effects" [6482-7194] -->
<h2><a>Add Sound Effects</a></h2> <h2><a>Add Sound Effects</a></h2>
<div> <div>
@ -223,7 +237,7 @@ Playing sounds using Nifty is also possible with a <code>playSound</code> effect
<span><span>&lt;/label&gt;</span></span></pre> <span><span>&lt;/label&gt;</span></span></pre>
</div> </div>
<!-- EDIT10 SECTION "Add Sound Effects" [6551-6913] --> <!-- EDIT10 SECTION "Add Sound Effects" [7195-7557] -->
<h2><a>Pass ClickLoc From Nifty to Java</a></h2> <h2><a>Pass ClickLoc From Nifty to Java</a></h2>
<div> <div>
@ -253,7 +267,7 @@ You can name the method (here <code>clicked</code>) what ever you like, as long
</p> </p>
</div> </div>
<!-- EDIT11 SECTION "Pass ClickLoc From Nifty to Java" [6914-7675] --> <!-- EDIT11 SECTION "Pass ClickLoc From Nifty to Java" [7558-8319] -->
<h2><a>Load Several XML Files</a></h2> <h2><a>Load Several XML Files</a></h2>
<div> <div>
@ -274,7 +288,7 @@ stateManager.attach&#40;optionsControl&#41;;
guiViewPort.addProcessor&#40;niftyDisplay&#41;;</pre> guiViewPort.addProcessor&#40;niftyDisplay&#41;;</pre>
</div> </div>
<!-- EDIT12 SECTION "Load Several XML Files" [7676-8724] --> <!-- EDIT12 SECTION "Load Several XML Files" [8320-9368] -->
<h2><a>Register additional explicit screen controllers</a></h2> <h2><a>Register additional explicit screen controllers</a></h2>
<div> <div>
@ -293,7 +307,7 @@ nifty.registerScreenController&#40;new OptionsScreenController&#40;randomConstru
nifty.addXml&#40;&quot;Interface/Screens/OptionsScreen.xml&quot;&#41;;</pre> nifty.addXml&#40;&quot;Interface/Screens/OptionsScreen.xml&quot;&#41;;</pre>
</div> </div>
<!-- EDIT13 SECTION "Register additional explicit screen controllers" [8725-9493] --> <!-- EDIT13 SECTION "Register additional explicit screen controllers" [9369-10137] -->
<h2><a>Design Your Own Styles</a></h2> <h2><a>Design Your Own Styles</a></h2>
<div> <div>
@ -345,5 +359,5 @@ Learn more from the NiftyGUI page:
</span></div> </span></div>
</div> </div>
<!-- EDIT14 SECTION "Design Your Own Styles" [9494-] --> <!-- EDIT14 SECTION "Design Your Own Styles" [10138-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:nifty_gui_scenarios?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:nifty_gui_scenarios?do=export_xhtmlbody">view online version</a></em></p>

@ -100,7 +100,7 @@ The following minimal <acronym title="Extensible Markup Language">XML</acronym>
<pre><span>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span> <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-1.3.xsd&quot;</span> <span>&lt;nifty xmlns=&quot;http://nifty-gui.sourceforge.net/nifty-1.3.xsd&quot;</span>
<span> xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span> <span> xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span>
<span> xsi:schemaLocation=&quot;http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd&quot;&gt;</span> <span> xsi:schemaLocation=&quot;http://nifty-gui.sourceforge.net/nifty-1.3.xsd&quot;&gt;</span>
<span>&lt;screen id=&quot;start&quot;&gt;</span> <span>&lt;screen id=&quot;start&quot;&gt;</span>
&lt;!-- ... --&gt; &lt;!-- ... --&gt;
<span><span>&lt;/screen&gt;</span></span> <span><span>&lt;/screen&gt;</span></span>
@ -118,7 +118,7 @@ Every Nifty <acronym title="Graphical User Interface">GUI</acronym> must have a
</p> </p>
</div> </div>
<!-- EDIT4 SECTION "Make Screens" [2140-2872] --> <!-- EDIT4 SECTION "Make Screens" [2140-2825] -->
<h3><a>Make Layers</a></h3> <h3><a>Make Layers</a></h3>
<div> <div>
@ -150,7 +150,7 @@ In a layer, you can now add panels and arrange them. Panels are containers that
</p> </p>
</div> </div>
<!-- EDIT5 SECTION "Make Layers" [2873-3646] --> <!-- EDIT5 SECTION "Make Layers" [2826-3599] -->
<h3><a>Make Panels</a></h3> <h3><a>Make Panels</a></h3>
<div> <div>
@ -203,7 +203,7 @@ The result should look as follows:
</p> </p>
</div> </div>
<!-- EDIT6 SECTION "Make Panels" [3647-5529] --> <!-- EDIT6 SECTION "Make Panels" [3600-5482] -->
<h2><a>Adding Content to Panels</a></h2> <h2><a>Adding Content to Panels</a></h2>
<div> <div>
@ -213,7 +213,7 @@ See also <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><
</p> </p>
</div> </div>
<!-- EDIT7 SECTION "Adding Content to Panels" [5530-5708] --> <!-- EDIT7 SECTION "Adding Content to Panels" [5483-5661] -->
<h3><a>Add Images</a></h3> <h3><a>Add Images</a></h3>
<div> <div>
@ -258,7 +258,7 @@ This image is scaled to use 50% of the height and 30% of the width of its contai
</p> </p>
</div> </div>
<!-- EDIT8 SECTION "Add Images" [5709-7395] --> <!-- EDIT8 SECTION "Add Images" [5662-7348] -->
<h3><a>Add Static Text</a></h3> <h3><a>Add Static Text</a></h3>
<div> <div>
@ -285,7 +285,7 @@ The font used is jME3&#039;s default font &quot;Interface/Fonts/Default.fnt&quot
</p> </p>
</div> </div>
<!-- EDIT9 SECTION "Add Static Text" [7396-8476] --> <!-- EDIT9 SECTION "Add Static Text" [7349-8429] -->
<h3><a>Add Controls</a></h3> <h3><a>Add Controls</a></h3>
<div> <div>
@ -351,7 +351,7 @@ Nifty additionally offers many customizable controls such as check boxes, text f
</p> </p>
</div> </div>
<!-- EDIT10 SECTION "Add Controls" [8477-10564] --> <!-- EDIT10 SECTION "Add Controls" [8430-10517] -->
<h2><a>Intermediate Result</a></h2> <h2><a>Intermediate Result</a></h2>
<div> <div>
@ -369,7 +369,7 @@ Compare this result with the layout draft above.
</p> </p>
</div> </div>
<!-- EDIT11 SECTION "Intermediate Result" [10565-10925] --> <!-- EDIT11 SECTION "Intermediate Result" [10518-10878] -->
<h2><a>Next Steps</a></h2> <h2><a>Next Steps</a></h2>
<div> <div>
@ -391,5 +391,5 @@ Integrate the <acronym title="Graphical User Interface">GUI</acronym> into the g
</span></div> </span></div>
</div> </div>
<!-- EDIT12 SECTION "Next Steps" [10926-] --> <!-- EDIT12 SECTION "Next Steps" [10879-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:nifty_gui_xml_layout?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:nifty_gui_xml_layout?do=export_xhtmlbody">view online version</a></em></p>

@ -360,12 +360,12 @@ Click the links for details on the special PhysicsControls. This article is abou
</div> </div>
<!-- EDIT10 SECTION "Create PhysicsControl" [13625-15611] --> <!-- EDIT10 SECTION "Create PhysicsControl" [13625-15611] -->
<h3><a>PhysicsControls Code Samples</a></h3> <h3><a>Physics Control Code Samples</a></h3>
<div> <div>
<p> <p>
The PhysicsControl constructors expect a Collision Shape and a mass (a float in kilogram). The most commonly used PhysicsControl is the RigidBodyControl: The most commonly used physics control is RigidBodyControl. The RigidBodyControl constructor takes up to two parameters: a collision shape and a mass (a float in kilograms). The mass parameter also determines whether the object is dynamic (movable) or static (fixed). For a static object such as a floor or wall, specify zero mass.
</p> </p>
<pre>RigidBodyControl myThing_phys = <pre>RigidBodyControl myThing_phys =
new RigidBodyControl&#40; myThing_shape , 123.0f &#41;; // dynamic</pre> new RigidBodyControl&#40; myThing_shape , 123.0f &#41;; // dynamic</pre>
@ -373,7 +373,7 @@ The PhysicsControl constructors expect a Collision Shape and a mass (a float in
new RigidBodyControl&#40; myDungeon_shape , 0.0f &#41;; // static </pre> new RigidBodyControl&#40; myDungeon_shape , 0.0f &#41;; // static </pre>
<p> <p>
<p><div>When you create the PhysicsControl, the mass value makes an important distinction: Set the mass to a non-zero value to create a dynamic object that can fall or roll, etc. Set the mass value to zero to create a static object, such as floor, wall, etc. If you give your floor a mass, it will fall out of the scene! <p><div>If you give your floor a non-zero mass, it will fall out of the scene!
</div></p> </div></p>
</p> </p>
@ -395,10 +395,11 @@ gameLevel.addControl&#40;new RigidBodyControl&#40;0.0f&#41;&#41;; // explicit ze
<p> <p>
<p><div>Spheres and Boxes automatically fall back on the correct default CollisionShape if you do not specify a CollisionShape in the RigidBodyControl constructor. Complex static objects can fall back on MeshCollisionShapes, unless it is a Node, in which case it will become a CompoundCollisionShape containing a MeshCollisionShape <p><div>Spheres and Boxes automatically fall back on the correct default CollisionShape if you do not specify a CollisionShape in the RigidBodyControl constructor. Complex static objects can fall back on MeshCollisionShapes, unless it is a Node, in which case it will become a CompoundCollisionShape containing a MeshCollisionShape
</div></p> </div></p>
</p> </p>
</div> </div>
<!-- EDIT13 SECTION "PhysicsControls Code Samples" [15612-17191] --> <!-- EDIT13 SECTION "Physics Control Code Samples" [15612-17129] -->
<h2><a>Add PhysicsControl to Spatial</a></h2> <h2><a>Add PhysicsControl to Spatial</a></h2>
<div> <div>
@ -415,7 +416,7 @@ For each physical Spatial in the scene:
</ol> </ol>
</div> </div>
<!-- EDIT14 SECTION "Add PhysicsControl to Spatial" [17192-17439] --> <!-- EDIT14 SECTION "Add PhysicsControl to Spatial" [17130-17377] -->
<h2><a>Add PhysicsControl to PhysicsSpace</a></h2> <h2><a>Add PhysicsControl to PhysicsSpace</a></h2>
<div> <div>
@ -442,7 +443,7 @@ myThing_geo.removeFromParent&#40;&#41;;</pre>
</p> </p>
</div> </div>
<!-- EDIT15 SECTION "Add PhysicsControl to PhysicsSpace" [17440-18255] --> <!-- EDIT15 SECTION "Add PhysicsControl to PhysicsSpace" [17378-18193] -->
<h2><a>Changing the Scale of a PhysicsControl</a></h2> <h2><a>Changing the Scale of a PhysicsControl</a></h2>
<div> <div>
@ -481,7 +482,7 @@ With the corresponding output below:
</p> </p>
</div> </div>
<!-- EDIT16 SECTION "Changing the Scale of a PhysicsControl" [18256-20006] --> <!-- EDIT16 SECTION "Changing the Scale of a PhysicsControl" [18194-19944] -->
<h3><a>PhysicsSpace Code Samples</a></h3> <h3><a>PhysicsSpace Code Samples</a></h3>
<div> <div>
@ -511,9 +512,9 @@ setWorldMin(new Vector3f(-10000f, -10000f, -10000f));</td><td>Specifies the size
<td>setCcdMotionThreshold()</td><td>The amount of motion in 1 physics tick to trigger the continuous motion detection in moving objects that push one another. Rarely used, but necessary if your moving objects get stuck or roll through one another.</td> <td>setCcdMotionThreshold()</td><td>The amount of motion in 1 physics tick to trigger the continuous motion detection in moving objects that push one another. Rarely used, but necessary if your moving objects get stuck or roll through one another.</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT18 TABLE [20233-21440] --> <!-- EDIT18 TABLE [20171-21378] -->
</div> </div>
<!-- EDIT17 SECTION "PhysicsSpace Code Samples" [20007-21441] --> <!-- EDIT17 SECTION "PhysicsSpace Code Samples" [19945-21379] -->
<h2><a>Specify Physical Properties</a></h2> <h2><a>Specify Physical Properties</a></h2>
<div> <div>
@ -553,7 +554,7 @@ This setting has an impact on performance, so use it sparingly. </td><td> Brick:
Rubber ball: 1.0f </td> Rubber ball: 1.0f </td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT20 TABLE [21666-23176] --> <!-- EDIT20 TABLE [21604-23114] -->
<p> <p>
On a RigidBodyControl, you can apply the following physical forces: On a RigidBodyControl, you can apply the following physical forces:
@ -574,9 +575,9 @@ On a RigidBodyControl, you can apply the following physical forces:
(See detailed explanation below.) </td> (See detailed explanation below.) </td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT21 TABLE [23247-23857] --> <!-- EDIT21 TABLE [23185-23795] -->
</div> </div>
<!-- EDIT19 SECTION "Specify Physical Properties" [21442-23857] --> <!-- EDIT19 SECTION "Specify Physical Properties" [21380-23795] -->
<h3><a>Kinematic vs Dynamic vs Static</a></h3> <h3><a>Kinematic vs Dynamic vs Static</a></h3>
<div> <div>
@ -626,7 +627,7 @@ setKinematic(true);</td><td>setMass(1f); <br/>
setKinematic(false);</td> setKinematic(false);</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT23 TABLE [24094-25153] --> <!-- EDIT23 TABLE [24032-25091] -->
</div> </div>
<h4><a>When Do I Use Kinematic Objects?</a></h4> <h4><a>When Do I Use Kinematic Objects?</a></h4>
@ -649,7 +650,7 @@ setKinematic(false);</td>
</p> </p>
</div> </div>
<!-- EDIT22 SECTION "Kinematic vs Dynamic vs Static" [23858-26259] --> <!-- EDIT22 SECTION "Kinematic vs Dynamic vs Static" [23796-26197] -->
<h2><a>Forces: Moving Dynamic Objects</a></h2> <h2><a>Forces: Moving Dynamic Objects</a></h2>
<div> <div>
@ -687,7 +688,7 @@ Use the following methods to move dynamic physical objects.
<td> clearForces()</td><td>Cancels out all forces (force, torque) etc and stops the motion.</td> <td> clearForces()</td><td>Cancels out all forces (force, torque) etc and stops the motion.</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT25 TABLE [26365-27354] --> <!-- EDIT25 TABLE [26303-27292] -->
<p> <p>
<p><div>It is technically possible to position PhysicsControls using setLocalTranslation(), e.g. to place them in their start position in the scene. However you must be very careful not to cause an &quot;impossible state&quot; where one physical object overlaps with another! Within the game, you typically use the setters shown here exclusively. <p><div>It is technically possible to position PhysicsControls using setLocalTranslation(), e.g. to place them in their start position in the scene. However you must be very careful not to cause an &quot;impossible state&quot; where one physical object overlaps with another! Within the game, you typically use the setters shown here exclusively.
@ -727,7 +728,7 @@ removeCollideWithGroup(COLLISION_GROUP_01)</td><td>Collision Groups are integer
<td> setCcdSweptSphereRadius(.5f)</td><td>Bullet does not use the full collision shape for continuous collision detection, instead it uses a &quot;swept sphere&quot; shape to approximate a motion, which can be imprecise and cause strange behaviors such as objects passing through one another or getting stuck. Only relevant for fast moving dynamic bodies. </td> <td> setCcdSweptSphereRadius(.5f)</td><td>Bullet does not use the full collision shape for continuous collision detection, instead it uses a &quot;swept sphere&quot; shape to approximate a motion, which can be imprecise and cause strange behaviors such as objects passing through one another or getting stuck. Only relevant for fast moving dynamic bodies. </td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT26 TABLE [27772-29727] --> <!-- EDIT26 TABLE [27710-29665] -->
<p> <p>
<p><div> You can <code>setApplyPhysicsLocal(true)</code> for an object to make it move relatively to its local physics space. You would do that if you need a physics space that moves with a node (e.g. a spaceship with artificial gravity surrounded by zero-g space). By default, it&#039;s set to false, and all movement is relative to the world. <p><div> You can <code>setApplyPhysicsLocal(true)</code> for an object to make it move relatively to its local physics space. You would do that if you need a physics space that moves with a node (e.g. a spaceship with artificial gravity surrounded by zero-g space). By default, it&#039;s set to false, and all movement is relative to the world.
@ -735,7 +736,7 @@ removeCollideWithGroup(COLLISION_GROUP_01)</td><td>Collision Groups are integer
</p> </p>
</div> </div>
<!-- EDIT24 SECTION "Forces: Moving Dynamic Objects" [26260-30069] --> <!-- EDIT24 SECTION "Forces: Moving Dynamic Objects" [26198-30007] -->
<h2><a>Best Practices</a></h2> <h2><a>Best Practices</a></h2>
<div> <div>
<ul> <ul>
@ -771,7 +772,7 @@ removeCollideWithGroup(COLLISION_GROUP_01)</td><td>Collision Groups are integer
</span></div> </span></div>
</div> </div>
<!-- EDIT27 SECTION "Best Practices" [30070-] --><div> <!-- EDIT27 SECTION "Best Practices" [30008-] --><div>
<div><sup><a href="#fnt__1">1)</a></sup> <div><sup><a href="#fnt__1">1)</a></sup>
Inertia is calculated for kinematic objects, and you need mass to do that.</div> Inertia is calculated for kinematic objects, and you need mass to do that.</div>
</div> </div>

@ -188,11 +188,11 @@ manager.loadTexture(&quot;Textures/wavenormals.png&quot;) )</td><td>This normal
</tr> </tr>
<tr> <tr>
<td>water.setWaterColor(ColorRGBA.Brown.mult(2.0f));</td><td>Sets the main water color.</td><td>greenish blue <br/> <td>water.setWaterColor(ColorRGBA.Brown.mult(2.0f));</td><td>Sets the main water color.</td><td>greenish blue <br/>
Vector3f(0.0f,0.5f,0.5f,1.0f)</td> ColorRGBA(0.0f,0.5f,0.5f,1.0f)</td>
</tr> </tr>
<tr> <tr>
<td>water.setDeepWaterColor(ColorRGBA.Brown);</td><td>Sets the deep water color.</td><td>dark blue <br/> <td>water.setDeepWaterColor(ColorRGBA.Brown);</td><td>Sets the deep water color.</td><td>dark blue <br/>
Vector3f(0.0f, 0.0f,0.2f,1.0f)</td> ColorRGBA(0.0f, 0.0f,0.2f,1.0f)</td>
</tr> </tr>
<tr> <tr>
<td>water.setWaterTransparency(0.2f);</td><td>Sets how fast colors fade out. use this to control how clear (e.g. 0.05f) or muddy (0.2f) water is.</td><td> 0.1f </td> <td>water.setWaterTransparency(0.2f);</td><td>Sets how fast colors fade out. use this to control how clear (e.g. 0.05f) or muddy (0.2f) water is.</td><td> 0.1f </td>
@ -201,7 +201,7 @@ Vector3f(0.0f, 0.0f,0.2f,1.0f)</td>
<td>water.setColorExtinction(new Vector3f(10f,20f,30f));</td><td>Sets At what depth the refraction color extincts. The three values are RGB (red, green, blue) in this order. Play with these parameters to &quot;muddy&quot; the water.</td><td>Vector3f(5f,20f,30f)</td> <td>water.setColorExtinction(new Vector3f(10f,20f,30f));</td><td>Sets At what depth the refraction color extincts. The three values are RGB (red, green, blue) in this order. Play with these parameters to &quot;muddy&quot; the water.</td><td>Vector3f(5f,20f,30f)</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT9 TABLE [6562-7566] --><div><table> <!-- EDIT9 TABLE [6562-7568] --><div><table>
<tr> <tr>
<th> Water method example</th><th> Effects: Shore</th><th>Default</th> <th> Water method example</th><th> Effects: Shore</th><th>Default</th>
</tr> </tr>
@ -216,7 +216,7 @@ water.setRadius(260);</td><td>Limit the water filter to a semisphere with the gi
<td>water.setUseHQShoreline(false);</td><td>Renders shoreline with better quality ?</td><td>true</td> <td>water.setUseHQShoreline(false);</td><td>Renders shoreline with better quality ?</td><td>true</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT10 TABLE [7568-8066] --><div><table> <!-- EDIT10 TABLE [7570-8068] --><div><table>
<tr> <tr>
<th> Water method example</th><th> Effects: Foam</th><th>Default</th> <th> Water method example</th><th> Effects: Foam</th><th>Default</th>
</tr> </tr>
@ -234,7 +234,7 @@ water.setRadius(260);</td><td>Limit the water filter to a semisphere with the gi
manager.loadTexture(&quot;Textures/foam.png&quot;) )</td><td>This foam texture will be used with WrapMode.Repeat</td><td>&quot;Common/MatDefs/Water/Textures/foam.jpg&quot;</td> manager.loadTexture(&quot;Textures/foam.png&quot;) )</td><td>This foam texture will be used with WrapMode.Repeat</td><td>&quot;Common/MatDefs/Water/Textures/foam.jpg&quot;</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT11 TABLE [8068-8713] --><div><table> <!-- EDIT11 TABLE [8070-8715] --><div><table>
<tr> <tr>
<th> Water method example</th><th> Effects: Light</th><th>Default</th> <th> Water method example</th><th> Effects: Light</th><th>Default</th>
</tr> </tr>
@ -260,9 +260,9 @@ manager.loadTexture(&quot;Textures/foam.png&quot;) )</td><td>This foam texture w
<td>water.setReflectionMapSize(256)</td><td>Sets the size of the reflection map. The higher, the better the quality, but the slower the effect.</td><td>512</td> <td>water.setReflectionMapSize(256)</td><td>Sets the size of the reflection map. The higher, the better the quality, but the slower the effect.</td><td>512</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT12 TABLE [8715-9630] --> <!-- EDIT12 TABLE [8717-9632] -->
</div> </div>
<!-- EDIT7 SECTION "Optional: Water Wave and Color Effects" [5230-9632] --> <!-- EDIT7 SECTION "Optional: Water Wave and Color Effects" [5230-9634] -->
<h3><a>Sound Effects</a></h3> <h3><a>Sound Effects</a></h3>
<div> <div>
@ -291,5 +291,5 @@ See also:
</ul> </ul>
</div> </div>
<!-- EDIT13 SECTION "Sound Effects" [9633-] --> <!-- EDIT13 SECTION "Sound Effects" [9635-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:post-processor_water?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:post-processor_water?do=export_xhtmlbody">view online version</a></em></p>

@ -7,14 +7,14 @@
The goal of TerraMonkey is to provide a base implementation that will be usable for 80% of people&#039;s goals, while providing tools and a good foundation for the other 20% to build off of. Check out the videos in the following announcements: The goal of TerraMonkey is to provide a base implementation that will be usable for 80% of people&#039;s goals, while providing tools and a good foundation for the other 20% to build off of. Check out the videos in the following announcements:
</p> </p>
<ul> <ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.org/2011/06/17/infinite-terrains-with-terraingrid-new-features-in-terramonkey/"><param name="text" value="<html><u>New features</u></html>"><param name="textColor" value="blue"></object></div> <li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://hub.jmonkeyengine.org/2011/06/17/infinite-terrains-with-terraingrid-new-features-in-terramonkey/"><param name="text" value="<html><u>New features</u></html>"><param name="textColor" value="blue"></object></div>
</li> </li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.org/2011/07/03/terramonkey-more-textures-tools-and-undo/"><param name="text" value="<html><u>More textures and Tools</u></html>"><param name="textColor" value="blue"></object></div> <li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://hub.jmonkeyengine.org/2011/07/03/terramonkey-more-textures-tools-and-undo/"><param name="text" value="<html><u>More textures and Tools</u></html>"><param name="textColor" value="blue"></object></div>
</li> </li>
</ul> </ul>
</div> </div>
<!-- EDIT1 SECTION "TerraMonkey - The jMonkeyEngine Terrain System" [1-533] --> <!-- EDIT1 SECTION "TerraMonkey - The jMonkeyEngine Terrain System" [1-541] -->
<h2><a>Overview</a></h2> <h2><a>Overview</a></h2>
<div> <div>
@ -38,7 +38,7 @@ TerraMonkey is a GeoMipMapping quad tree of terrain tiles that supports real tim
</ul> </ul>
</div> </div>
<!-- EDIT2 SECTION "Overview" [534-1906] --> <!-- EDIT2 SECTION "Overview" [542-1914] -->
<h3><a>Current Features:</a></h3> <h3><a>Current Features:</a></h3>
<div> <div>
<ul> <ul>
@ -55,7 +55,7 @@ TerraMonkey is a GeoMipMapping quad tree of terrain tiles that supports real tim
</ul> </ul>
</div> </div>
<!-- EDIT3 SECTION "Current Features:" [1907-2293] --> <!-- EDIT3 SECTION "Current Features:" [1915-2301] -->
<h3><a>Planned Features:</a></h3> <h3><a>Planned Features:</a></h3>
<div> <div>
<ul> <ul>
@ -66,7 +66,7 @@ TerraMonkey is a GeoMipMapping quad tree of terrain tiles that supports real tim
</ul> </ul>
</div> </div>
<!-- EDIT4 SECTION "Planned Features:" [2294-2403] --> <!-- EDIT4 SECTION "Planned Features:" [2302-2411] -->
<h2><a>Sample Code</a></h2> <h2><a>Sample Code</a></h2>
<div> <div>
<ul> <ul>
@ -83,7 +83,7 @@ TerraMonkey is a GeoMipMapping quad tree of terrain tiles that supports real tim
</ul> </ul>
</div> </div>
<!-- EDIT5 SECTION "Sample Code" [2404-3175] --> <!-- EDIT5 SECTION "Sample Code" [2412-3183] -->
<h2><a>Geo Mip Mapping</a></h2> <h2><a>Geo Mip Mapping</a></h2>
<div> <div>
@ -105,7 +105,7 @@ GeoMipMapping in TerraMonkey has been split into several parts: the terrain quad
</p> </p>
</div> </div>
<!-- EDIT6 SECTION "Geo Mip Mapping" [3176-4787] --> <!-- EDIT6 SECTION "Geo Mip Mapping" [3184-4795] -->
<h2><a>Terrain Quad Tree</a></h2> <h2><a>Terrain Quad Tree</a></h2>
<div> <div>
@ -115,7 +115,7 @@ TerraMonkey is a quad tree. Each node is a TerrainQuad, and each leaf is a Terra
</p> </p>
</div> </div>
<!-- EDIT7 SECTION "Terrain Quad Tree" [4788-5217] --> <!-- EDIT7 SECTION "Terrain Quad Tree" [4796-5225] -->
<h2><a>Texture Splatting</a></h2> <h2><a>Texture Splatting</a></h2>
<div> <div>
@ -185,7 +185,7 @@ Here are the names of TerrainLighting.j3md&#039;s material properties:
</p> </p>
<p> <p>
Video cards support a maximum of 16 Splat textures total. This means you can only use a subset of material properties at the same time! OpenGL supports a maximum of 16 <em>samplers</em> in any given shader. This means you can only use a subset of material properties at the same time if you use the terrain&#039;s default lighting shader (TerrainLighting.j3md)!
</p> </p>
<p> <p>
@ -237,7 +237,7 @@ You can hand-paint Alpha, Diffuse, Glow, and Specular maps in a drawing program,
</p> </p>
</div> </div>
<!-- EDIT8 SECTION "Texture Splatting" [5218-9435] --> <!-- EDIT8 SECTION "Texture Splatting" [5226-9523] -->
<h2><a>Code Sample: Terrain.j3md</a></h2> <h2><a>Code Sample: Terrain.j3md</a></h2>
<div> <div>
@ -304,5 +304,5 @@ PS: As an alternative to an image-based height map, you can also generate a Hill
<pre>heightmap = new HillHeightMap&#40;1025, 1000, 50, 100, &#40;byte&#41; 3&#41;;</pre> <pre>heightmap = new HillHeightMap&#40;1025, 1000, 50, 100, &#40;byte&#41; 3&#41;;</pre>
</div> </div>
<!-- EDIT9 SECTION "Code Sample: Terrain.j3md" [9436-] --> <!-- EDIT9 SECTION "Code Sample: Terrain.j3md" [9524-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:terrain?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:terrain?do=export_xhtmlbody">view online version</a></em></p>

@ -419,6 +419,15 @@ This method resets the walk animation.
&#125; &#125;
&nbsp; &nbsp;
public void onAnimChange&#40;AnimControl control, AnimChannel channel, String animName&#41; &#123; &#125;</pre> public void onAnimChange&#40;AnimControl control, AnimChannel channel, String animName&#41; &#123; &#125;</pre>
</div>
<!-- EDIT13 SECTION "Handle Navigation" [10505-14748] -->
<h2><a>See also</a></h2>
<div>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://hub.jmonkeyengine.org/forum/topic/bettercharactercontrol-in-the-works/"><param name="text" value="<html><u>http://hub.jmonkeyengine.org/forum/topic/bettercharactercontrol-in-the-works/</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>
<div><span> <div><span>
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>, <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:physics?do=showtag&amp;tag=tag%3Aphysics">physics</a>,
@ -430,5 +439,5 @@ public void onAnimChange&#40;AnimControl control, AnimChannel channel, String an
</span></div> </span></div>
</div> </div>
<!-- EDIT13 SECTION "Handle Navigation" [10505-] --> <!-- EDIT14 SECTION "See also" [14749-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:walking_character?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:walking_character?do=export_xhtmlbody">view online version</a></em></p>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 42 KiB

@ -55,7 +55,7 @@ public class HelloAssets extends SimpleApplication &#123;
rootNode.attachChild&#40;teapot&#41;; rootNode.attachChild&#40;teapot&#41;;
&nbsp; &nbsp;
// Create a wall with a simple texture from test_data // Create a wall with a simple texture from test_data
Box box = new Box&#40;Vector3f.ZERO, 2.5f,2.5f,1.0f&#41;; Box box = new Box&#40;2.5f,2.5f,1.0f&#41;;
Spatial wall = new Geometry&#40;&quot;Box&quot;, box &#41;; Spatial wall = new Geometry&#40;&quot;Box&quot;, box &#41;;
Material mat_brick = new Material&#40; Material mat_brick = new Material&#40;
assetManager, &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;; assetManager, &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;;
@ -93,7 +93,7 @@ Build and run the code sample. You should see a green Ninja with a colorful teap
</p> </p>
</div> </div>
<!-- EDIT2 SECTION "Code Sample" [839-3449] --> <!-- EDIT2 SECTION "Code Sample" [839-3434] -->
<h2><a>The Asset Manager</a></h2> <h2><a>The Asset Manager</a></h2>
<div> <div>
@ -115,16 +115,17 @@ The AssetManager can load files from:
The following is the recommended directory structure for storing assets in your project directoy: The following is the recommended directory structure for storing assets in your project directoy:
</p> </p>
<pre>MyGame/assets/Interface/ <pre>MyGame/assets/
MyGame/assets/Interface/
MyGame/assets/MatDefs/ MyGame/assets/MatDefs/
MyGame/assets/Materials/ MyGame/assets/Materials/
MyGame/assets/Models/ MyGame/assets/Models/ &lt;-- your .j3o models go here
MyGame/assets/Scenes/ MyGame/assets/Scenes/
MyGame/assets/Shaders/ MyGame/assets/Shaders/
MyGame/assets/Sounds/ MyGame/assets/Sounds/ &lt;-- your audio files go here
MyGame/assets/Textures/ MyGame/assets/Textures/ &lt;-- your textures go here
MyGame/build.xml &lt;-- Ant build script MyGame/build.xml &lt;-- Default Ant build script
MyGame/src/... &lt;-- Java sources go here MyGame/src/... &lt;-- your Java sources go here
MyGame/...</pre> MyGame/...</pre>
<p> <p>
@ -132,7 +133,7 @@ This is just a suggested best practice, and it&#039;s what you get by default wh
</p> </p>
</div> </div>
<!-- EDIT3 SECTION "The Asset Manager" [3450-4573] --> <!-- EDIT3 SECTION "The Asset Manager" [3435-4701] -->
<h3><a>Loading Textures</a></h3> <h3><a>Loading Textures</a></h3>
<div> <div>
@ -141,7 +142,7 @@ This is just a suggested best practice, and it&#039;s what you get by default wh
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: 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> </p>
<pre>// Create a wall with a simple texture from test_data <pre>// Create a wall with a simple texture from test_data
Box box = new Box&#40;Vector3f.ZERO, 2.5f,2.5f,1.0f&#41;; Box box = new Box&#40;2.5f,2.5f,1.0f&#41;;
Spatial wall = new Geometry&#40;&quot;Box&quot;, box &#41;; Spatial wall = new Geometry&#40;&quot;Box&quot;, box &#41;;
Material mat_brick = new Material&#40; Material mat_brick = new Material&#40;
assetManager, &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;; assetManager, &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;;
@ -156,7 +157,7 @@ In this case, you <a href="/com/jme3/gde/docs/jme3/beginner/hello_material.html"
</p> </p>
</div> </div>
<!-- EDIT4 SECTION "Loading Textures" [4574-5490] --> <!-- EDIT4 SECTION "Loading Textures" [4702-5603] -->
<h3><a>Loading Text and Fonts</a></h3> <h3><a>Loading Text and Fonts</a></h3>
<div> <div>
@ -179,7 +180,7 @@ guiNode.attachChild&#40;helloText&#41;;</pre>
</p> </p>
</div> </div>
<!-- EDIT5 SECTION "Loading Text and Fonts" [5491-6336] --> <!-- EDIT5 SECTION "Loading Text and Fonts" [5604-6449] -->
<h3><a>Loading a Model</a></h3> <h3><a>Loading a Model</a></h3>
<div> <div>
@ -203,7 +204,7 @@ Note that you do not need to create a Material if you exported the model with a
</p> </p>
</div> </div>
<!-- EDIT6 SECTION "Loading a Model" [6337-7266] --> <!-- EDIT6 SECTION "Loading a Model" [6450-7379] -->
<h3><a>Loading Assets From Custom Paths</a></h3> <h3><a>Loading Assets From Custom Paths</a></h3>
<div> <div>
@ -233,18 +234,19 @@ JME3 offers ClasspathLocator, ZipLocator, FileLocator, HttpZipLocator, and UrlLo
</p> </p>
</div> </div>
<!-- EDIT7 SECTION "Loading Assets From Custom Paths" [7267-8284] --> <!-- EDIT7 SECTION "Loading Assets From Custom Paths" [7380-8397] -->
<h2><a>Creating Models and Scenes</a></h2> <h2><a>Creating Models and Scenes</a></h2>
<div> <div>
<p> <p>
To create 3D models and scenes, you need a 3D Mesh Editor with an OgreXML Exporter plugin. For example, you can <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>create fully textured models with Blender</u></html>"><param name="textColor" value="blue"></object>. To create 3D models and scenes, you need a 3D Mesh Editor. If you don&#039;t have any tools, install Blender and the OgreXML Exporter plugin.
You use the <a href="/com/jme3/gde/docs/sdk.html">SDK</a> to <a href="/com/jme3/gde/docs/sdk/model_loader_and_viewer.html">load models</a>, <a href="/com/jme3/gde/docs/sdk/blender.html">convert models</a> and <a href="/com/jme3/gde/docs/sdk/scene_composer.html">create scenes</a> from them. Then you <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>create fully textured models (e.g. with Blender)</u></html>"><param name="textColor" value="blue"></object> and export them to your project.
Then you use the <a href="/com/jme3/gde/docs/sdk.html">SDK</a> to <a href="/com/jme3/gde/docs/sdk/model_loader_and_viewer.html">load models</a>, <a href="/com/jme3/gde/docs/sdk/blender.html">convert models</a>, and <a href="/com/jme3/gde/docs/sdk/scene_composer.html">create 3D scenes</a> from them.
</p> </p>
<p> <p>
If you use Blender, export your models as Ogre <acronym title="Extensible Markup Language">XML</acronym> meshes with materials as follows: <strong>Example:</strong> From Blender, you export your models as Ogre <acronym title="Extensible Markup Language">XML</acronym> meshes with materials as follows:
</p> </p>
<ol> <ol>
<li><div> Open the menu File &gt; Export &gt; OgreXML Exporter to open the exporter dialog.</div> <li><div> Open the menu File &gt; Export &gt; OgreXML Exporter to open the exporter dialog.</div>
@ -272,17 +274,28 @@ If you use Blender, export your models as Ogre <acronym title="Extensible Markup
</ol> </ol>
</div> </div>
<!-- EDIT8 SECTION "Creating Models and Scenes" [8285-9444] --> <!-- EDIT8 SECTION "Creating Models and Scenes" [8398-9651] -->
<h3><a>Model File Formats</a></h3> <h3><a>Model File Formats</a></h3>
<div> <div>
<p> <p>
JME3 can load Ogre <acronym title="Extensible Markup Language">XML</acronym> models + materials, Ogre DotScenes, as well as Wavefront OBJ+MTL models. The loadModel() code works with these files when you run the code directly from the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>. JME3 can convert and load
</p> </p>
<ul>
<li><div> Ogre <acronym title="Extensible Markup Language">XML</acronym> models + materials, </div>
</li>
<li><div> Ogre DotScenes, </div>
</li>
<li><div> Wavefront OBJ + MTL models, </div>
</li>
<li><div> .Blend files.</div>
</li>
</ul>
<p> <p>
If you build the executables using the default build script, then <strong>the original model files (<acronym title="Extensible Markup Language">XML</acronym>, OBJ, etc) are not included.</strong> When you run the executable, you get an error message if you try to load any models directly:
The <code>loadModel()</code> method loads these original file formats when you run your code directly from the <acronym title="Software Development Kit">SDK</acronym>. If you however build the executables using the default build script, then the original model files (<acronym title="Extensible Markup Language">XML</acronym>, OBJ, etc) <em>are not included</em>. This means, when you run the executable outside the <acronym title="Software Development Kit">SDK</acronym>, and load any original models directly, you get the following error message:
</p> </p>
<pre>com.jme3.asset.DesktopAssetManager loadAsset <pre>com.jme3.asset.DesktopAssetManager loadAsset
WARNING: Cannot locate resource: Models/Ninja/Ninja.mesh.xml WARNING: Cannot locate resource: Models/Ninja/Ninja.mesh.xml
@ -291,11 +304,11 @@ SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.NullPointerException</pre> java.lang.NullPointerException</pre>
<p> <p>
Loading the <acronym title="Extensible Markup Language">XML</acronym>/OBJ files directly is only acceptable during the development phase. If your graphic designer pushes updated files to the asset directory, you can quickly review the latest version in your development environment. You see that loading the <strong><acronym title="Extensible Markup Language">XML</acronym>/OBJ/Blend files</strong> directly is only acceptable during the development phase in the <acronym title="Software Development Kit">SDK</acronym>. For example, every time your graphic designer pushes updated files to the asset directory, you can quickly review the latest version in your development environment.
</p> </p>
<p> <p>
For testing and for the final release build, you use .j3o files exclusively. J3o is an optimized binary format for jME3 applications, and .j3o files are automatically included in the distributable JAR file by the build script. When you do QA test builds or are ready to release, use the <a href="/com/jme3/gde/docs/sdk.html">SDK</a> to <a href="/com/jme3/gde/docs/sdk/model_loader_and_viewer.html">convert</a> all .obj/.scene/.xml/.blend files to .j3o files, and only load the .j3o versions. But for QA test builds and for the final release build, you use <strong>.j3o files</strong> exclusively. J3o is an optimized binary format for jME3 applications. When you do QA test builds, or are ready to release, use the <a href="/com/jme3/gde/docs/sdk.html">SDK</a> to <a href="/com/jme3/gde/docs/sdk/model_loader_and_viewer.html">convert</a> all .obj/.scene/.xml/.blend files to .j3o files, and update all code to load the .j3o files. The default build script automatically packages .j3o files in the executables.
</p> </p>
<p> <p>
@ -306,18 +319,20 @@ Open your JME3 Project in the jMonkeyEngine <acronym title="Software Development
</li> </li>
<li><div> The .j3o file appears next to the .mesh.xml file and has the same name. </div> <li><div> The .j3o file appears next to the .mesh.xml file and has the same name. </div>
</li> </li>
<li><div> Change all your loadModel() lines accordingly. For example: <pre>Spatial ninja = assetManager.loadModel&#40;&quot;Models/Ninja/Ninja.j3o&quot;&#41;;</pre> <li><div> Update all your <code>loadModel()</code> lines accordingly. For example: <pre>Spatial ninja = assetManager.loadModel&#40;&quot;Models/Ninja/Ninja.j3o&quot;&#41;;</pre>
</div> </div>
</li> </li>
</ol> </ol>
<p> <p>
If your executable gets a runtime exception, make sure you have converted all models to .j3o! <p><div>If your executable throws a &quot;Cannot locate resource&quot; runtime exception, check all load paths and make sure you have converted all models to .j3o files!
</div></p>
</p> </p>
</div> </div>
<!-- EDIT9 SECTION "Model File Formats" [9445-11297] --> <!-- EDIT9 SECTION "Model File Formats" [9652-11736] -->
<h3><a>Loading Models and Scenes</a></h3> <h3><a>Loading Models and Scenes</a></h3>
<div> <div>
<div><table> <div><table>
@ -346,9 +361,9 @@ rootNode.attachChild&#40;scene&#41;;</pre>
</td> </td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT11 TABLE [11335-12389] --> <!-- EDIT11 TABLE [11774-12828] -->
</div> </div>
<!-- EDIT10 SECTION "Loading Models and Scenes" [11298-12390] --> <!-- EDIT10 SECTION "Loading Models and Scenes" [11737-12829] -->
<h2><a>Excercise - How to Load Assets</a></h2> <h2><a>Excercise - How to Load Assets</a></h2>
<div> <div>
@ -435,7 +450,7 @@ Here is a third method you must know, loading a scene/model from a .j3o file:
</li> </li>
<li><div> In the projects window, browse to the <code>assets/Scenes/town</code> directory. </div> <li><div> In the projects window, browse to the <code>assets/Scenes/town</code> directory. </div>
</li> </li>
<li><div> Right-click the <code>main.scene</code> and convert the scene to binary: The jMoneyPlatform generates a main.j3o file.</div> <li><div> Right-click the <code>main.scene</code> and convert the scene to binary: The jMonkeyPlatform generates a main.j3o file.</div>
</li> </li>
<li><div> Add the following code under <code>simpleInitApp() {</code><pre> Spatial gameLevel = assetManager.loadModel&#40;&quot;Scenes/town/main.j3o&quot;&#41;; <li><div> Add the following code under <code>simpleInitApp() {</code><pre> Spatial gameLevel = assetManager.loadModel&#40;&quot;Scenes/town/main.j3o&quot;&#41;;
gameLevel.setLocalTranslation&#40;0, -5.2f, 0&#41;; gameLevel.setLocalTranslation&#40;0, -5.2f, 0&#41;;
@ -453,7 +468,7 @@ Again, you should see the Ninja+wall+teapot standing in a town. </div>
</ol> </ol>
</div> </div>
<!-- EDIT12 SECTION "Excercise - How to Load Assets" [12391-15725] --> <!-- EDIT12 SECTION "Excercise - How to Load Assets" [12830-16165] -->
<h2><a>Conclusion</a></h2> <h2><a>Conclusion</a></h2>
<div> <div>
@ -497,5 +512,5 @@ Let&#039;s add some action to the scene and continue with the <a href="/com/jme3
</span></div> </span></div>
</div> </div>
<!-- EDIT13 SECTION "Conclusion" [15726-] --> <!-- EDIT13 SECTION "Conclusion" [16166-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_asset?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_asset?do=export_xhtmlbody">view online version</a></em></p>

@ -24,11 +24,11 @@ This tutorial explains how to add 3D sound to a game, and how to make sounds pla
&nbsp; &nbsp;
import com.jme3.app.SimpleApplication; import com.jme3.app.SimpleApplication;
import com.jme3.audio.AudioNode; import com.jme3.audio.AudioNode;
import com.jme3.input.MouseInput;
import com.jme3.input.controls.ActionListener; import com.jme3.input.controls.ActionListener;
import com.jme3.input.controls.MouseButtonTrigger; import com.jme3.input.controls.MouseButtonTrigger;
import com.jme3.material.Material; import com.jme3.material.Material;
import com.jme3.math.ColorRGBA; import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry; import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Box; import com.jme3.scene.shape.Box;
&nbsp; &nbsp;
@ -49,10 +49,9 @@ public class HelloAudio extends SimpleApplication &#123;
flyCam.setMoveSpeed&#40;40&#41;; flyCam.setMoveSpeed&#40;40&#41;;
&nbsp; &nbsp;
/** just a blue box floating in space */ /** just a blue box floating in space */
Box box1 = new Box&#40;Vector3f.ZERO, 1, 1, 1&#41;; Box box1 = new Box&#40;1, 1, 1&#41;;
player = new Geometry&#40;&quot;Player&quot;, box1&#41;; player = new Geometry&#40;&quot;Player&quot;, box1&#41;;
Material mat1 = new Material&#40;assetManager, Material mat1 = new Material&#40;assetManager,&quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;;
&quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;;
mat1.setColor&#40;&quot;Color&quot;, ColorRGBA.Blue&#41;; mat1.setColor&#40;&quot;Color&quot;, ColorRGBA.Blue&#41;;
player.setMaterial&#40;mat1&#41;; player.setMaterial&#40;mat1&#41;;
rootNode.attachChild&#40;player&#41;; rootNode.attachChild&#40;player&#41;;
@ -66,23 +65,23 @@ public class HelloAudio extends SimpleApplication &#123;
private void initAudio&#40;&#41; &#123; private void initAudio&#40;&#41; &#123;
/* gun shot sound is to be triggered by a mouse click. */ /* gun shot sound is to be triggered by a mouse click. */
audio_gun = new AudioNode&#40;assetManager, &quot;Sound/Effects/Gun.wav&quot;, false&#41;; audio_gun = new AudioNode&#40;assetManager, &quot;Sound/Effects/Gun.wav&quot;, false&#41;;
audio_gun.setPositional&#40;false&#41;;
audio_gun.setLooping&#40;false&#41;; audio_gun.setLooping&#40;false&#41;;
audio_gun.setVolume&#40;2&#41;; audio_gun.setVolume&#40;2&#41;;
rootNode.attachChild&#40;audio_gun&#41;; rootNode.attachChild&#40;audio_gun&#41;;
&nbsp; &nbsp;
/* nature sound - keeps playing in a loop. */ /* nature sound - keeps playing in a loop. */
audio_nature = new AudioNode&#40;assetManager, &quot;Sound/Environment/Nature.ogg&quot;, false&#41;; audio_nature = new AudioNode&#40;assetManager, &quot;Sound/Environment/Ocean Waves.ogg&quot;, true&#41;;
audio_nature.setLooping&#40;true&#41;; // activate continuous playing audio_nature.setLooping&#40;true&#41;; // activate continuous playing
audio_nature.setPositional&#40;true&#41;; audio_nature.setPositional&#40;true&#41;;
audio_nature.setLocalTranslation&#40;Vector3f.ZERO.clone&#40;&#41;&#41;;
audio_nature.setVolume&#40;3&#41;; audio_nature.setVolume&#40;3&#41;;
rootNode.attachChild&#40;audio_nature&#41;; rootNode.attachChild&#40;audio_nature&#41;;
audio_nature.play&#40;&#41;; // play continuously! audio_nature.play&#40;&#41;; // play continuously!
&#125; &#125;
&nbsp; &nbsp;
/** Declaring &quot;Shoot&quot; action, mapping it to a trigger (mouse click). */ /** Declaring &quot;Shoot&quot; action, mapping it to a trigger (mouse left click). */
private void initKeys&#40;&#41; &#123; private void initKeys&#40;&#41; &#123;
inputManager.addMapping&#40;&quot;Shoot&quot;, new MouseButtonTrigger&#40;0&#41;&#41;; inputManager.addMapping&#40;&quot;Shoot&quot;, new MouseButtonTrigger&#40;MouseInput.BUTTON_LEFT&#41;&#41;;
inputManager.addListener&#40;actionListener, &quot;Shoot&quot;&#41;; inputManager.addListener&#40;actionListener, &quot;Shoot&quot;&#41;;
&#125; &#125;
&nbsp; &nbsp;
@ -110,7 +109,7 @@ When you run the sample, you should see a blue cube. You should hear a nature-li
</p> </p>
</div> </div>
<!-- EDIT2 SECTION "Sample Code" [684-3519] --> <!-- EDIT2 SECTION "Sample Code" [684-3501] -->
<h2><a>Understanding the Code Sample</a></h2> <h2><a>Understanding the Code Sample</a></h2>
<div> <div>
@ -124,7 +123,7 @@ Let&#039;s have a closer look at <code>initAudio()</code> to learn how to use <c
</p> </p>
</div> </div>
<!-- EDIT3 SECTION "Understanding the Code Sample" [3520-3857] --> <!-- EDIT3 SECTION "Understanding the Code Sample" [3502-3839] -->
<h2><a>AudioNodes</a></h2> <h2><a>AudioNodes</a></h2>
<div> <div>
@ -153,10 +152,17 @@ These two lines create new sound nodes from the given audio files in the AssetMa
<p> <p>
You want the gunshot sound to play <em>once</em> (you don&#039;t want it to loop). You also specify its volume as gain factor (at 0, sound is muted, at 2, it is twice as loud, etc.). You want the gunshot sound to play <em>once</em> (you don&#039;t want it to loop). You also specify its volume as gain factor (at 0, sound is muted, at 2, it is twice as loud, etc.).
</p> </p>
<pre> audio_gun.setLooping&#40;false&#41;; <pre> audio_gun.setPositional&#40;false&#41;;
audio_gun.setLooping&#40;false&#41;;
audio_gun.setVolume&#40;2&#41;; audio_gun.setVolume&#40;2&#41;;
rootNode.attachChild&#40;audio_gun&#41;;</pre> rootNode.attachChild&#40;audio_gun&#41;;</pre>
<p>
<p><div>Note that setPositional(false) is pretty important when you use stereo sounds. Positional sounds must always be mono audio files, otherwise the engine will remind it to you with a crash.
</div></p>
</p>
<p> <p>
The nature sound is different: You want it to loop <em>continuously</em> as background sound. This is why you set looping to true, and immediately call the play() method on the node. You also choose to set its volume to 3. The nature sound is different: You want it to loop <em>continuously</em> as background sound. This is why you set looping to true, and immediately call the play() method on the node. You also choose to set its volume to 3.
</p> </p>
@ -184,7 +190,7 @@ Here you make audio_nature a positional sound that comes from a certain place. F
</p> </p>
</div> </div>
<!-- EDIT4 SECTION "AudioNodes" [3858-6947] --> <!-- EDIT4 SECTION "AudioNodes" [3840-7174] -->
<h2><a>Triggering Sound</a></h2> <h2><a>Triggering Sound</a></h2>
<div> <div>
@ -192,9 +198,9 @@ Here you make audio_nature a positional sound that comes from a certain place. F
Let&#039;s have a closer look at <code>initKeys()</code>: As you learned in previous tutorials, you use the <code>inputManager</code> to respond to user input. Here you add a mapping for a left mouse button click, and name this new action <code>Shoot</code>. Let&#039;s have a closer look at <code>initKeys()</code>: As you learned in previous tutorials, you use the <code>inputManager</code> to respond to user input. Here you add a mapping for a left mouse button click, and name this new action <code>Shoot</code>.
</p> </p>
<pre> /** Declaring &quot;Shoot&quot; action, mapping it to a trigger (mouse click). */ <pre> /** Declaring &quot;Shoot&quot; action, mapping it to a trigger (mouse left click). */
private void initKeys&#40;&#41; &#123; private void initKeys&#40;&#41; &#123;
inputManager.addMapping&#40;&quot;Shoot&quot;, new MouseButtonTrigger&#40;0&#41;&#41;; inputManager.addMapping&#40;&quot;Shoot&quot;, new MouseButtonTrigger&#40;MouseInput.BUTTON_LEFT&#41;&#41;;
inputManager.addListener&#40;actionListener, &quot;Shoot&quot;&#41;; inputManager.addListener&#40;actionListener, &quot;Shoot&quot;&#41;;
&#125;</pre> &#125;</pre>
@ -213,10 +219,11 @@ Setting up the ActionListener should also be familiar from previous tutorials. Y
<p> <p>
Since you want to be able to shoot fast repeatedly, so you do not want to wait for the previous gunshot sound to end before the next one can start. This is why you play this sound using the <code>playInstance()</code> method. This means that every click starts a new instance of the sound, so two instances can overlap. You set this sound not to loop, so each instance only plays once. As you would expect it of a gunshot. Since you want to be able to shoot fast repeatedly, so you do not want to wait for the previous gunshot sound to end before the next one can start. This is why you play this sound using the <code>playInstance()</code> method. This means that every click starts a new instance of the sound, so two instances can overlap. You set this sound not to loop, so each instance only plays once. As you would expect it of a gunshot.
</p> </p>
</div> </div>
<!-- EDIT5 SECTION "Triggering Sound" [6948-8412] --> <!-- EDIT5 SECTION "Triggering Sound" [7175-8664] -->
<h2><a>Ambient or Situational?</a></h2> <h2><a>Ambient or Situational?</a></h2>
<div> <div>
@ -265,7 +272,7 @@ Apart from the looping boolean, another difference is where <code>play().playIns
</ul> </ul>
</div> </div>
<!-- EDIT6 SECTION "Ambient or Situational?" [8413-9643] --> <!-- EDIT6 SECTION "Ambient or Situational?" [8665-9895] -->
<h2><a>Buffered or Streaming?</a></h2> <h2><a>Buffered or Streaming?</a></h2>
<div> <div>
@ -274,7 +281,7 @@ Apart from the looping boolean, another difference is where <code>play().playIns
The Boolean in the AudioNode constructor defines whether the audio is buffered (false) or streamed (true). For example: The Boolean in the AudioNode constructor defines whether the audio is buffered (false) or streamed (true). For example:
</p> </p>
<pre>audio_nature = new AudioNode&#40;assetManager, &quot;Sound/Effects/Gun.wav&quot;, false&#41;; // buffered <pre>audio_gunshot = new AudioNode&#40;assetManager, &quot;Sound/Effects/Gun.wav&quot;, false&#41;; // buffered
... ...
audio_nature = new AudioNode&#40;assetManager, &quot;Sound/Environment/Nature.ogg&quot;, true&#41;; // streamed </pre> audio_nature = new AudioNode&#40;assetManager, &quot;Sound/Environment/Nature.ogg&quot;, true&#41;; // streamed </pre>
@ -288,7 +295,7 @@ Note that streamed sounds can not loop (i.e. setLooping will not work as you exp
</p> </p>
</div> </div>
<!-- EDIT7 SECTION "Buffered or Streaming?" [9644-10225] --> <!-- EDIT7 SECTION "Buffered or Streaming?" [9896-10478] -->
<h2><a>Play() or PlayInstance()?</a></h2> <h2><a>Play() or PlayInstance()?</a></h2>
<div> <div>
<div><table> <div><table>
@ -305,9 +312,9 @@ Note that streamed sounds can not loop (i.e. setLooping will not work as you exp
<td>The same sound cannot play twice at the same time.</td><td>The same sounds can play multiple times and overlap.</td> <td>The same sound cannot play twice at the same time.</td><td>The same sounds can play multiple times and overlap.</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT9 TABLE [10265-10509] --> <!-- EDIT9 TABLE [10518-10762] -->
</div> </div>
<!-- EDIT8 SECTION "Play() or PlayInstance()?" [10226-10510] --> <!-- EDIT8 SECTION "Play() or PlayInstance()?" [10479-10763] -->
<h2><a>Your Ear in the Scene</a></h2> <h2><a>Your Ear in the Scene</a></h2>
<div> <div>
@ -329,7 +336,7 @@ If you don&#039;t do that, the results of 3D audio will be quite random.
</p> </p>
</div> </div>
<!-- EDIT10 SECTION "Your Ear in the Scene" [10511-11213] --> <!-- EDIT10 SECTION "Your Ear in the Scene" [10764-11466] -->
<h2><a>Global, Directional, Positional?</a></h2> <h2><a>Global, Directional, Positional?</a></h2>
<div> <div>
@ -356,7 +363,7 @@ In short, you must choose in every situation whether it makes sense for a sound
</p> </p>
</div> </div>
<!-- EDIT11 SECTION "Global, Directional, Positional?" [11214-12570] --> <!-- EDIT11 SECTION "Global, Directional, Positional?" [11467-12823] -->
<h2><a>Conclusion</a></h2> <h2><a>Conclusion</a></h2>
<div> <div>
@ -391,5 +398,5 @@ See also:
</span></div> </span></div>
</div> </div>
<!-- EDIT12 SECTION "Conclusion" [12571-] --> <!-- EDIT12 SECTION "Conclusion" [12824-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_audio?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_audio?do=export_xhtmlbody">view online version</a></em></p>

@ -69,6 +69,11 @@ public class HelloCollision extends SimpleApplication
private CharacterControl player; private CharacterControl player;
private Vector3f walkDirection = new Vector3f&#40;&#41;; private Vector3f walkDirection = new Vector3f&#40;&#41;;
private boolean left = false, right = false, up = false, down = false; private boolean left = false, right = false, up = false, down = false;
&nbsp;
//Temporary vectors used on each frame.
//They here to avoid instanciating new vectors on each frame
private Vector3f camDir = new Vector3f&#40;&#41;;
private Vector3f camLeft = new Vector3f&#40;&#41;;
&nbsp; &nbsp;
public static void main&#40;String&#91;&#93; args&#41; &#123; public static void main&#40;String&#91;&#93; args&#41; &#123;
HelloCollision app = new HelloCollision&#40;&#41;; HelloCollision app = new HelloCollision&#40;&#41;;
@ -111,7 +116,7 @@ public class HelloCollision extends SimpleApplication
player.setGravity&#40;30&#41;; player.setGravity&#40;30&#41;;
player.setPhysicsLocation&#40;new Vector3f&#40;0, 10, 0&#41;&#41;; player.setPhysicsLocation&#40;new Vector3f&#40;0, 10, 0&#41;&#41;;
&nbsp; &nbsp;
// We attach the scene and the player to the rootNode and the physics space, // We attach the scene and the player to the rootnode and the physics space,
// to make them appear in the game world. // to make them appear in the game world.
rootNode.attachChild&#40;sceneModel&#41;; rootNode.attachChild&#40;sceneModel&#41;;
bulletAppState.getPhysicsSpace&#40;&#41;.add&#40;landscape&#41;; bulletAppState.getPhysicsSpace&#40;&#41;.add&#40;landscape&#41;;
@ -147,17 +152,17 @@ public class HelloCollision extends SimpleApplication
&nbsp; &nbsp;
<span>/** These are our custom actions triggered by key presses. <span>/** These are our custom actions triggered by key presses.
* We do not walk yet, we just keep track of the direction the user pressed. */</span> * We do not walk yet, we just keep track of the direction the user pressed. */</span>
public void onAction&#40;String binding, boolean value, float tpf&#41; &#123; public void onAction&#40;String binding, boolean isPressed, float tpf&#41; &#123;
if &#40;binding.equals&#40;&quot;Left&quot;&#41;&#41; &#123; if &#40;binding.equals&#40;&quot;Left&quot;&#41;&#41; &#123;
left = value; left = isPressed;
&#125; else if &#40;binding.equals&#40;&quot;Right&quot;&#41;&#41; &#123; &#125; else if &#40;binding.equals&#40;&quot;Right&quot;&#41;&#41; &#123;
right = value; right= isPressed;
&#125; else if &#40;binding.equals&#40;&quot;Up&quot;&#41;&#41; &#123; &#125; else if &#40;binding.equals&#40;&quot;Up&quot;&#41;&#41; &#123;
up = value; up = isPressed;
&#125; else if &#40;binding.equals&#40;&quot;Down&quot;&#41;&#41; &#123; &#125; else if &#40;binding.equals&#40;&quot;Down&quot;&#41;&#41; &#123;
down = value; down = isPressed;
&#125; else if &#40;binding.equals&#40;&quot;Jump&quot;&#41;&#41; &#123; &#125; else if &#40;binding.equals&#40;&quot;Jump&quot;&#41;&#41; &#123;
player.jump&#40;&#41;; if &#40;isPressed&#41; &#123; player.jump&#40;&#41;; &#125;
&#125; &#125;
&#125; &#125;
&nbsp; &nbsp;
@ -170,13 +175,21 @@ public class HelloCollision extends SimpleApplication
*/</span> */</span>
@Override @Override
public void simpleUpdate&#40;float tpf&#41; &#123; public void simpleUpdate&#40;float tpf&#41; &#123;
Vector3f camDir = cam.getDirection&#40;&#41;.clone&#40;&#41;.multLocal&#40;0.6f&#41;; camDir.set&#40;cam.getDirection&#40;&#41;&#41;.multLocal&#40;0.6f&#41;;
Vector3f camLeft = cam.getLeft&#40;&#41;.clone&#40;&#41;.multLocal&#40;0.4f&#41;; camLeft.set&#40;cam.getLeft&#40;&#41;&#41;.multLocal&#40;0.4f&#41;;
walkDirection.set&#40;0, 0, 0&#41;; walkDirection.set&#40;0, 0, 0&#41;;
if &#40;left&#41; &#123; walkDirection.addLocal&#40;camLeft&#41;; &#125; if &#40;left&#41; &#123;
if &#40;right&#41; &#123; walkDirection.addLocal&#40;camLeft.negate&#40;&#41;&#41;; &#125; walkDirection.addLocal&#40;camLeft&#41;;
if &#40;up&#41; &#123; walkDirection.addLocal&#40;camDir&#41;; &#125; &#125;
if &#40;down&#41; &#123; walkDirection.addLocal&#40;camDir.negate&#40;&#41;&#41;; &#125; if &#40;right&#41; &#123;
walkDirection.addLocal&#40;camLeft.negate&#40;&#41;&#41;;
&#125;
if &#40;up&#41; &#123;
walkDirection.addLocal&#40;camDir&#41;;
&#125;
if &#40;down&#41; &#123;
walkDirection.addLocal&#40;camDir.negate&#40;&#41;&#41;;
&#125;
player.setWalkDirection&#40;walkDirection&#41;; player.setWalkDirection&#40;walkDirection&#41;;
cam.setLocation&#40;player.getPhysicsLocation&#40;&#41;&#41;; cam.setLocation&#40;player.getPhysicsLocation&#40;&#41;&#41;;
&#125; &#125;
@ -184,10 +197,11 @@ public class HelloCollision extends SimpleApplication
<p> <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=":-)" /> 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> </p>
</div> </div>
<!-- EDIT2 SECTION "Sample Code" [596-7019] --> <!-- EDIT2 SECTION "Sample Code" [596-7341] -->
<h2><a>Understanding the Code</a></h2> <h2><a>Understanding the Code</a></h2>
<div> <div>
@ -206,7 +220,12 @@ You already know that SimpleApplication is the base class for all jME3 games. Yo
private RigidBodyControl landscape; private RigidBodyControl landscape;
private CharacterControl player; private CharacterControl player;
private Vector3f walkDirection = new Vector3f&#40;&#41;; private Vector3f walkDirection = new Vector3f&#40;&#41;;
private boolean left = false, right = false, up = false, down = false;</pre> private boolean left = false, right = false, up = false, down = false;
&nbsp;
//Temporary vectors used on each frame.
//They here to avoid instanciating new vectors on each frame
private Vector3f camDir = new Vector3f&#40;&#41;;
private Vector3f camLeft = new Vector3f&#40;&#41;;</pre>
<p> <p>
You initialize a few private fields: You initialize a few private fields:
@ -222,15 +241,18 @@ You initialize a few private fields:
</li> </li>
<li><div> The fields <code>walkDirection</code> and the four Booleans are used for physics-controlled navigation.</div> <li><div> The fields <code>walkDirection</code> and the four Booleans are used for physics-controlled navigation.</div>
</li> </li>
<li><div> camDir and camLeft are temporary vectors used later when computing the walkingDirection from the cam position and rotation</div>
</li>
</ul> </ul>
<p> <p>
Let&#039;s have a look at all the details: Let&#039;s have a look at all the details:
</p> </p>
</div> </div>
<!-- EDIT3 SECTION "Understanding the Code" [7020-8244] --> <!-- EDIT3 SECTION "Understanding the Code" [7342-8887] -->
<h2><a>Initializing the Game</a></h2> <h2><a>Initializing the Game</a></h2>
<div> <div>
@ -254,7 +276,7 @@ As usual, you initialize the game in the <code>simpleInitApp()</code> method.
</ol> </ol>
</div> </div>
<!-- EDIT4 SECTION "Initializing the Game" [8245-8841] --> <!-- EDIT4 SECTION "Initializing the Game" [8888-9484] -->
<h3><a>The Physics-Controlled Scene</a></h3> <h3><a>The Physics-Controlled Scene</a></h3>
<div> <div>
@ -301,7 +323,7 @@ To use collision detection, you add a RigidBodyControl to the <code>sceneModel</
</p> </p>
</div> </div>
<!-- EDIT5 SECTION "The Physics-Controlled Scene" [8842-10815] --> <!-- EDIT5 SECTION "The Physics-Controlled Scene" [9485-11458] -->
<h3><a>The Physics-Controlled Player</a></h3> <h3><a>The Physics-Controlled Player</a></h3>
<div> <div>
@ -353,7 +375,7 @@ Finally we put the player in its starting position and update its state ??? reme
</p> </p>
</div> </div>
<!-- EDIT6 SECTION "The Physics-Controlled Player" [10816-13580] --> <!-- EDIT6 SECTION "The Physics-Controlled Player" [11459-14223] -->
<h3><a>PhysicsSpace</a></h3> <h3><a>PhysicsSpace</a></h3>
<div> <div>
@ -369,7 +391,7 @@ The invisible body of the character just sits there on the physical floor. It ca
</p> </p>
</div> </div>
<!-- EDIT7 SECTION "PhysicsSpace" [13581-13982] --> <!-- EDIT7 SECTION "PhysicsSpace" [14224-14625] -->
<h2><a>Navigation</a></h2> <h2><a>Navigation</a></h2>
<div> <div>
@ -387,7 +409,7 @@ In short, you must re-define the flyCam&#039;s navigational key mappings to use
</p> </p>
</div> </div>
<!-- EDIT8 SECTION "Navigation" [13983-14930] --> <!-- EDIT8 SECTION "Navigation" [14626-15573] -->
<h3><a>1. inputManager</a></h3> <h3><a>1. inputManager</a></h3>
<div> <div>
@ -413,7 +435,7 @@ You can move this block of code into an auxiliary method <code>setupKeys()</code
</p> </p>
</div> </div>
<!-- EDIT9 SECTION "1. inputManager" [14931-15841] --> <!-- EDIT9 SECTION "1. inputManager" [15574-16484] -->
<h3><a>2. onAction()</a></h3> <h3><a>2. onAction()</a></h3>
<div> <div>
@ -444,7 +466,7 @@ For all other directions: Every time the user presses one of the WASD keys, you
</p> </p>
</div> </div>
<!-- EDIT10 SECTION "2. onAction()" [15842-17258] --> <!-- EDIT10 SECTION "2. onAction()" [16485-17901] -->
<h3><a>3. setWalkDirection()</a></h3> <h3><a>3. setWalkDirection()</a></h3>
<div> <div>
@ -457,13 +479,21 @@ Previously in the <code>onAction()</code> method, you have collected the info in
This last and most important code snippet goes into the <code>simpleUpdate()</code> method. This last and most important code snippet goes into the <code>simpleUpdate()</code> method.
</p> </p>
<pre> public void simpleUpdate&#40;float tpf&#41; &#123; <pre> public void simpleUpdate&#40;float tpf&#41; &#123;
Vector3f camDir = cam.getDirection&#40;&#41;.clone&#40;&#41;.multLocal&#40;0.6f&#41;; camDir.set&#40;cam.getDirection&#40;&#41;&#41;.multLocal&#40;0.6f&#41;;
Vector3f camLeft = cam.getLeft&#40;&#41;.clone&#40;&#41;.multLocal&#40;0.4f&#41;; camLeft.set&#40;cam.getLeft&#40;&#41;&#41;.multLocal&#40;0.4f&#41;;
walkDirection.set&#40;0, 0, 0&#41;; walkDirection.set&#40;0, 0, 0&#41;;
if &#40;left&#41; &#123; walkDirection.addLocal&#40;camLeft&#41;; &#125; if &#40;left&#41; &#123;
if &#40;right&#41; &#123; walkDirection.addLocal&#40;camLeft.negate&#40;&#41;&#41;; &#125; walkDirection.addLocal&#40;camLeft&#41;;
if &#40;up&#41; &#123; walkDirection.addLocal&#40;camDir&#41;; &#125; &#125;
if &#40;down&#41; &#123; walkDirection.addLocal&#40;camDir.negate&#40;&#41;&#41;; &#125; if &#40;right&#41; &#123;
walkDirection.addLocal&#40;camLeft.negate&#40;&#41;&#41;;
&#125;
if &#40;up&#41; &#123;
walkDirection.addLocal&#40;camDir&#41;;
&#125;
if &#40;down&#41; &#123;
walkDirection.addLocal&#40;camDir.negate&#40;&#41;&#41;;
&#125;
player.setWalkDirection&#40;walkDirection&#41;; player.setWalkDirection&#40;walkDirection&#41;;
cam.setLocation&#40;player.getPhysicsLocation&#40;&#41;&#41;; cam.setLocation&#40;player.getPhysicsLocation&#40;&#41;&#41;;
&#125;</pre> &#125;</pre>
@ -491,10 +521,11 @@ This is how the walking is triggered:
<p> <p>
<strong>Important:</strong> Again, do not use <code>setLocalTranslation()</code> to walk the player around. You will get it stuck by overlapping with another physical object. You can put the player in a start position with <code>setPhysicalLocation()</code> if you make sure to place it a bit above the floor and away from obstacles. <strong>Important:</strong> Again, do not use <code>setLocalTranslation()</code> to walk the player around. You will get it stuck by overlapping with another physical object. You can put the player in a start position with <code>setPhysicalLocation()</code> if you make sure to place it a bit above the floor and away from obstacles.
</p> </p>
</div> </div>
<!-- EDIT11 SECTION "3. setWalkDirection()" [17259-19294] --> <!-- EDIT11 SECTION "3. setWalkDirection()" [17902-20020] -->
<h2><a>Conclusion</a></h2> <h2><a>Conclusion</a></h2>
<div> <div>
@ -535,5 +566,5 @@ Related info:
</span></div> </span></div>
</div> </div>
<!-- EDIT12 SECTION "Conclusion" [19295-] --> <!-- EDIT12 SECTION "Conclusion" [20021-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_collision?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_collision?do=export_xhtmlbody">view online version</a></em></p>

@ -65,8 +65,8 @@ public class HelloInput extends SimpleApplication &#123;
inputManager.addMapping&#40;&quot;Rotate&quot;, new KeyTrigger&#40;KeyInput.KEY_SPACE&#41;, inputManager.addMapping&#40;&quot;Rotate&quot;, new KeyTrigger&#40;KeyInput.KEY_SPACE&#41;,
new MouseButtonTrigger&#40;MouseInput.BUTTON_LEFT&#41;&#41;; new MouseButtonTrigger&#40;MouseInput.BUTTON_LEFT&#41;&#41;;
// Add the names to the action listener. // Add the names to the action listener.
inputManager.addListener&#40;actionListener, new String&#91;&#93;&#123;&quot;Pause&quot;&#125;&#41;; inputManager.addListener&#40;actionListener,&quot;Pause&quot;&#41;;
inputManager.addListener&#40;analogListener, new String&#91;&#93;&#123;&quot;Left&quot;, &quot;Right&quot;, &quot;Rotate&quot;&#125;&#41;; inputManager.addListener&#40;analogListener,&quot;Left&quot;, &quot;Right&quot;, &quot;Rotate&quot;&#41;;
&nbsp; &nbsp;
&#125; &#125;
&nbsp; &nbsp;
@ -112,7 +112,7 @@ Build and run the example.
</ul> </ul>
</div> </div>
<!-- EDIT2 SECTION "Sample Code" [634-3678] --> <!-- EDIT2 SECTION "Sample Code" [634-3651] -->
<h2><a>Defining Mappings and Triggers</a></h2> <h2><a>Defining Mappings and Triggers</a></h2>
<div> <div>
@ -164,15 +164,16 @@ Now you need to register your trigger mappings.
</li> </li>
</ol> </ol>
<pre> // Add the names to the action listener. <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;actionListener,&quot;Pause&quot;&#41;;
inputManager.addListener&#40;analogListener, new String&#91;&#93;&#123;&quot;Left&quot;, &quot;Right&quot;, &quot;Rotate&quot;&#125;&#41;;</pre> inputManager.addListener&#40;analogListener,&quot;Left&quot;, &quot;Right&quot;, &quot;Rotate&quot;&#41;;</pre>
<p> <p>
This code goes into the <code>simpleInitApp()</code> method. But since we will likely add many keybindings, we extract these lines and wrap them in an auxiliary method, <code>initKeys()</code>. The <code>initKeys()</code> method is not part of the Input Controls interface ??? you can name it whatever you like. Just don&#039;t forget to call your method from the <code>initSimpleApp()</code> method. This code goes into the <code>simpleInitApp()</code> method. But since we will likely add many keybindings, we extract these lines and wrap them in an auxiliary method, <code>initKeys()</code>. The <code>initKeys()</code> method is not part of the Input Controls interface ??? you can name it whatever you like. Just don&#039;t forget to call your method from the <code>initSimpleApp()</code> method.
</p> </p>
</div> </div>
<!-- EDIT3 SECTION "Defining Mappings and Triggers" [3679-5893] --> <!-- EDIT3 SECTION "Defining Mappings and Triggers" [3652-5835] -->
<h2><a>Implementing the Actions</a></h2> <h2><a>Implementing the Actions</a></h2>
<div> <div>
@ -268,7 +269,7 @@ It&#039;s okay to use only one of the two Listeners, and not implement the other
</p> </p>
</div> </div>
<!-- EDIT4 SECTION "Implementing the Actions" [5894-9012] --> <!-- EDIT4 SECTION "Implementing the Actions" [5836-8954] -->
<h2><a>Analog, Pressed, or Released?</a></h2> <h2><a>Analog, Pressed, or Released?</a></h2>
<div> <div>
@ -325,7 +326,7 @@ Mappings registered to the <strong>ActionListener</strong> are digital either-or
&#125;</pre> &#125;</pre>
</div> </div>
<!-- EDIT5 SECTION "Analog, Pressed, or Released?" [9013-11037] --> <!-- EDIT5 SECTION "Analog, Pressed, or Released?" [8955-10979] -->
<h2><a>Table of Triggers</a></h2> <h2><a>Table of Triggers</a></h2>
<div> <div>
@ -361,14 +362,14 @@ You can find the list of input constants in the files <code>src/core/com/jme3/in
KeyTrigger(KeyInput.KEY_LEFT), KeyTrigger(KeyInput.KEY_RIGHT) </td> KeyTrigger(KeyInput.KEY_LEFT), KeyTrigger(KeyInput.KEY_RIGHT) </td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT7 TABLE [11270-11866] --> <!-- EDIT7 TABLE [11212-11808] -->
<p> <p>
<strong>Tip:</strong> If you don&#039;t recall an input constant during development, you benefit from an IDE&#039;s code completion functionality: Place the caret after e.g. <code>KeyInput.|</code> and trigger code completion to select possible input identifiers. <strong>Tip:</strong> If you don&#039;t recall an input constant during development, you benefit from an IDE&#039;s code completion functionality: Place the caret after e.g. <code>KeyInput.|</code> and trigger code completion to select possible input identifiers.
</p> </p>
</div> </div>
<!-- EDIT6 SECTION "Table of Triggers" [11038-12100] --> <!-- EDIT6 SECTION "Table of Triggers" [10980-12042] -->
<h2><a>Exercises</a></h2> <h2><a>Exercises</a></h2>
<div> <div>
<ol> <ol>
@ -396,7 +397,7 @@ inputManager.addMapping&#40;&quot;Pause&quot;, new KeyTrigger&#40;usersPauseKey
</p> </p>
</div> </div>
<!-- EDIT8 SECTION "Exercises" [12101-12785] --> <!-- EDIT8 SECTION "Exercises" [12043-12727] -->
<h2><a>Conclusion</a></h2> <h2><a>Conclusion</a></h2>
<div> <div>
@ -418,5 +419,5 @@ Now you can already write a little interactive game! But wouldn&#039;t it be coo
</span></div> </span></div>
</div> </div>
<!-- EDIT9 SECTION "Conclusion" [12786-] --> <!-- EDIT9 SECTION "Conclusion" [12728-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_input_system?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_input_system?do=export_xhtmlbody">view online version</a></em></p>

@ -21,12 +21,12 @@ Now that you know how to load assets, such as 3D models, you want to implement s
import com.jme3.app.SimpleApplication; import com.jme3.app.SimpleApplication;
import com.jme3.material.Material; import com.jme3.material.Material;
import com.jme3.math.ColorRGBA; import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry; import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Box; import com.jme3.scene.shape.Box;
&nbsp; &nbsp;
<span>/** Sample 4 - how to trigger repeating actions from the main update loop. <span>/** Sample 4 - how to trigger repeating actions from the main event loop.
* In this example, we make the player character rotate. */</span> * In this example, you use the loop to make the player character
* rotate continuously. */</span>
public class HelloLoop extends SimpleApplication &#123; public class HelloLoop extends SimpleApplication &#123;
&nbsp; &nbsp;
public static void main&#40;String&#91;&#93; args&#41;&#123; public static void main&#40;String&#91;&#93; args&#41;&#123;
@ -38,8 +38,8 @@ public class HelloLoop extends SimpleApplication &#123;
&nbsp; &nbsp;
@Override @Override
public void simpleInitApp&#40;&#41; &#123; public void simpleInitApp&#40;&#41; &#123;
&nbsp; /** this blue box is our player character */
Box b = new Box&#40;Vector3f.ZERO, 1, 1, 1&#41;; Box b = new Box&#40;1, 1, 1&#41;;
player = new Geometry&#40;&quot;blue cube&quot;, b&#41;; player = new Geometry&#40;&quot;blue cube&quot;, b&#41;;
Material mat = new Material&#40;assetManager, Material mat = new Material&#40;assetManager,
&quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;; &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;;
@ -48,20 +48,21 @@ public class HelloLoop extends SimpleApplication &#123;
rootNode.attachChild&#40;player&#41;; rootNode.attachChild&#40;player&#41;;
&#125; &#125;
&nbsp; &nbsp;
/* This is the update loop */ /* Use the main event loop to trigger repeating actions. */
@Override @Override
public void simpleUpdate&#40;float tpf&#41; &#123; public void simpleUpdate&#40;float tpf&#41; &#123;
// make the player rotate // make the player rotate:
player.rotate&#40;0, 2*tpf, 0&#41;; player.rotate&#40;0, 2*tpf, 0&#41;;
&#125; &#125;
&#125;</pre> &#125;</pre>
<p> <p>
Build and run the file: You see a constantly rotating cube. Build and run the file: You see a constantly rotating cube.
</p> </p>
</div> </div>
<!-- EDIT2 SECTION "Code Sample" [405-1613] --> <!-- EDIT2 SECTION "Code Sample" [405-1682] -->
<h2><a>Understanding the Code</a></h2> <h2><a>Understanding the Code</a></h2>
<div> <div>
@ -83,7 +84,7 @@ Now have a closer look at the <code>simpleUpdate()</code> method ??? this is the
</ul> </ul>
</div> </div>
<!-- EDIT3 SECTION "Understanding the Code" [1614-2397] --> <!-- EDIT3 SECTION "Understanding the Code" [1683-2466] -->
<h2><a>Using the Update Loop</a></h2> <h2><a>Using the Update Loop</a></h2>
<div> <div>
@ -108,38 +109,39 @@ A rotating object is just a simple example. In the update loop, you typically ha
</ul> </ul>
</div> </div>
<!-- EDIT4 SECTION "Using the Update Loop" [2398-3232] --> <!-- EDIT4 SECTION "Using the Update Loop" [2467-3301] -->
<h2><a>Init - Update - Render</a></h2> <h2><a>Init - Update - Render</a></h2>
<div> <div>
<p> <p>
Note the contrast: Note the the three phases of every game:
</p> </p>
<ul> <ul>
<li><div> The <code>simpleInitApp()</code> method is executed only once, right at the beginning; </div> <li><div> <strong>Init:</strong> The <code>simpleInitApp()</code> method is executed only <em>once</em>, right at the beginning; </div>
</li> </li>
<li><div> The <code>simpleUpdate()</code> method runs repeatedly, during the game. </div> <li><div> <strong>Update:</strong> The <code>simpleUpdate()</code> method runs <em>repeatedly</em>, during the game. </div>
</li> </li>
<li><div> After every update, the jMonkeyEngine automatically redraws (<code>renders</code>) the screen for you!</div> <li><div> <strong>Render:</strong> After every update, the jMonkeyEngine <em>automatically</em> redraws (<code>renders</code>) the screen for you.</div>
</li> </li>
</ul> </ul>
<p> <p>
Since rendering is automatic, initialization and updating are the two most important concepts in a SimpleApplication for you right now. These methods are where you load and create game data (once), and (repeatedly) change their properties to update the game state: Since rendering is automatic, initialization and updating are the two most important concepts in a SimpleApplication-based game for you:
</p> </p>
<ul> <ul>
<li><div> <code>simpleInitApp()</code> is the application&#039;s &quot;first breath&quot;.</div> <li><div> The <code>simpleInitApp()</code> method is the application&#039;s &quot;first breath&quot;. <br/>
Here you load and create game data (once).</div>
</li> </li>
<li><div> <code>simpleUpdate()</code> is the application&#039;s heartbeat. <br/> <li><div> The <code>simpleUpdate()</code> method is the application&#039;s &quot;heartbeat&quot; (the time unit is called <code>ticks</code>). <br/>
The update time unit is called <code>ticks</code>.</div> Here you change their properties to update the game state (repeatedly).</div>
</li> </li>
</ul> </ul>
<p> <p>
<p><div>Everything in a game happens either during initialization or during the update loop. This means that these two methods grow very long over time. There are two strategies how experienced developers spread out their init and update code over several Java classes: <p><div>Everything in a game happens either during initialization, or during the update loop. This means that these two methods grow very long over time. Follwo these two strategies to spread out init and update code over several modular Java classes:
</p> </p>
<ul> <ul>
<li><div> Move code blocks from the simpleInitApp() method to <a href="/com/jme3/gde/docs/jme3/advanced/application_states.html">AppStates</a>.</div> <li><div> Move code blocks from the simpleInitApp() method to <a href="/com/jme3/gde/docs/jme3/advanced/application_states.html">AppStates</a>.</div>
@ -155,7 +157,7 @@ Keep this in mind for later when your application grows.
</p> </p>
</div> </div>
<!-- EDIT5 SECTION "Init - Update - Render" [3233-4502] --> <!-- EDIT5 SECTION "Init - Update - Render" [3302-4629] -->
<h2><a>Exercises</a></h2> <h2><a>Exercises</a></h2>
<div> <div>
@ -189,7 +191,7 @@ Look back at the <a href="/com/jme3/gde/docs/jme3/beginner/hello_node.html">Hell
</p> </p>
</div> </div>
<!-- EDIT6 SECTION "Exercises" [4503-5274] --> <!-- EDIT6 SECTION "Exercises" [4630-5401] -->
<h2><a>Conclusion</a></h2> <h2><a>Conclusion</a></h2>
<div> <div>
@ -221,5 +223,5 @@ See also:
</span></div> </span></div>
</div> </div>
<!-- EDIT7 SECTION "Conclusion" [5275-] --> <!-- EDIT7 SECTION "Conclusion" [5402-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_main_event_loop?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_main_event_loop?do=export_xhtmlbody">view online version</a></em></p>

@ -14,13 +14,13 @@ The term Material includes everything that influences what the surface of a 3D m
</p> </p>
<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. <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> </div></p>
</p> </p>
</div> </div>
<!-- EDIT1 SECTION "jMonkeyEngine 3 Tutorial (6) - Hello Materials" [1-713] --> <!-- EDIT1 SECTION "jMonkeyEngine 3 Tutorial (6) - Hello Materials" [1-715] -->
<h2><a>Sample Code</a></h2> <h2><a>Sample Code</a></h2>
<div> <div>
<pre>package jme3test.helloworld; <pre>package jme3test.helloworld;
@ -31,18 +31,17 @@ import com.jme3.material.Material;
import com.jme3.material.RenderState.BlendMode; import com.jme3.material.RenderState.BlendMode;
import com.jme3.math.ColorRGBA; import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f; import com.jme3.math.Vector3f;
import com.jme3.renderer.queue.RenderQueue.Bucket;
import com.jme3.scene.Geometry; import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Box; import com.jme3.scene.shape.Box;
import com.jme3.scene.shape.Sphere; import com.jme3.scene.shape.Sphere;
import com.jme3.texture.Texture; import com.jme3.texture.Texture;
import com.jme3.util.TangentBinormalGenerator; import com.jme3.util.TangentBinormalGenerator;
import com.jme3.renderer.queue.RenderQueue.Bucket;
&nbsp; &nbsp;
<span>/** Sample 6 - how to give an object's surface a material and texture. <span>/** Sample 6 - how to give an object's surface a material and texture.
* How to make objects transparent, or let colors &quot;leak&quot; through partially * How to make objects transparent. How to make bumpy and shiny surfaces. */</span>
* transparent textures. How to make bumpy and shiny surfaces. */</span>
&nbsp;
public class HelloMaterial extends SimpleApplication &#123; public class HelloMaterial extends SimpleApplication &#123;
&nbsp;
public static void main&#40;String&#91;&#93; args&#41; &#123; public static void main&#40;String&#91;&#93; args&#41; &#123;
HelloMaterial app = new HelloMaterial&#40;&#41;; HelloMaterial app = new HelloMaterial&#40;&#41;;
app.start&#40;&#41;; app.start&#40;&#41;;
@ -50,58 +49,57 @@ public class HelloMaterial extends SimpleApplication &#123;
&nbsp; &nbsp;
@Override @Override
public void simpleInitApp&#40;&#41; &#123; public void simpleInitApp&#40;&#41; &#123;
&nbsp;
/** A simple textured cube -- in good MIP map quality. */ /** A simple textured cube -- in good MIP map quality. */
Box boxshape1 = new Box&#40;new Vector3f&#40;-3f,1.1f,0f&#41;, 1f,1f,1f&#41;; Box cube1Mesh = new Box&#40; 1f,1f,1f&#41;;
Geometry cube = new Geometry&#40;&quot;My Textured Box&quot;, boxshape1&#41;; Geometry cube1Geo = new Geometry&#40;&quot;My Textured Box&quot;, cube1Mesh&#41;;
Material mat_stl = new Material&#40;assetManager, &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;; cube1Geo.setLocalTranslation&#40;new Vector3f&#40;-3f,1.1f,0f&#41;&#41;;
Texture tex_ml = assetManager.loadTexture&#40;&quot;Interface/Logo/Monkey.jpg&quot;&#41;; Material cube1Mat = new Material&#40;assetManager,
mat_stl.setTexture&#40;&quot;ColorMap&quot;, tex_ml&#41;; &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;;
cube.setMaterial&#40;mat_stl&#41;; Texture cube1Tex = assetManager.loadTexture&#40;
rootNode.attachChild&#40;cube&#41;; &quot;Interface/Logo/Monkey.jpg&quot;&#41;;
cube1Mat.setTexture&#40;&quot;ColorMap&quot;, cube1Tex&#41;;
cube1Geo.setMaterial&#40;cube1Mat&#41;;
rootNode.attachChild&#40;cube1Geo&#41;;
&nbsp; &nbsp;
/** A translucent/transparent texture, similar to a window frame. */ /** A translucent/transparent texture, similar to a window frame. */
Box boxshape3 = new Box&#40;new Vector3f&#40;0f,0f,0f&#41;, 1f,1f,0.01f&#41;; Box cube2Mesh = new Box&#40; 1f,1f,0.01f&#41;;
Geometry window_frame = new Geometry&#40;&quot;window frame&quot;, boxshape3&#41;; Geometry cube2Geo = new Geometry&#40;&quot;window frame&quot;, cube2Mesh&#41;;
Material mat_tt = new Material&#40;assetManager, &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;; Material cube2Mat = new Material&#40;assetManager,
mat_tt.setTexture&#40;&quot;ColorMap&quot;, assetManager.loadTexture&#40;&quot;Textures/ColoredTex/Monkey.png&quot;&#41;&#41;; &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;;
mat_tt.getAdditionalRenderState&#40;&#41;.setBlendMode&#40;BlendMode.Alpha&#41;; cube2Mat.setTexture&#40;&quot;ColorMap&quot;,
window_frame.setMaterial&#40;mat_tt&#41;; assetManager.loadTexture&#40;&quot;Textures/ColoredTex/Monkey.png&quot;&#41;&#41;;
&nbsp; cube2Mat.getAdditionalRenderState&#40;&#41;.setBlendMode&#40;BlendMode.Alpha&#41;;
/** Objects with transparency need to be in the render bucket for transparent objects: */ cube2Geo.setQueueBucket&#40;Bucket.Transparent&#41;;
window_frame.setQueueBucket&#40;Bucket.Transparent&#41;; cube2Geo.setMaterial&#40;cube2Mat&#41;;
rootNode.attachChild&#40;window_frame&#41;; rootNode.attachChild&#40;cube2Geo&#41;;
&nbsp;
/** A cube with base color &quot;leaking&quot; through a partially transparent texture */
Box boxshape4 = new Box&#40;new Vector3f&#40;3f,-1f,0f&#41;, 1f,1f,1f&#41;;
Geometry cube_leak = new Geometry&#40;&quot;Leak-through color cube&quot;, boxshape4&#41;;
Material mat_tl = new Material&#40;assetManager, &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;;
mat_tl.setTexture&#40;&quot;ColorMap&quot;, assetManager.loadTexture&#40;&quot;Textures/ColoredTex/Monkey.png&quot;&#41;&#41;;
mat_tl.setColor&#40;&quot;Color&quot;, new ColorRGBA&#40;1f,0f,1f, 1f&#41;&#41;; // purple
cube_leak.setMaterial&#40;mat_tl&#41;;
rootNode.attachChild&#40;cube_leak&#41;;
&nbsp; &nbsp;
/** A bumpy rock with a shiny light effect */ /** A bumpy rock with a shiny light effect.*/
Sphere rock = new Sphere&#40;32,32, 2f&#41;; Sphere sphereMesh = new Sphere&#40;32,32, 2f&#41;;
Geometry shiny_rock = new Geometry&#40;&quot;Shiny rock&quot;, rock&#41;; Geometry sphereGeo = new Geometry&#40;&quot;Shiny rock&quot;, sphereMesh&#41;;
rock.setTextureMode&#40;Sphere.TextureMode.Projected&#41;; // better quality on spheres sphereMesh.setTextureMode&#40;Sphere.TextureMode.Projected&#41;; // better quality on spheres
TangentBinormalGenerator.generate&#40;rock&#41;; // for lighting effect TangentBinormalGenerator.generate&#40;sphereMesh&#41;; // for lighting effect
Material mat_lit = new Material&#40;assetManager, &quot;Common/MatDefs/Light/Lighting.j3md&quot;&#41;; Material sphereMat = new Material&#40;assetManager,
mat_lit.setTexture&#40;&quot;DiffuseMap&quot;, assetManager.loadTexture&#40;&quot;Textures/Terrain/Pond/Pond.jpg&quot;&#41;&#41;; &quot;Common/MatDefs/Light/Lighting.j3md&quot;&#41;;
mat_lit.setTexture&#40;&quot;NormalMap&quot;, assetManager.loadTexture&#40;&quot;Textures/Terrain/Pond/Pond_normal.png&quot;&#41;&#41;; sphereMat.setTexture&#40;&quot;DiffuseMap&quot;,
mat_lit.setBoolean&#40;&quot;UseMaterialColors&quot;,true&#41;; assetManager.loadTexture&#40;&quot;Textures/Terrain/Pond/Pond.jpg&quot;&#41;&#41;;
mat_lit.setColor&#40;&quot;Specular&quot;,ColorRGBA.White&#41;; sphereMat.setTexture&#40;&quot;NormalMap&quot;,
mat_lit.setColor&#40;&quot;Diffuse&quot;,ColorRGBA.White&#41;; assetManager.loadTexture&#40;&quot;Textures/Terrain/Pond/Pond_normal.png&quot;&#41;&#41;;
mat_lit.setFloat&#40;&quot;Shininess&quot;, 5f&#41;; // [1,128] sphereMat.setBoolean&#40;&quot;UseMaterialColors&quot;,true&#41;;
shiny_rock.setMaterial&#40;mat_lit&#41;; sphereMat.setColor&#40;&quot;Diffuse&quot;,ColorRGBA.White&#41;;
shiny_rock.setLocalTranslation&#40;0,2,-2&#41;; // Move it a bit sphereMat.setColor&#40;&quot;Specular&quot;,ColorRGBA.White&#41;;
shiny_rock.rotate&#40;1.6f, 0, 0&#41;; // Rotate it a bit sphereMat.setFloat&#40;&quot;Shininess&quot;, 64f&#41;; // [0,128]
rootNode.attachChild&#40;shiny_rock&#41;; sphereGeo.setMaterial&#40;sphereMat&#41;;
sphereGeo.setLocalTranslation&#40;0,2,-2&#41;; // Move it a bit
sphereGeo.rotate&#40;1.6f, 0, 0&#41;; // Rotate it a bit
rootNode.attachChild&#40;sphereGeo&#41;;
&nbsp; &nbsp;
/** Must add a light to make the lit object visible! */ /** Must add a light to make the lit object visible! */
DirectionalLight sun = new DirectionalLight&#40;&#41;; DirectionalLight sun = new DirectionalLight&#40;&#41;;
sun.setDirection&#40;new Vector3f&#40;1,0,-2&#41;.normalizeLocal&#40;&#41;&#41;; sun.setDirection&#40;new Vector3f&#40;1,0,-2&#41;.normalizeLocal&#40;&#41;&#41;;
sun.setColor&#40;ColorRGBA.White&#41;; sun.setColor&#40;ColorRGBA.White&#41;;
rootNode.addLight&#40;sun&#41;; rootNode.addLight&#40;sun&#41;;
&nbsp;
&#125; &#125;
&#125;</pre> &#125;</pre>
@ -111,9 +109,7 @@ You should see
<ul> <ul>
<li><div> Left ??? A cube with a brown monkey texture.</div> <li><div> Left ??? A cube with a brown monkey texture.</div>
</li> </li>
<li><div> Middle ??? A translucent monkey picture in front of a shiny rock.</div> <li><div> Right ??? A translucent monkey picture in front of a shiny bumpy rock.</div>
</li>
<li><div> Right ??? A cube with a purple monkey texture.</div>
</li> </li>
</ul> </ul>
@ -122,7 +118,7 @@ Move around with the WASD keys to have a closer look at the translucency, and th
</p> </p>
</div> </div>
<!-- EDIT2 SECTION "Sample Code" [714-4923] --> <!-- EDIT2 SECTION "Sample Code" [716-4277] -->
<h2><a>Simple Unshaded Texture</a></h2> <h2><a>Simple Unshaded Texture</a></h2>
<div> <div>
@ -130,80 +126,89 @@ Move around with the WASD keys to have a closer look at the translucency, and th
Typically you want to give objects in your scene textures: It can be rock, grass, brick, wood, water, metal, paper??? A texture is a normal image file in <acronym title="Joint Photographics Experts Group">JPG</acronym> or <acronym title="Portable Network Graphics">PNG</acronym> format. In this example, you create a box with a simple unshaded Monkey texture as material. Typically you want to give objects in your scene textures: It can be rock, grass, brick, wood, water, metal, paper??? A texture is a normal image file in <acronym title="Joint Photographics Experts Group">JPG</acronym> or <acronym title="Portable Network Graphics">PNG</acronym> format. In this example, you create a box with a simple unshaded Monkey texture as material.
</p> </p>
<pre> /** A simple textured cube. */ <pre> /** A simple textured cube -- in good MIP map quality. */
Box boxshape1 = new Box&#40;new Vector3f&#40;-3f,1.1f,0f&#41;, 1f,1f,1f&#41;; Box cube1Mesh = new Box&#40; 1f,1f,1f&#41;;
Geometry cube = new Geometry&#40;&quot;My Textured Box&quot;, boxshape1&#41;; Geometry cube1Geo = new Geometry&#40;&quot;My Textured Box&quot;, cube1Mesh&#41;;
Material mat_stl = new Material&#40;assetManager, cube1Geo.setLocalTranslation&#40;new Vector3f&#40;-3f,1.1f,0f&#41;&#41;;
Material cube1Mat = new Material&#40;assetManager,
&quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;; &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;;
Texture tex_ml = assetManager.loadTexture&#40;&quot;Interface/Logo/Monkey.jpg&quot;&#41;; Texture cube1Tex = assetManager.loadTexture&#40;
mat_stl.setTexture&#40;&quot;ColorMap&quot;, tex_ml&#41;; &quot;Interface/Logo/Monkey.jpg&quot;&#41;;
cube.setMaterial&#40;mat_stl&#41;; cube1Mat.setTexture&#40;&quot;ColorMap&quot;, cube1Tex&#41;;
rootNode.attachChild&#40;cube&#41;;</pre> cube1Geo.setMaterial&#40;cube1Mat&#41;;
rootNode.attachChild&#40;cube1Geo&#41;;</pre>
<p> <p>
Here is what we did: Here is what we did: to create a textured box:
</p> </p>
<ol> <ol>
<li><div> Create a Geometry from a Box mesh. Let&#039;s call it <code>cube</code>.</div> <li><div> Create a Geometry <code>cube1Geo</code> from a Box mesh <code>cube1Mesh</code>. </div>
</li>
<li><div> Create a Material <code>cube1Mat</code> based on jME3&#039;s default <code>Unshaded.j3md</code> material definition.</div>
</li> </li>
<li><div> Create a Material based on jME3&#039;s default <code>Unshaded.j3md</code> material definition.</div> <li><div> Create a texture <code>cube1Tex</code> from the <code>Monkey.jpg</code> file in the <code>assets/Interface/Logo/</code> directory of the project. </div>
</li> </li>
<li><div> Create a texture from the <code>Monkey.jpg</code> file and load it into the material. <br/> <li><div> Load the texture <code>cube1Tex</code> into the <code>ColorMap</code> layer of the material <code>cube1Mat</code>. </div>
The ColorMap is the typical material layer where textures go.</div>
</li> </li>
<li><div> Apply the material to the cube, and attach the cube to the rootnode.</div> <li><div> Apply the material to the cube, and attach the cube to the rootnode.</div>
</li> </li>
</ol> </ol>
</div> </div>
<!-- EDIT3 SECTION "Simple Unshaded Texture" [4924-6074] --> <!-- EDIT3 SECTION "Simple Unshaded Texture" [4278-5632] -->
<h2><a>Transparent Unshaded Texture</a></h2> <h2><a>Transparent Unshaded Texture</a></h2>
<div> <div>
<p> <p>
<code>Monkey.png</code> is the same texture as <code>Monkey.jpg</code>, but with an added alpha channel. The alpha channel allows you to specify which areas of the texture you want to be opaque or transparent: Black areas remain opaque, gray areas become translucent, and white areas become transparent. <code>Monkey.png</code> is the same texture as <code>Monkey.jpg</code>, but with an added alpha channel. The alpha channel allows you to specify which areas of the texture you want to be opaque or transparent: Black areas of the alpha channel remain opaque, gray areas become translucent, and white areas become transparent.
</p> </p>
<p> <p>
For a partially translucent/transparent texture, you need: For a partially translucent/transparent texture, you need:
</p> </p>
<ul> <ul>
<li><div> A texture with alpha channel</div> <li><div> A Texture with alpha channel</div>
</li> </li>
<li><div> A Texture blend mode of <code>BlendMode.Alpha</code></div> <li><div> A Texture with blend mode of <code>BlendMode.Alpha</code></div>
</li> </li>
<li><div> A geometry in the <code>Bucket.Transparent</code> render bucket. This bucket ensures that the translucent object is drawn on top of objects behind it, and they show up correctly under the translucent parts. (For non-translucent objects the drawing order is not so important, because the z-buffer keeps track of whether a pixel is behind something else or not, and the color of a pixel doesn&#039;t depend on the pixels under it, this is why opaque Geometries can be drawn in any order.)</div> <li><div> A Geometry in the <code>Bucket.Transparent</code> render bucket. <br/>
This bucket ensures that the transparent object is drawn on top of objects behind it, and they show up correctly under the transparent parts. </div>
</li> </li>
</ul> </ul>
<pre> /** A translucent/transparent texture. */ <pre> /** A translucent/transparent texture, similar to a window frame. */
Box boxshape3 = new Box&#40;new Vector3f&#40;0f,0f,0f&#41;, 1f,1f,0.01f&#41;; Box cube2Mesh = new Box&#40; 1f,1f,0.01f&#41;;
Geometry seethrough = new Geometry&#40;&quot;see-through box&quot;, boxshape3&#41;; Geometry cube2Geo = new Geometry&#40;&quot;window frame&quot;, cube2Mesh&#41;;
Material mat_tt = new Material&#40;assetManager, &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;; Material cube2Mat = new Material&#40;assetManager,
mat_tt.setTexture&#40;&quot;ColorMap&quot;, assetManager.loadTexture&#40;&quot;Textures/ColoredTex/Monkey.png&quot;&#41;&#41;; &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;;
mat_tt.getAdditionalRenderState&#40;&#41;.setBlendMode&#40;BlendMode.Alpha&#41;; // activate transparency cube2Mat.setTexture&#40;&quot;ColorMap&quot;,
seethrough.setMaterial&#40;mat_tt&#41;; assetManager.loadTexture&#40;&quot;Textures/ColoredTex/Monkey.png&quot;&#41;&#41;;
seethrough.setQueueBucket&#40;Bucket.Transparent&#41;; cube2Mat.getAdditionalRenderState&#40;&#41;.setBlendMode&#40;BlendMode.Alpha&#41;; // !
rootNode.attachChild&#40;seethrough&#41;;</pre> cube2Geo.setQueueBucket&#40;Bucket.Transparent&#41;; // !
cube2Geo.setMaterial&#40;cube2Mat&#41;;
rootNode.attachChild&#40;cube2Geo&#41;;</pre>
<p>
For non-transparent objects, the drawing order is not so important, because the z-buffer already keeps track of whether a pixel is behind something else or not, and the color of an opaque pixel doesn&#039;t depend on the pixels under it, this is why opaque Geometries can be drawn in any order.
</p>
<p> <p>
What you did is the same as before, with only one added step for the transparency. What you did for the transparent texture is the same as before, with only one added step for the transparency.
</p> </p>
<ol> <ol>
<li><div> Create a Geometry from a mesh. This Geometry is flat upright box.</div> <li><div> Create a Geometry <code>cube2Geo</code> from a Box mesh <code>cube2Mesh</code>. This Box Geometry is flat upright box (because z=0.01f).</div>
</li> </li>
<li><div> Create a Material based on jME3&#039;s default <code>Unshaded.j3md</code> material definition.</div> <li><div> Create a Material <code>cube2Mat</code> based on jME3&#039;s default <code>Unshaded.j3md</code> material definition.</div>
</li> </li>
<li><div> Create a texture from the <code>Monkey.png</code> file and load it into the material. <br/> <li><div> Create a texture <code>cube2Tex</code> from the <code>Monkey.png</code> file in the <code>assets/Textures/ColoredTex/</code> directory of the project. This <acronym title="Portable Network Graphics">PNG</acronym> file must have an alpha layer.</div>
The ColorMap is the material layer where textures go. This <acronym title="Portable Network Graphics">PNG</acronym> file must have an alpha layer.</div>
</li> </li>
<li><div> Activate transparency in the material by setting the blend mode to Alpha!</div> <li><div> <strong>Activate transparency in the material by setting the blend mode to Alpha.</strong></div>
</li> </li>
<li><div> Apply the material to the Geometry.</div> <li><div> <strong>Set the QueueBucket of the Geometry to <code>Bucket.Transparent</code>.</strong></div>
</li> </li>
<li><div> Set the QueueBucket of the Geometry to <code>Bucket.Transparent</code>.</div> <li><div> Load the texture <code>cube2Tex</code> into the <code>ColorMap</code> layer of the material <code>cube2Mat</code>.</div>
</li> </li>
<li><div> Attach the cube to the rootnode.</div> <li><div> Apply the material to the cube, and attach the cube to the rootnode.</div>
</li> </li>
</ol> </ol>
@ -213,59 +218,62 @@ The ColorMap is the material layer where textures go. This <acronym title="Porta
</p> </p>
</div> </div>
<!-- EDIT4 SECTION "Transparent Unshaded Texture" [6075-8376] --> <!-- EDIT4 SECTION "Transparent Unshaded Texture" [5633-8184] -->
<h2><a>Shininess and Bumpiness</a></h2> <h2><a>Shininess and Bumpiness</a></h2>
<div> <div>
<p> <p>
But textures are not all. Have a close look at the shiny sphere ??? you cannot get such a nice bumpy material with just a texture. JME3 also supports so-called Phong-illuminated materials: But textures are not all. Have a close look at the shiny sphere ??? you cannot get such a nice bumpy material with just a plain texture. You see that JME3 also supports so-called Phong-illuminated materials:
</p> </p>
<p> <p>
In a lit material, the standard texture layer is refered to as <em>Diffuse Map</em>, any material can use this layer. A lit material can additionally have lighting effects such as <em>Shininess</em> used together with the <em>Specular Map</em> layer, and even a realistically bumpy or cracked surface with help of the <em>Normal Map</em> layer. In a lit material, the standard texture layer is refered to as <em>DiffuseMap</em>, any material can use this layer. A lit material can additionally have lighting effects such as <em>Shininess</em> used together with the <em>SpecularMap</em> layer and <em>Specular</em> color. And you can even get a realistically bumpy or cracked surface with help of the <em>NormalMap</em> layer.
</p> </p>
<p> <p>
Let&#039;s have a look at the part of the code example where you create the shiny bumpy rock. Let&#039;s have a look at the part of the code example where you create the shiny bumpy rock.
</p> </p>
<ol> <ol>
<li><div> Create a Geometry from a Sphere shape. Note that this shape is a normal smooth sphere mesh. <pre> Sphere rock = new Sphere&#40;32,32, 2f&#41;; <li><div> Create a Geometry from a Sphere shape. Note that this shape is a normal smooth sphere mesh. <pre> Sphere sphereMesh = new Sphere&#40;32,32, 2f&#41;;
Geometry shiny_rock = new Geometry&#40;&quot;Shiny rock&quot;, rock&#41;;</pre> Geometry sphereGeo = new Geometry&#40;&quot;Shiny rock&quot;, sphereMesh&#41;;</pre>
</div> </div>
<ol> <ol>
<li><div> (Only for Spheres) Change the sphere&#039;s TextureMode to make the square texture project better onto the sphere.<pre> rock.setTextureMode&#40;Sphere.TextureMode.Projected&#41;; </pre> <li><div> (Only for Spheres) Change the sphere&#039;s TextureMode to make the square texture project better onto the sphere.<pre> sphereMesh.setTextureMode&#40;Sphere.TextureMode.Projected&#41;;</pre>
</div> </div>
</li> </li>
<li><div> You generate TangentBinormals for the sphere mesh so you can use the NormalMap layer of the texture.<pre> TangentBinormalGenerator.generate&#40;rock&#41;;</pre> <li><div> You must generate TangentBinormals for the mesh so you can use the NormalMap layer of the texture.<pre> TangentBinormalGenerator.generate&#40;sphereMesh&#41;;</pre>
</div> </div>
</li> </li>
</ol> </ol>
</li> </li>
<li><div> Create a material based on the <code>Lighting.j3md</code> default material.<pre> Material mat_lit = new Material&#40;assetManager, <li><div> Create a material based on the <code>Lighting.j3md</code> default material.<pre> Material sphereMat = new Material&#40;assetManager,
&quot;Common/MatDefs/Light/Lighting.j3md&quot;&#41;;</pre> &quot;Common/MatDefs/Light/Lighting.j3md&quot;&#41;;</pre>
</div> </div>
<ol> <ol>
<li><div> Set a standard rocky texture in the <code>DiffuseMap</code> layer. <br/> <li><div> Set a standard rocky texture in the <code>DiffuseMap</code> layer. <br/>
<img src="/wiki/lib/exe/fetch.php"><pre> mat_lit.setTexture&#40;&quot;DiffuseMap&quot;, assetManager.loadTexture&#40; <img src="/wiki/lib/exe/fetch.php"><pre> sphereMat.setTexture&#40;&quot;DiffuseMap&quot;,
&quot;Textures/Terrain/Pond/Pond.jpg&quot;&#41;&#41;;</pre> assetManager.loadTexture&#40;&quot;Textures/Terrain/Pond/Pond.jpg&quot;&#41;&#41;;</pre>
</div> </div>
</li> </li>
<li><div> Set the <code>NormalMap</code> layer that contains the bumpiness. The NormalMap was generated for this particular DiffuseMap with a special tool (e.g. Blender). <img src="/wiki/lib/exe/fetch.php"> <pre> mat_lit.setTexture&#40;&quot;NormalMap&quot;, assetManager.loadTexture&#40; <li><div> Set the <code>NormalMap</code> layer that contains the bumpiness. The NormalMap was generated for this particular DiffuseMap with a special tool (e.g. Blender). <img src="/wiki/lib/exe/fetch.php"> <pre> sphereMat.setTexture&#40;&quot;NormalMap&quot;,
&quot;Textures/Terrain/Pond/Pond_normal.png&quot;&#41;&#41;;</pre> assetManager.loadTexture&#40;&quot;Textures/Terrain/Pond/Pond_normal.png&quot;&#41;&#41;;</pre>
</div> </div>
</li> </li>
<li><div> Set the Material&#039;s Shininess to a value between 1 and 128. For a rock, a low fuzzy shininess is appropriate. <pre> mat_lit.setFloat&#40;&quot;Shininess&quot;, 5f&#41;; // [1,128]</pre> <li><div> Set the Material&#039;s Shininess to a value between 1 and 128. For a rock, a low fuzzy shininess is appropriate. Use material colors to define the shiny Specular color. <pre> sphereMat.setBoolean&#40;&quot;UseMaterialColors&quot;,true&#41;;
sphereMat.setColor&#40;&quot;Diffuse&quot;,ColorRGBA.White&#41;; // minimum material color
sphereMat.setColor&#40;&quot;Specular&quot;,ColorRGBA.White&#41;; // for shininess
sphereMat.setFloat&#40;&quot;Shininess&quot;, 64f&#41;; // [1,128] for shininess</pre>
</div> </div>
</li> </li>
</ol> </ol>
</li> </li>
<li><div> Assign your newly created material to the Geometry.<pre> shiny_rock.setMaterial&#40;mat_lit&#41;;</pre> <li><div> Assign your newly created material to the Geometry.<pre> sphereGeo.setMaterial&#40;sphereMat&#41;;</pre>
</div> </div>
</li> </li>
<li><div> Let&#039;s move and rotate the geometry a bit to position it better. <pre> shiny_rock.setLocalTranslation&#40;0,2,-2&#41;; // Move it a bit <li><div> Let&#039;s move and rotate the geometry a bit to position it better. <pre> sphereGeo.setLocalTranslation&#40;0,2,-2&#41;; // Move it a bit
shiny_rock.rotate&#40;1.6f, 0, 0&#41;; // Rotate it a bit sphereGeo.rotate&#40;1.6f, 0, 0&#41;; // Rotate it a bit
rootNode.attachChild&#40;shiny_rock&#41;;</pre> rootNode.attachChild&#40;sphereGeo&#41;;</pre>
</div> </div>
</li> </li>
</ol> </ol>
@ -280,7 +288,7 @@ Remember that any Lighting.j3md-based material requires a light source, as shown
</p> </p>
</div> </div>
<!-- EDIT5 SECTION "Shininess and Bumpiness" [8377-11260] --> <!-- EDIT5 SECTION "Shininess and Bumpiness" [8185-11426] -->
<h2><a>Default Material Definitions</a></h2> <h2><a>Default Material Definitions</a></h2>
<div> <div>
@ -305,59 +313,70 @@ DiffuseMap, NormalMap, SpecularMap : Texture2D <br/>
Shininess : Float </td> Shininess : Float </td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT7 TABLE [11400-11870] --> <!-- EDIT7 TABLE [11566-12036] -->
<p> <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. 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.
</p> </p>
</div> </div>
<!-- EDIT6 SECTION "Default Material Definitions" [11261-12027] --> <!-- EDIT6 SECTION "Default Material Definitions" [11427-12193] -->
<h2><a>Exercises</a></h2> <h2><a>Exercises</a></h2>
<div> <div>
</div> </div>
<!-- EDIT8 SECTION "Exercises" [12028-12050] --> <!-- EDIT8 SECTION "Exercises" [12194-12216] -->
<h3><a>Exercise 1: Custom .j3m Material</a></h3> <h3><a>Exercise 1: Custom .j3m Material</a></h3>
<div> <div>
<p> <p>
Look at the purple leak-through sample above again. It takes four lines to create and set the Material. Look at the shiny rocky sphere above again. It takes several lines to create and set the Material.
</p> </p>
<ul> <ul>
<li><div> Note how it loads the <code>Unshaded.j3md</code> Material definition.</div> <li><div> Note how it loads the <code>Lighting.j3md</code> Material definition.</div>
</li>
<li><div> Note how it sets the <code>DiffuseMap</code> and <code>NormalMap</code> to a texture path.</div>
</li> </li>
<li><div> Note how it sets the <code>Color</code> parameter to purple (<code>new ColorRGBA(1f,0f,1f,1f)</code>).</div> <li><div> Note how it activates <code>UseMaterialColors</code> and sets <code>Specular</code> and <code>Diffuse</code> to 4 float values (RGBA color).</div>
</li> </li>
<li><div> Note how it sets the <code>ColorMap</code> to a texture path.</div> <li><div> Note how it sets <code>Shininess</code> to 64.</div>
</li> </li>
</ul> </ul>
<p> <p>
If you want to use one custom material for several models, you can store it in a .j3m file, and save a few lines of code every time. If you want to use one custom material for several models, you can store it in a .j3m file, and save a few lines of code every time.
</p>
<p>
You create a j3m file as follows: You create a j3m file as follows:
</p> </p>
<ol> <ol>
<li><div> Create a file <code>assets/Materials/LeakThrough.j3m</code> in your project directory, with the following content:<pre>Material Leak Through : Common/MatDefs/Misc/Unshaded.j3md { <li><div> Create a plain text file <code>assets/Materials/MyCustomMaterial.j3m</code> in your project directory, with the following content:<pre>Material My shiny custom material : Common/MatDefs/Light/Lighting.j3md {
MaterialParameters { MaterialParameters {
Color : 1 0 1 1 DiffuseMap : Textures/Terrain/Pond/Pond.jpg
ColorMap : Flip Textures/ColoredTex/Monkey.png NormalMap : Textures/Terrain/Pond/Pond_normal.png
UseMaterialColors : true
Specular : 1.0 1.0 1.0 1.0
Diffuse : 1.0 1.0 1.0 1.0
Shininess : 64.0
} }
}</pre> }</pre>
</div> </div>
<ul> <ul>
<li><div> Note that <code>Material</code> is a fixed keyword.</div> <li><div> Note that <code>Material</code> is a fixed keyword.</div>
</li> </li>
<li><div> Note that <code>Leak Through</code> is a String that you can choose to name the material.</div> <li><div> Note that <code>My shiny custom material</code> is a String that you can choose to describe the material.</div>
</li> </li>
<li><div> Note how the code sets the same three properties, Color, ColorMap, and Unshaded.j3md.</div> <li><div> Note how the code sets all the same properties as before! </div>
</li> </li>
</ul> </ul>
</li> </li>
<li><div> In the code sample, comment out the three lines with <code>mat_tl</code> in them.</div> <li><div> In the code sample, comment out the eight lines that have <code>sphereMat</code> in them.</div>
</li> </li>
<li><div> Below them, add the following line: <pre>cube_leak.setMaterial&#40;&#40;Material&#41; assetManager.loadMaterial&#40; &quot;Materials/LeakThrough.j3m&quot;&#41;&#41;;</pre> <li><div> Below this line, add the following line: <pre>sphereGeo.setMaterial&#40;&#40;Material&#41; assetManager.loadMaterial&#40;
&quot;Materials/MyCustomMaterial.j3m&quot;&#41;&#41;;</pre>
</div> </div>
</li> </li>
<li><div> Run the app. The result is the same.</div> <li><div> Run the app. The result is the same.</div>
@ -366,11 +385,11 @@ You create a j3m file as follows:
<p> <p>
Using this new custom material <code>LeakThrough.j3m</code> only takes one line. You have replaced the three lines of an on-the-fly material definition with one line that loads a custom material from a file. This method is very handy if you use the same material often. Using this new custom material <code>MyCustomMaterial.j3m</code> only takes one line. You have replaced the eight lines of an on-the-fly material definition with one line that loads a custom material from a file. Using .j3m files is very handy if you use the same material often.
</p> </p>
</div> </div>
<!-- EDIT9 SECTION "Exercise 1: Custom .j3m Material" [12051-13637] --> <!-- EDIT9 SECTION "Exercise 1: Custom .j3m Material" [12217-14101] -->
<h3><a>Exercise 2: Bumpiness and Shininess</a></h3> <h3><a>Exercise 2: Bumpiness and Shininess</a></h3>
<div> <div>
@ -400,7 +419,7 @@ Go back to the bumpy rock sample above:
</ol> </ol>
</div> </div>
<!-- EDIT10 SECTION "Exercise 2: Bumpiness and Shininess" [13638-14065] --> <!-- EDIT10 SECTION "Exercise 2: Bumpiness and Shininess" [14102-14529] -->
<h2><a>Conclusion</a></h2> <h2><a>Conclusion</a></h2>
<div> <div>
@ -450,5 +469,5 @@ See also
</span></div> </span></div>
</div> </div>
<!-- EDIT11 SECTION "Conclusion" [14066-] --> <!-- EDIT11 SECTION "Conclusion" [14530-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_material?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_material?do=export_xhtmlbody">view online version</a></em></p>

@ -44,16 +44,15 @@ You will learn that the scene graph represents the 3D world, and why the rootNod
&nbsp; &nbsp;
import com.jme3.app.SimpleApplication; import com.jme3.app.SimpleApplication;
import com.jme3.material.Material; import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f; import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry; import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Box;
import com.jme3.math.ColorRGBA;
import com.jme3.scene.Node; import com.jme3.scene.Node;
import com.jme3.scene.shape.Box;
&nbsp; &nbsp;
<span>/** Sample 2 - How to use nodes as handles to manipulate objects in the scene. <span>/** Sample 2 - How to use nodes as handles to manipulate objects in the scene.
* You can rotate, translate, and scale objects by manipulating their parent nodes. * You can rotate, translate, and scale objects by manipulating their parent nodes.
* The Root Node is special: Only what is attached to the Root Node appears in the scene. */</span> * The Root Node is special: Only what is attached to the Root Node appears in the scene. */</span>
&nbsp;
public class HelloNode extends SimpleApplication &#123; public class HelloNode extends SimpleApplication &#123;
&nbsp; &nbsp;
public static void main&#40;String&#91;&#93; args&#41;&#123; public static void main&#40;String&#91;&#93; args&#41;&#123;
@ -65,28 +64,28 @@ public class HelloNode extends SimpleApplication &#123;
public void simpleInitApp&#40;&#41; &#123; public void simpleInitApp&#40;&#41; &#123;
&nbsp; &nbsp;
/** create a blue box at coordinates (1,-1,1) */ /** create a blue box at coordinates (1,-1,1) */
Box box1 = new Box&#40; Vector3f.ZERO, 1,1,1&#41;; Box box1 = new Box&#40;1,1,1&#41;;
Geometry blue = new Geometry&#40;&quot;Box&quot;, box1&#41;; Geometry blue = new Geometry&#40;&quot;Box&quot;, box1&#41;;
blue.setLocalTranslation&#40;new Vector3f&#40;1,-1,1&#41;&#41;;
Material mat1 = new Material&#40;assetManager, Material mat1 = new Material&#40;assetManager,
&quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;; &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;;
mat1.setColor&#40;&quot;Color&quot;, ColorRGBA.Blue&#41;; mat1.setColor&#40;&quot;Color&quot;, ColorRGBA.Blue&#41;;
blue.setMaterial&#40;mat1&#41;; blue.setMaterial&#40;mat1&#41;;
blue.move&#40;1,-1,1&#41;;
&nbsp; &nbsp;
/** create a red box straight above the blue one at (1,3,1) */ /** create a red box straight above the blue one at (1,3,1) */
Box box2 = new Box&#40; Vector3f.ZERO, 1,1,1&#41;; Box box2 = new Box&#40;1,1,1&#41;;
Geometry red = new Geometry&#40;&quot;Box&quot;, box2&#41;; Geometry red = new Geometry&#40;&quot;Box&quot;, box2&#41;;
red.setLocalTranslation&#40;new Vector3f&#40;1,3,1&#41;&#41;;
Material mat2 = new Material&#40;assetManager, Material mat2 = new Material&#40;assetManager,
&quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;; &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;;
mat2.setColor&#40;&quot;Color&quot;, ColorRGBA.Red&#41;; mat2.setColor&#40;&quot;Color&quot;, ColorRGBA.Red&#41;;
red.setMaterial&#40;mat2&#41;; red.setMaterial&#40;mat2&#41;;
red.move&#40;1,3,1&#41;;
&nbsp; &nbsp;
/** Create a pivot node at (0,0,0) and attach it to the root node */ /** Create a pivot node at (0,0,0) and attach it to the root node */
Node pivot = new Node&#40;&quot;pivot&quot;&#41;; Node pivot = new Node&#40;&quot;pivot&quot;&#41;;
rootNode.attachChild&#40;pivot&#41;; // put this node in the scene rootNode.attachChild&#40;pivot&#41;; // put this node in the scene
&nbsp; &nbsp;
/** Attach the two boxes to the *pivot* node. */ /** Attach the two boxes to the *pivot* node. (And transitively to the root node.) */
pivot.attachChild&#40;blue&#41;; pivot.attachChild&#40;blue&#41;;
pivot.attachChild&#40;red&#41;; pivot.attachChild&#40;red&#41;;
/** Rotate the pivot node: Note that both boxes have rotated! */ /** Rotate the pivot node: Note that both boxes have rotated! */
@ -99,7 +98,7 @@ Build and run the code sample. You should see two colored boxes tilted at the sa
</p> </p>
</div> </div>
<!-- EDIT2 SECTION "Code Sample" [997-3048] --> <!-- EDIT2 SECTION "Code Sample" [997-3108] -->
<h2><a>Understanding the Terminology</a></h2> <h2><a>Understanding the Terminology</a></h2>
<div> <div>
@ -128,7 +127,7 @@ In this tutorial, you learn some new terms:
<td>Position/move, turn, or resize an object</td><td>Translate, or rotate, or scale an object = transform an object.</td> <td>Position/move, turn, or resize an object</td><td>Translate, or rotate, or scale an object = transform an object.</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT4 TABLE [3137-3561] --> <!-- EDIT4 TABLE [3197-3621] -->
<p> <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. 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.
@ -155,9 +154,9 @@ Every JME3 application has a rootNode: Your game automatically inherits the <cod
<th> Examples: </th><td> A box, a sphere, a player, a building, a piece of terrain, a vehicle, missiles, NPCs, etc??? </td><td> The <code>rootNode</code>, a floor node grouping several terrains, a custom vehicle-with-passengers node, a player-with-weapon node, an audio node, etc??? </td> <th> Examples: </th><td> A box, a sphere, a player, a building, a piece of terrain, a vehicle, missiles, NPCs, etc??? </td><td> The <code>rootNode</code>, a floor node grouping several terrains, a custom vehicle-with-passengers node, a player-with-weapon node, an audio node, etc??? </td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT5 TABLE [3977-4470] --> <!-- EDIT5 TABLE [4037-4530] -->
</div> </div>
<!-- EDIT3 SECTION "Understanding the Terminology" [3049-4471] --> <!-- EDIT3 SECTION "Understanding the Terminology" [3109-4531] -->
<h2><a>Understanding the Code</a></h2> <h2><a>Understanding the Code</a></h2>
<div> <div>
@ -171,19 +170,18 @@ What happens in the code snippet? You use the <code>simpleInitApp()</code> metho
<ul> <ul>
<li><div> Create a Box shape with extents of (1,1,1), that makes the box 2x2x2 world units big.</div> <li><div> Create a Box shape with extents of (1,1,1), that makes the box 2x2x2 world units big.</div>
</li> </li>
<li><div> Position the box at (1,-1,1) using the move() method. (Don&#039;t change the Vector3f.ZERO unless you want to change the center of rotation)</div> <li><div> Position the box at (1,-1,1) using the setLocalTranslation() method.</div>
</li> </li>
<li><div> Wrap the Box shape into a Geometry.</div> <li><div> Wrap the Box shape into a Geometry.</div>
</li> </li>
<li><div> Create a blue material. </div> <li><div> Create a blue material. </div>
</li> </li>
<li><div> Apply the blue material to the Box Geometry. <pre> Box box1 = new Box&#40; Vector3f.ZERO, 1,1,1&#41;; <li><div> Apply the blue material to the Box Geometry. <pre> Box box1 = new Box&#40;1,1,1&#41;;
Geometry blue = new Geometry&#40;&quot;Box&quot;, box1&#41;; Geometry blue = new Geometry&#40;&quot;Box&quot;, box1&#41;;
Material mat1 = new Material&#40;assetManager, blue.setLocalTranslation&#40;new Vector3f&#40;1,-1,1&#41;&#41;;
&quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;; Material mat1 = new Material&#40;assetManager,&quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;;
mat1.setColor&#40;&quot;Color&quot;, ColorRGBA.Blue&#41;; mat1.setColor&#40;&quot;Color&quot;, ColorRGBA.Blue&#41;;
blue.setMaterial&#40;mat1&#41;; blue.setMaterial&#40;mat1&#41;;</pre>
blue.move&#40;1,-1,1&#41;;</pre>
</div> </div>
</li> </li>
</ul> </ul>
@ -198,13 +196,13 @@ What happens in the code snippet? You use the <code>simpleInitApp()</code> metho
</li> </li>
<li><div> Create a red material. </div> <li><div> Create a red material. </div>
</li> </li>
<li><div> Apply the red material to the Box Geometry. <pre> Box box2 = new Box&#40; Vector3f.ZERO, 1,1,1&#41;; <li><div> Apply the red material to the Box Geometry. <pre> Box box2 = new Box&#40;1,1,1&#41;;
Geometry red = new Geometry&#40;&quot;Box&quot;, box2&#41;; Geometry red = new Geometry&#40;&quot;Box&quot;, box2&#41;;
red.setLocalTranslation&#40;new Vector3f&#40;1,3,1&#41;&#41;;
Material mat2 = new Material&#40;assetManager, Material mat2 = new Material&#40;assetManager,
&quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;; &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;;
mat2.setColor&#40;&quot;Color&quot;, ColorRGBA.Red&#41;; mat2.setColor&#40;&quot;Color&quot;, ColorRGBA.Red&#41;;
red.setMaterial&#40;mat2&#41;; red.setMaterial&#40;mat2&#41;;</pre>
red.move&#40;1,3,1&#41;;</pre>
</div> </div>
</li> </li>
</ul> </ul>
@ -245,7 +243,7 @@ If you run the app with only the code up to here, you see two cubes: A red cube
</ol> </ol>
</div> </div>
<!-- EDIT6 SECTION "Understanding the Code" [4472-6874] --> <!-- EDIT6 SECTION "Understanding the Code" [4532-6885] -->
<h3><a>What is a Pivot Node?</a></h3> <h3><a>What is a Pivot Node?</a></h3>
<div> <div>
@ -264,7 +262,7 @@ You can transform (e.g. rotate) Geometries around their own center, or around a
</ul> </ul>
</div> </div>
<!-- EDIT7 SECTION "What is a Pivot Node?" [6875-8197] --> <!-- EDIT7 SECTION "What is a Pivot Node?" [6886-8208] -->
<h2><a>How do I Populate the Scenegraph?</a></h2> <h2><a>How do I Populate the Scenegraph?</a></h2>
<div> <div>
<div><table> <div><table>
@ -298,9 +296,9 @@ thing.setMaterial&#40;mat&#41;;</pre>
<td> Specify what should be loaded at the start </td><td> Everything you initialize and attach to the <code>rootNode</code> in the <code>simpleInitApp()</code> method is part of the scene at the start of the game. </td> <td> Specify what should be loaded at the start </td><td> Everything you initialize and attach to the <code>rootNode</code> in the <code>simpleInitApp()</code> method is part of the scene at the start of the game. </td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT9 TABLE [8245-9538] --> <!-- EDIT9 TABLE [8256-9549] -->
</div> </div>
<!-- EDIT8 SECTION "How do I Populate the Scenegraph?" [8198-9539] --> <!-- EDIT8 SECTION "How do I Populate the Scenegraph?" [8209-9550] -->
<h2><a>How do I Transform Spatials?</a></h2> <h2><a>How do I Transform Spatials?</a></h2>
<div> <div>
@ -324,7 +322,7 @@ To move a Spatial <em>to</em> specific coordinates, such as (0,40.2f,-2), use: <
</td><td>+right -left</td><td>+up -down</td><td>+forward -backward</td> </td><td>+right -left</td><td>+up -down</td><td>+forward -backward</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT11 TABLE [9663-10179] --><div><table> <!-- EDIT11 TABLE [9674-10190] --><div><table>
<tr> <tr>
<th> Scaling resizes Spatials </th><th> X-axis </th><th> Y-axis </th><th> Z-axis </th> <th> Scaling resizes Spatials </th><th> X-axis </th><th> Y-axis </th><th> Z-axis </th>
</tr> </tr>
@ -336,7 +334,7 @@ To scale a Spatial 10 times longer, one tenth the height, and keep the same widt
</td><td>length</td><td>height</td><td>width</td> </td><td>length</td><td>height</td><td>width</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT12 TABLE [10181-10670] --><div><table> <!-- EDIT12 TABLE [10192-10681] --><div><table>
<tr> <tr>
<th> Rotation turns Spatials </th><th> X-axis </th><th> Y-axis </th><th> Z-axis </th> <th> Rotation turns Spatials </th><th> X-axis </th><th> Y-axis </th><th> Z-axis </th>
</tr> </tr>
@ -352,9 +350,9 @@ To roll an object 180?? around the z axis: <pre>thing.rotate&#40; 0f , 0f , 180*
</td><td>pitch = nodding your head</td><td>yaw = shaking your head</td><td>roll = cocking your head</td> </td><td>pitch = nodding your head</td><td>yaw = shaking your head</td><td>roll = cocking your head</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT13 TABLE [10672-11453] --> <!-- EDIT13 TABLE [10683-11464] -->
</div> </div>
<!-- EDIT10 SECTION "How do I Transform Spatials?" [9540-11454] --> <!-- EDIT10 SECTION "How do I Transform Spatials?" [9551-11465] -->
<h2><a>How do I Troubleshoot Spatials?</a></h2> <h2><a>How do I Troubleshoot Spatials?</a></h2>
<div> <div>
@ -371,7 +369,7 @@ If you get unexpected results, check whether you made the following common mista
<td> A created Geometry does not appear in the scene. </td><td> Have you attached it to (a node that is attached to) the rootNode? <br/> <td> A created Geometry does not appear in the scene. </td><td> Have you attached it to (a node that is attached to) the rootNode? <br/>
Does it have a Material? <br/> Does it have a Material? <br/>
What is its translation (position)? Is it behind the camera or covered up by another Geometry? <br/> What is its translation (position)? Is it behind the camera or covered up by another Geometry? <br/>
Is it to tiny or too gigantic to see? <br/> Is it too tiny or too gigantic to see? <br/>
Is it too far from the camera? (Try <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.org/javadoc/com/jme3/renderer/Camera.html#setFrustumFar%28float%29"><param name="text" value="<html><u>cam.setFrustumFar</u></html>"><param name="textColor" value="blue"></object>(111111f); to see further) </td> Is it too far from the camera? (Try <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.org/javadoc/com/jme3/renderer/Camera.html#setFrustumFar%28float%29"><param name="text" value="<html><u>cam.setFrustumFar</u></html>"><param name="textColor" value="blue"></object>(111111f); to see further) </td>
</tr> </tr>
<tr> <tr>
@ -384,9 +382,9 @@ Did you rotate around the right axis? </td>
<td> A Geometry has an unexpected Color or Material. </td><td> Did you reuse a Material from another Geometry and have inadvertently changed its properties? (If so, consider cloning it: mat2 = mat.clone(); ) </td> <td> A Geometry has an unexpected Color or Material. </td><td> Did you reuse a Material from another Geometry and have inadvertently changed its properties? (If so, consider cloning it: mat2 = mat.clone(); ) </td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT15 TABLE [11586-12644] --> <!-- EDIT15 TABLE [11597-12656] -->
</div> </div>
<!-- EDIT14 SECTION "How do I Troubleshoot Spatials?" [11455-12645] --> <!-- EDIT14 SECTION "How do I Troubleshoot Spatials?" [11466-12657] -->
<h2><a>How do I Add Custom Data to Spatials?</a></h2> <h2><a>How do I Add Custom Data to Spatials?</a></h2>
<div> <div>
@ -419,7 +417,7 @@ By using different Strings keys (here the key is <code>pivot id</code>), you can
</p> </p>
</div> </div>
<!-- EDIT16 SECTION "How do I Add Custom Data to Spatials?" [12646-14099] --> <!-- EDIT16 SECTION "How do I Add Custom Data to Spatials?" [12658-14111] -->
<h2><a>Conclusion</a></h2> <h2><a>Conclusion</a></h2>
<div> <div>
@ -445,5 +443,5 @@ Since standard shapes like spheres and boxes get old fast, continue with the nex
</span></div> </span></div>
</div> </div>
<!-- EDIT17 SECTION "Conclusion" [14100-] --> <!-- EDIT17 SECTION "Conclusion" [14112-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_node?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_node?do=export_xhtmlbody">view online version</a></em></p>

@ -109,10 +109,10 @@ public class HelloPhysics extends SimpleApplication &#123;
sphere = new Sphere&#40;32, 32, 0.4f, true, false&#41;; sphere = new Sphere&#40;32, 32, 0.4f, true, false&#41;;
sphere.setTextureMode&#40;TextureMode.Projected&#41;; sphere.setTextureMode&#40;TextureMode.Projected&#41;;
/** Initialize the brick geometry */ /** Initialize the brick geometry */
box = new Box&#40;Vector3f.ZERO, brickLength, brickHeight, brickWidth&#41;; box = new Box&#40;brickLength, brickHeight, brickWidth&#41;;
box.scaleTextureCoordinates&#40;new Vector2f&#40;1f, .5f&#41;&#41;; box.scaleTextureCoordinates&#40;new Vector2f&#40;1f, .5f&#41;&#41;;
/** Initialize the floor geometry */ /** Initialize the floor geometry */
floor = new Box&#40;Vector3f.ZERO, 10f, 0.1f, 5f&#41;; floor = new Box&#40;10f, 0.1f, 5f&#41;;
floor.scaleTextureCoordinates&#40;new Vector2f&#40;3, 6&#41;&#41;; floor.scaleTextureCoordinates&#40;new Vector2f&#40;3, 6&#41;&#41;;
&#125; &#125;
&nbsp; &nbsp;
@ -251,7 +251,7 @@ You should see a brick wall. Click to shoot cannon balls. Watch the bricks fall
</p> </p>
</div> </div>
<!-- EDIT2 SECTION "Sample Code" [1379-8764] --> <!-- EDIT2 SECTION "Sample Code" [1379-8734] -->
<h2><a>A Basic Physics Application</a></h2> <h2><a>A Basic Physics Application</a></h2>
<div> <div>
@ -279,12 +279,12 @@ The BulletAppState gives the game access to a PhysicsSpace. The PhysicsSpace let
</p> </p>
</div> </div>
<!-- EDIT3 SECTION "A Basic Physics Application" [8765-9748] --> <!-- EDIT3 SECTION "A Basic Physics Application" [8735-9718] -->
<h2><a>Creating Bricks and Cannon Balls</a></h2> <h2><a>Creating Bricks and Cannon Balls</a></h2>
<div> <div>
</div> </div>
<!-- EDIT4 SECTION "Creating Bricks and Cannon Balls" [9749-9794] --> <!-- EDIT4 SECTION "Creating Bricks and Cannon Balls" [9719-9764] -->
<h3><a>Geometries</a></h3> <h3><a>Geometries</a></h3>
<div> <div>
@ -305,15 +305,15 @@ In this &quot;shoot at the wall&quot; example, you use Geometries such as cannon
sphere = new Sphere&#40;32, 32, 0.4f, true, false&#41;; sphere = new Sphere&#40;32, 32, 0.4f, true, false&#41;;
sphere.setTextureMode&#40;TextureMode.Projected&#41;; sphere.setTextureMode&#40;TextureMode.Projected&#41;;
/** Initialize the brick geometry */ /** Initialize the brick geometry */
box = new Box&#40;Vector3f.ZERO, brickLength, brickHeight, brickWidth&#41;; box = new Box&#40;brickLength, brickHeight, brickWidth&#41;;
box.scaleTextureCoordinates&#40;new Vector2f&#40;1f, .5f&#41;&#41;; box.scaleTextureCoordinates&#40;new Vector2f&#40;1f, .5f&#41;&#41;;
/** Initialize the floor geometry */ /** Initialize the floor geometry */
floor = new Box&#40;Vector3f.ZERO, 10f, 0.1f, 5f&#41;; floor = new Box&#40;10f, 0.1f, 5f&#41;;
floor.scaleTextureCoordinates&#40;new Vector2f&#40;3, 6&#41;&#41;; floor.scaleTextureCoordinates&#40;new Vector2f&#40;3, 6&#41;&#41;;
&#125;</pre> &#125;</pre>
</div> </div>
<!-- EDIT5 SECTION "Geometries" [9795-10890] --> <!-- EDIT5 SECTION "Geometries" [9765-10830] -->
<h3><a>RigidBodyControl: Brick</a></h3> <h3><a>RigidBodyControl: Brick</a></h3>
<div> <div>
@ -375,7 +375,7 @@ This code sample does the following:
</ol> </ol>
</div> </div>
<!-- EDIT6 SECTION "RigidBodyControl: Brick" [10891-12413] --> <!-- EDIT6 SECTION "RigidBodyControl: Brick" [10831-12353] -->
<h3><a>RigidBodyControl: Cannonball</a></h3> <h3><a>RigidBodyControl: Cannonball</a></h3>
<div> <div>
@ -438,7 +438,7 @@ Since you are shooting cannon balls, the last line accelerates the ball in the d
</p> </p>
</div> </div>
<!-- EDIT7 SECTION "RigidBodyControl: Cannonball" [12414-14010] --> <!-- EDIT7 SECTION "RigidBodyControl: Cannonball" [12354-13950] -->
<h3><a>RigidBodyControl: Floor</a></h3> <h3><a>RigidBodyControl: Floor</a></h3>
<div> <div>
@ -493,7 +493,7 @@ This code sample does the following:
</ol> </ol>
</div> </div>
<!-- EDIT8 SECTION "RigidBodyControl: Floor" [14011-15435] --> <!-- EDIT8 SECTION "RigidBodyControl: Floor" [13951-15375] -->
<h2><a>Creating the Scene</a></h2> <h2><a>Creating the Scene</a></h2>
<div> <div>
@ -518,7 +518,7 @@ These methods are each called once from the <code>simpleInitApp()</code> method
</p> </p>
</div> </div>
<!-- EDIT9 SECTION "Creating the Scene" [15436-16264] --> <!-- EDIT9 SECTION "Creating the Scene" [15376-16204] -->
<h2><a>The Cannon Ball Shooting Action</a></h2> <h2><a>The Cannon Ball Shooting Action</a></h2>
<div> <div>
@ -548,7 +548,7 @@ In the moment the cannonball appears in the scene, it flies off with the velocit
</p> </p>
</div> </div>
<!-- EDIT10 SECTION "The Cannon Ball Shooting Action" [16265-17305] --> <!-- EDIT10 SECTION "The Cannon Ball Shooting Action" [16205-17245] -->
<h2><a>Moving a Physical Spatial</a></h2> <h2><a>Moving a Physical Spatial</a></h2>
<div> <div>
@ -575,12 +575,12 @@ Learn more about static versus kinematic versus dynamic in the <a href="/com/jme
</p> </p>
</div> </div>
<!-- EDIT11 SECTION "Moving a Physical Spatial" [17306-18275] --> <!-- EDIT11 SECTION "Moving a Physical Spatial" [17246-18215] -->
<h2><a>Excercises</a></h2> <h2><a>Excercises</a></h2>
<div> <div>
</div> </div>
<!-- EDIT12 SECTION "Excercises" [18276-18299] --> <!-- EDIT12 SECTION "Excercises" [18216-18239] -->
<h3><a>Exercise 1: Debug Shapes</a></h3> <h3><a>Exercise 1: Debug Shapes</a></h3>
<div> <div>
@ -597,7 +597,7 @@ Now you see the collisionShapes of the bricks and spheres, and the floor highlig
</p> </p>
</div> </div>
<!-- EDIT13 SECTION "Exercise 1: Debug Shapes" [18300-18565] --> <!-- EDIT13 SECTION "Exercise 1: Debug Shapes" [18240-18505] -->
<h3><a>Exercise 2: No Mo&#039; Static</a></h3> <h3><a>Exercise 2: No Mo&#039; Static</a></h3>
<div> <div>
@ -607,7 +607,7 @@ What happens if you give a static node, such as the floor, a mass of more than 0
</p> </p>
</div> </div>
<!-- EDIT14 SECTION "Exercise 2: No Mo' Static" [18566-18686] --> <!-- EDIT14 SECTION "Exercise 2: No Mo' Static" [18506-18626] -->
<h3><a>Exercise 3: Behind the Curtain</a></h3> <h3><a>Exercise 3: Behind the Curtain</a></h3>
<div> <div>
@ -625,7 +625,7 @@ Using physics everywhere in a game sounds like a cool idea, but it is easily ove
</p> </p>
</div> </div>
<!-- EDIT15 SECTION "Exercise 3: Behind the Curtain" [18687-19692] --> <!-- EDIT15 SECTION "Exercise 3: Behind the Curtain" [18627-19632] -->
<h2><a>Conclusion</a></h2> <h2><a>Conclusion</a></h2>
<div> <div>
@ -649,5 +649,5 @@ You have learned how to activate the jBullet PhysicsSpace in an application by a
</span></div> </span></div>
</div> </div>
<!-- EDIT16 SECTION "Conclusion" [19693-] --> <!-- EDIT16 SECTION "Conclusion" [19633-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_physics?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_physics?do=export_xhtmlbody">view online version</a></em></p>

@ -39,12 +39,14 @@ import com.jme3.input.MouseInput;
import com.jme3.input.controls.ActionListener; import com.jme3.input.controls.ActionListener;
import com.jme3.input.controls.KeyTrigger; import com.jme3.input.controls.KeyTrigger;
import com.jme3.input.controls.MouseButtonTrigger; import com.jme3.input.controls.MouseButtonTrigger;
import com.jme3.light.DirectionalLight;
import com.jme3.material.Material; import com.jme3.material.Material;
import com.jme3.math.ColorRGBA; import com.jme3.math.ColorRGBA;
import com.jme3.math.Ray; import com.jme3.math.Ray;
import com.jme3.math.Vector3f; import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry; import com.jme3.scene.Geometry;
import com.jme3.scene.Node; import com.jme3.scene.Node;
import com.jme3.scene.Spatial;
import com.jme3.scene.shape.Box; import com.jme3.scene.shape.Box;
import com.jme3.scene.shape.Sphere; import com.jme3.scene.shape.Sphere;
&nbsp; &nbsp;
@ -56,8 +58,8 @@ public class HelloPicking extends SimpleApplication &#123;
HelloPicking app = new HelloPicking&#40;&#41;; HelloPicking app = new HelloPicking&#40;&#41;;
app.start&#40;&#41;; app.start&#40;&#41;;
&#125; &#125;
Node shootables; private Node shootables;
Geometry mark; private Geometry mark;
&nbsp; &nbsp;
@Override @Override
public void simpleInitApp&#40;&#41; &#123; public void simpleInitApp&#40;&#41; &#123;
@ -73,6 +75,7 @@ public class HelloPicking extends SimpleApplication &#123;
shootables.attachChild&#40;makeCube&#40;&quot;the Sheriff&quot;, 0f, 1f, -2f&#41;&#41;; shootables.attachChild&#40;makeCube&#40;&quot;the Sheriff&quot;, 0f, 1f, -2f&#41;&#41;;
shootables.attachChild&#40;makeCube&#40;&quot;the Deputy&quot;, 1f, 0f, -4f&#41;&#41;; shootables.attachChild&#40;makeCube&#40;&quot;the Deputy&quot;, 1f, 0f, -4f&#41;&#41;;
shootables.attachChild&#40;makeFloor&#40;&#41;&#41;; shootables.attachChild&#40;makeFloor&#40;&#41;&#41;;
shootables.attachChild&#40;makeCharacter&#40;&#41;&#41;;
&#125; &#125;
&nbsp; &nbsp;
/** Declaring the &quot;Shoot&quot; action and mapping to its triggers. */ /** Declaring the &quot;Shoot&quot; action and mapping to its triggers. */
@ -120,8 +123,9 @@ public class HelloPicking extends SimpleApplication &#123;
&nbsp; &nbsp;
/** A cube object for target practice */ /** A cube object for target practice */
protected Geometry makeCube&#40;String name, float x, float y, float z&#41; &#123; protected Geometry makeCube&#40;String name, float x, float y, float z&#41; &#123;
Box box = new Box&#40;new Vector3f&#40;x, y, z&#41;, 1, 1, 1&#41;; Box box = new Box&#40;1, 1, 1&#41;;
Geometry cube = new Geometry&#40;name, box&#41;; Geometry cube = new Geometry&#40;name, box&#41;;
cube.setLocalTranslation&#40;x, y, z&#41;;
Material mat1 = new Material&#40;assetManager, &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;; Material mat1 = new Material&#40;assetManager, &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;;
mat1.setColor&#40;&quot;Color&quot;, ColorRGBA.randomColor&#40;&#41;&#41;; mat1.setColor&#40;&quot;Color&quot;, ColorRGBA.randomColor&#40;&#41;&#41;;
cube.setMaterial&#40;mat1&#41;; cube.setMaterial&#40;mat1&#41;;
@ -130,8 +134,9 @@ public class HelloPicking extends SimpleApplication &#123;
&nbsp; &nbsp;
/** A floor to show that the &quot;shot&quot; can go through several objects. */ /** A floor to show that the &quot;shot&quot; can go through several objects. */
protected Geometry makeFloor&#40;&#41; &#123; protected Geometry makeFloor&#40;&#41; &#123;
Box box = new Box&#40;new Vector3f&#40;0, -4, -5&#41;, 15, .2f, 15&#41;; Box box = new Box&#40;15, .2f, 15&#41;;
Geometry floor = new Geometry&#40;&quot;the Floor&quot;, box&#41;; Geometry floor = new Geometry&#40;&quot;the Floor&quot;, box&#41;;
floor.setLocalTranslation&#40;0, -4, -5&#41;;
Material mat1 = new Material&#40;assetManager, &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;; Material mat1 = new Material&#40;assetManager, &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;;
mat1.setColor&#40;&quot;Color&quot;, ColorRGBA.Gray&#41;; mat1.setColor&#40;&quot;Color&quot;, ColorRGBA.Gray&#41;;
floor.setMaterial&#40;mat1&#41;; floor.setMaterial&#40;mat1&#41;;
@ -149,16 +154,28 @@ public class HelloPicking extends SimpleApplication &#123;
&nbsp; &nbsp;
/** A centred plus sign to help the player aim. */ /** A centred plus sign to help the player aim. */
protected void initCrossHairs&#40;&#41; &#123; protected void initCrossHairs&#40;&#41; &#123;
guiNode.detachAllChildren&#40;&#41;; setDisplayStatView&#40;false&#41;;
guiFont = assetManager.loadFont&#40;&quot;Interface/Fonts/Default.fnt&quot;&#41;; guiFont = assetManager.loadFont&#40;&quot;Interface/Fonts/Default.fnt&quot;&#41;;
BitmapText ch = new BitmapText&#40;guiFont, false&#41;; BitmapText ch = new BitmapText&#40;guiFont, false&#41;;
ch.setSize&#40;guiFont.getCharSet&#40;&#41;.getRenderedSize&#40;&#41; * 2&#41;; ch.setSize&#40;guiFont.getCharSet&#40;&#41;.getRenderedSize&#40;&#41; * 2&#41;;
ch.setText&#40;&quot;+&quot;&#41;; // crosshairs ch.setText&#40;&quot;+&quot;&#41;; // crosshairs
ch.setLocalTranslation&#40; // center ch.setLocalTranslation&#40; // center
settings.getWidth&#40;&#41; / 2 - guiFont.getCharSet&#40;&#41;.getRenderedSize&#40;&#41; / 3 * 2, settings.getWidth&#40;&#41; / 2 - ch.getLineWidth&#40;&#41;/2, settings.getHeight&#40;&#41; / 2 + ch.getLineHeight&#40;&#41;/2, 0&#41;;
settings.getHeight&#40;&#41; / 2 + ch.getLineHeight&#40;&#41; / 2, 0&#41;;
guiNode.attachChild&#40;ch&#41;; guiNode.attachChild&#40;ch&#41;;
&#125; &#125;
&nbsp;
protected Spatial makeCharacter&#40;&#41; &#123;
// load a character from jme3test-test-data
Spatial golem = assetManager.loadModel&#40;&quot;Models/Oto/Oto.mesh.xml&quot;&#41;;
golem.scale&#40;0.5f&#41;;
golem.setLocalTranslation&#40;-1.0f, -1.5f, -0.6f&#41;;
&nbsp;
// We must add a light to make the model visible
DirectionalLight sun = new DirectionalLight&#40;&#41;;
sun.setDirection&#40;new Vector3f&#40;-0.1f, -0.7f, -1.0f&#41;&#41;;
golem.addLight&#40;sun&#41;;
return golem;
&#125;
&#125;</pre> &#125;</pre>
<p> <p>
@ -167,10 +184,11 @@ You should see four colored cubes floating over a gray floor, and cross-hairs. A
<p> <p>
Keep an eye on the application&#039;s output stream, it will give you more details: The name of the mesh that was hit, the coordinates of the hit, and the distance. Keep an eye on the application&#039;s output stream, it will give you more details: The name of the mesh that was hit, the coordinates of the hit, and the distance.
</p> </p>
</div> </div>
<!-- EDIT2 SECTION "Sample Code" [992-6844] --> <!-- EDIT2 SECTION "Sample Code" [992-7402] -->
<h2><a>Understanding the Helper Methods</a></h2> <h2><a>Understanding the Helper Methods</a></h2>
<div> <div>
@ -204,7 +222,7 @@ In this example, we attached all &quot;shootable&quot; objects to one custom nod
</p> </p>
</div> </div>
<!-- EDIT3 SECTION "Understanding the Helper Methods" [6845-7885] --> <!-- EDIT3 SECTION "Understanding the Helper Methods" [7403-8443] -->
<h2><a>Understanding Ray Casting for Hit Testing</a></h2> <h2><a>Understanding Ray Casting for Hit Testing</a></h2>
<div> <div>
@ -236,12 +254,12 @@ Here is our simple ray casting algorithm for picking objects:
</ol> </ol>
</div> </div>
<!-- EDIT4 SECTION "Understanding Ray Casting for Hit Testing" [7886-8728] --> <!-- EDIT4 SECTION "Understanding Ray Casting for Hit Testing" [8444-9286] -->
<h2><a>Implementing Hit Testing</a></h2> <h2><a>Implementing Hit Testing</a></h2>
<div> <div>
</div> </div>
<!-- EDIT5 SECTION "Implementing Hit Testing" [8729-8766] --> <!-- EDIT5 SECTION "Implementing Hit Testing" [9287-9324] -->
<h3><a>Loading the scene</a></h3> <h3><a>Loading the scene</a></h3>
<div> <div>
@ -269,7 +287,7 @@ First initialize some shootable nodes and attach them to the scene. You will use
&#125;</pre> &#125;</pre>
</div> </div>
<!-- EDIT6 SECTION "Loading the scene" [8767-9453] --> <!-- EDIT6 SECTION "Loading the scene" [9325-10011] -->
<h3><a>Setting Up the Input Listener</a></h3> <h3><a>Setting Up the Input Listener</a></h3>
<div> <div>
@ -282,12 +300,12 @@ Next you declare the shooting action. It can be triggered either by clicking, or
private void initKeys&#40;&#41; &#123; private void initKeys&#40;&#41; &#123;
inputManager.addMapping&#40;&quot;Shoot&quot;, // Declare... inputManager.addMapping&#40;&quot;Shoot&quot;, // Declare...
new KeyTrigger&#40;KeyInput.KEY_SPACE&#41;, // trigger 1: spacebar, or new KeyTrigger&#40;KeyInput.KEY_SPACE&#41;, // trigger 1: spacebar, or
new MouseButtonTrigger&#40;0&#41;&#41;; // trigger 2: left-button click new MouseButtonTrigger&#40;MouseInput.BUTTON_LEFT&#41;&#41;; // trigger 2: left-button click
inputManager.addListener&#40;actionListener, &quot;Shoot&quot;&#41;; // ... and add. inputManager.addListener&#40;actionListener, &quot;Shoot&quot;&#41;; // ... and add.
&#125;</pre> &#125;</pre>
</div> </div>
<!-- EDIT7 SECTION "Setting Up the Input Listener" [9454-10074] --> <!-- EDIT7 SECTION "Setting Up the Input Listener" [10012-10652] -->
<h3><a>Picking Action Using Crosshairs</a></h3> <h3><a>Picking Action Using Crosshairs</a></h3>
<div> <div>
@ -353,7 +371,7 @@ Note how it prints a lot of output to show you which hits were registered.
</p> </p>
</div> </div>
<!-- EDIT8 SECTION "Picking Action Using Crosshairs" [10075-12848] --> <!-- EDIT8 SECTION "Picking Action Using Crosshairs" [10653-13426] -->
<h3><a>Picking Action Using Mouse Pointer</a></h3> <h3><a>Picking Action Using Mouse Pointer</a></h3>
<div> <div>
@ -394,7 +412,7 @@ Note that since you now use the mouse for picking, you can no longer use it to r
</p> </p>
</div> </div>
<!-- EDIT9 SECTION "Picking Action Using Mouse Pointer" [12849-14285] --> <!-- EDIT9 SECTION "Picking Action Using Mouse Pointer" [13427-14863] -->
<h2><a>Exercises</a></h2> <h2><a>Exercises</a></h2>
<div> <div>
@ -405,7 +423,7 @@ Modify the code sample to solve these exercises:
</p> </p>
</div> </div>
<!-- EDIT10 SECTION "Exercises" [14286-14457] --> <!-- EDIT10 SECTION "Exercises" [14864-15035] -->
<h3><a>Exercise 1: Magic Spell</a></h3> <h3><a>Exercise 1: Magic Spell</a></h3>
<div> <div>
@ -432,7 +450,7 @@ Here are some tips:
</ol> </ol>
</div> </div>
<!-- EDIT11 SECTION "Exercise 1: Magic Spell" [14458-14990] --> <!-- EDIT11 SECTION "Exercise 1: Magic Spell" [15036-15568] -->
<h3><a>Exercise 2: Shoot a Character</a></h3> <h3><a>Exercise 2: Shoot a Character</a></h3>
<div> <div>
@ -448,7 +466,7 @@ Shooting boxes isn&#039;t very exciting ??? can you add code that loads and posi
</ul> </ul>
</div> </div>
<!-- EDIT12 SECTION "Exercise 2: Shoot a Character" [14991-15329] --> <!-- EDIT12 SECTION "Exercise 2: Shoot a Character" [15569-15907] -->
<h3><a>Exercise 3: Pick up into Inventory</a></h3> <h3><a>Exercise 3: Pick up into Inventory</a></h3>
<div> <div>
@ -482,7 +500,7 @@ Change the code as follows to simulate the player picking up objects into the in
</p> </p>
</div> </div>
<!-- EDIT13 SECTION "Exercise 3: Pick up into Inventory" [15330-16463] --> <!-- EDIT13 SECTION "Exercise 3: Pick up into Inventory" [15908-17041] -->
<h2><a>Conclusion</a></h2> <h2><a>Conclusion</a></h2>
<div> <div>
@ -533,5 +551,5 @@ See also:
</span></div> </span></div>
</div> </div>
<!-- EDIT14 SECTION "Conclusion" [16464-] --> <!-- EDIT14 SECTION "Conclusion" [17042-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_picking?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_picking?do=export_xhtmlbody">view online version</a></em></p>

@ -56,7 +56,7 @@ If you have questions, read more about <a href="/com/jme3/gde/docs/sdk/project_c
</div> </div>
<!-- EDIT2 SECTION "Create a Project" [727-1588] --> <!-- EDIT2 SECTION "Create a Project" [727-1588] -->
<h2><a>Write a SimpleApplication</a></h2> <h2><a>Extend SimpleApplication</a></h2>
<div> <div>
<p> <p>
@ -85,7 +85,7 @@ The <acronym title="Software Development Kit">SDK</acronym> creates the file Hel
</p> </p>
</div> </div>
<!-- EDIT3 SECTION "Write a SimpleApplication" [1589-2061] --> <!-- EDIT3 SECTION "Extend SimpleApplication" [1589-2060] -->
<h2><a>Sample Code</a></h2> <h2><a>Sample Code</a></h2>
<div> <div>
@ -114,7 +114,7 @@ public class HelloJME3 extends SimpleApplication &#123;
&nbsp; &nbsp;
@Override @Override
public void simpleInitApp&#40;&#41; &#123; public void simpleInitApp&#40;&#41; &#123;
Box b = new Box&#40;Vector3f.ZERO, 1, 1, 1&#41;; // create cube shape at the origin Box b = new Box&#40;1, 1, 1&#41;; // create cube shape
Geometry geom = new Geometry&#40;&quot;Box&quot;, b&#41;; // create cube geometry from the shape Geometry geom = new Geometry&#40;&quot;Box&quot;, b&#41;; // create cube geometry from the shape
Material mat = new Material&#40;assetManager, Material mat = new Material&#40;assetManager,
&quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;; // create a simple material &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;; // create a simple material
@ -143,7 +143,7 @@ Congratulations! Now let&#039;s find out how it works!
</p> </p>
</div> </div>
<!-- EDIT4 SECTION "Sample Code" [2062-3976] --> <!-- EDIT4 SECTION "Sample Code" [2061-3946] -->
<h2><a>Understanding the Code</a></h2> <h2><a>Understanding the Code</a></h2>
<div> <div>
@ -153,20 +153,20 @@ The code above has initialized the scene, and started the application.
</p> </p>
</div> </div>
<!-- EDIT5 SECTION "Understanding the Code" [3977-4084] --> <!-- EDIT5 SECTION "Understanding the Code" [3947-4054] -->
<h3><a>Start the SimpleApplication</a></h3> <h3><a>Start the SimpleApplication</a></h3>
<div> <div>
<p> <p>
Look at the first line. The HelloJME3.java class extends <code>com.jme3.app.SimpleApplication</code>. Look at the first line. Your HelloJME3.java class extends <code>com.jme3.app.SimpleApplication</code>.
</p> </p>
<pre>public class HelloJME3 extends SimpleApplication &#123; <pre>public class HelloJME3 extends SimpleApplication &#123;
// your code... // your code...
&#125;</pre> &#125;</pre>
<p> <p>
Every JME3 game is an instance of <code>com.jme3.app.SimpleApplication</code>. The SimpleApplication class manages your 3D scene graph and automatically draws it to the screen ??? that is, in short, what a game engine does for you! Every JME3 game is an instance of the <code>com.jme3.app.SimpleApplication</code> class. The SimpleApplication class is the simplest example of an application: It manages a 3D scene graph, checks for user input, updates the game state, and automatically draws the scene to the screen. These are the core features of a game engine. You extend this simple application and customize it to create your game.
</p> </p>
<p> <p>
@ -184,11 +184,11 @@ You start every JME3 game from the main() method, as every standard Java applica
&#125;</pre> &#125;</pre>
<p> <p>
This code opens your application window. Let&#039;s learn how you put something into the window next. The <code>app.start();</code> line opens the application window. Let&#039;s learn how you put something into this window (the scene) next.
</p> </p>
</div> </div>
<!-- EDIT6 SECTION "Start the SimpleApplication" [4085-5044] --> <!-- EDIT6 SECTION "Start the SimpleApplication" [4055-5215] -->
<h3><a>Understanding the Terminology</a></h3> <h3><a>Understanding the Terminology</a></h3>
<div> <div>
<div><table> <div><table>
@ -211,14 +211,14 @@ This code opens your application window. Let&#039;s learn how you put something
<td>You want the cube to appear in the center.</td><td>I create the Box at the origin = at <code>Vector3f.ZERO</code>.</td> <td>You want the cube to appear in the center.</td><td>I create the Box at the origin = at <code>Vector3f.ZERO</code>.</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT8 TABLE [5086-5559] --> <!-- EDIT8 TABLE [5257-5730] -->
<p> <p>
If you are unfamiliar with the vocabulary, read more about <a href="/com/jme3/gde/docs/jme3/the_scene_graph.html">the Scene Graph</a> here. If you are unfamiliar with the vocabulary, read more about <a href="/com/jme3/gde/docs/jme3/the_scene_graph.html">the Scene Graph</a> here.
</p> </p>
</div> </div>
<!-- EDIT7 SECTION "Understanding the Terminology" [5045-5652] --> <!-- EDIT7 SECTION "Understanding the Terminology" [5216-5823] -->
<h3><a>Initialize the Scene</a></h3> <h3><a>Initialize the Scene</a></h3>
<div> <div>
@ -234,7 +234,7 @@ Look at rest of the code sample. The <code>simpleInitApp()</code> method is auto
The initialization code of a blue cube looks as follows: The initialization code of a blue cube looks as follows:
</p> </p>
<pre> public void simpleInitApp&#40;&#41; &#123; <pre> public void simpleInitApp&#40;&#41; &#123;
Box b = new Box&#40;Vector3f.ZERO, 1, 1, 1&#41;; // create a 1x1x1 box shape at the origin Box b = new Box&#40;1, 1, 1&#41;; // create a 1x1x1 box shape
Geometry geom = new Geometry&#40;&quot;Box&quot;, b&#41;; // create a cube geometry from the box shape Geometry geom = new Geometry&#40;&quot;Box&quot;, b&#41;; // create a cube geometry from the box shape
Material mat = new Material&#40;assetManager, Material mat = new Material&#40;assetManager,
&quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;; // create a simple material &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;; // create a simple material
@ -288,7 +288,7 @@ A typical JME3 game has the following initialization process:
</ol> </ol>
</div> </div>
<!-- EDIT9 SECTION "Initialize the Scene" [5653-7652] --> <!-- EDIT9 SECTION "Initialize the Scene" [5824-7794] -->
<h2><a>Conclusion</a></h2> <h2><a>Conclusion</a></h2>
<div> <div>
@ -349,5 +349,5 @@ See also:
</span></div> </span></div>
</div> </div>
<!-- EDIT10 SECTION "Conclusion" [7653-] --> <!-- EDIT10 SECTION "Conclusion" [7795-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_simpleapplication?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_simpleapplication?do=export_xhtmlbody">view online version</a></em></p>

@ -4,7 +4,7 @@
<p> <p>
You are welcome to try out the new jME3, and contribute patches and features! This document shows how to download, set up, build, and run the latest development version from the sources. (As of Spring 2010, we are in alpha.) These instructions work in NetBeans IDE 6 or better. You are welcome to try out the new jME3, and contribute patches and features! This document shows how to download, set up, build, and run the latest development version from the sources. These instructions work in NetBeans IDE 6 or better.
</p> </p>
<p> <p>
@ -12,7 +12,7 @@ Note: In the following, always replace &quot;~&quot; with the path to your home
</p> </p>
</div> </div>
<!-- EDIT1 SECTION "Setting up JME3 in Netbeans 6+" [1-407] --> <!-- EDIT1 SECTION "Setting up JME3 in Netbeans 6+" [1-369] -->
<h2><a>Downloading the Sources</a></h2> <h2><a>Downloading the Sources</a></h2>
<div> <div>
@ -51,59 +51,85 @@ The jme3 project opens in the Project window. It already includes a working ANT
<p> <p>
Look into the Libraries node and confirm that the project depends on the following libraries in the classpath: Look into the Libraries node and confirm that the project depends on the following libraries in the classpath:
</p> </p>
<pre>jME3-natives-joal.jar lwjgl.jar gluegen-rt.jar <ul>
jME3-lwjgl-natives.jar jinput.jar swing-layout-1.0.4.jar <li><div> j-ogg-oggd.jar </div>
j-ogg-oggd.jar vecmath.jar stack-alloc.jar </li>
j-ogg-vorbisd.jar asm-all-3.1.jar jbullet.jar <li><div> j-ogg-vorbisd.jar </div>
jheora-jst-debug-0.6.0.jar xmlpull.xpp3-1.1.4c.jar </li>
nifty*.jar eventbus-1.4.jar</pre> <li><div> jbullet.jar </div>
</li>
<li><div> stack-alloc.jar</div>
</li>
<li><div> vecmath.jar </div>
</li>
<li><div> lwjgl.jar </div>
</li>
<li><div> jME3-lwjgl-natives.jar </div>
</li>
<li><div> jinput.jar </div>
</li>
<li><div> eventbus.jar</div>
</li>
<li><div> nifty-default-controls.jar </div>
</li>
<li><div> nifty-examples.jar </div>
</li>
<li><div> nifty-style-black.jar </div>
</li>
<li><div> nifty.jar</div>
</li>
<li><div> jglfont-core.jar </div>
</li>
<li><div> xmlpull-xpp3.jar</div>
</li>
<li><div> android.jar</div>
</li>
<li><div> jME3-bullet-natives.jar</div>
</li>
<li><div> gluegen-rt.jar</div>
</li>
<li><div> joal.jar</div>
</li>
<li><div> jogl-all.jar</div>
</li>
<li><div> jME3-natives-joal.jar</div>
</li>
<li><div> jME3-openal-soft-natives-android.jar</div>
</li>
</ul>
<p> <p>
For a detailed description of the separate jar files see <a href="/com/jme3/gde/docs/jme3/jme3_source_structure#structure_of_jmonkeyengine3_jars.html">this list</a>. For a detailed description of the separate jar files see <a href="/com/jme3/gde/docs/jme3/jme3_source_structure#structure_of_jmonkeyengine3_jars.html">this list</a>.
</p> </p>
</div> </div>
<!-- EDIT2 SECTION "Downloading the Sources" [408-1785] --> <!-- EDIT2 SECTION "Downloading the Sources" [370-2005] -->
<h2><a>Build and Run</a></h2> <h2><a>Build the Project and Run a Sample App</a></h2>
<div> <div>
<p>
That&#039;s it!
</p>
<ol> <ol>
<li><div> Right-click the jme3 project node and &quot;Clean and Build&quot; the project.</div> <li><div> Right-click the jme3 project node and &quot;Clean and Build&quot; the project.</div>
</li> </li>
<li><div> In the Projects window, browse to the <code>src/test/jme3test</code> folder. </div> <li><div> In the Projects window, open the <code>Test</code> folder which contains the sample apps.</div>
</li>
<li><div> Every file with a Main class (for example <code>jme3test.model/TestHoverTank.java</code> or <code>jme3test.game/CubeField.java</code>) is an app.</div>
</li> </li>
<li><div> Right-click e.g. the file <code>src/test/jme3test/model/TestHoverTank.java</code> and choose &quot;Run&quot; to run a sample. </div> <li><div> Right-click a sample app and choose &quot;Run File&quot; (Shift-F6).</div>
</li>
<li><div> Generally in sample apps:</div>
<ol> <ol>
<li><div> In the sample application, use the mouse and the AWSD keys to move around the test object.</div> <li><div> the mouse and the WASD keys control movement</div>
</li> </li>
<li><div> Press escape to quit the sample application.</div> <li><div> the Esc key exits the application</div>
</li> </li>
</ol> </ol>
</li> </li>
</ol> </ol>
<p>
Sample code for cool features is in the <code>src/test/jme3test</code> folder. A sample game can be found in <code>src/games/jme3game/cubefield/CubeField.java</code>.
</p>
<p>
Tips:
</p>
<ul>
<li><div> To run runnable classes from the Projects window, right-click and choose Run.</div>
</li>
<li><div> To run any runnable class that is open in the editor, press shift-F6.</div>
</li>
</ul>
</div> </div>
<!-- EDIT3 SECTION "Build and Run" [1786-2545] --> <!-- EDIT3 SECTION "Build the Project and Run a Sample App" [2006-2531] -->
<h2><a>Optional: Javadoc Popups and Source Navigation in NetBeans</a></h2> <h2><a>Optional: Javadoc Popups and Source Navigation in NetBeans</a></h2>
<div> <div>
@ -159,5 +185,5 @@ Sources used: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplay
</span></div> </span></div>
</div> </div>
<!-- EDIT4 SECTION "Optional: Javadoc Popups and Source Navigation in NetBeans" [2546-] --> <!-- EDIT4 SECTION "Optional: Javadoc Popups and Source Navigation in NetBeans" [2532-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:build_jme3_sources_with_netbeans?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:build_jme3_sources_with_netbeans?do=export_xhtmlbody">view online version</a></em></p>

@ -282,8 +282,54 @@ Models for live rendering should have a low polygon count. To increase the perce
</div></p> </div></p>
</p> </p>
<p>
<p><div>Be careful: The steps above lead to terrible normal maps - use this procedure instead:
</div></p>
</p>
<ul>
<li><div> uncheck &quot;[ ] Bake from Multires&quot;</div>
</li>
<li><div> switch to object mode</div>
</li>
<li><div> make a copy of your mesh (SHIFT+D)</div>
</li>
<li><div> remove the Multires modifier from the copied model</div>
</li>
<li><div> remove any materials from the copied model</div>
</li>
<li><div> remove the armature modifier from the copied model</div>
</li>
<li><div> select the original (highres) model</div>
</li>
<li><div> go into pose mode, clear any pose transformations</div>
</li>
<li><div> the highres and lowres models should be on top of each other now</div>
</li>
<li><div> select the original (highres) model</div>
</li>
<li><div> hold SHIFT and select the copied (lowres) model</div>
</li>
<li><div> in the properties menu go to render</div>
</li>
<li><div> use Bake &gt; Normal</div>
</li>
<li><div> check &quot;[x] Selected to Active&quot;</div>
</li>
<li><div> use a reasonably high value for &quot;Margin&quot; (4+ pixels at least for 1024x1024 maps)</div>
</li>
<li><div> don&#039;t forget to safe the normal map image</div>
</li>
</ul>
<p>
<p><div>Be careful: in the Outliner the camera symbol (Restrict Render) must be on!
</div></p>
</p>
</div> </div>
<!-- EDIT8 SECTION "Blender modeling lowPoly & highPoly" [7640-8762] --> <!-- EDIT8 SECTION "Blender modeling lowPoly & highPoly" [7640-9694] -->
<h3><a>Fixing the normal colors in Blender</a></h3> <h3><a>Fixing the normal colors in Blender</a></h3>
<div> <div>
@ -328,7 +374,7 @@ To do this, go to the Blender Node Window
</ul> </ul>
</div> </div>
<!-- EDIT9 SECTION "Fixing the normal colors in Blender" [8763-9572] --> <!-- EDIT9 SECTION "Fixing the normal colors in Blender" [9695-10504] -->
<h2><a>LightMap baking</a></h2> <h2><a>LightMap baking</a></h2>
<div> <div>
@ -338,7 +384,7 @@ The goal of this tutorial is to explain briefly how to bake light map in blender
</p> </p>
</div> </div>
<!-- EDIT10 SECTION "LightMap baking" [9573-9774] --> <!-- EDIT10 SECTION "LightMap baking" [10505-10706] -->
<h3><a>Blender modeling + texturing</a></h3> <h3><a>Blender modeling + texturing</a></h3>
<div> <div>
<ul> <ul>
@ -387,7 +433,7 @@ The goal of this tutorial is to explain briefly how to bake light map in blender
</ul> </ul>
</div> </div>
<!-- EDIT11 SECTION "Blender modeling + texturing" [9775-10909] --> <!-- EDIT11 SECTION "Blender modeling + texturing" [10707-11841] -->
<h3><a>Importing the model in the SDK and creating the appropriate material</a></h3> <h3><a>Importing the model in the SDK and creating the appropriate material</a></h3>
<div> <div>
@ -424,7 +470,27 @@ The blend file, the ogre xml files and the textures can be found in the download
</p> </p>
</div> </div>
<!-- EDIT12 SECTION "Importing the model in the SDK and creating the appropriate material" [10910-11654] --> <!-- EDIT12 SECTION "Importing the model in the SDK and creating the appropriate material" [11842-12586] -->
<h2><a>Modelling racing tracks and cars</a></h2>
<div>
<p>
Follow the link below to a pdf tutorial by rhymez where I guide you to modelling a car and importing it to the jMonkeyengine correctly and edit it in the vehicle editor.Plus how to model a simple racing track.
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.indiedb.com/games/street-rally-3d/downloads/modelling-in-blender-to-the-jmonkeyengine"><param name="text" value="<html><u>http://www.indiedb.com/games/street-rally-3d/downloads/modelling-in-blender-to-the-jmonkeyengine</u></html>"><param name="textColor" value="blue"></object>
</p>
</div>
<!-- EDIT13 SECTION "Modelling racing tracks and cars" [12587-12943] -->
<h2><a>Optimizing Models for 3D games</a></h2>
<div>
<p>
Follow the link below to a pdf tutorial by rhymez where I guide you on how you can optimize your models for faster rendering.
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.indiedb.com/games/street-rally-3d/downloads/optimizing-3d-models-for-games"><param name="text" value="<html><u>http://www.indiedb.com/games/street-rally-3d/downloads/optimizing-3d-models-for-games</u></html>"><param name="textColor" value="blue"></object>
</p>
</div>
<!-- EDIT14 SECTION "Optimizing Models for 3D games" [12944-13203] -->
<h2><a>SkyBox baking</a></h2> <h2><a>SkyBox baking</a></h2>
<div> <div>
@ -548,10 +614,12 @@ If you want to do it from code, here is an example:
</p> </p>
</div> </div>
<!-- EDIT13 SECTION "SkyBox baking" [11655-16338] --> <!-- EDIT15 SECTION "SkyBox baking" [13204-17887] -->
<h3><a>Further reading</a></h3> <h3><a>Further reading</a></h3>
<div> <div>
<ul> <ul>
<li><div> <a href="/com/jme3/gde/docs/jme3/external/blender-example.html">Warg - from cube to animated and textured game model Example</a></div>
</li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:sky"><param name="text" value="<html><u>http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:sky</u></html>"><param name="textColor" value="blue"></object></div> <li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:sky"><param name="text" value="<html><u>http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:sky</u></html>"><param name="textColor" value="blue"></object></div>
</li> </li>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.org/groups/contribution-depot-jme3/forum/topic/jmonkeyengine-tutorial-how-to-create-skymaps-using-blender/"><param name="text" value="<html><u>http://jmonkeyengine.org/groups/contribution-depot-jme3/forum/topic/jmonkeyengine-tutorial-how-to-create-skymaps-using-blender/</u></html>"><param name="textColor" value="blue"></object></div> <li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.org/groups/contribution-depot-jme3/forum/topic/jmonkeyengine-tutorial-how-to-create-skymaps-using-blender/"><param name="text" value="<html><u>http://jmonkeyengine.org/groups/contribution-depot-jme3/forum/topic/jmonkeyengine-tutorial-how-to-create-skymaps-using-blender/</u></html>"><param name="textColor" value="blue"></object></div>
@ -559,5 +627,5 @@ If you want to do it from code, here is an example:
</ul> </ul>
</div> </div>
<!-- EDIT14 SECTION "Further reading" [16339-] --> <!-- EDIT16 SECTION "Further reading" [17888-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:external:blender?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:external:blender?do=export_xhtmlbody">view online version</a></em></p>

@ -43,14 +43,14 @@ Yes! Actually, you MUST customize it! For your own games, you always create a cu
<div> <div>
<p> <p>
You should break app your application logic into components by spreading it out over individual AppStates. AppStates can be attached to and detached from the game. AppStates have access to all objects (rootNode, PhysicsSpace, inputManager, etc) and methods in your main application. So each AppState can bring its own subset of input handlers, <acronym title="Graphical User Interface">GUI</acronym> nodes, spatial nodes, and even its own subset of game mechanics in the update() loop. You should break down your application logic into components by spreading it out over individual AppStates. AppStates can be attached to and detached from the game. AppStates have access to all objects (rootNode, PhysicsSpace, inputManager, etc) and methods in your main application. So each AppState can bring its own subset of input handlers, <acronym title="Graphical User Interface">GUI</acronym> nodes, spatial nodes, and even its own subset of game mechanics in the update() loop.
<br/> <br/>
<strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/advanced/application_states.html">Application States</a>. <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/advanced/application_states.html">Application States</a>.
</p> </p>
</div> </div>
<!-- EDIT6 SECTION "How can I switch between screens or states?" [1260-1804] --> <!-- EDIT6 SECTION "How can I switch between screens or states?" [1260-1805] -->
<h3><a>How do I pause/unpause a game?</a></h3> <h3><a>How do I pause/unpause a game?</a></h3>
<div> <div>
@ -62,7 +62,7 @@ You split up your application into several AppStates and implement the setEnable
</p> </p>
</div> </div>
<!-- EDIT7 SECTION "How do I pause/unpause a game?" [1805-2410] --> <!-- EDIT7 SECTION "How do I pause/unpause a game?" [1806-2411] -->
<h3><a>How do I disable logger output to the console?</a></h3> <h3><a>How do I disable logger output to the console?</a></h3>
<div> <div>
@ -86,19 +86,19 @@ For the release, switch the severity level of the default logger to print only S
</p> </p>
</div> </div>
<!-- EDIT8 SECTION "How do I disable logger output to the console?" [2411-2897] --> <!-- EDIT8 SECTION "How do I disable logger output to the console?" [2412-2898] -->
<h3><a>Why does the executable crash with &quot;Cannot locate resource&quot;?</a></h3> <h3><a>Why does the executable crash with &quot;Cannot locate resource&quot;?</a></h3>
<div> <div>
<p> <p>
Make sure to only load() models converted to .j3o binary format, not the original Ogre or Wavefront formats. If you load assets from zip files, make sure to ammend the build script to copy them ito the build. Make sure to only load() models converted to .j3o binary format, not the original Ogre or Wavefront formats. If you load assets from zip files, make sure to ammend the build script to copy them to the build directory.
<br/> <br/>
<strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/advanced/asset_manager.html">Asset Manager</a> <strong>Learn more:</strong> <a href="/com/jme3/gde/docs/jme3/advanced/asset_manager.html">Asset Manager</a>
</p> </p>
</div> </div>
<!-- EDIT9 SECTION "Why does the executable crash with Cannot locate resource?" [2898-3228] --> <!-- EDIT9 SECTION "Why does the executable crash with Cannot locate resource?" [2899-3238] -->
<h3><a>What is java.lang.LinkageError: Version mismatch?</a></h3> <h3><a>What is java.lang.LinkageError: Version mismatch?</a></h3>
<div> <div>
@ -110,12 +110,12 @@ To fix this, search for .dll (Windows), .jnilib (Mac), and .so (Linux) files for
</p> </p>
</div> </div>
<!-- EDIT10 SECTION "What is java.lang.LinkageError: Version mismatch?" [3229-4612] --> <!-- EDIT10 SECTION "What is java.lang.LinkageError: Version mismatch?" [3239-4622] -->
<h2><a>I want to load my scene</a></h2> <h2><a>I want to load my scene</a></h2>
<div> <div>
</div> </div>
<!-- EDIT11 SECTION "I want to load my scene" [4613-4648] --> <!-- EDIT11 SECTION "I want to load my scene" [4623-4658] -->
<h3><a>How do I make objects appear / disappear in the 3D scene?</a></h3> <h3><a>How do I make objects appear / disappear in the 3D scene?</a></h3>
<div> <div>
@ -132,7 +132,7 @@ To make a spatial appear in the scene, you attach it to the rootNode (or to a no
</p> </p>
</div> </div>
<!-- EDIT12 SECTION "How do I make objects appear / disappear in the 3D scene?" [4649-5425] --> <!-- EDIT12 SECTION "How do I make objects appear / disappear in the 3D scene?" [4659-5435] -->
<h3><a>Why do I get AssetNotFoundException when loading X ?</a></h3> <h3><a>Why do I get AssetNotFoundException when loading X ?</a></h3>
<div> <div>
@ -159,7 +159,7 @@ Note that you should not register every single folder containing a texture as th
</p> </p>
</div> </div>
<!-- EDIT13 SECTION "Why do I get AssetNotFoundException when loading X ?" [5426-6474] --> <!-- EDIT13 SECTION "Why do I get AssetNotFoundException when loading X ?" [5436-6484] -->
<h3><a>How do I Create 3-D models, textures, sounds?</a></h3> <h3><a>How do I Create 3-D models, textures, sounds?</a></h3>
<div> <div>
@ -175,7 +175,7 @@ You create sounds in an audio editor, for example, Audacity, and export them as
</p> </p>
</div> </div>
<!-- EDIT14 SECTION "How do I Create 3-D models, textures, sounds?" [6475-7472] --> <!-- EDIT14 SECTION "How do I Create 3-D models, textures, sounds?" [6485-7482] -->
<h3><a>How do I load a 3-D model into the scene?</a></h3> <h3><a>How do I load a 3-D model into the scene?</a></h3>
<div> <div>
@ -195,7 +195,7 @@ Spatial ninja = assetManager.loadModel&#40;&quot;Models/Ninja/Ninja.j3o&quot;&#4
</p> </p>
</div> </div>
<!-- EDIT15 SECTION "How do I load a 3-D model into the scene?" [7473-8678] --> <!-- EDIT15 SECTION "How do I load a 3-D model into the scene?" [7483-8688] -->
<h3><a>How do initialize the scene?</a></h3> <h3><a>How do initialize the scene?</a></h3>
<div> <div>
@ -206,12 +206,12 @@ Use the simpleInitApp() method in SimpleApplication (or initApp() in Application
</p> </p>
</div> </div>
<!-- EDIT16 SECTION "How do initialize the scene?" [8679-9011] --> <!-- EDIT16 SECTION "How do initialize the scene?" [8689-9021] -->
<h2><a>I want to transform objects in the scene</a></h2> <h2><a>I want to transform objects in the scene</a></h2>
<div> <div>
</div> </div>
<!-- EDIT17 SECTION "I want to transform objects in the scene" [9012-9064] --> <!-- EDIT17 SECTION "I want to transform objects in the scene" [9022-9074] -->
<h3><a>How do I move or turn or resize a spatial?</a></h3> <h3><a>How do I move or turn or resize a spatial?</a></h3>
<div> <div>
@ -227,7 +227,7 @@ To move or turn or resize a spatial you use transformations. You can concatenate
</p> </p>
</div> </div>
<!-- EDIT18 SECTION "How do I move or turn or resize a spatial?" [9065-9646] --> <!-- EDIT18 SECTION "How do I move or turn or resize a spatial?" [9075-9656] -->
<h3><a>How do I make a spatial move by itself?</a></h3> <h3><a>How do I make a spatial move by itself?</a></h3>
<div> <div>
@ -240,7 +240,7 @@ Change the geometry&#039;s translation (position) live in the update loop using
</p> </p>
</div> </div>
<!-- EDIT19 SECTION "How do I make a spatial move by itself?" [9647-10510] --> <!-- EDIT19 SECTION "How do I make a spatial move by itself?" [9657-10520] -->
<h3><a>How do I access a named sub-mesh in Model?</a></h3> <h3><a>How do I access a named sub-mesh in Model?</a></h3>
<div> <div>
<pre>Geometry result = spatial.getName&#40;&#41;.startsWith&#40;name&#41;;</pre> <pre>Geometry result = spatial.getName&#40;&#41;.startsWith&#40;name&#41;;</pre>
@ -251,7 +251,7 @@ Change the geometry&#039;s translation (position) live in the update loop using
</p> </p>
</div> </div>
<!-- EDIT20 SECTION "How do I access a named sub-mesh in Model?" [10511-10678] --> <!-- EDIT20 SECTION "How do I access a named sub-mesh in Model?" [10521-10688] -->
<h3><a>How do I make procedural or custom shapes?</a></h3> <h3><a>How do I make procedural or custom shapes?</a></h3>
<div> <div>
@ -262,12 +262,12 @@ You can programmatically create com.jme3.scene.Mesh&#039;es.
</p> </p>
</div> </div>
<!-- EDIT21 SECTION "How do I make procedural or custom shapes?" [10679-10839] --> <!-- EDIT21 SECTION "How do I make procedural or custom shapes?" [10689-10849] -->
<h2><a>I want to change the surface of objects in the scene</a></h2> <h2><a>I want to change the surface of objects in the scene</a></h2>
<div> <div>
</div> </div>
<!-- EDIT22 SECTION "I want to change the surface of objects in the scene" [10840-10904] --> <!-- EDIT22 SECTION "I want to change the surface of objects in the scene" [10850-10914] -->
<h3><a>Why is my UV wrapping / texture appearance all wrong?</a></h3> <h3><a>Why is my UV wrapping / texture appearance all wrong?</a></h3>
<div> <div>
@ -285,7 +285,7 @@ You can set the boolean value in the constructor of TextureKey to flipped or not
<pre> material.setTexture&#40;&quot;ColorMap&quot;, this.assetManager.loadTexture&#40;new TextureKey&#40;&quot;myTexture.jpg&quot;, false&#41;&#41;&#41;;</pre> <pre> material.setTexture&#40;&quot;ColorMap&quot;, this.assetManager.loadTexture&#40;new TextureKey&#40;&quot;myTexture.jpg&quot;, false&#41;&#41;&#41;;</pre>
</div> </div>
<!-- EDIT23 SECTION "Why is my UV wrapping / texture appearance all wrong?" [10905-11454] --> <!-- EDIT23 SECTION "Why is my UV wrapping / texture appearance all wrong?" [10915-11464] -->
<h3><a>How do I scale, mirror, or wrap a texture?</a></h3> <h3><a>How do I scale, mirror, or wrap a texture?</a></h3>
<div> <div>
@ -303,7 +303,7 @@ You can choose among various <code>com.jme3.texture.Texture.WrapMode</code>s for
<pre>material.getTextureParam&#40;&quot;DiffuseMap&quot;&#41;.getTextureValue&#40;&#41;.setWrap&#40;WrapMode.Repeat&#41;;</pre> <pre>material.getTextureParam&#40;&quot;DiffuseMap&quot;&#41;.getTextureValue&#40;&#41;.setWrap&#40;WrapMode.Repeat&#41;;</pre>
</div> </div>
<!-- EDIT24 SECTION "How do I scale, mirror, or wrap a texture?" [11455-11996] --> <!-- EDIT24 SECTION "How do I scale, mirror, or wrap a texture?" [11465-12006] -->
<h3><a>How do I change color or shininess of an material?</a></h3> <h3><a>How do I change color or shininess of an material?</a></h3>
<div> <div>
@ -316,7 +316,7 @@ Use the AssetManager to load Materials, and change material settings.
</p> </p>
</div> </div>
<!-- EDIT25 SECTION "How do I change color or shininess of an material?" [11997-12584] --> <!-- EDIT25 SECTION "How do I change color or shininess of an material?" [12007-12594] -->
<h3><a>How do I make a surface wood, stone, metal, etc?</a></h3> <h3><a>How do I make a surface wood, stone, metal, etc?</a></h3>
<div> <div>
@ -329,7 +329,7 @@ Create Textures as image files. Use the AssetManager to load a Material and use
</p> </p>
</div> </div>
<!-- EDIT26 SECTION "How do I make a surface wood, stone, metal, etc?" [12585-13358] --> <!-- EDIT26 SECTION "How do I make a surface wood, stone, metal, etc?" [12595-13368] -->
<h3><a>Why are materials too bright, too dark, or flickering?</a></h3> <h3><a>Why are materials too bright, too dark, or flickering?</a></h3>
<div> <div>
@ -338,7 +338,7 @@ If you use a lit material (based on Lighting.j3md) then you must attach a light
</p> </p>
</div> </div>
<!-- EDIT27 SECTION "Why are materials too bright, too dark, or flickering?" [13359-14172] --> <!-- EDIT27 SECTION "Why are materials too bright, too dark, or flickering?" [13369-14182] -->
<h3><a>How do I make geometries cast a shadow?</a></h3> <h3><a>How do I make geometries cast a shadow?</a></h3>
<div> <div>
@ -351,7 +351,7 @@ Use com.jme3.shadow.BasicShadowRenderer together with com.jme3.light.Directional
</p> </p>
</div> </div>
<!-- EDIT28 SECTION "How do I make geometries cast a shadow?" [14173-14681] --> <!-- EDIT28 SECTION "How do I make geometries cast a shadow?" [14183-14691] -->
<h3><a>How do I make materials transparent?</a></h3> <h3><a>How do I make materials transparent?</a></h3>
<div> <div>
@ -367,7 +367,7 @@ Assign a texture with an alpha channel to a Material and set the Material&#039;s
</p> </p>
</div> </div>
<!-- EDIT29 SECTION "How do I make materials transparent?" [14682-15118] --> <!-- EDIT29 SECTION "How do I make materials transparent?" [14692-15128] -->
<h3><a>How do I force or disable culling?</a></h3> <h3><a>How do I force or disable culling?</a></h3>
<div> <div>
@ -391,7 +391,7 @@ You can also deactivate the <code>com.jme3.scene.Spatial.CullHint</code> of a wh
</p> </p>
</div> </div>
<!-- EDIT30 SECTION "How do I force or disable culling?" [15119-15667] --> <!-- EDIT30 SECTION "How do I force or disable culling?" [15129-15677] -->
<h3><a>Can I draw only an outline of the scene?</a></h3> <h3><a>Can I draw only an outline of the scene?</a></h3>
<div> <div>
@ -407,12 +407,12 @@ Add a renders state to the material&#039;s and activate <code>Wireframe</code>.
</p> </p>
</div> </div>
<!-- EDIT31 SECTION "Can I draw only an outline of the scene?" [15668-15904] --> <!-- EDIT31 SECTION "Can I draw only an outline of the scene?" [15678-15914] -->
<h2><a>I want to control the camera</a></h2> <h2><a>I want to control the camera</a></h2>
<div> <div>
</div> </div>
<!-- EDIT32 SECTION "I want to control the camera" [15905-15945] --> <!-- EDIT32 SECTION "I want to control the camera" [15915-15955] -->
<h3><a>How do I switch between third-person and first-person view ?</a></h3> <h3><a>How do I switch between third-person and first-person view ?</a></h3>
<div> <div>
@ -434,18 +434,18 @@ chaseCam = new ChaseCamera&#40;cam, spatial, inputManager&#41;;</pre>
</ul> </ul>
</div> </div>
<!-- EDIT33 SECTION "How do I switch between third-person and first-person view ?" [15946-17002] --> <!-- EDIT33 SECTION "How do I switch between third-person and first-person view ?" [15956-17012] -->
<h3><a>How do I increase camera speed?</a></h3> <h3><a>How do I increase camera speed?</a></h3>
<div> <div>
<pre>flyCam.setMoveSpeed&#40;50f&#41;;</pre> <pre>flyCam.setMoveSpeed&#40;50f&#41;;</pre>
</div> </div>
<!-- EDIT34 SECTION "How do I increase camera speed?" [17003-17089] --> <!-- EDIT34 SECTION "How do I increase camera speed?" [17013-17099] -->
<h2><a>Actions, Interactions, Physics</a></h2> <h2><a>Actions, Interactions, Physics</a></h2>
<div> <div>
</div> </div>
<!-- EDIT35 SECTION "Actions, Interactions, Physics" [17090-17132] --> <!-- EDIT35 SECTION "Actions, Interactions, Physics" [17100-17142] -->
<h3><a>How do I implement game logic / game mechanics?</a></h3> <h3><a>How do I implement game logic / game mechanics?</a></h3>
<div> <div>
@ -456,7 +456,7 @@ Use Controls to define the behaviour of types of Spatials. Use Application State
</p> </p>
</div> </div>
<!-- EDIT36 SECTION "How do I implement game logic / game mechanics?" [17133-17694] --> <!-- EDIT36 SECTION "How do I implement game logic / game mechanics?" [17143-17704] -->
<h3><a>How do I let players interact via keyboard?</a></h3> <h3><a>How do I let players interact via keyboard?</a></h3>
<div> <div>
@ -467,7 +467,7 @@ Use com.jme3.input.KeyInput and a Input Listener.
</p> </p>
</div> </div>
<!-- EDIT37 SECTION "How do I let players interact via keyboard?" [17695-17902] --> <!-- EDIT37 SECTION "How do I let players interact via keyboard?" [17705-17912] -->
<h3><a>How do I let players interact by clicking?</a></h3> <h3><a>How do I let players interact by clicking?</a></h3>
<div> <div>
@ -480,7 +480,7 @@ Players typically click the mouse to pick up objects, to open doors, to shoot a
</p> </p>
</div> </div>
<!-- EDIT38 SECTION "How do I let players interact by clicking?" [17903-18727] --> <!-- EDIT38 SECTION "How do I let players interact by clicking?" [17913-18737] -->
<h3><a>How do I animate characters?</a></h3> <h3><a>How do I animate characters?</a></h3>
<div> <div>
@ -493,7 +493,7 @@ Create an animated OgreMesh model with bones in a 3-D mesh editor (e.g. Blender)
</p> </p>
</div> </div>
<!-- EDIT39 SECTION "How do I animate characters?" [18728-19199] --> <!-- EDIT39 SECTION "How do I animate characters?" [18738-19209] -->
<h3><a>How do I keep players from falling through walls and floors?</a></h3> <h3><a>How do I keep players from falling through walls and floors?</a></h3>
<div> <div>
@ -504,7 +504,7 @@ Use collision detection. The most common solution is to use jme&#039;s physics i
</p> </p>
</div> </div>
<!-- EDIT40 SECTION "How do I keep players from falling through walls and floors?" [19200-19562] --> <!-- EDIT40 SECTION "How do I keep players from falling through walls and floors?" [19210-19572] -->
<h3><a>How do I make balls/wheels/etc bounce and roll?</a></h3> <h3><a>How do I make balls/wheels/etc bounce and roll?</a></h3>
<div> <div>
@ -517,7 +517,7 @@ Add physics controls to Spatials and give them spherical or cylindrical bounding
</p> </p>
</div> </div>
<!-- EDIT41 SECTION "How do I make balls/wheels/etc bounce and roll?" [19563-20160] --> <!-- EDIT41 SECTION "How do I make balls/wheels/etc bounce and roll?" [19573-20170] -->
<h3><a>How do I debug weird Physics behaviour?</a></h3> <h3><a>How do I debug weird Physics behaviour?</a></h3>
<div> <div>
@ -527,12 +527,12 @@ Maybe your collision shapes overlap ??? or they are not where you think they are
<pre>bulletAppState.getPhysicsSpace&#40;&#41;.enableDebug&#40;assetManager&#41;;</pre> <pre>bulletAppState.getPhysicsSpace&#40;&#41;.enableDebug&#40;assetManager&#41;;</pre>
</div> </div>
<!-- EDIT42 SECTION "How do I debug weird Physics behaviour?" [20161-20474] --> <!-- EDIT42 SECTION "How do I debug weird Physics behaviour?" [20171-20484] -->
<h3><a>How do I make a walking character?</a></h3> <h3><a>How do I make a walking character?</a></h3>
<div> <div>
<p> <p>
You can use jBullet&#039;s CharacterControl that locks a physical object upright, so it does not tip over when moving/walking (as tall physical objects are wont to do). You can use jBullet&#039;s CharacterControl that locks a physical object upright, so it does not tip over when moving/walking (as tall physical objects are typically wanted to).
<br/> <br/>
<strong>Learn more:</strong> CharacterControl <strong>Learn more:</strong> CharacterControl
<br/> <br/>
@ -540,7 +540,7 @@ Code samples: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplay
</p> </p>
</div> </div>
<!-- EDIT43 SECTION "How do I make a walking character?" [20475-21033] --> <!-- EDIT43 SECTION "How do I make a walking character?" [20485-21052] -->
<h3><a>How do I steer vehicles?</a></h3> <h3><a>How do I steer vehicles?</a></h3>
<div> <div>
@ -553,7 +553,7 @@ Code samples: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplay
</p> </p>
</div> </div>
<!-- EDIT44 SECTION "How do I steer vehicles?" [21034-21401] --> <!-- EDIT44 SECTION "How do I steer vehicles?" [21053-21420] -->
<h3><a>Can objects swing like a pendulums, chains, ropebridges?</a></h3> <h3><a>Can objects swing like a pendulums, chains, ropebridges?</a></h3>
<div> <div>
@ -565,12 +565,12 @@ Use a PhysicsControl&#039;s hinges and joints.
</p> </p>
</div> </div>
<!-- EDIT45 SECTION "Can objects swing like a pendulums, chains, ropebridges?" [21402-21802] --> <!-- EDIT45 SECTION "Can objects swing like a pendulums, chains, ropebridges?" [21421-21821] -->
<h2><a>Default GUI Display</a></h2> <h2><a>Default GUI Display</a></h2>
<div> <div>
</div> </div>
<!-- EDIT46 SECTION "Default GUI Display" [21803-21834] --> <!-- EDIT46 SECTION "Default GUI Display" [21822-21853] -->
<h3><a>What are these FPS/Objects/Vertices/Triangles statistics?</a></h3> <h3><a>What are these FPS/Objects/Vertices/Triangles statistics?</a></h3>
<div> <div>
@ -582,7 +582,7 @@ At the bottom left of every default SimpleGame, you see the <a href="/com/jme3/g
</p> </p>
</div> </div>
<!-- EDIT47 SECTION "What are these FPS/Objects/Vertices/Triangles statistics?" [21835-22362] --> <!-- EDIT47 SECTION "What are these FPS/Objects/Vertices/Triangles statistics?" [21854-22381] -->
<h3><a>How do I get rid of the FPS/Objects statistics?</a></h3> <h3><a>How do I get rid of the FPS/Objects statistics?</a></h3>
<div> <div>
@ -601,7 +601,7 @@ setDisplayStatView(false); // to hide the statistics </pre>
</p> </p>
</div> </div>
<!-- EDIT48 SECTION "How do I get rid of the FPS/Objects statistics?" [22363-22627] --> <!-- EDIT48 SECTION "How do I get rid of the FPS/Objects statistics?" [22382-22646] -->
<h3><a>How do I display score, health, mini-maps, status icons?</a></h3> <h3><a>How do I display score, health, mini-maps, status icons?</a></h3>
<div> <div>
@ -614,7 +614,7 @@ Attach text and pictures to the orthogonal <code>guiNode</code> to create a head
</p> </p>
</div> </div>
<!-- EDIT49 SECTION "How do I display score, health, mini-maps, status icons?" [22628-23220] --> <!-- EDIT49 SECTION "How do I display score, health, mini-maps, status icons?" [22647-23239] -->
<h3><a>How do I display buttons and UI controls?</a></h3> <h3><a>How do I display buttons and UI controls?</a></h3>
<div> <div>
@ -627,7 +627,7 @@ Sample Code: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplaye
</p> </p>
</div> </div>
<!-- EDIT50 SECTION "How do I display buttons and UI controls?" [23221-23665] --> <!-- EDIT50 SECTION "How do I display buttons and UI controls?" [23240-23684] -->
<h3><a>How do i display a loading screen?</a></h3> <h3><a>How do i display a loading screen?</a></h3>
<div> <div>
@ -638,12 +638,12 @@ Instead of having a frozen frame while your games loads, you can have a loading
</p> </p>
</div> </div>
<!-- EDIT51 SECTION "How do i display a loading screen?" [23666-23882] --> <!-- EDIT51 SECTION "How do i display a loading screen?" [23685-23901] -->
<h2><a>Nifty GUI</a></h2> <h2><a>Nifty GUI</a></h2>
<div> <div>
</div> </div>
<!-- EDIT52 SECTION "Nifty GUI" [23883-23904] --> <!-- EDIT52 SECTION "Nifty GUI" [23902-23923] -->
<h3><a>I get NoSuchElementException when adding controls (buttons etc)!</a></h3> <h3><a>I get NoSuchElementException when adding controls (buttons etc)!</a></h3>
<div> <div>
@ -654,7 +654,7 @@ Verify that you include a controls definition file link in your <acronym title="
<pre><span>&lt;useControls filename=&quot;nifty-default-controls.xml&quot;/&gt;</span></pre> <pre><span>&lt;useControls filename=&quot;nifty-default-controls.xml&quot;/&gt;</span></pre>
</div> </div>
<!-- EDIT53 SECTION "I get NoSuchElementException when adding controls (buttons etc)!" [23905-24140] --> <!-- EDIT53 SECTION "I get NoSuchElementException when adding controls (buttons etc)!" [23924-24159] -->
<h3><a>Where can I find example code of Nifty GUI&#039;s XML and Java classes?</a></h3> <h3><a>Where can I find example code of Nifty GUI&#039;s XML and Java classes?</a></h3>
<div> <div>
@ -663,7 +663,7 @@ Verify that you include a controls definition file link in your <acronym title="
</p> </p>
</div> </div>
<!-- EDIT54 SECTION "Where can I find example code of Nifty GUI's XML and Java classes?" [24141-24303] --> <!-- EDIT54 SECTION "Where can I find example code of Nifty GUI's XML and Java classes?" [24160-24322] -->
<h3><a>Is there Java Doc for Nifty GUI?</a></h3> <h3><a>Is there Java Doc for Nifty GUI?</a></h3>
<div> <div>
@ -672,12 +672,12 @@ Verify that you include a controls definition file link in your <acronym title="
</p> </p>
</div> </div>
<!-- EDIT55 SECTION "Is there Java Doc for Nifty GUI?" [24304-24429] --> <!-- EDIT55 SECTION "Is there Java Doc for Nifty GUI?" [24323-24448] -->
<h2><a>I want to create an environment with sounds, effects, and landscapes</a></h2> <h2><a>I want to create an environment with sounds, effects, and landscapes</a></h2>
<div> <div>
</div> </div>
<!-- EDIT56 SECTION "I want to create an environment with sounds, effects, and landscapes" [24430-24510] --> <!-- EDIT56 SECTION "I want to create an environment with sounds, effects, and landscapes" [24449-24529] -->
<h3><a>How do I play sounds and noises?</a></h3> <h3><a>How do I play sounds and noises?</a></h3>
<div> <div>
@ -690,7 +690,7 @@ Use AudioRenderer, Listener, and AudioNode from com.jme3.audio.*.
</p> </p>
</div> </div>
<!-- EDIT57 SECTION "How do I play sounds and noises?" [24511-24814] --> <!-- EDIT57 SECTION "How do I play sounds and noises?" [24530-24833] -->
<h3><a>How do I make fire, smoke, explosions, swarms, magic spells?</a></h3> <h3><a>How do I make fire, smoke, explosions, swarms, magic spells?</a></h3>
<div> <div>
@ -703,7 +703,7 @@ For swarm like effects you use particle emitters.
</p> </p>
</div> </div>
<!-- EDIT58 SECTION "How do I make fire, smoke, explosions, swarms, magic spells?" [24815-25470] --> <!-- EDIT58 SECTION "How do I make fire, smoke, explosions, swarms, magic spells?" [24834-25489] -->
<h3><a>How do I make water, waves, reflections?</a></h3> <h3><a>How do I make water, waves, reflections?</a></h3>
<div> <div>
@ -716,7 +716,7 @@ Use a special post-processor renderer from com.jme3.water.*.
</p> </p>
</div> </div>
<!-- EDIT59 SECTION "How do I make water, waves, reflections?" [25471-26231] --> <!-- EDIT59 SECTION "How do I make water, waves, reflections?" [25490-26250] -->
<h3><a>How do I make fog, bloom, blur, light scattering?</a></h3> <h3><a>How do I make fog, bloom, blur, light scattering?</a></h3>
<div> <div>
@ -727,7 +727,7 @@ Use special post-processor renderers from com.jme3.post.*.
</p> </p>
</div> </div>
<!-- EDIT60 SECTION "How do I make fog, bloom, blur, light scattering?" [26232-26406] --> <!-- EDIT60 SECTION "How do I make fog, bloom, blur, light scattering?" [26251-26425] -->
<h3><a>How do I generate a terrain?</a></h3> <h3><a>How do I generate a terrain?</a></h3>
<div> <div>
@ -740,7 +740,7 @@ Use com.jme3.terrain.*. The JMonkeyEngine also provides you with a Terrain Edito
</p> </p>
</div> </div>
<!-- EDIT61 SECTION "How do I generate a terrain?" [26407-26790] --> <!-- EDIT61 SECTION "How do I generate a terrain?" [26426-26809] -->
<h3><a>How do I make a sky?</a></h3> <h3><a>How do I make a sky?</a></h3>
<div> <div>
@ -758,12 +758,12 @@ skyGeo.setQueueBucket&#40;Bucket.Sky&#41; </pre>
</p> </p>
</div> </div>
<!-- EDIT62 SECTION "How do I make a sky?" [26791-27170] --> <!-- EDIT62 SECTION "How do I make a sky?" [26810-27189] -->
<h2><a>I want to access to back-end properties</a></h2> <h2><a>I want to access to back-end properties</a></h2>
<div> <div>
</div> </div>
<!-- EDIT63 SECTION "I want to access to back-end properties" [27171-27222] --> <!-- EDIT63 SECTION "I want to access to back-end properties" [27190-27241] -->
<h3><a>How do I read out graphic card capabilities?</a></h3> <h3><a>How do I read out graphic card capabilities?</a></h3>
<div> <div>
@ -775,12 +775,12 @@ If your game is heavily using features that older cards do not support, you can
Logger.getLogger&#40;HelloJME3.class.getName&#40;&#41;&#41;.log&#40;Level.INFO, &quot;Capabilities: {0}&quot;, caps.toString&#40;&#41;&#41;;</pre> Logger.getLogger&#40;HelloJME3.class.getName&#40;&#41;&#41;.log&#40;Level.INFO, &quot;Capabilities: {0}&quot;, caps.toString&#40;&#41;&#41;;</pre>
</div> </div>
<!-- EDIT64 SECTION "How do I read out graphic card capabilities?" [27223-27658] --> <!-- EDIT64 SECTION "How do I read out graphic card capabilities?" [27242-27677] -->
<h3><a>How do I Run jMonkeyEngine 3 with OpenGL1?</a></h3> <h3><a>How do I Run jMonkeyEngine 3 with OpenGL1?</a></h3>
<div> <div>
<p> <p>
In you game, add In your game, add
</p> </p>
<pre>settings.setRenderer&#40;AppSettings.LWJGL_OPENGL1&#41;</pre> <pre>settings.setRenderer&#40;AppSettings.LWJGL_OPENGL1&#41;</pre>
@ -792,7 +792,7 @@ For the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> it
</p> </p>
</div> </div>
<!-- EDIT65 SECTION "How do I Run jMonkeyEngine 3 with OpenGL1?" [27659-27938] --> <!-- EDIT65 SECTION "How do I Run jMonkeyEngine 3 with OpenGL1?" [27678-27958] -->
<h3><a>How do I optimize the heck out of the Scene Graph?</a></h3> <h3><a>How do I optimize the heck out of the Scene Graph?</a></h3>
<div> <div>
@ -809,7 +809,7 @@ Batching means that all Geometries with the same Material are combined into one
</p> </p>
</div> </div>
<!-- EDIT66 SECTION "How do I optimize the heck out of the Scene Graph?" [27939-28408] --> <!-- EDIT66 SECTION "How do I optimize the heck out of the Scene Graph?" [27959-28428] -->
<h3><a>How do I prevent users from unzipping my JAR?</a></h3> <h3><a>How do I prevent users from unzipping my JAR?</a></h3>
<div> <div>
@ -819,12 +819,12 @@ Add an <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><pa
</p> </p>
</div> </div>
<!-- EDIT67 SECTION "How do I prevent users from unzipping my JAR?" [28409-28658] --> <!-- EDIT67 SECTION "How do I prevent users from unzipping my JAR?" [28429-28678] -->
<h2><a>I want to do maths</a></h2> <h2><a>I want to do maths</a></h2>
<div> <div>
</div> </div>
<!-- EDIT68 SECTION "I want to do maths" [28659-28689] --> <!-- EDIT68 SECTION "I want to do maths" [28679-28709] -->
<h3><a>What does addLocal() / multLocal() etc mean?</a></h3> <h3><a>What does addLocal() / multLocal() etc mean?</a></h3>
<div> <div>
@ -877,7 +877,7 @@ Many maths functions (mult(), add(), subtract(), etc) come as local and a non-lo
</ol> </ol>
</div> </div>
<!-- EDIT69 SECTION "What does addLocal() / multLocal() etc mean?" [28690-30051] --> <!-- EDIT69 SECTION "What does addLocal() / multLocal() etc mean?" [28710-30071] -->
<h3><a>What is the difference between World and Local coordinates?</a></h3> <h3><a>What is the difference between World and Local coordinates?</a></h3>
<div> <div>
@ -887,7 +887,7 @@ World coordinates of a Spatial are its absolute coordinates in the 3D scene (thi
</p> </p>
</div> </div>
<!-- EDIT70 SECTION "What is the difference between World and Local coordinates?" [30052-30361] --> <!-- EDIT70 SECTION "What is the difference between World and Local coordinates?" [30072-30381] -->
<h3><a>How do I convert Degrees to Radians?</a></h3> <h3><a>How do I convert Degrees to Radians?</a></h3>
<div> <div>
@ -901,5 +901,5 @@ Multiply degree value by FastMath.DEG_TO_RAD to convert it to radians.
</span></div> </span></div>
</div> </div>
<!-- EDIT71 SECTION "How do I convert Degrees to Radians?" [30362-] --> <!-- EDIT71 SECTION "How do I convert Degrees to Radians?" [30382-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:faq?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:faq?do=export_xhtmlbody">view online version</a></em></p>

@ -8,7 +8,7 @@ Every class that extends jme3.app.SimpleApplication has properties that can be c
</p> </p>
<p> <p>
<p><div>Configure application settings in <code>main()</code>, before you call <code>app.start()</code> on the application object. If you change display settings during runtime, for eyample in <code>simpleInitApp()</code>, you must call <code>app.restart()</code> to make them take effect. <p><div>Configure application settings in <code>main()</code>, before you call <code>app.start()</code> on the application object. If you change display settings during runtime, for example in <code>simpleInitApp()</code>, you must call <code>app.restart()</code> to make them take effect.
</div></p> </div></p>
</p> </p>
@ -47,14 +47,14 @@ This example toggles the settings to fullscreen while the game is already runnin
int i=0; // note: there are usually several, let's pick the first int i=0; // note: there are usually several, let's pick the first
settings.setResolution&#40;modes&#91;i&#93;.getWidth&#40;&#41;,modes&#91;i&#93;.getHeight&#40;&#41;&#41;; settings.setResolution&#40;modes&#91;i&#93;.getWidth&#40;&#41;,modes&#91;i&#93;.getHeight&#40;&#41;&#41;;
settings.setFrequency&#40;modes&#91;i&#93;.getRefreshRate&#40;&#41;&#41;; settings.setFrequency&#40;modes&#91;i&#93;.getRefreshRate&#40;&#41;&#41;;
settings.setDepthBits&#40;modes&#91;i&#93;.getBitDepth&#40;&#41;&#41;; settings.setBitsPerPixel&#40;modes&#91;i&#93;.getBitDepth&#40;&#41;&#41;;
settings.setFullscreen&#40;device.isFullScreenSupported&#40;&#41;&#41;; settings.setFullscreen&#40;device.isFullScreenSupported&#40;&#41;&#41;;
app.setSettings&#40;settings&#41;; app.setSettings&#40;settings&#41;;
app.restart&#40;&#41;; // restart the context to apply changes app.restart&#40;&#41;; // restart the context to apply changes
&#125;</pre> &#125;</pre>
</div> </div>
<!-- EDIT2 SECTION "Code Samples" [559-2059] --> <!-- EDIT2 SECTION "Code Samples" [559-2062] -->
<h2><a>Properties</a></h2> <h2><a>Properties</a></h2>
<div> <div>
<div><table> <div><table>
@ -94,7 +94,7 @@ Set VSync to false to deactivate vertical syncing (faster, but possible page tea
60 fps</td> 60 fps</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT4 TABLE [2084-4305] --><div><table> <!-- EDIT4 TABLE [2087-4308] --><div><table>
<tr> <tr>
<th>Settings Property (Input)</th><th>Description</th><th>Default</th> <th>Settings Property (Input)</th><th>Description</th><th>Default</th>
</tr> </tr>
@ -111,7 +111,7 @@ Set VSync to false to deactivate vertical syncing (faster, but possible page tea
<td>setEmulateMouseFlipAxis(true,true)</td><td>Flips the X or Y (or both) axes for the emulated mouse. Set the first parameter to true to flip the x axis, and the second to flip the y axis.</td><td>false,false</td> <td>setEmulateMouseFlipAxis(true,true)</td><td>Flips the X or Y (or both) axes for the emulated mouse. Set the first parameter to true to flip the x axis, and the second to flip the y axis.</td><td>false,false</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT5 TABLE [4307-5021] --><div><table> <!-- EDIT5 TABLE [4310-5024] --><div><table>
<tr> <tr>
<th>Settings Property (Audio)</th><th>Description</th><th>Default</th> <th>Settings Property (Audio)</th><th>Description</th><th>Default</th>
</tr> </tr>
@ -122,7 +122,7 @@ Set VSync to false to deactivate vertical syncing (faster, but possible page tea
<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> <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> </tr>
</table></div> </table></div>
<!-- EDIT6 TABLE [5023-5447] --><div><table> <!-- EDIT6 TABLE [5026-5450] --><div><table>
<tr> <tr>
<th>Settings Property (Branding)</th><th>Description</th><th>Default</th> <th>Settings Property (Branding)</th><th>Description</th><th>Default</th>
</tr> </tr>
@ -137,7 +137,7 @@ ImageIO.read(new File(&quot;&quot;)), ???});</td><td>This specifies the little a
<td>setSettingsDialogImage(&quot;Interface/mysplashscreen.png&quot;)</td><td>A custom splashscreen image in the <code>assets/Interface</code> directory which is displayed when the settings dialog is shown.</td><td>&quot;/com/jme3/app/Monkey.png&quot;</td> <td>setSettingsDialogImage(&quot;Interface/mysplashscreen.png&quot;)</td><td>A custom splashscreen image in the <code>assets/Interface</code> directory which is displayed when the settings dialog is shown.</td><td>&quot;/com/jme3/app/Monkey.png&quot;</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT7 TABLE [5449-6156] --> <!-- EDIT7 TABLE [5452-6159] -->
<p> <p>
<p><div>You can use <code>app.setShowSettings(true);</code> and <code>setSettingsDialogImage(&quot;Interface/mysplashscreen.png&quot;)</code> to present the user with jme3&#039;s default display settings dialog when starting the game. Use <code>app.setShowSettings(false);</code> to hide the default settings screen. Set this boolean before calling <code>app.start()</code> on the SimpleApplication. <p><div>You can use <code>app.setShowSettings(true);</code> and <code>setSettingsDialogImage(&quot;Interface/mysplashscreen.png&quot;)</code> to present the user with jme3&#039;s default display settings dialog when starting the game. Use <code>app.setShowSettings(false);</code> to hide the default settings screen. Set this boolean before calling <code>app.start()</code> on the SimpleApplication.
@ -145,7 +145,7 @@ ImageIO.read(new File(&quot;&quot;)), ???});</td><td>This specifies the little a
</p> </p>
</div> </div>
<!-- EDIT3 SECTION "Properties" [2060-6516] --> <!-- EDIT3 SECTION "Properties" [2063-6519] -->
<h2><a>Toggling and Activating Settings</a></h2> <h2><a>Toggling and Activating Settings</a></h2>
<div> <div>
<div><table> <div><table>
@ -165,9 +165,9 @@ ImageIO.read(new File(&quot;&quot;)), ???});</td><td>This specifies the little a
<td>app.restart()</td><td>Restart()ing a running game restarts the game context and applies the updated settings object. (This does not restart or reinitialize the whole game.)</td> <td>app.restart()</td><td>Restart()ing a running game restarts the game context and applies the updated settings object. (This does not restart or reinitialize the whole game.)</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT9 TABLE [6563-7444] --> <!-- EDIT9 TABLE [6566-7447] -->
</div> </div>
<!-- EDIT8 SECTION "Toggling and Activating Settings" [6517-7445] --> <!-- EDIT8 SECTION "Toggling and Activating Settings" [6520-7448] -->
<h2><a>Saving and Loading Settings</a></h2> <h2><a>Saving and Loading Settings</a></h2>
<div> <div>
@ -207,5 +207,5 @@ Provide the unique name of your jME3 application as the String argument. For exa
</ul> </ul>
</div> </div>
<!-- EDIT10 SECTION "Saving and Loading Settings" [7446-] --> <!-- EDIT10 SECTION "Saving and Loading Settings" [7449-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:intermediate:appsettings?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:intermediate:appsettings?do=export_xhtmlbody">view online version</a></em></p>

@ -158,7 +158,7 @@ Whether you work in a team or alone, keeping a version controlled repository of
<ul> <ul>
<li><div> Treat commit messages as messages to your future self. &quot;Made some changes&quot; is <em>not</em> a commit message.</div> <li><div> Treat commit messages as messages to your future self. &quot;Made some changes&quot; is <em>not</em> a commit message.</div>
</li> </li>
<li><div> The jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> supports Subversion, Mercurial, and <acronym title="Concurrent Versions System">CVS</acronym>. <br/> <li><div> The jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> supports Subversion, Mercurial, and Git. <br/>
If you don&#039;t know which to choose, Subversion is a good choice for starters.</div> If you don&#039;t know which to choose, Subversion is a good choice for starters.</div>
</li> </li>
<li><div> Set up your own local server, or get free remote hosting space from various open-source dev portals like <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://sourceforge.net/"><param name="text" value="<html><u>Sourceforge</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="https://github.com/"><param name="text" value="<html><u>Github</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="https://bitbucket.org/"><param name="text" value="<html><u>bitbucket</u></html>"><param name="textColor" value="blue"></object> (supports private projects), <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://home.java.net/create-project"><param name="text" value="<html><u>Java.net</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="https://code.google.com"><param name="text" value="<html><u>Google Code</u></html>"><param name="textColor" value="blue"></object>???</div> <li><div> Set up your own local server, or get free remote hosting space from various open-source dev portals like <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://sourceforge.net/"><param name="text" value="<html><u>Sourceforge</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="https://github.com/"><param name="text" value="<html><u>Github</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="https://bitbucket.org/"><param name="text" value="<html><u>bitbucket</u></html>"><param name="textColor" value="blue"></object> (supports private projects), <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://home.java.net/create-project"><param name="text" value="<html><u>Java.net</u></html>"><param name="textColor" value="blue"></object>, <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="https://code.google.com"><param name="text" value="<html><u>Google Code</u></html>"><param name="textColor" value="blue"></object>???</div>

@ -294,7 +294,7 @@ To make a Geometry transparent or translucent:
</div> </div>
</li> </li>
<li><div> Put the Geometry (not the Material!) in the appropriate render queue bucket. <br/> <li><div> Put the Geometry (not the Material!) in the appropriate render queue bucket. <br/>
Objects in the translucent bucket (e.g. particles) are not affected by SceneProcessors (e.g. shadows). Obejcts in the transparent bucket (e.g. foliage) are affected by SceneProcessors (e.g. shadows).</div> Objects in the translucent bucket (e.g. particles) are not affected by SceneProcessors (e.g. shadows). Objects in the transparent bucket (e.g. foliage) are affected by SceneProcessors (e.g. shadows).</div>
<ul> <ul>
<li><div> <pre>geo.setQueueBucket&#40;Bucket.Translucent&#41;; </pre> <li><div> <pre>geo.setQueueBucket&#40;Bucket.Translucent&#41;; </pre>
</div> </div>

@ -109,7 +109,7 @@ float z = FastMath.sin(phi)*r;</td>
</table></div> </table></div>
<!-- EDIT4 TABLE [1461-2555] --> <!-- EDIT4 TABLE [1461-2555] -->
</div> </div>
<!-- EDIT2 SECTION "Formulas" [32-2557] --> <!-- EDIT2 SECTION "Formulas" [32-2556] -->
<h2><a>Local vs Non-local methods?</a></h2> <h2><a>Local vs Non-local methods?</a></h2>
<div> <div>
<ul> <ul>
@ -122,5 +122,5 @@ float z = FastMath.sin(phi)*r;</td>
</ul> </ul>
</div> </div>
<!-- EDIT5 SECTION "Local vs Non-local methods?" [2558-] --> <!-- EDIT5 SECTION "Local vs Non-local methods?" [2557-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:intermediate:math?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:intermediate:math?do=export_xhtmlbody">view online version</a></em></p>

@ -20,7 +20,7 @@ Assets are files that are not code. Your multi-media assets includes, for exampl
<th>DO</th><th>DON&#039;T</th> <th>DO</th><th>DON&#039;T</th>
</tr> </tr>
<tr> <tr>
<td> Save original models plus textures into <code>assets/Textures</code>. </td><td> Don&#039;t leave textures or models in a folder outside your JME project: The game cannot load or reference them from there. </td> <td> Import original models plus textures into <code>assets/Textures</code>. </td><td> Don&#039;t leave textures or models in a folder outside your JME project: The game cannot load or reference them from there. </td>
</tr> </tr>
<tr> <tr>
<td> Save sounds into <code>assets/Sounds</code>. </td><td> Don&#039;t leave audio files in a folder outside your JME project: The game cannot load or reference them from there. </td> <td> Save sounds into <code>assets/Sounds</code>. </td><td> Don&#039;t leave audio files in a folder outside your JME project: The game cannot load or reference them from there. </td>
@ -41,14 +41,14 @@ Assets are files that are not code. Your multi-media assets includes, for exampl
<td>Agree on naming schemes and folder schemes with your artists early on to avoid confusion. E.g. keep naming schemes for bones and certain model parts. Try to keep your assets folder clean, its like your codes class structure.</td><td>Don&#039;t mindlessly import downloaded models and other assets into your project without keeping a structure and knowing the files work. You can reimport, delete junk.</td> <td>Agree on naming schemes and folder schemes with your artists early on to avoid confusion. E.g. keep naming schemes for bones and certain model parts. Try to keep your assets folder clean, its like your codes class structure.</td><td>Don&#039;t mindlessly import downloaded models and other assets into your project without keeping a structure and knowing the files work. You can reimport, delete junk.</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT2 TABLE [623-2089] --> <!-- EDIT2 TABLE [623-2091] -->
<p> <p>
Read on for details. Read on for details.
</p> </p>
</div> </div>
<!-- EDIT1 SECTION "Multi-Media Asset Pipeline" [1-2112] --> <!-- EDIT1 SECTION "Multi-Media Asset Pipeline" [1-2114] -->
<h2><a>Use The Assets Folder</a></h2> <h2><a>Use The Assets Folder</a></h2>
<div> <div>
@ -59,7 +59,7 @@ Store your assets in subfolders of your project&#039;s <code>assets</code> direc
<pre>jMonkeyProjects/MyGame/assets/Interface/ # .font, .jpg, .png, .xml <pre>jMonkeyProjects/MyGame/assets/Interface/ # .font, .jpg, .png, .xml
jMonkeyProjects/MyGame/assets/MatDefs/ # .j3md jMonkeyProjects/MyGame/assets/MatDefs/ # .j3md
jMonkeyProjects/MyGame/assets/Materials/ # .j3m jMonkeyProjects/MyGame/assets/Materials/ # .j3m
jMonkeyProjects/MyGame/assets/Models/ # .j3o jMonkeyProjects/MyGame/assets/Models/ # .blend, .j3o
jMonkeyProjects/MyGame/assets/Scenes/ # .j3o jMonkeyProjects/MyGame/assets/Scenes/ # .j3o
jMonkeyProjects/MyGame/assets/Shaders/ # .j3f, .vert, .frag jMonkeyProjects/MyGame/assets/Shaders/ # .j3f, .vert, .frag
jMonkeyProjects/MyGame/assets/Sounds/ # .ogg, .wav jMonkeyProjects/MyGame/assets/Sounds/ # .ogg, .wav
@ -105,7 +105,7 @@ See also:
</ul> </ul>
</div> </div>
<!-- EDIT3 SECTION "Use The Assets Folder" [2113-3997] --> <!-- EDIT3 SECTION "Use The Assets Folder" [2115-4007] -->
<h2><a>Create Textures and Materials</a></h2> <h2><a>Create Textures and Materials</a></h2>
<div> <div>
@ -140,7 +140,7 @@ Storing the textures inside your project directory is necessary for the paths in
</p> </p>
</div> </div>
<!-- EDIT4 SECTION "Create Textures and Materials" [3998-5259] --> <!-- EDIT4 SECTION "Create Textures and Materials" [4008-5269] -->
<h2><a>Create 3D Models</a></h2> <h2><a>Create 3D Models</a></h2>
<div> <div>
@ -189,7 +189,7 @@ See also: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer">
</p> </p>
</div> </div>
<!-- EDIT5 SECTION "Create 3D Models" [5260-7588] --> <!-- EDIT5 SECTION "Create 3D Models" [5270-7598] -->
<h2><a>Convert 3D Models to .j3o Format</a></h2> <h2><a>Convert 3D Models to .j3o Format</a></h2>
<div> <div>
@ -216,7 +216,7 @@ This process ensures that the texture paths are correct, and it also keeps your
</p> </p>
</div> </div>
<!-- EDIT6 SECTION "Convert 3D Models to .j3o Format" [7589-8388] --> <!-- EDIT6 SECTION "Convert 3D Models to .j3o Format" [7599-8398] -->
<h3><a>Must I convert to .j3o? Yes!</a></h3> <h3><a>Must I convert to .j3o? Yes!</a></h3>
<div> <div>
@ -245,7 +245,7 @@ Use Java commands, or use the <a href="/com/jme3/gde/docs/sdk/scene_composer.htm
</p> </p>
</div> </div>
<!-- EDIT7 SECTION "Must I convert to .j3o? Yes!" [8389-9851] --> <!-- EDIT7 SECTION "Must I convert to .j3o? Yes!" [8399-9861] -->
<h2><a>See Also</a></h2> <h2><a>See Also</a></h2>
<div> <div>
<ul> <ul>
@ -264,5 +264,5 @@ Use Java commands, or use the <a href="/com/jme3/gde/docs/sdk/scene_composer.htm
</span></div> </span></div>
</div> </div>
<!-- EDIT8 SECTION "See Also" [9852-] --> <!-- EDIT8 SECTION "See Also" [9862-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:intermediate:multi-media_asset_pipeline?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:intermediate:multi-media_asset_pipeline?do=export_xhtmlbody">view online version</a></em></p>

@ -45,15 +45,41 @@ You can optimize nodes using the SceneComposer in the <acronym title="Software D
<p> <p>
When you use math operations like <code>vectorA.mult(vectorB);</code>, they create new objects for the result. These objects have to be garbage collected when you don&#039;t use them anymore. Different Java implementations use different garbage collection algorithms, so depending on the platforms you target, different advice applies.
</p> </p>
<p> <p>
Check your math operations for opportunities to use the <em>local</em> version of the math operations, e.g. <code>vectorA.multLocal(vectorB)</code>. Local methods store the result in vectorA and do not create a new object. Use local methods if you do not need to keep the previous vectorA. The major variants are Oracle&#039;s JRE, old (pre-Gingerbread) Androids, and newer (Gingerbread or later) Androids.
</p>
<p>
Oracle&#039;s JRE is a copying collector. This means that it does not need to do any work for objects that have become unreachable, it just keeps copying live objects to new memory areas and recycles the now-unused area as a whole.
Older objects are copied less often, so the garbage collection overhead is roughly proportional to the rate at which your code creates new objects that survive for, say, more than a minute.
</p>
<p>
Gingerbread and newer Androids use a garbage collector that does some optimization tricks with local variables, but you should avoid creating and forgetting lots of objects in the scene graph.
</p>
<p>
Older Androids use a very naive garbage collector that needs to do real work for every object, both during creation and during collection. Creating local variables can build up a heap of work, particularly if the function is called often.
</p>
<p>
To avoid creating a temporary object, use <em>local methods</em> to overwrite the contents of an existing object instead of creating a new temporary object for the result.
</p>
<p>
E.g. when you use math operations like <code>vectorA.mult(vectorB);</code>, they create new objects for the result.
</p>
<p>
Check your math operations for opportunities to use the <em>local</em> version of the math operations, e.g. <code>vectorA.multLocal(vectorB)</code>. Local methods store the result in vectorA and do not create a new object.
</p> </p>
</div> </div>
<!-- EDIT3 SECTION "Avoid creating new objects" [1394-1890] --> <!-- EDIT3 SECTION "Avoid creating new objects" [1394-3028] -->
<h2><a>Avoid large objects in physics</a></h2> <h2><a>Avoid large objects in physics</a></h2>
<div> <div>
@ -63,7 +89,7 @@ To offload much computation to the less CPU intense physics broadphase collision
</p> </p>
</div> </div>
<!-- EDIT4 SECTION "Avoid large objects in physics" [1891-2295] --> <!-- EDIT4 SECTION "Avoid large objects in physics" [3029-3433] -->
<h2><a>Check the Statistics</a></h2> <h2><a>Check the Statistics</a></h2>
<div> <div>
@ -94,5 +120,5 @@ Generally jME3 is well optimized and optimizes these things correctly. Read <a h
</span></div> </span></div>
</div> </div>
<!-- EDIT5 SECTION "Check the Statistics" [2296-] --> <!-- EDIT5 SECTION "Check the Statistics" [3434-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:intermediate:optimization?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:intermediate:optimization?do=export_xhtmlbody">view online version</a></em></p>

@ -6,17 +6,23 @@
To use iOS deployment you need a computer running MacOSX and a version of Xcode 4.0+ installed. To deploy to a device or the Apple App Store, you need an Apple developer account. To use iOS deployment you need a computer running MacOSX and a version of Xcode 4.0+ installed. To deploy to a device or the Apple App Store, you need an Apple developer account.
</p> </p>
<p>
<p><div>Note that at the moment iOS deployment is in alpha state.
</div></p>
</p>
<p> <p>
iOS deployment works via cross-compilation to native iOS ARM code, there is no virtual machine running on the device. The Avian JVM supports this feature while maintaining general compatibility to OpenJDK and JNI for native access. The minimum compatible iOS deployment target is 4.3. iOS deployment works via cross-compilation to native iOS ARM code, there is no virtual machine running on the device. The Avian JVM supports this feature while maintaining general compatibility to OpenJDK and JNI for native access. The minimum compatible iOS deployment target is 4.3.
</p> </p>
<p> <p>
<p><div>Note that at the moment this option is in pre-alpha state and the system runs on a null renderer. This means there is no visual or audio output. You can however use the current system to explore the options and test cross-compiling your applications. <p><div>To install the iOS deployment plugin, go to Tools???Plugins and under &quot;Available plugins&quot; select the &quot;iOS Support&quot; plugin.
</div></p> </div></p>
</p> </p>
</div> </div>
<!-- EDIT1 SECTION "iOS Deployment" [1-764] --> <!-- EDIT1 SECTION "iOS Deployment" [1-710] -->
<h3><a>Enabling iOS deployment</a></h3> <h3><a>Enabling iOS deployment</a></h3>
<div> <div>
@ -39,7 +45,7 @@ After enabling deployment, a new <code>ios</code> directory is created in the pr
</p> </p>
</div> </div>
<!-- EDIT2 SECTION "Enabling iOS deployment" [765-1685] --> <!-- EDIT2 SECTION "Enabling iOS deployment" [711-1631] -->
<h3><a>Building the iOS binaries</a></h3> <h3><a>Building the iOS binaries</a></h3>
<div> <div>
@ -56,7 +62,7 @@ After the iOS classpath has been created the avian compiler is used to create a
</p> </p>
</div> </div>
<!-- EDIT3 SECTION "Building the iOS binaries" [1686-2507] --> <!-- EDIT3 SECTION "Building the iOS binaries" [1632-2453] -->
<h3><a>Running and deploying the application</a></h3> <h3><a>Running and deploying the application</a></h3>
<div> <div>
@ -68,7 +74,7 @@ To run the application, open the Xcode project under <code>ios/project</code> in
</p> </p>
</div> </div>
<!-- EDIT4 SECTION "Running and deploying the application" [2508-2996] --> <!-- EDIT4 SECTION "Running and deploying the application" [2454-2942] -->
<h3><a>Creating native and java code for iOS</a></h3> <h3><a>Creating native and java code for iOS</a></h3>
<div> <div>
@ -97,5 +103,5 @@ Java code for iOS should be in the <code>ios/src</code> folder as well for clean
</span></div> </span></div>
</div> </div>
<!-- EDIT5 SECTION "Creating native and java code for iOS" [2997-] --> <!-- EDIT5 SECTION "Creating native and java code for iOS" [2943-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:ios?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:ios?do=export_xhtmlbody">view online version</a></em></p>

@ -44,6 +44,30 @@ The definition of a coordinate system is defined in jME by the properties sent t
</div> </div>
<!-- EDIT3 SECTION "Definition" [993-1806] --> <!-- EDIT3 SECTION "Definition" [993-1806] -->
<h3><a>Homogenous coordinates</a></h3>
<div>
<p>
Homogenous coordinates have an additional <em>W</em> value tacked on to the end. The XYZ values are to be divided by W to give the true coordinates.
</p>
<p>
This has several advantages, one technical, some relevant to application programmers:
</p>
<p>
Technically, it simplifies some formulae used inside the vector math. For example, some operations need to apply the same factor to the XYZ coordinates. Chain multiple operations of that kind (and vector math tends to do that), and you can save a lot of multiplications by simply keeping the scaling factor around and doing the multiplication to XYZ at the end of the pipeline, in the 3D card (which does accept homogenous coordinates).
It also simplifies some formulae, in particular anything that is related to rotations.
</p>
<p>
For application programmers, this means you can express infinitely long vectors that still have a direction - these tend to be used in lighting. Just use a W value of 0.0.
</p>
</div>
<!-- EDIT4 SECTION "Homogenous coordinates" [1807-2767] -->
<h2><a>Transformations</a></h2> <h2><a>Transformations</a></h2>
<div> <div>
@ -53,7 +77,7 @@ Transformations define an operation that converts points from one coordinate sys
</p> </p>
</div> </div>
<!-- EDIT4 SECTION "Transformations" [1807-2199] --> <!-- EDIT5 SECTION "Transformations" [2768-3160] -->
<h2><a>Visibility Determination</a></h2> <h2><a>Visibility Determination</a></h2>
<div> <div>
@ -63,17 +87,17 @@ Visibility Determination concerns itself with minimizing the amount of data that
</p> </p>
</div> </div>
<!-- EDIT5 SECTION "Visibility Determination" [2200-2972] --> <!-- EDIT6 SECTION "Visibility Determination" [3161-3933] -->
<h1><a>Fundamental Types</a></h1> <h1><a>Fundamental Types</a></h1>
<div> <div>
</div> </div>
<!-- EDIT6 SECTION "Fundamental Types" [2973-3005] --> <!-- EDIT7 SECTION "Fundamental Types" [3934-3966] -->
<h2><a>ColorRGBA</a></h2> <h2><a>ColorRGBA</a></h2>
<div> <div>
</div> </div>
<!-- EDIT7 SECTION "ColorRGBA" [3006-3026] --> <!-- EDIT8 SECTION "ColorRGBA" [3967-3987] -->
<h3><a>Definition</a></h3> <h3><a>Definition</a></h3>
<div> <div>
@ -87,7 +111,7 @@ ColorRGBA defines a color value in the jME library. The color value is made of t
</p> </p>
</div> </div>
<!-- EDIT8 SECTION "Definition" [3027-3498] --> <!-- EDIT9 SECTION "Definition" [3988-4459] -->
<h3><a>jME Class</a></h3> <h3><a>jME Class</a></h3>
<div> <div>
@ -109,7 +133,7 @@ ColorRGBA will also handle interpolation between two colors. Given a second colo
</p> </p>
</div> </div>
<!-- EDIT9 SECTION "jME Class" [3499-3973] --> <!-- EDIT10 SECTION "jME Class" [4460-4934] -->
<h2><a>Matrix</a></h2> <h2><a>Matrix</a></h2>
<div> <div>
@ -121,7 +145,7 @@ and <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param
</p> </p>
</div> </div>
<!-- EDIT10 SECTION "Matrix" [3974-4164] --> <!-- EDIT11 SECTION "Matrix" [4935-5125] -->
<h3><a>Definition</a></h3> <h3><a>Definition</a></h3>
<div> <div>
@ -148,7 +172,7 @@ There are a few special matrices:
<td>0</td><td>0</td><td>0</td> <td>0</td><td>0</td><td>0</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT12 TABLE [4484-4507] --> <!-- EDIT13 TABLE [5445-5468] -->
<p> <p>
The <em>Identity Matrix</em> is the matrix with 1 on the diagonal entries and 0 for all other entries. The <em>Identity Matrix</em> is the matrix with 1 on the diagonal entries and 0 for all other entries.
@ -164,7 +188,7 @@ The <em>Identity Matrix</em> is the matrix with 1 on the diagonal entries and 0
<td>0</td><td>0</td><td>1</td> <td>0</td><td>0</td><td>1</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT13 TABLE [4608-4631] --> <!-- EDIT14 TABLE [5569-5592] -->
<p> <p>
A Matrix is <em>invertible</em> if there is a matrix <em>M<sup>-1</sup></em> where <em>MM<sup>-1</sup> = M<sup>-1</sup>M = I</em>. A Matrix is <em>invertible</em> if there is a matrix <em>M<sup>-1</sup></em> where <em>MM<sup>-1</sup> = M<sup>-1</sup>M = I</em>.
@ -185,7 +209,7 @@ The <em>transpose</em> of a matrix <em>M = [m<sub>ij</sub>]</em> is <em>M<sup>T<
<td>3</td><td>3</td><td>3</td><td> </td><td>1</td><td>2</td><td>3</td> <td>3</td><td>3</td><td>3</td><td> </td><td>1</td><td>2</td><td>3</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT14 TABLE [4922-4988] --> <!-- EDIT15 TABLE [5883-5949] -->
<p> <p>
A Matrix is symmetric if <em>M</em> = <em>M<sup>T</sup></em>. A Matrix is symmetric if <em>M</em> = <em>M<sup>T</sup></em>.
@ -201,7 +225,7 @@ A Matrix is symmetric if <em>M</em> = <em>M<sup>T</sup></em>.
<td>B</td><td>C</td><td>X</td> <td>B</td><td>C</td><td>X</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT15 TABLE [5043-5068] --> <!-- EDIT16 TABLE [6004-6029] -->
<p> <p>
Where X, A, B, and C equal numbers Where X, A, B, and C equal numbers
</p> </p>
@ -211,7 +235,7 @@ jME includes two types of Matrix classes: Matrix3f and Matrix4f. Matrix3f is a 3
</p> </p>
</div> </div>
<!-- EDIT11 SECTION "Definition" [4165-5330] --> <!-- EDIT12 SECTION "Definition" [5126-6291] -->
<h3><a>Transformations</a></h3> <h3><a>Transformations</a></h3>
<div> <div>
@ -251,7 +275,7 @@ A <em>rotation matrix</em> requires that the transpose and inverse are the same
<td>u<sub>1</sub></td><td>-u<sub>0</sub></td><td>0</td> <td>u<sub>1</sub></td><td>-u<sub>0</sub></td><td>0</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT17 TABLE [6022-6120] --> <!-- EDIT18 TABLE [6983-7081] -->
</div> </div>
<h4><a>Translation</a></h4> <h4><a>Translation</a></h4>
@ -270,14 +294,14 @@ Translation requires a 4x4 matrix, where the vector (x,y,z) is mapped to (x,y,z,
<td>S<sup>T</sup></td><td>1</td> <td>S<sup>T</sup></td><td>1</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT18 TABLE [6292-6315] --> <!-- EDIT19 TABLE [7253-7276] -->
<p> <p>
where M is the 3x3 matrix (containing any rotation/scale information), T is the translation vector and S<sup>T</sup> is the transpose Vector of T. 1 is just a constant. where M is the 3x3 matrix (containing any rotation/scale information), T is the translation vector and S<sup>T</sup> is the transpose Vector of T. 1 is just a constant.
</p> </p>
</div> </div>
<!-- EDIT16 SECTION "Transformations" [5331-6487] --> <!-- EDIT17 SECTION "Transformations" [6292-7448] -->
<h3><a>jME Class</a></h3> <h3><a>jME Class</a></h3>
<div> <div>
@ -291,7 +315,7 @@ Most methods are straight forward, and I will leave documentation to the Javadoc
</p> </p>
</div> </div>
<!-- EDIT19 SECTION "jME Class" [6488-6730] --> <!-- EDIT20 SECTION "jME Class" [7449-7691] -->
<h2><a>Vector</a></h2> <h2><a>Vector</a></h2>
<div> <div>
@ -303,7 +327,7 @@ and <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param
</p> </p>
</div> </div>
<!-- EDIT20 SECTION "Vector" [6731-6921] --> <!-- EDIT21 SECTION "Vector" [7692-7882] -->
<h3><a>Definition</a></h3> <h3><a>Definition</a></h3>
<div> <div>
@ -321,7 +345,7 @@ We have two Vectors (2f and 3f) meaning we have tuples of 2 float values or 3 fl
</p> </p>
</div> </div>
<!-- EDIT21 SECTION "Definition" [6922-7346] --> <!-- EDIT22 SECTION "Definition" [7883-8307] -->
<h3><a>Operations</a></h3> <h3><a>Operations</a></h3>
<div> <div>
@ -411,7 +435,7 @@ Vector3f and Vector2f store their values (x, y, z) and (x, y) respectively as fl
</p> </p>
</div> </div>
<!-- EDIT22 SECTION "Operations" [7347-9282] --> <!-- EDIT23 SECTION "Operations" [8308-10243] -->
<h2><a>Quaternion</a></h2> <h2><a>Quaternion</a></h2>
<div> <div>
@ -421,7 +445,7 @@ See <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param
</p> </p>
</div> </div>
<!-- EDIT23 SECTION "Quaternion" [9283-9395] --> <!-- EDIT24 SECTION "Quaternion" [10244-10356] -->
<h3><a>Definition</a></h3> <h3><a>Definition</a></h3>
<div> <div>
@ -485,7 +509,7 @@ These basic operations allow us to convert various rotation representations to Q
</p> </p>
</div> </div>
<!-- EDIT24 SECTION "Definition" [9396-11564] --> <!-- EDIT25 SECTION "Definition" [10357-12525] -->
<h3><a>Angle Axis</a></h3> <h3><a>Angle Axis</a></h3>
<div> <div>
@ -505,7 +529,7 @@ float angle = 3.14f;
s.getLocalRotation&#40;&#41;.fromAngleAxis&#40;angle, axis&#41;;</pre> s.getLocalRotation&#40;&#41;.fromAngleAxis&#40;angle, axis&#41;;</pre>
</div> </div>
<!-- EDIT25 SECTION "Angle Axis" [11565-12330] --> <!-- EDIT26 SECTION "Angle Axis" [12526-13291] -->
<h3><a>Three Angles</a></h3> <h3><a>Three Angles</a></h3>
<div> <div>
@ -523,7 +547,7 @@ float&#91;&#93; angles = &#123;1, 3, 0&#125;;
s.getLocalRotation&#40;&#41;.fromAngles&#40;angles&#41;;</pre> s.getLocalRotation&#40;&#41;.fromAngles&#40;angles&#41;;</pre>
</div> </div>
<!-- EDIT26 SECTION "Three Angles" [12331-12880] --> <!-- EDIT27 SECTION "Three Angles" [13292-13841] -->
<h3><a>Three Axes</a></h3> <h3><a>Three Axes</a></h3>
<div> <div>
@ -545,7 +569,7 @@ axes&#91;2&#93; = new Vector3f&#40;0, 0.5f, 0.5f&#41;; //dir
s.getLocalRotation&#40;&#41;.fromAxes&#40;axes&#41;;</pre> s.getLocalRotation&#40;&#41;.fromAxes&#40;axes&#41;;</pre>
</div> </div>
<!-- EDIT27 SECTION "Three Axes" [12881-13627] --> <!-- EDIT28 SECTION "Three Axes" [13842-14588] -->
<h3><a>Rotation Matrix</a></h3> <h3><a>Rotation Matrix</a></h3>
<div> <div>
@ -570,7 +594,7 @@ As you can see there are many ways to build a Quaternion. This allows you to wor
</p> </p>
</div> </div>
<!-- EDIT28 SECTION "Rotation Matrix" [13628-14532] --> <!-- EDIT29 SECTION "Rotation Matrix" [14589-15493] -->
<h3><a>Slerp</a></h3> <h3><a>Slerp</a></h3>
<div> <div>
@ -590,7 +614,7 @@ Quaternion q2;
Quaternion q3 = q1.slerp&#40;q2, 0.5f&#41;;</pre> Quaternion q3 = q1.slerp&#40;q2, 0.5f&#41;;</pre>
</div> </div>
<!-- EDIT29 SECTION "Slerp" [14533-15170] --> <!-- EDIT30 SECTION "Slerp" [15494-16131] -->
<h3><a>Multiplication</a></h3> <h3><a>Multiplication</a></h3>
<div> <div>
@ -608,7 +632,7 @@ Vector3f myVector = new Vector3f&#40;0,0,-1&#41;;
myRotation.multLocal&#40;myVector&#41;;</pre> myRotation.multLocal&#40;myVector&#41;;</pre>
</div> </div>
<!-- EDIT30 SECTION "Multiplication" [15171-15645] --> <!-- EDIT31 SECTION "Multiplication" [16132-16606] -->
<h1><a>Utility Classes</a></h1> <h1><a>Utility Classes</a></h1>
<div> <div>
@ -618,7 +642,7 @@ Along with the base Math classes, jME provides a number of Math classes to make
</p> </p>
</div> </div>
<!-- EDIT31 SECTION "Utility Classes" [15646-15921] --> <!-- EDIT32 SECTION "Utility Classes" [16607-16882] -->
<h2><a>Fast Math</a></h2> <h2><a>Fast Math</a></h2>
<div> <div>
@ -628,7 +652,7 @@ See <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param
</p> </p>
</div> </div>
<!-- EDIT32 SECTION "Fast Math" [15922-16028] --> <!-- EDIT33 SECTION "Fast Math" [16883-16989] -->
<h3><a>Definition</a></h3> <h3><a>Definition</a></h3>
<div> <div>
@ -638,7 +662,7 @@ FastMath provides a number of convience methods, and where possible faster versi
</p> </p>
</div> </div>
<!-- EDIT33 SECTION "Definition" [16029-16182] --> <!-- EDIT34 SECTION "Definition" [16990-17143] -->
<h3><a>Usage</a></h3> <h3><a>Usage</a></h3>
<div> <div>
@ -729,7 +753,7 @@ There are five major categories of functions that FastMath provides.
</ul> </ul>
</div> </div>
<!-- EDIT34 SECTION "Usage" [16183-18604] --> <!-- EDIT35 SECTION "Usage" [17144-19565] -->
<h2><a>Line</a></h2> <h2><a>Line</a></h2>
<div> <div>
@ -739,7 +763,7 @@ See <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param
</p> </p>
</div> </div>
<!-- EDIT35 SECTION "Line" [18605-18698] --> <!-- EDIT36 SECTION "Line" [19566-19659] -->
<h3><a>Definition</a></h3> <h3><a>Definition</a></h3>
<div> <div>
@ -749,7 +773,7 @@ A line is a straight one-dimensional figure having no thickness and extending in
</p> </p>
</div> </div>
<!-- EDIT36 SECTION "Definition" [18699-18912] --> <!-- EDIT37 SECTION "Definition" [19660-19873] -->
<h3><a>Usage</a></h3> <h3><a>Usage</a></h3>
<div> <div>
@ -763,14 +787,14 @@ jME defines a Line class that is defined by an origin and direction. In reality,
</p> </p>
</div> </div>
<!-- EDIT37 SECTION "Usage" [18913-19251] --> <!-- EDIT38 SECTION "Usage" [19874-20212] -->
<h3><a>Example 1 - Find a Random Point on a Line</a></h3> <h3><a>Example 1 - Find a Random Point on a Line</a></h3>
<div> <div>
<pre>Line l = new Line&#40;new Vector3f&#40;0,1,0&#41;, new Vector3f&#40;3,2,1&#41;&#41;; <pre>Line l = new Line&#40;new Vector3f&#40;0,1,0&#41;, new Vector3f&#40;3,2,1&#41;&#41;;
Vector3f randomPoint = l.random&#40;&#41;;</pre> Vector3f randomPoint = l.random&#40;&#41;;</pre>
</div> </div>
<!-- EDIT38 SECTION "Example 1 - Find a Random Point on a Line" [19252-19419] --> <!-- EDIT39 SECTION "Example 1 - Find a Random Point on a Line" [20213-20380] -->
<h2><a>Plane</a></h2> <h2><a>Plane</a></h2>
<div> <div>
@ -780,7 +804,7 @@ See <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param
</p> </p>
</div> </div>
<!-- EDIT39 SECTION "Plane" [19420-19516] --> <!-- EDIT40 SECTION "Plane" [20381-20477] -->
<h3><a>Definition</a></h3> <h3><a>Definition</a></h3>
<div> <div>
@ -814,7 +838,7 @@ This gives us the general equation: (ax + by + cz + d = 0)
</p> </p>
</div> </div>
<!-- EDIT40 SECTION "Definition" [19517-20211] --> <!-- EDIT41 SECTION "Definition" [20478-21172] -->
<h3><a>Usage in jME</a></h3> <h3><a>Usage in jME</a></h3>
<div> <div>
@ -846,7 +870,7 @@ These values are returned on a call to <code>whichSide</code>.
</p> </p>
</div> </div>
<!-- EDIT41 SECTION "Usage in jME" [20212-20930] --> <!-- EDIT42 SECTION "Usage in jME" [21173-21891] -->
<h3><a>Example 1 - Determining if a Point is On the Positive Side of a Plane</a></h3> <h3><a>Example 1 - Determining if a Point is On the Positive Side of a Plane</a></h3>
<div> <div>
<pre>Vector3f normal = new Vector3f&#40;0,1,0&#41;; <pre>Vector3f normal = new Vector3f&#40;0,1,0&#41;;
@ -860,7 +884,7 @@ if&#40;side == Plane.NO_SIDE&#41; &#123;
&#125;</pre> &#125;</pre>
</div> </div>
<!-- EDIT42 SECTION "Example 1 - Determining if a Point is On the Positive Side of a Plane" [20931-21305] --> <!-- EDIT43 SECTION "Example 1 - Determining if a Point is On the Positive Side of a Plane" [21892-22266] -->
<h3><a>Example 2 - For the Layperson</a></h3> <h3><a>Example 2 - For the Layperson</a></h3>
<div> <div>
@ -932,7 +956,7 @@ public class TestPlanes
&#125;</pre> &#125;</pre>
</div> </div>
<!-- EDIT43 SECTION "Example 2 - For the Layperson" [21306-23943] --> <!-- EDIT44 SECTION "Example 2 - For the Layperson" [22267-24904] -->
<h2><a>Ray</a></h2> <h2><a>Ray</a></h2>
<div> <div>
@ -942,7 +966,7 @@ See <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param
</p> </p>
</div> </div>
<!-- EDIT44 SECTION "Ray" [23944-24034] --> <!-- EDIT45 SECTION "Ray" [24905-24995] -->
<h3><a>Definition</a></h3> <h3><a>Definition</a></h3>
<div> <div>
@ -956,13 +980,13 @@ This Ray is used extensively in jME for <a href="/com/jme3/gde/docs/jme3/picking
</p> </p>
</div> </div>
<!-- EDIT45 SECTION "Definition" [24035-24401] --> <!-- EDIT46 SECTION "Definition" [24996-25362] -->
<h3><a>Example 1 - Create a Ray That Represents Where the Camera is Looking</a></h3> <h3><a>Example 1 - Create a Ray That Represents Where the Camera is Looking</a></h3>
<div> <div>
<pre>Ray ray = new Ray&#40;cam.getLocation&#40;&#41;, cam.getDirection&#40;&#41;&#41;;</pre> <pre>Ray ray = new Ray&#40;cam.getLocation&#40;&#41;, cam.getDirection&#40;&#41;&#41;;</pre>
</div> </div>
<!-- EDIT46 SECTION "Example 1 - Create a Ray That Represents Where the Camera is Looking" [24402-24558] --> <!-- EDIT47 SECTION "Example 1 - Create a Ray That Represents Where the Camera is Looking" [25363-25519] -->
<h2><a>Rectangle</a></h2> <h2><a>Rectangle</a></h2>
<div> <div>
@ -972,7 +996,7 @@ See <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param
</p> </p>
</div> </div>
<!-- EDIT47 SECTION "Rectangle" [24559-24667] --> <!-- EDIT48 SECTION "Rectangle" [25520-25628] -->
<h3><a>Definition</a></h3> <h3><a>Definition</a></h3>
<div> <div>
@ -982,7 +1006,7 @@ Rectangle defines a finite plane within three dimensional space that is specifie
</p> </p>
</div> </div>
<!-- EDIT48 SECTION "Definition" [24668-24896] --> <!-- EDIT49 SECTION "Definition" [25629-25857] -->
<h3><a>jME Usage</a></h3> <h3><a>jME Usage</a></h3>
<div> <div>
@ -992,7 +1016,7 @@ Rectangle is a straight forward data class that simply maintains values that def
</p> </p>
</div> </div>
<!-- EDIT49 SECTION "jME Usage" [24897-25211] --> <!-- EDIT50 SECTION "jME Usage" [25858-26172] -->
<h3><a>Example 1 : Define a Rectangle and Get a Point From It</a></h3> <h3><a>Example 1 : Define a Rectangle and Get a Point From It</a></h3>
<div> <div>
<pre>Vector3f v1 = new Vector3f&#40;1,0,0&#41;; <pre>Vector3f v1 = new Vector3f&#40;1,0,0&#41;;
@ -1002,7 +1026,7 @@ Rectangle r = new Rectangle&#40;v1, v2, v3&#41;;
Vector3f point = r.random&#40;&#41;;</pre> Vector3f point = r.random&#40;&#41;;</pre>
</div> </div>
<!-- EDIT50 SECTION "Example 1 : Define a Rectangle and Get a Point From It" [25212-25471] --> <!-- EDIT51 SECTION "Example 1 : Define a Rectangle and Get a Point From It" [26173-26432] -->
<h2><a>Triangle</a></h2> <h2><a>Triangle</a></h2>
<div> <div>
@ -1012,7 +1036,7 @@ See <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param
</p> </p>
</div> </div>
<!-- EDIT51 SECTION "Triangle" [25472-25577] --> <!-- EDIT52 SECTION "Triangle" [26433-26538] -->
<h3><a>Definition</a></h3> <h3><a>Definition</a></h3>
<div> <div>
@ -1022,7 +1046,7 @@ A triangle is a 3-sided polygon. Every triangle has three sides and three angles
</p> </p>
</div> </div>
<!-- EDIT52 SECTION "Definition" [25578-25991] --> <!-- EDIT53 SECTION "Definition" [26539-26952] -->
<h3><a>Usage</a></h3> <h3><a>Usage</a></h3>
<div> <div>
@ -1032,7 +1056,7 @@ jME&#039;s Triangle class is a simple data class. It contains three <a href="/co
</p> </p>
</div> </div>
<!-- EDIT53 SECTION "Usage" [25992-26318] --> <!-- EDIT54 SECTION "Usage" [26953-27279] -->
<h3><a>Example 1 - Creating a Triangle</a></h3> <h3><a>Example 1 - Creating a Triangle</a></h3>
<div> <div>
<pre>//the three points that make up the triangle <pre>//the three points that make up the triangle
@ -1042,12 +1066,12 @@ Vector3f p3 = new Vector3f&#40;0,1,1&#41;;
Triangle t = new Triangle&#40;p1, p2, p3&#41;;</pre> Triangle t = new Triangle&#40;p1, p2, p3&#41;;</pre>
</div> </div>
<!-- EDIT54 SECTION "Example 1 - Creating a Triangle" [26319-26569] --> <!-- EDIT55 SECTION "Example 1 - Creating a Triangle" [27280-27530] -->
<h1><a>Tips and Tricks</a></h1> <h1><a>Tips and Tricks</a></h1>
<div> <div>
</div> </div>
<!-- EDIT55 SECTION "Tips and Tricks" [26570-26600] --> <!-- EDIT56 SECTION "Tips and Tricks" [27531-27561] -->
<h2><a>How do I get height/width of a spatial?</a></h2> <h2><a>How do I get height/width of a spatial?</a></h2>
<div> <div>
@ -1062,13 +1086,13 @@ float y = &#40; &#40;BoundingBox&#41;spatial.getWorldBound&#40;&#41;&#41;.getYEx
float z = &#40; &#40;BoundingBox&#41;spatial.getWorldBound&#40;&#41;&#41;.getZExtent&#40;&#41;;</pre> float z = &#40; &#40;BoundingBox&#41;spatial.getWorldBound&#40;&#41;&#41;.getZExtent&#40;&#41;;</pre>
</div> </div>
<!-- EDIT56 SECTION "How do I get height/width of a spatial?" [26601-27031] --> <!-- EDIT57 SECTION "How do I get height/width of a spatial?" [27562-27992] -->
<h2><a>How do I position the center of a Geomtry?</a></h2> <h2><a>How do I position the center of a Geomtry?</a></h2>
<div> <div>
<pre>geo.center&#40;&#41;.move&#40;pos&#41;;</pre> <pre>geo.center&#40;&#41;.move&#40;pos&#41;;</pre>
</div> </div>
<!-- EDIT57 SECTION "How do I position the center of a Geomtry?" [27032-27131] --> <!-- EDIT58 SECTION "How do I position the center of a Geomtry?" [27993-28092] -->
<h3><a>See Also</a></h3> <h3><a>See Also</a></h3>
<div> <div>
<ul> <ul>
@ -1079,5 +1103,5 @@ float z = &#40; &#40;BoundingBox&#41;spatial.getWorldBound&#40;&#41;&#41;.getZEx
</ul> </ul>
</div> </div>
<!-- EDIT58 SECTION "See Also" [27132-] --> <!-- EDIT59 SECTION "See Also" [28093-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:math?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:math?do=export_xhtmlbody">view online version</a></em></p>

@ -352,11 +352,11 @@ See also: <a href="/com/jme3/gde/docs/jme3/advanced/water.html">Water</a>.
<p> <p>
MIP Map means that you provide one texture in two or three resolutions in one file (MIP = &quot;multum in parvo&quot; = &quot;many in one&quot;). Depending on how close (or far) the camera is, the engine automatically renders a more (or less) detailed texture for the object. Thus objects look smooth from close up, but don&#039;t waste resources with unspottable details when far away. Good for everything, but requires more time to create and more space to store textures. If you don&#039;t provide custom ones, the jMonkeyEngine creates basic MIP maps automatically as an optimization. MIP Map means that you provide one texture in two or three resolutions in one file (MIP = &quot;multum in parvo&quot; = &quot;many in one&quot;). Depending on how close (or far) the camera is, the engine automatically renders a more (or less) detailed texture for the object. Thus objects look detailed at close up, but also look good when viewed from far away. Good for everything, but requires more time to create and more space to store textures. If you don&#039;t provide custom ones, the jMonkeyEngine creates basic MIP maps automatically as an optimization.
</p> </p>
</div> </div>
<!-- EDIT23 SECTION "MIP Map Texture" [10812-11398] --> <!-- EDIT23 SECTION "MIP Map Texture" [10812-11378] -->
<h2><a>Procedural Textures</a></h2> <h2><a>Procedural Textures</a></h2>
<div> <div>
@ -374,7 +374,7 @@ See also: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer">
</p> </p>
</div> </div>
<!-- EDIT24 SECTION "Procedural Textures" [11399-12305] --> <!-- EDIT24 SECTION "Procedural Textures" [11379-12285] -->
<h1><a>Animation</a></h1> <h1><a>Animation</a></h1>
<div> <div>
@ -388,7 +388,7 @@ Unless you animate a 3D cartoon, realism of animated characters is generally a p
</p> </p>
</div> </div>
<!-- EDIT25 SECTION "Animation" [12306-12902] --> <!-- EDIT25 SECTION "Animation" [12286-12882] -->
<h2><a>Rigging and Skinning</a></h2> <h2><a>Rigging and Skinning</a></h2>
<div> <div>
@ -458,7 +458,7 @@ E.g. when the thigh bone moves, the leg is fully affected, the hips joints less
</p> </p>
</div> </div>
<!-- EDIT26 SECTION "Rigging and Skinning" [12903-15439] --> <!-- EDIT26 SECTION "Rigging and Skinning" [12883-15419] -->
<h2><a>Kinematics</a></h2> <h2><a>Kinematics</a></h2>
<div> <div>
<ul> <ul>
@ -469,7 +469,7 @@ E.g. when the thigh bone moves, the leg is fully affected, the hips joints less
</ul> </ul>
</div> </div>
<!-- EDIT27 SECTION "Kinematics" [15440-15704] --> <!-- EDIT27 SECTION "Kinematics" [15420-15684] -->
<h2><a>Controller and Channel</a></h2> <h2><a>Controller and Channel</a></h2>
<div> <div>
@ -478,7 +478,7 @@ In the JME3 application, you register animated models to the Animation Controlle
</p> </p>
</div> </div>
<!-- EDIT28 SECTION "Controller and Channel" [15705-16073] --> <!-- EDIT28 SECTION "Controller and Channel" [15685-16053] -->
<h1><a>Artificial Intelligence (AI)</a></h1> <h1><a>Artificial Intelligence (AI)</a></h1>
<div> <div>
@ -529,7 +529,7 @@ There are lots of resources explaining interesting AI algorithms:
</ul> </ul>
</div> </div>
<!-- EDIT29 SECTION "Artificial Intelligence (AI)" [16074-19559] --> <!-- EDIT29 SECTION "Artificial Intelligence (AI)" [16054-19539] -->
<h1><a>Math</a></h1> <h1><a>Math</a></h1>
<div> <div>
@ -538,7 +538,7 @@ There are lots of resources explaining interesting AI algorithms:
</p> </p>
</div> </div>
<!-- EDIT30 SECTION "Math" [19560-19633] --> <!-- EDIT30 SECTION "Math" [19540-19613] -->
<h2><a>Coordinates</a></h2> <h2><a>Coordinates</a></h2>
<div> <div>
@ -549,7 +549,7 @@ In contrast to a vector (which looks similar), a coordinate is a location, not a
</p> </p>
</div> </div>
<!-- EDIT31 SECTION "Coordinates" [19634-20023] --> <!-- EDIT31 SECTION "Coordinates" [19614-20003] -->
<h3><a>The Origin</a></h3> <h3><a>The Origin</a></h3>
<div> <div>
@ -563,7 +563,7 @@ The origin is the central point in the 3D world, where the three axes meet. It&#
</p> </p>
</div> </div>
<!-- EDIT32 SECTION "The Origin" [20024-20228] --> <!-- EDIT32 SECTION "The Origin" [20004-20208] -->
<h2><a>Vectors</a></h2> <h2><a>Vectors</a></h2>
<div> <div>
@ -579,7 +579,7 @@ A vector has a length and a direction, like an arrow in 3D space. A vector start
Vector3f v = new Vector3f&#40; 8f , 0f , 33f &#41;.add&#40;new Vector3f&#40; 0f , -2f , -2f &#41;&#41;; // starts at (8,-2,31)</pre> Vector3f v = new Vector3f&#40; 8f , 0f , 33f &#41;.add&#40;new Vector3f&#40; 0f , -2f , -2f &#41;&#41;; // starts at (8,-2,31)</pre>
</div> </div>
<!-- EDIT33 SECTION "Vectors" [20229-20679] --> <!-- EDIT33 SECTION "Vectors" [20209-20659] -->
<h3><a>Unit Vectors</a></h3> <h3><a>Unit Vectors</a></h3>
<div> <div>
@ -603,7 +603,7 @@ Negate the vegator to change its direction, e.g. (-1, 0, 0) = left.
</p> </p>
</div> </div>
<!-- EDIT34 SECTION "Unit Vectors" [20680-21178] --> <!-- EDIT34 SECTION "Unit Vectors" [20660-21158] -->
<h3><a>Normalized Vectors</a></h3> <h3><a>Normalized Vectors</a></h3>
<div> <div>
@ -618,7 +618,7 @@ When you normalize a vector, it still has the same direction, but you lose the i
</p> </p>
</div> </div>
<!-- EDIT35 SECTION "Normalized Vectors" [21179-21522] --> <!-- EDIT35 SECTION "Normalized Vectors" [21159-21502] -->
<h3><a>Surface Normal Vectors</a></h3> <h3><a>Surface Normal Vectors</a></h3>
<div> <div>
@ -630,7 +630,7 @@ You calculate the Surface Normal by calculating the cross product.
</p> </p>
</div> </div>
<!-- EDIT36 SECTION "Surface Normal Vectors" [21523-21735] --> <!-- EDIT36 SECTION "Surface Normal Vectors" [21503-21715] -->
<h3><a>Cross Product</a></h3> <h3><a>Cross Product</a></h3>
<div> <div>
@ -647,7 +647,7 @@ In 3D space, speaking of an orthogonal only makes sense with respect to a plane.
</p> </p>
</div> </div>
<!-- EDIT37 SECTION "Cross Product" [21736-22446] --> <!-- EDIT37 SECTION "Cross Product" [21716-22426] -->
<h3><a>Transformation</a></h3> <h3><a>Transformation</a></h3>
<div> <div>
@ -661,7 +661,7 @@ Examples: Falling and rotating bricks in 3D Tetris.
</p> </p>
</div> </div>
<!-- EDIT38 SECTION "Transformation" [22447-22711] --> <!-- EDIT38 SECTION "Transformation" [22427-22691] -->
<h3><a>Slerp</a></h3> <h3><a>Slerp</a></h3>
<div> <div>
@ -679,7 +679,7 @@ Example: A burning meteorite Geometry slerps from &quot;position p1, rotation r1
</p> </p>
</div> </div>
<!-- EDIT39 SECTION "Slerp" [22712-23481] --> <!-- EDIT39 SECTION "Slerp" [22692-23461] -->
<h1><a>Game Developer Jargon</a></h1> <h1><a>Game Developer Jargon</a></h1>
<div> <div>
<ul> <ul>
@ -688,7 +688,7 @@ Example: A burning meteorite Geometry slerps from &quot;position p1, rotation r1
</ul> </ul>
</div> </div>
<!-- EDIT40 SECTION "Game Developer Jargon" [23482-23645] --> <!-- EDIT40 SECTION "Game Developer Jargon" [23462-23625] -->
<h1><a>3D graphics Terminology Wiki book</a></h1> <h1><a>3D graphics Terminology Wiki book</a></h1>
<div> <div>
<ul> <ul>
@ -697,5 +697,5 @@ Example: A burning meteorite Geometry slerps from &quot;position p1, rotation r1
</ul> </ul>
</div> </div>
<!-- EDIT41 SECTION "3D graphics Terminology Wiki book" [23646-] --> <!-- EDIT41 SECTION "3D graphics Terminology Wiki book" [23626-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:terminology?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:terminology?do=export_xhtmlbody">view online version</a></em></p>

@ -15,10 +15,12 @@ After you have written and tested your game, you want to brand it and distribute
</li> </li>
<li><div> Android mobile device (.APK)</div> <li><div> Android mobile device (.APK)</div>
</li> </li>
<li><div> iOS mobile device (XCode project)</div>
</li>
</ul> </ul>
</div> </div>
<!-- EDIT1 SECTION "jMonkeyEngine SDK: Application Deployment" [1-417] --> <!-- EDIT1 SECTION "jMonkeyEngine SDK: Application Deployment" [1-455] -->
<h2><a>Requirements</a></h2> <h2><a>Requirements</a></h2>
<div> <div>
@ -28,7 +30,7 @@ Since JAR files are platform independent, your customers can play your jMonkeyEn
</p> </p>
</div> </div>
<!-- EDIT2 SECTION "Requirements" [418-719] --> <!-- EDIT2 SECTION "Requirements" [456-757] -->
<h2><a>Branding</a></h2> <h2><a>Branding</a></h2>
<div> <div>
@ -72,7 +74,7 @@ TODO: where does this info actually show up?
</p> </p>
</div> </div>
<!-- EDIT3 SECTION "Branding" [720-1444] --> <!-- EDIT3 SECTION "Branding" [758-1482] -->
<h2><a>Creating the Distributable</a></h2> <h2><a>Creating the Distributable</a></h2>
<div> <div>
@ -90,7 +92,7 @@ Here are your deployment options in detail:
</p> </p>
</div> </div>
<!-- EDIT4 SECTION "Creating the Distributable" [1445-1988] --> <!-- EDIT4 SECTION "Creating the Distributable" [1483-2026] -->
<h3><a>Desktop Application (JAR)</a></h3> <h3><a>Desktop Application (JAR)</a></h3>
<div> <div>
@ -118,7 +120,7 @@ Most operating systems execute a JAR when users double-click on it, but you can
</p> </p>
</div> </div>
<!-- EDIT5 SECTION "Desktop Application (JAR)" [1989-2865] --> <!-- EDIT5 SECTION "Desktop Application (JAR)" [2027-2903] -->
<h3><a>Desktop Executables (.EXE, .APP, .JAR)</a></h3> <h3><a>Desktop Executables (.EXE, .APP, .JAR)</a></h3>
<div> <div>
@ -144,7 +146,7 @@ When you build your project, zip files for each selected platform will be create
</p> </p>
</div> </div>
<!-- EDIT6 SECTION "Desktop Executables (.EXE, .APP, .JAR)" [2866-3799] --> <!-- EDIT6 SECTION "Desktop Executables (.EXE, .APP, .JAR)" [2904-3837] -->
<h3><a>Web Start (.JNLP)</a></h3> <h3><a>Web Start (.JNLP)</a></h3>
<div> <div>
@ -181,7 +183,7 @@ Also, see this <object classid="java:org.netbeans.modules.javahelp.BrowserDispla
</p> </p>
</div> </div>
<!-- EDIT7 SECTION "Web Start (.JNLP)" [3800-5403] --> <!-- EDIT7 SECTION "Web Start (.JNLP)" [3838-5441] -->
<h3><a>Browser Applet</a></h3> <h3><a>Browser Applet</a></h3>
<div> <div>
@ -246,7 +248,7 @@ The <code>dist/Applet</code> directory now contains all the files necessary for
</ul> </ul>
</div> </div>
<!-- EDIT8 SECTION "Browser Applet" [5404-7168] --> <!-- EDIT8 SECTION "Browser Applet" [5442-7206] -->
<h3><a>Android Mobile Device</a></h3> <h3><a>Android Mobile Device</a></h3>
<div> <div>
@ -260,13 +262,13 @@ Learn more about <a href="/com/jme3/gde/docs/jme3/android.html">Android Support<
</p> </p>
</div> </div>
<!-- EDIT9 SECTION "Android Mobile Device" [7169-7347] --> <!-- EDIT9 SECTION "Android Mobile Device" [7207-7385] -->
<h3><a>iOS Device</a></h3> <h3><a>iOS Device</a></h3>
<div> <div>
<p> <p>
You can set the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> to build an executable for iOS platforms. Mac support is work in progress. You can set the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> to build an executable for iOS platforms. A Mac with XCode installed is needed.
</p> </p>
<p> <p>
@ -274,7 +276,7 @@ Learn more about <a href="/com/jme3/gde/docs/jme3/ios.html">iOS Support</a> here
</p> </p>
</div> </div>
<!-- EDIT10 SECTION "iOS Device" [7348-7529] --> <!-- EDIT10 SECTION "iOS Device" [7386-7571] -->
<h2><a>Tip: Switching Build Configurations</a></h2> <h2><a>Tip: Switching Build Configurations</a></h2>
<div> <div>
@ -299,7 +301,7 @@ Now you can use the <code>Set Project Configuration</code> popup menu to switch
</p> </p>
</div> </div>
<!-- EDIT11 SECTION "Tip: Switching Build Configurations" [7530-8305] --> <!-- EDIT11 SECTION "Tip: Switching Build Configurations" [7572-8347] -->
<h2><a>Tip: Reduce Distribution File Size</a></h2> <h2><a>Tip: Reduce Distribution File Size</a></h2>
<div> <div>
@ -342,5 +344,5 @@ jme3-libraries-gui, jme3-libraries-physics, jme3-libraries-video, etc.</div>
</span></div> </span></div>
</div> </div>
<!-- EDIT12 SECTION "Tip: Reduce Distribution File Size" [8306-] --> <!-- EDIT12 SECTION "Tip: Reduce Distribution File Size" [8348-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/sdk:application_deployment?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/sdk:application_deployment?do=export_xhtmlbody">view online version</a></em></p>

@ -158,15 +158,23 @@ By default a BlenderModelLoader is registered with your assetManager to load ble
</li> </li>
</ul> </ul>
</li> </li>
<li><div> Importing sky</div>
<ul>
<li><div> loading world&#039;s horizon color as a background color if no sky type is used</div>
</li>
<li><div> loading sky without the texture</div>
</li>
<li><div> loading textured sky (including both generated and normal textures)</div>
</li>
</ul>
</li>
</ol> </ol>
</div> </div>
<!-- EDIT4 SECTION "Currently supported features" [1229-4399] --> <!-- EDIT4 SECTION "Currently supported features" [1229-4610] -->
<h2><a>Planned features.</a></h2> <h2><a>Planned features.</a></h2>
<div> <div>
<ol> <ol>
<li><div> Loading sky.</div>
</li>
<li><div> Full support for scale and offset in texture input mapping.</div> <li><div> Full support for scale and offset in texture input mapping.</div>
</li> </li>
<li><div> Full support for bone and object constraints.</div> <li><div> Full support for bone and object constraints.</div>
@ -180,7 +188,7 @@ By default a BlenderModelLoader is registered with your assetManager to load ble
</ol> </ol>
</div> </div>
<!-- EDIT5 SECTION "Planned features." [4400-4660] --> <!-- EDIT5 SECTION "Planned features." [4611-4854] -->
<h2><a>Known bugs/problems.</a></h2> <h2><a>Known bugs/problems.</a></h2>
<div> <div>
<ol> <ol>
@ -191,7 +199,7 @@ By default a BlenderModelLoader is registered with your assetManager to load ble
</ol> </ol>
</div> </div>
<!-- EDIT6 SECTION "Known bugs/problems." [4661-5067] --> <!-- EDIT6 SECTION "Known bugs/problems." [4855-5261] -->
<h2><a>Using BlenderLoader instead of BlenderModelLoader</a></h2> <h2><a>Using BlenderLoader instead of BlenderModelLoader</a></h2>
<div> <div>
@ -252,7 +260,7 @@ You can use ModelKey as well. This will give the same result as using default Bl
</p> </p>
</div> </div>
<!-- EDIT7 SECTION "Using BlenderLoader instead of BlenderModelLoader" [5068-6804] --> <!-- EDIT7 SECTION "Using BlenderLoader instead of BlenderModelLoader" [5262-6998] -->
<h2><a>How does it work?</a></h2> <h2><a>How does it work?</a></h2>
<div> <div>
@ -298,7 +306,7 @@ Here is the list of how blender features are mapped into jme.
<td>Surface </td><td>Node </td><td>The surface is transformed to the proper mesh</td> <td>Surface </td><td>Node </td><td>The surface is transformed to the proper mesh</td>
</tr> </tr>
</table></div> </table></div>
<!-- EDIT9 TABLE [7278-7629] --> <!-- EDIT9 TABLE [7472-7823] -->
<p> <p>
Using BlenderLoader can allow you to use blend file as your local assets repository. Using BlenderLoader can allow you to use blend file as your local assets repository.
@ -308,7 +316,7 @@ Probably versions before 2.49 will work pretty well too, but I never checked tha
</p> </p>
</div> </div>
<!-- EDIT8 SECTION "How does it work?" [6805-7964] --> <!-- EDIT8 SECTION "How does it work?" [6999-8158] -->
<h2><a>Notes</a></h2> <h2><a>Notes</a></h2>
<div> <div>
@ -321,6 +329,15 @@ Hope I will meet your expectations.
Be mindful of the result model vertices amount. The best results are achieved when the model is smooth and has no texture. Then the vertex amount is equal to the vertex amount in blender. If the model is not smooth or has a generated texture applied then the amount of vertices is 3 times larger than mesh&#039;s triangles amount. If a 2d texture is applied with UV mapping then the vertex count will vary depending on how much the UV map is fragmented. Be mindful of the result model vertices amount. The best results are achieved when the model is smooth and has no texture. Then the vertex amount is equal to the vertex amount in blender. If the model is not smooth or has a generated texture applied then the amount of vertices is 3 times larger than mesh&#039;s triangles amount. If a 2d texture is applied with UV mapping then the vertex count will vary depending on how much the UV map is fragmented.
</p> </p>
<p>
When using polygon meshes in blender 2.5 and newer, better add and apply the triangulation modifier (if available in your version) or save the file with convertion from polygons to triangles.
Even though the importer supports loading of polygons as the mesh faces, if your face isn&#039;t convex, the results might contain errors.
</p>
<p>
Not all modifiers are supported. If your model has modifiers and looks not the way you want in the jme scene - try to apply them and load again.
</p>
<p> <p>
Cheers, Cheers,
Marcin Roguski (Kaelthas) Marcin Roguski (Kaelthas)
@ -349,5 +366,5 @@ See also:
</span></div> </span></div>
</div> </div>
<!-- EDIT10 SECTION "Notes" [7965-] --> <!-- EDIT10 SECTION "Notes" [8159-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/sdk:blender?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/sdk:blender?do=export_xhtmlbody">view online version</a></em></p>

@ -78,6 +78,26 @@ If you feel like you want to make an addition to jMonkeyEngine <acronym title="S
</div> </div>
<h4><a>Teminology used here</a></h4>
<div>
<ul>
<li><div> A ???plugin??? is anything you can tick in the plugin manager of the <acronym title="Software Development Kit">SDK</acronym>. It can contain editors, simple ???Java SE Libraries??? that you can add to your projects as jar files and other things like project templates etc.</div>
</li>
<li><div> A ???module??? is the project type that allows you to create plugins, strictly speaking all plugins are modules but there can be modules that are never shown in the plugin list and only exist as dependencies of other modules.</div>
</li>
<li><div> A ???library??? is an entry for a jar file (and optionally sources and javadocs) which can be added to a <acronym title="Software Development Kit">SDK</acronym> project to be used and distributed with it</div>
</li>
<li><div> An ???extension??? is a generic name for stuff that extends the jME engine, like pathfinding algorithms or anything that can be used at the game runtime..</div>
</li>
</ul>
<p>
So if you have some cool code that others can use in their games too, you would make your extension a library by creating a module that the users can download as a plugin :)
</p>
</div>
<h4><a>Handy things in jMonkeyEngine SDK Core</a></h4> <h4><a>Handy things in jMonkeyEngine SDK Core</a></h4>
<div> <div>
<ul> <ul>

@ -112,7 +112,7 @@ Or in your Java code
<li><div> Use a loader and a setter to assign the material to a Geometry</div> <li><div> Use a loader and a setter to assign the material to a Geometry</div>
</li> </li>
</ul> </ul>
<pre>mywall.setMaterial&#40;assetManager.loadAsset&#40; &quot;Materials/mat_wall.j3m&quot;&#41;&#41;;</pre> <pre>mywall.setMaterial&#40;assetManager.loadMaterial&#40; &quot;Materials/mat_wall.j3m&quot;&#41;&#41;;</pre>
<hr /> <hr />
<p> <p>

@ -30,11 +30,11 @@ The SceneExplorer displays Nodes in a tree that represents the tree of Spatials
</p> </p>
<p> <p>
You open the SceneExplorer by viewing a model (j3o file or other) in the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>. SceneExplorer works in conjunction with SceneComposer, the default editor for J3O files in the jMonkeyEngine IDE. If SceneExplorer doesn&#039;t appear when you select &quot;Edit in SceneComposer&quot;, choose Window ??? SceneExplorer from the menu bar to reveal the window.
</p> </p>
</div> </div>
<!-- EDIT3 SECTION "Using the SceneExplorer" [478-780] --> <!-- EDIT3 SECTION "Using the SceneExplorer" [478-947] -->
<h3><a>Editing Objects in the scene</a></h3> <h3><a>Editing Objects in the scene</a></h3>
<div> <div>
<ol> <ol>
@ -47,7 +47,7 @@ You open the SceneExplorer by viewing a model (j3o file or other) in the jMonkey
</ol> </ol>
</div> </div>
<!-- EDIT4 SECTION "Editing Objects in the scene" [781-1085] --> <!-- EDIT4 SECTION "Editing Objects in the scene" [948-1252] -->
<h3><a>Reorganizing Objects in the scene</a></h3> <h3><a>Reorganizing Objects in the scene</a></h3>
<div> <div>
<ol> <ol>
@ -58,7 +58,7 @@ You open the SceneExplorer by viewing a model (j3o file or other) in the jMonkey
</ol> </ol>
</div> </div>
<!-- EDIT5 SECTION "Reorganizing Objects in the scene" [1086-1348] --> <!-- EDIT5 SECTION "Reorganizing Objects in the scene" [1253-1515] -->
<h3><a>Adding Objects to the scene</a></h3> <h3><a>Adding Objects to the scene</a></h3>
<div> <div>
@ -75,5 +75,5 @@ Right-click a Spatial or Node in the SceneExplorer to add other Spatials like Pa
</span></div> </span></div>
</div> </div>
<!-- EDIT6 SECTION "Adding Objects to the scene" [1349-] --> <!-- EDIT6 SECTION "Adding Objects to the scene" [1516-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/sdk:scene_explorer?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/sdk:scene_explorer?do=export_xhtmlbody">view online version</a></em></p>

@ -4,30 +4,6 @@
</div> </div>
<!-- EDIT1 SECTION "Troubleshooting jMonkeyEngine3 SDK" [1-47] --> <!-- EDIT1 SECTION "Troubleshooting jMonkeyEngine3 SDK" [1-47] -->
<h3><a>Specifying the JDK location</a></h3>
<div>
<p>
You should install the <acronym title="Java Development Kit">JDK</acronym> (the one from Oracle, not OpenJDK) first, and then the jMonkey <acronym title="Software Development Kit">SDK</acronym>. 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, then you have to specify the location manually.
</p>
<ol>
<li><div> Go to your jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> installation directory. <br/>
Mac users right-click jMonkeyApplication.app (which actually is a directory) in the Finder and select &quot;Show package contents&quot;. </div>
</li>
<li><div> Navigate to the <code>etc</code> directory. <br/>
Mac users navigate to <code>Contents/Resources/jmonkeyplatform/etc/</code>.</div>
</li>
<li><div> Open the file <code>jmonkeyplatform.conf</code> in a text editor.</div>
</li>
<li><div> Uncomment the following line and enter the path to the <acronym title="Java Development Kit">JDK</acronym>: <pre>jdkhome=&quot;/path/to/jdk&quot;</pre>
</div>
</li>
</ol>
</div>
<!-- EDIT2 SECTION "Specifying the JDK location" [48-766] -->
<h3><a>Graphics Card Driver</a></h3> <h3><a>Graphics Card Driver</a></h3>
<div> <div>
@ -37,7 +13,7 @@ Mac users navigate to <code>Contents/Resources/jmonkeyplatform/etc/</code>.</div
</p> </p>
</div> </div>
<!-- EDIT3 SECTION "Graphics Card Driver" [767-1020] --> <!-- EDIT2 SECTION "Graphics Card Driver" [48-301] -->
<h3><a>Stability / Graphics issues</a></h3> <h3><a>Stability / Graphics issues</a></h3>
<div> <div>
@ -80,7 +56,7 @@ Compiz on Linux might cause issues, if you set its rendering quality to &quot;me
</p> </p>
</div> </div>
<!-- EDIT4 SECTION "Stability / Graphics issues" [1021-2353] --> <!-- EDIT3 SECTION "Stability / Graphics issues" [302-1634] -->
<h3><a>Updating problems</a></h3> <h3><a>Updating problems</a></h3>
<div> <div>
@ -89,7 +65,7 @@ If you have problems updating the <acronym title="Software Development Kit">SDK<
</p> </p>
</div> </div>
<!-- EDIT5 SECTION "Updating problems" [2354-2601] --> <!-- EDIT4 SECTION "Updating problems" [1635-1882] -->
<h3><a>Preferences and Settings</a></h3> <h3><a>Preferences and Settings</a></h3>
<div> <div>
@ -108,7 +84,7 @@ To completely remove and/or reinstall the <acronym title="Software Development K
</ul> </ul>
</div> </div>
<!-- EDIT6 SECTION "Preferences and Settings" [2602-3090] --> <!-- EDIT5 SECTION "Preferences and Settings" [1883-2371] -->
<h3><a>Log</a></h3> <h3><a>Log</a></h3>
<div> <div>
@ -117,7 +93,7 @@ To see or post the error output of the <acronym title="Software Development Kit"
</p> </p>
</div> </div>
<!-- EDIT7 SECTION "Log" [3091-3280] --> <!-- EDIT6 SECTION "Log" [2372-2561] -->
<h3><a>Getting error messages and reporting issues</a></h3> <h3><a>Getting error messages and reporting issues</a></h3>
<div> <div>
@ -126,7 +102,31 @@ When an exception happens in the <acronym title="Software Development Kit">SDK</
</p> </p>
</div> </div>
<!-- EDIT8 SECTION "Getting error messages and reporting issues" [3281-3670] --> <!-- EDIT7 SECTION "Getting error messages and reporting issues" [2562-2951] -->
<h3><a>Specifying the JDK location</a></h3>
<div>
<p>
You can install another <acronym title="Java Development Kit">JDK</acronym> for use with the jMonkey <acronym title="Software Development Kit">SDK</acronym>. You then have to specify the location manually.
</p>
<ol>
<li><div> Go to your jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> installation directory. <br/>
Mac users right-click jMonkeyApplication.app (which actually is a directory) in the Finder and select &quot;Show package contents&quot;. </div>
</li>
<li><div> Navigate to the <code>etc</code> directory. <br/>
Mac users navigate to <code>Contents/Resources/jmonkeyplatform/etc/</code>.</div>
</li>
<li><div> Open the file <code>jmonkeyplatform.conf</code> in a text editor.</div>
</li>
<li><div> Uncomment the following line and enter the path to the <acronym title="Java Development Kit">JDK</acronym>: <pre>jdkhome=&quot;/path/to/jdk&quot;</pre>
</div>
</li>
</ol>
</div>
<!-- EDIT8 SECTION "Specifying the JDK location" [2952-3556] -->
<h3><a>Known Issues</a></h3> <h3><a>Known Issues</a></h3>
<div> <div>
@ -142,5 +142,5 @@ For a list of known issues and possible workarounds see the following link:
</span></div> </span></div>
</div> </div>
<!-- EDIT9 SECTION "Known Issues" [3671-] --> <!-- EDIT9 SECTION "Known Issues" [3557-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/sdk:troubleshooting?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/sdk:troubleshooting?do=export_xhtmlbody">view online version</a></em></p>

@ -4,7 +4,7 @@
<p> <p>
Whether you work in a development team or alone: File versioning is a handy method to keep your code consistent, compare files line-by-line, and even roll back unwanted changes. This documentation shows you how to make the most of the <acronym title="Software Development Kit">SDK</acronym>&#039;s integrated version control features for Subversion, Mercurial, and <acronym title="Concurrent Versions System">CVS</acronym>. Whether you work in a development team or alone: File versioning is a handy method to keep your code consistent, compare files line-by-line, and even roll back unwanted changes. This documentation shows you how to make the most of the <acronym title="Software Development Kit">SDK</acronym>&#039;s integrated version control features for Subversion, Mercurial, and Git.
</p> </p>
<p> <p>
@ -31,7 +31,7 @@ Note: Since the jMonkeyEngine <acronym title="Software Development Kit">SDK</acr
<p> <p>
The jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> supports various Version Control Systems such as Subversion, Mercurial, and <acronym title="Concurrent Versions System">CVS</acronym>. No matter which of them you use, they all share a common user interface. The jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> supports various Version Control Systems such as Subversion, Mercurial, and Git. No matter which of them you use, they all share a common user interface.
</p> </p>
<p> <p>
@ -50,7 +50,7 @@ Requirements:
<ul> <ul>
<li><div> You must have a project that you want to version. </div> <li><div> You must have a project that you want to version. </div>
</li> </li>
<li><div> You must have version control software installed (Subversion, Mercurial, or <acronym title="Concurrent Versions System">CVS</acronym>) and have initialized a repository.</div> <li><div> You must have version control software installed (Subversion, Mercurial, or Git) and have initialized a repository.</div>
<ul> <ul>
<li><div> Tip: For Subversion, for example, the init command looks like this example: <code>svnadmin create /home/joe/jMonkeyProjects/MyGame</code></div> <li><div> Tip: For Subversion, for example, the init command looks like this example: <code>svnadmin create /home/joe/jMonkeyProjects/MyGame</code></div>
</li> </li>
@ -70,7 +70,7 @@ Now you create a repository to store your project&#039;s files.
</p> </p>
<ol> <ol>
<li><div> In the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>, right-click the project in the Projects window and choose Versioning &gt; Import Into <acronym title="Concurrent Versions System">CVS</acronym>/Subversion Repository (or initialize Mercurial Project, respectively). </div> <li><div> In the jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym>, right-click the project in the Projects window and choose Versioning &gt; Import Into Subversion Repository (or initialize Mercurial Project, etc, respectively). </div>
<ul> <ul>
<li><div> Tip: If you haven&#039;t evaluated yet which system to choose, start with Subversion for now.</div> <li><div> Tip: If you haven&#039;t evaluated yet which system to choose, start with Subversion for now.</div>
</li> </li>
@ -81,7 +81,7 @@ Now you create a repository to store your project&#039;s files.
</ol> </ol>
</div> </div>
<!-- EDIT3 SECTION "Creating a Repository (Upload)" [1376-2438] --> <!-- EDIT3 SECTION "Creating a Repository (Upload)" [1376-2439] -->
<h2><a>Checking Out a Repository (Download)</a></h2> <h2><a>Checking Out a Repository (Download)</a></h2>
<div> <div>
@ -91,7 +91,7 @@ You and your team mates check out (download) the repository to their individual
</p> </p>
<ol> <ol>
<li><div> Go to the Team menu and choose Subversion &gt; Checkout (or <acronym title="Concurrent Versions System">CVS</acronym>/Mercurial&gt;Checkout respectively)</div> <li><div> Go to the Team menu and choose Subversion &gt; Checkout (or Git or Mercurial respectively)</div>
</li> </li>
<li><div> Fill in your repo data into the wizard and click Finish.</div> <li><div> Fill in your repo data into the wizard and click Finish.</div>
<ul> <ul>
@ -117,7 +117,7 @@ Of course you can also check out existing repositories and access code from othe
</p> </p>
</div> </div>
<!-- EDIT4 SECTION "Checking Out a Repository (Download)" [2439-3412] --> <!-- EDIT4 SECTION "Checking Out a Repository (Download)" [2440-3407] -->
<h2><a>Updating and Committing Changes (Send and Receive)</a></h2> <h2><a>Updating and Committing Changes (Send and Receive)</a></h2>
<div> <div>
@ -156,7 +156,7 @@ Receiving the latest changes from the team&#039;s repository is referred to as <
</ol> </ol>
</div> </div>
<!-- EDIT5 SECTION "Updating and Committing Changes (Send and Receive)" [3413-4661] --> <!-- EDIT5 SECTION "Updating and Committing Changes (Send and Receive)" [3408-4656] -->
<h2><a>Comparing and Reverting Changes</a></h2> <h2><a>Comparing and Reverting Changes</a></h2>
<div> <div>
<ul> <ul>
@ -187,7 +187,7 @@ Receiving the latest changes from the team&#039;s repository is referred to as <
</ul> </ul>
</div> </div>
<!-- EDIT6 SECTION "Comparing and Reverting Changes" [4662-5453] --> <!-- EDIT6 SECTION "Comparing and Reverting Changes" [4657-5448] -->
<h2><a>No Version Control? Local History!</a></h2> <h2><a>No Version Control? Local History!</a></h2>
<div> <div>
@ -221,5 +221,5 @@ See also:
</span></div> </span></div>
</div> </div>
<!-- EDIT7 SECTION "No Version Control? Local History!" [5454-] --> <!-- EDIT7 SECTION "No Version Control? Local History!" [5449-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/sdk:version_control?do=export_xhtmlbody">view online version</a></em></p> <p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/sdk:version_control?do=export_xhtmlbody">view online version</a></em></p>

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