- update manual content

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10674 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 12 years ago
parent 583c46d36d
commit 7e7ba75592
  1. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/1.jpg
  2. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/2.jpg
  3. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/220px-trefoil_knot_arb.png
  4. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/3.jpg
  5. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/3d_models.html
  6. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/4.jpg
  7. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/5.jpg
  8. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/6.jpg
  9. 46
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/animation.html
  10. 42
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/application_states.html
  11. 34
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/appstatesdemo.html
  12. 20
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/asset_manager.html
  13. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/audio.html
  14. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/audio_environment_presets.html
  15. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/bloom_and_glow.html
  16. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/bullet_multithreading.html
  17. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/bump-mapped-sphere.png
  18. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/butterfly-particle-emitter.png
  19. 36
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/camera.html
  20. 40
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/capture_audio_video_to_a_file.html
  21. 234
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/cinematics.html
  22. 24
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/collision_and_intersection.html
  23. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/combo_moves.html
  24. 4
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/custom_controls.html
  25. 195
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/custom_meshes.html
  26. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/debug-shapes.png
  27. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/debugging.html
  28. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/dof-blur.png
  29. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/drop-shadows.png
  30. 4
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/effects_overview.html
  31. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/elephant-pointlights.png
  32. 9
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/endless_terraingrid.html
  33. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/explosion-5.png
  34. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/fade.html
  35. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/headless_server.html
  36. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/hinges_and_joints.html
  37. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/house-directionallight.png
  38. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/hud.html
  39. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/input_handling.html
  40. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/j3m_material_files.html
  41. 4
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/jme3_shaders.html
  42. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/light-scattering-filter.png
  43. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/light-sources.png
  44. 47
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/light_and_shadow.html
  45. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/loading_screen.html
  46. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/localization.html
  47. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/logging.html
  48. 20
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/making_the_camera_follow_a_character.html
  49. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/material_definitions.html
  50. 42
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/materials_overview.html
  51. 77
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/mesh.html
  52. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/monkey_zone.html
  53. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/motionpath.html
  54. 4
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/mouse_picking.html
  55. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/multiple_camera_views.html
  56. 41
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/multithreading.html
  57. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/networking.html
  58. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty-gui-13.png
  59. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty-gui-example.png
  60. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty-gui.png
  61. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty-screen-layer-panel.png
  62. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui.html
  63. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_java_interaction.html
  64. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_java_layout.html
  65. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_overlay.html
  66. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_popup_menu.html
  67. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_projection.html
  68. 4
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_scenarios.html
  69. 16
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_xml_layout.html
  70. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nurbs_3-d_surface.png
  71. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/ogrecompatibility.html
  72. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/open_game_finder.html
  73. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/otoglow.png
  74. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/otonobloom.png
  75. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/particle.png
  76. 4
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/particle_emitters.html
  77. 128
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/physics.html
  78. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/physics_listeners.html
  79. 6
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/post-processor_water.html
  80. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/ragdoll.html
  81. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/read_graphic_card_capabilites.html
  82. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/remote-controlling_the_camera.html
  83. 4
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/save_and_load.html
  84. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/screenshots.html
  85. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shaderblow_glass.jpg
  86. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shaderblow_light1.jpg
  87. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shaderblow_light2.jpg
  88. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shaderblow_matcap.jpg
  89. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shadow-sponza-ssao.png
  90. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shadow.png
  91. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shape.html
  92. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/simplewater.png
  93. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/sky.html
  94. 47
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/spatial.html
  95. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/swing_canvas.html
  96. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/tanlglow1.png
  97. 2
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/terrain.html
  98. 36
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/terrain_collision.html
  99. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/toon-dino.png
  100. BIN
      sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/underwater2.jpg
  101. Some files were not shown because too many files have changed in this diff Show More

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 29 KiB

@ -88,4 +88,4 @@ You can now use the <a href="/com/jme3/gde/docs/sdk.html">jMonkeyEngine SDK</a>
</div>
<!-- EDIT3 SECTION "Creating Models and Scenes" [902-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:3d_models?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:3d_models?do=export_xhtmlbody">view online version</a></em></p>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 23 KiB

@ -21,11 +21,11 @@ JME3 only loads and plays animated models, it does not create them.
What is required for an animated model? (<a href="/com/jme3/gde/docs/jme3/terminology#animation.html">See also: Animation terminology</a>)
</p>
<ol>
<li><div> For each model, you have to segment the model into a skeleton (bone rigging). </div>
<li><div> For each model, you have to segment the model into a skeleton (<strong>bone rigging</strong>). </div>
</li>
<li><div> For each motion, you have to specify how the animation distorts parts of the model (skinning). </div>
<li><div> For each motion, you have to specify how the animation distorts parts of the model (<strong>skinning</strong>). </div>
</li>
<li><div> For each animation, you have to specify a series of snapshots of how the bones are positioned (keyframes).</div>
<li><div> For each animation, you have to specify a series of snapshots of how the bones are positioned (<strong>keyframes</strong>).</div>
</li>
<li><div> One model can contain several animations. You give every animation a name when you save it in the mesh editor.</div>
</li>
@ -62,7 +62,7 @@ What is required in your JME3-based Java class?
</ul>
</div>
<!-- EDIT2 SECTION "Requirements" [168-2025] -->
<!-- EDIT2 SECTION "Requirements" [168-2038] -->
<h2><a>Code Samples</a></h2>
<div>
<ul>
@ -81,12 +81,12 @@ What is required in your JME3-based Java class?
</ul>
</div>
<!-- EDIT3 SECTION "Code Samples" [2026-2934] -->
<!-- EDIT3 SECTION "Code Samples" [2039-2947] -->
<h2><a>Controlling Animations</a></h2>
<div>
</div>
<!-- EDIT4 SECTION "Controlling Animations" [2935-2970] -->
<!-- EDIT4 SECTION "Controlling Animations" [2948-2983] -->
<h3><a>The Animation Control</a></h3>
<div>
@ -100,7 +100,7 @@ Create one <code>com.jme3.animation.AnimControl</code> object in your JME3 appli
playerControl.addListener&#40;this&#41;; // add listener</pre>
</div>
<!-- EDIT5 SECTION "The Animation Control" [2971-3610] -->
<!-- EDIT5 SECTION "The Animation Control" [2984-3623] -->
<h3><a>Animation Channels</a></h3>
<div>
@ -121,7 +121,7 @@ To reset a Control, call <code>control.clearChannels();</code>
</p>
</div>
<!-- EDIT6 SECTION "Animation Channels" [3611-4244] -->
<!-- EDIT6 SECTION "Animation Channels" [3624-4257] -->
<h2><a>Animation Control Properties</a></h2>
<div>
@ -152,7 +152,7 @@ removeListener(animEventListener) <br/>
clearListeners() </td><td>Adds or removes listeners to receive animation related events.</td>
</tr>
</table></div>
<!-- EDIT8 TABLE [4347-4816] --><div><table>
<!-- EDIT8 TABLE [4360-4829] --><div><table>
<tr>
<th>AnimControl Property</th><th>Usage</th>
</tr>
@ -173,7 +173,7 @@ removeAnim(boneAnim)</td><td>Adds or removes an animation from this Control.</td
<td>getAnimationLength(&quot;anim&quot;)</td><td>Returns the length of the given named animation in seconds</td>
</tr>
</table></div>
<!-- EDIT9 TABLE [4818-5378] --><div><table>
<!-- EDIT9 TABLE [4831-5391] --><div><table>
<tr>
<th>AnimControl Property</th><th>Usage</th>
</tr>
@ -187,9 +187,9 @@ removeAnim(boneAnim)</td><td>Adds or removes an animation from this Control.</td
<td>getAttachmentsNode(&quot;bone&quot;)</td><td>Returns the attachment node of a bone. Attach models and effects to this node to make them follow this bone&#039;s motions.</td>
</tr>
</table></div>
<!-- EDIT10 TABLE [5380-5695] -->
<!-- EDIT10 TABLE [5393-5708] -->
</div>
<!-- EDIT7 SECTION "Animation Control Properties" [4245-5697] -->
<!-- EDIT7 SECTION "Animation Control Properties" [4258-5710] -->
<h2><a>Animation Channel Properties</a></h2>
<div>
@ -218,7 +218,7 @@ The following properties are set per AnimChannel.
<td>setTime(1.3f); </td><td> Fast-forward or rewind to a certain moment in time of this animation. </td>
</tr>
</table></div>
<!-- EDIT12 TABLE [5791-6415] -->
<!-- EDIT12 TABLE [5804-6428] -->
<p>
The following information is available for a channel.
@ -244,7 +244,7 @@ The following information is available for a channel.
<td>getControl()</td><td>The AnimControl that belongs to this AnimChannel.</td>
</tr>
</table></div>
<!-- EDIT13 TABLE [6472-7105] -->
<!-- EDIT13 TABLE [6485-7118] -->
<p>
Use the following methods to add or remove individual bones to an AnimChannel. This is useful when you play two animations in parallel on two channels, and each controls a subset of the bones (e.g. one the arms, and the other the legs).
@ -270,9 +270,9 @@ addToRootBone(bone1) </td><td>Add a series of bones to be influenced by this ani
addFromRootBone(bone1) </td><td>Add a series of bones to be influenced by this animation channel: Add all bones, starting from the given root bone, going towards the children bones.</td>
</tr>
</table></div>
<!-- EDIT14 TABLE [7345-7966] -->
<!-- EDIT14 TABLE [7358-7979] -->
</div>
<!-- EDIT11 SECTION "Animation Channel Properties" [5698-7968] -->
<!-- EDIT11 SECTION "Animation Channel Properties" [5711-7981] -->
<h2><a>Playing Animations</a></h2>
<div>
@ -290,14 +290,14 @@ Animations are played by channel. <strong>Note:</strong> Whether the animation c
The float value specifies the time how long the animation should overlap with the previous one on this channel. If set to 0f, then no blending will occur and the new animation will be applied instantly.</td>
</tr>
</table></div>
<!-- EDIT16 TABLE [8154-8480] -->
<!-- EDIT16 TABLE [8167-8493] -->
<p>
<strong>Tip:</strong> Use the AnimEventLister below to react at the end or start of an animation cycle.
</p>
</div>
<!-- EDIT15 SECTION "Playing Animations" [7969-8573] -->
<!-- EDIT15 SECTION "Playing Animations" [7982-8586] -->
<h3><a>Usage Example</a></h3>
<div>
@ -324,7 +324,7 @@ In this short example, we define the space key to trigger playing the &quot;Walk
&#125;;</pre>
</div>
<!-- EDIT17 SECTION "Usage Example" [8574-9263] -->
<!-- EDIT17 SECTION "Usage Example" [8587-9276] -->
<h2><a>Animation Event Listener</a></h2>
<div>
@ -340,7 +340,7 @@ This optional Listener enables you to respond to animation start and end events,
</p>
</div>
<!-- EDIT18 SECTION "Animation Event Listener" [9264-9667] -->
<!-- EDIT18 SECTION "Animation Event Listener" [9277-9680] -->
<h3><a>Responding to Animation End</a></h3>
<div>
@ -369,7 +369,7 @@ You have access to the following objects:
&#125;</pre>
</div>
<!-- EDIT19 SECTION "Responding to Animation End" [9668-10458] -->
<!-- EDIT19 SECTION "Responding to Animation End" [9681-10471] -->
<h3><a>Responding to Animation Start</a></h3>
<div>
@ -398,5 +398,5 @@ You have access to the following objects
&#125;</pre>
</div>
<!-- EDIT20 SECTION "Responding to Animation Start" [10459-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:animation?do=export_xhtmlbody">view online version</a></em></p>
<!-- EDIT20 SECTION "Responding to Animation Start" [10472-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:animation?do=export_xhtmlbody">view online version</a></em></p>

@ -62,20 +62,20 @@ You can! This is what AppStates are there for. An AppState class is subset of (o
<p>
Each AppState lets you define what happens in the following situations:
Each AppState lets you define what happens to it in the following situations:
</p>
<ul>
<li><div> <strong>The AppState is initialized:</strong> You load and initialize game data, InputHandlers, AppStates and Controls and attach nodes. <br/>
The AppState has its own simpleInitApp() method, so to speak.</div>
The AppState executes its own simpleInitApp() method when it is attached, so to speak.</div>
</li>
<li><div> <strong>The AppState has been enabled (unpaused):</strong> This toggles a boolean isEnabled() to true. Here you attach nodes and listeners that should become active while it&#039;s running. </div>
</li>
<li><div> <strong>While the AppState is running/paused:</strong> You can poll isEnabled() to define paused and unpaused game behaviour in the update() loop that. Polls and modify the game state, modify the scene graph, and triggers events. If !isEnabled(), write code that skips the running sections of this AppState&#039;s <code>update()</code> loop. <br/>
<li><div> <strong>While the AppState is running/paused:</strong> You can poll isEnabled() to define paused and unpaused game behaviour in the update() loop. In update(), you poll and modify the game state, modify the scene graph, and trigger events. Test if <code>!isEnabled()</code>, and write code that skips the running sections of this AppState&#039;s <code>update()</code> loop. <br/>
Each AppState has its own update loop, which hooks into the main simpleUpdate() loop (callback). </div>
</li>
<li><div> <strong>The AppState has been disabled (paused):</strong> This toggles a boolean isEnabled() to false. Switch to your specific &quot;paused&quot; state. </div>
<li><div> <strong>The AppState has been disabled (paused):</strong> This toggles a boolean isEnabled() to false. Here you switch all objects to their specific &quot;paused&quot; behaviour. </div>
</li>
<li><div> <strong>The AppState is cleaned up:</strong> Here you decide whether to save this AppState&#039;s game state, unregister Controls and InputHandlers, detach related AppStates, and detach nodes from the rootNode.</div>
<li><div> <strong>The AppState is cleaned up:</strong> Here you decide what happens when the AppState is detached. Save this AppState&#039;s game state, unregister Controls and InputHandlers, detach related AppStates, detach nodes from the rootNode, etc.</div>
</li>
</ul>
@ -86,7 +86,7 @@ Each AppState has its own update loop, which hooks into the main simpleUpdate()
</p>
</div>
<!-- EDIT4 SECTION "Supported Features" [2035-3649] -->
<!-- EDIT4 SECTION "Supported Features" [2035-3763] -->
<h3><a>Usage</a></h3>
<div>
@ -105,9 +105,11 @@ To implement game logic:
</li>
</ul>
</li>
<li><div> Attach the AppState to the AppStateManager (<code>stateManager.attach(myAppState);</code>).</div>
<li><div> Create and attach the AppState to the AppStateManager (<code>stateManager.attach(myAppState);</code>) and initialize it.</div>
</li>
<li><div> Activate and deactivate (unpause and pause) the AppStates that you need.</div>
<li><div> Enable and disable (unpause and pause) the AppStates that you need during the game.</div>
</li>
<li><div> Detach the AppState from the AppStateManager (<code>stateManager.detach(myAppState);</code>) and clean it up it.</div>
</li>
</ol>
@ -117,7 +119,7 @@ When you add several AppStates to one Application and activate them, their initi
</p>
</div>
<!-- EDIT5 SECTION "Usage" [3650-4363] -->
<!-- EDIT5 SECTION "Usage" [3764-4625] -->
<h3><a>Code Samples</a></h3>
<div>
@ -137,7 +139,7 @@ JME3 comes with a BulletAppState that implements Physical behaviour (using the j
</ul>
</div>
<!-- EDIT6 SECTION "Code Samples" [4364-5144] -->
<!-- EDIT6 SECTION "Code Samples" [4626-5406] -->
<h2><a>AppState</a></h2>
<div>
@ -182,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>
</tr>
</table></div>
<!-- EDIT8 TABLE [5293-6855] -->
<!-- EDIT8 TABLE [5555-7117] -->
</div>
<!-- EDIT7 SECTION "AppState" [5145-6856] -->
<!-- EDIT7 SECTION "AppState" [5407-7118] -->
<h2><a>AbstractAppState</a></h2>
<div>
@ -247,7 +249,7 @@ Definition:
&#125;</pre>
</div>
<!-- EDIT9 SECTION "AbstractAppState" [6857-9029] -->
<!-- EDIT9 SECTION "AbstractAppState" [7119-9291] -->
<h2><a>Pausing and Unpausing</a></h2>
<div>
@ -257,7 +259,7 @@ You define what an AppState does when Paused or Unpaused, in the <code>setEnable
</p>
</div>
<!-- EDIT10 SECTION "Pausing and Unpausing" [9030-9320] -->
<!-- EDIT10 SECTION "Pausing and Unpausing" [9292-9582] -->
<h2><a>AppStateManager</a></h2>
<div>
@ -277,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>
</tr>
</table></div>
<!-- EDIT12 TABLE [9728-9938] -->
<!-- EDIT12 TABLE [9990-10200] -->
<p>
The AppStateManager&#039;s <code>render(), postRender(), cleanup()</code> methods are internal, ignore them, users never call them directly.
@ -297,12 +299,12 @@ The AppStateManager&#039;s <code>render(), postRender(), cleanup()</code> method
</ul>
</div>
<!-- EDIT11 SECTION "AppStateManager" [9321-10704] -->
<!-- EDIT11 SECTION "AppStateManager" [9583-10966] -->
<h2><a>Best Practices</a></h2>
<div>
</div>
<!-- EDIT13 SECTION "Best Practices" [10705-10732] -->
<!-- EDIT13 SECTION "Best Practices" [10967-10994] -->
<h3><a>Communication Among AppStates</a></h3>
<div>
@ -318,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>
</div>
<!-- EDIT14 SECTION "Communication Among AppStates" [10733-11488] -->
<!-- EDIT14 SECTION "Communication Among AppStates" [10995-11750] -->
<h3><a>Initialize Familiar Class Fields</a></h3>
<div>
@ -349,5 +351,5 @@ public class MyAppState extends AbstractAppState &#123;
&#125;</pre>
</div>
<!-- EDIT15 SECTION "Initialize Familiar Class Fields" [11489-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:application_states?do=export_xhtmlbody">view online version</a></em></p>
<!-- EDIT15 SECTION "Initialize Familiar Class Fields" [11751-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:application_states?do=export_xhtmlbody">view online version</a></em></p>

@ -4,15 +4,37 @@
<p>
<p><div>
THIS DEMO IS OUT OF DATE AND NEEDS CORRECTING
</div></p>
</p>
</div>
<!-- EDIT1 SECTION "Simple AppStates Demo" [1-108] -->
<h1><a>THIS DEMO IS OUT OF DATE AND NEEDS CORRECTING FOR NOW PLEASE SEE</a></h1>
<div>
<p>
<object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:application_states"><param name="text" value="<html><u>http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:application_states</u></html>"><param name="textColor" value="blue"></object>
</p>
<p>
Note: this tutorial needs to be fixed and is currently not correct. One should almost never override stateDetached and stateAttached??? and should certainly never do anything scene related in them.
</p>
<p>
This demo is a simple example of how you use AppStates to toggle between a StartScreen and a SettingsScreen (press RETURN) while the game is paused, and start the game by switching to a GameRunning state (press BACKSPACE).
</p>
<p>
There are four files, Main.java, GameRunningState.java, StartScreenState.java, SettingsScreenState.java.
</p>
</div>
<!-- EDIT1 SECTION "Simple AppStates Demo" [1-369] -->
<!-- EDIT2 SECTION "THIS DEMO IS OUT OF DATE AND NEEDS CORRECTING FOR NOW PLEASE SEE" [109-793] -->
<h2><a>Main.java</a></h2>
<div>
<pre>package chapter04.appstatedemo;
@ -108,7 +130,7 @@ public class Main extends SimpleApplication &#123;
&nbsp;</pre>
</div>
<!-- EDIT2 SECTION "Main.java" [370-3778] -->
<!-- EDIT3 SECTION "Main.java" [794-4202] -->
<h2><a>GameRunningState.java</a></h2>
<div>
<pre>package chapter04.appstatedemo;
@ -200,7 +222,7 @@ public class GameRunningState extends AbstractAppState &#123;
&#125;</pre>
</div>
<!-- EDIT3 SECTION "GameRunningState.java" [3779-6746] -->
<!-- EDIT4 SECTION "GameRunningState.java" [4203-7170] -->
<h2><a>SettingsScreenState.java</a></h2>
<div>
<pre>package chapter04.appstatedemo;
@ -289,7 +311,7 @@ public class SettingsScreenState extends AbstractAppState &#123;
&#125;</pre>
</div>
<!-- EDIT4 SECTION "SettingsScreenState.java" [6747-9561] -->
<!-- EDIT5 SECTION "SettingsScreenState.java" [7171-9985] -->
<h2><a>StartScreenState.java</a></h2>
<div>
<pre>package chapter04.appstatedemo;
@ -378,5 +400,5 @@ public StartScreenState&#40;SimpleApplication app&#41;&#123;
&#125;</pre>
</div>
<!-- EDIT5 SECTION "StartScreenState.java" [9562-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:appstatesdemo?do=export_xhtmlbody">view online version</a></em></p>
<!-- EDIT6 SECTION "StartScreenState.java" [9986-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:appstatesdemo?do=export_xhtmlbody">view online version</a></em></p>

@ -13,7 +13,7 @@ Advantages of the AssetManager:
<ul>
<li><div> The paths stay the same, no matter whether the game runs on Windows, Mac, Linux, etc!</div>
</li>
<li><div> The AssetManager automatically optimizes the handling of OpenGL objects. <br/>
<li><div> The AssetManager automatically caches and optimizes the handling of OpenGL objects. <br/>
For example, the same textures are not uploaded to the graphics card multiple times when multiple models use them.</div>
</li>
<li><div> The <a href="/com/jme3/gde/docs/sdk/default_build_script.html">default build script</a> automatically bundles the contents of the <code>assets</code> directory into the executable. </div>
@ -43,7 +43,7 @@ See also <a href="/com/jme3/gde/docs/jme3/intermediate/best_practices.html">Best
</p>
</div>
<!-- EDIT1 SECTION "AssetManager" [1-1691] -->
<!-- EDIT1 SECTION "AssetManager" [1-1702] -->
<h2><a>Usage</a></h2>
<div>
@ -71,7 +71,7 @@ Additionally, you can configure the Asset Manager and add any path to its root.
</p>
</div>
<!-- EDIT2 SECTION "Usage" [1692-2849] -->
<!-- EDIT2 SECTION "Usage" [1703-2860] -->
<h2><a>Asset Directory</a></h2>
<div>
@ -119,7 +119,7 @@ After the conversion, you move the .j3o file into the <code>assets/Models/</code
</p>
</div>
<!-- EDIT3 SECTION "Asset Directory" [2850-5279] -->
<!-- EDIT3 SECTION "Asset Directory" [2861-5290] -->
<h2><a>Example Code: Loading Assets</a></h2>
<div>
@ -176,7 +176,7 @@ jME3 also offers a ClasspathLocator, ZipLocator, FileLocator, HttpZipLocator, an
</p>
</div>
<!-- EDIT4 SECTION "Example Code: Loading Assets" [5280-6752] -->
<!-- EDIT4 SECTION "Example Code: Loading Assets" [5291-6763] -->
<h2><a>Common AssetManager Tasks</a></h2>
<div>
<div><table>
@ -203,9 +203,9 @@ rootNode.attachChild&#40;scene&#41;;</pre>
</td>
</tr>
</table></div>
<!-- EDIT6 TABLE [6792-7720] -->
<!-- EDIT6 TABLE [6803-7731] -->
</div>
<!-- EDIT5 SECTION "Common AssetManager Tasks" [6753-7721] -->
<!-- EDIT5 SECTION "Common AssetManager Tasks" [6764-7732] -->
<h2><a>NullPointerException: Cannot locate resource?</a></h2>
<div>
@ -266,7 +266,7 @@ This ensures that the model&#039;s Texture paths keep working between your 3D me
</p>
</div>
<!-- EDIT7 SECTION "NullPointerException: Cannot locate resource?" [7722-9798] -->
<!-- EDIT7 SECTION "NullPointerException: Cannot locate resource?" [7733-9809] -->
<h2><a>Asset Handling For Other IDEs: Codeless Projects</a></h2>
<div>
@ -316,5 +316,5 @@ Convert assets as described above.</div>
</p>
</div>
<!-- EDIT8 SECTION "Asset Handling For Other IDEs: Codeless Projects" [9799-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:asset_manager?do=export_xhtmlbody">view online version</a></em></p>
<!-- EDIT8 SECTION "Asset Handling For Other IDEs: Codeless Projects" [9810-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:asset_manager?do=export_xhtmlbody">view online version</a></em></p>

@ -267,4 +267,4 @@ Advanced users find more info about OpenAL and its features here: <object classi
</div>
<!-- EDIT16 SECTION "Setting Audio Environment Properties" [6656-] -->
<p><em><a href="http://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>

@ -210,4 +210,4 @@ Smallwaterroom = new Environment &#40; new float&#91;&#93;&#123; 26, 36.2f, 0.70
</div>
<!-- EDIT17 SECTION "Water" [24958-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:audio_environment_presets?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:audio_environment_presets?do=export_xhtmlbody">view online version</a></em></p>

@ -287,4 +287,4 @@ If you are using a glow color, set it to black
</div>
<!-- EDIT6 SECTION "Hints and tricks" [4240-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:bloom_and_glow?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:bloom_and_glow?do=export_xhtmlbody">view online version</a></em></p>

@ -62,4 +62,4 @@ Now the physics update happens in parallel to render(), that is, after the user&
</div>
<!-- EDIT3 SECTION "How is it handled in jme3 and bullet?" [262-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:bullet_multithreading?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:bullet_multithreading?do=export_xhtmlbody">view online version</a></em></p>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 10 KiB

@ -2,8 +2,13 @@
<h1><a>The jME3 Camera</a></h1>
<div>
<p>
Note that by default, the mouse pointer is invisible, and the mouse is set up to control the camera rotation.
</p>
</div>
<!-- EDIT1 SECTION "The jME3 Camera" [1-31] -->
<!-- EDIT1 SECTION "The jME3 Camera" [1-142] -->
<h2><a>Default Camera</a></h2>
<div>
@ -52,7 +57,7 @@ The camera object is created with the following defaults:
<td>cam.getUp(), setUp()</td><td>The up axis of the camera, usually Vector3f(0,1,0)</td>
</tr>
<tr>
<td>cam.getDirection(), setDirection()</td><td>The vector the camera is facing</td>
<td>cam.getDirection()</td><td>The vector the camera is facing</td>
</tr>
<tr>
<td>cam.getAxes(), setAxes(left,up,dir)</td><td>One accessor for the three properties left/up/direction.</td>
@ -82,21 +87,23 @@ The camera object is created with the following defaults:
<td>cam.getScreenCoordinates()</td><td>?</td>
</tr>
</table></div>
<!-- EDIT3 TABLE [583-1858] -->
<!-- EDIT3 TABLE [694-1953] -->
<p>
<strong>Tip:</strong> After you change view port, frustum, or frame, call <code>cam.update();</code>
</p>
</div>
<!-- EDIT2 SECTION "Default Camera" [32-1940] -->
<!-- EDIT2 SECTION "Default Camera" [143-2035] -->
<h2><a>FlyBy Camera</a></h2>
<div>
<p>
The flyby camera is an AppState that extends the default camera in com.jme3.app.SimpleApplication. It is preconfigured to respond to the WASD keys for walking forwards and backwards, and strafing to the sides; move the mouse to rotate the camera (&quot;Mouse Look&quot;), scroll the mouse wheel for zooming in or out. The QZ keys raise or lower the camera vertically.
The <code>flyCam</code> class field gives you access to an AppState that extends the default camera in <code>com.jme3.app.SimpleApplication</code> with more features. The input manager of the <code>com.jme3.input.FlyByCamera</code> AppState is preconfigured to respond to the WASD keys for walking forwards and backwards, and strafing to the sides; move the mouse to rotate the camera (&quot;Mouse Look&quot;), scroll the mouse wheel for zooming in or out. The QZ keys raise or lower the camera vertically.
</p>
<pre>Q W up forw
A S D --&gt; left back right
Z down </pre>
<div><table>
<tr>
<th>Method</th><th>Usage</th>
@ -114,15 +121,20 @@ The flyby camera is an AppState that extends the default camera in com.jme3.app.
<td>flyCam.setDragToRotate(true)</td><td>Forces the player to keep mouse button pressed to rotate camera, typically used for Applets. If false (default), all mouse movement will be captured and interpreted as rotations.</td>
</tr>
</table></div>
<!-- EDIT5 TABLE [2326-2708] -->
<!-- EDIT5 TABLE [2634-3016] -->
<p>
The FlyByCamera is active by default, but you can change all these defaults for your game.
</p>
</div>
<!-- EDIT4 SECTION "FlyBy Camera" [1941-2709] -->
<!-- EDIT4 SECTION "FlyBy Camera" [2036-3109] -->
<h2><a>Chase Camera</a></h2>
<div>
<p>
jME3 also supports a Chase Cam that can follow a moving target Spatial (<code>com.jme3.input.ChaseCamera</code>). Click and hold the mouse button to rotate around the target.
jME3 also supports an optional Chase Cam that can follow a moving target Spatial (<code>com.jme3.input.ChaseCamera</code>). When you use the chase cam, the player clicks and hold the mouse button to rotate the camera around the camera target. You can use a chase cam if you need the mouse pointer visible in your game.
</p>
<pre>flyCam.setEnabled&#40;false&#41;;
ChaseCamera chaseCam = new ChaseCamera&#40;cam, target, inputManager&#41;;</pre>
@ -164,11 +176,11 @@ ChaseCamera chaseCam = new ChaseCamera&#40;cam, target, inputManager&#41;;</pre>
<td>chaseCam.setDefaultHorizontalRotation(-FastMath.PI/2);</td><td>The default horizontal rotation angle of the camera around the target at the start of the application.</td>
</tr>
</table></div>
<!-- EDIT7 TABLE [3017-4489] --><div><span>
<!-- EDIT7 TABLE [3561-5033] --><div><span>
<a href="/wiki/doku.php/tag:camera?do=showtag&amp;tag=tag%3Acamera">camera</a>,
<a href="/wiki/doku.php/tag:documentation?do=showtag&amp;tag=tag%3Adocumentation">documentation</a>
</span></div>
</div>
<!-- EDIT6 SECTION "Chase Camera" [2710-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:camera?do=export_xhtmlbody">view online version</a></em></p>
<!-- EDIT6 SECTION "Chase Camera" [3110-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:camera?do=export_xhtmlbody">view online version</a></em></p>

@ -10,7 +10,7 @@ make a cutscene for your game using the physics and characters in the
game itself. Screen capturing is the most straightforward way to do
this, but it can slow down your game and produce low-quality video and
audio as a result. A better way is to record video and audio directly
from the game while it is running.
from the game while it is running using VideoRecorderAppState.
</p>
<p>
@ -21,7 +21,7 @@ feature to record high-quality game trailers!
</p>
</div>
<!-- EDIT1 SECTION "Capture Audio/Video to a File" [1-630] -->
<!-- EDIT1 SECTION "Capture Audio/Video to a File" [1-658] -->
<h2><a>Simple Way</a></h2>
<div>
@ -39,10 +39,14 @@ Add the following code to your <code>simpleInitApp()</code> method.
<p>
The game will run slow, but the recording will be in high-quality and
normal speed. The video files will be stored in your user home
directory, if you want to save to another file, specify it in the
VideoRecorderAppState constructor. Recording starts when the state is
attached and ends when the application quits or the state is detached.
normal speed. Recording starts when the state is
attached, and ends when the application quits or the state is detached.
</p>
<p>
The video files will be stored in your <strong>user home directory</strong>.
If you want to save to another path, specify a File object in the
VideoRecorderAppState constructor.
</p>
<p>
@ -50,7 +54,7 @@ That&#039;s all!
</p>
</div>
<!-- EDIT2 SECTION "Simple Way" [631-1315] -->
<!-- EDIT2 SECTION "Simple Way" [659-1362] -->
<h2><a>Advanced Way</a></h2>
<div>
@ -153,7 +157,7 @@ a file.
</p>
</div>
<!-- EDIT3 SECTION "Advanced Way" [1316-4508] -->
<!-- EDIT3 SECTION "Advanced Way" [1363-4555] -->
<h3><a>Basic Example</a></h3>
<div>
@ -201,7 +205,7 @@ public class Basic &#123;
&#125;</pre>
</div>
<!-- EDIT4 SECTION "Basic Example" [4509-5641] -->
<!-- EDIT4 SECTION "Basic Example" [4556-5688] -->
<h3><a>How it works</a></h3>
<div>
@ -242,7 +246,7 @@ would be useless.
</p>
</div>
<!-- EDIT5 SECTION "How it works" [5642-7280] -->
<!-- EDIT5 SECTION "How it works" [5689-7327] -->
<h3><a>Advanced Example</a></h3>
<div>
@ -582,13 +586,13 @@ public class Advanced extends SimpleApplication &#123;
<p>
<!--[if !IE]> -->
<object>
<object class="media" width="400" height="350" type="application/x-shockwave-flash" data="/wiki/lib/exe/fetch.php?hash=568504&amp;media=http%3A%2F%2Fwww.youtube.com%2Fv%2FoCEfK0yhDrY%3F.swf" >
<!-- <![endif]-->
<!--[if IE]>
<object class="media" width="400" height="350" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" >
<param name="movie" value="/wiki/lib/exe/fetch.php?hash=568504&amp;media=http%3A%2F%2Fwww.youtube.com%2Fv%2FoCEfK0yhDrY%3F.swf" />
<!--><!-- -->
<param name="quality" value="high"/>
<param name="quality" value="high" />
The <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.adobe.com/products/flashplayer/"><param name="text" value="<html><u>Adobe Flash Plugin</u></html>"><param name="textColor" value="blue"></object> is needed to display this content.
</object>
<!-- <![endif]-->
@ -596,20 +600,20 @@ The <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param
</p>
</div>
<!-- EDIT6 SECTION "Advanced Example" [7281-17184] -->
<!-- EDIT6 SECTION "Advanced Example" [7328-17231] -->
<h3><a>Using Advanced features to Record from more than one perspective at once</a></h3>
<div>
<p>
<!--[if !IE]> -->
<object>
<object class="media" width="400" height="350" type="application/x-shockwave-flash" data="/wiki/lib/exe/fetch.php?hash=6921c2&amp;media=http%3A%2F%2Fwww.youtube.com%2Fv%2FWIJt9aRGusc%3F.swf" >
<!-- <![endif]-->
<!--[if IE]>
<object class="media" width="400" height="350" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" >
<param name="movie" value="/wiki/lib/exe/fetch.php?hash=6921c2&amp;media=http%3A%2F%2Fwww.youtube.com%2Fv%2FWIJt9aRGusc%3F.swf" />
<!--><!-- -->
<param name="quality" value="high"/>
<param name="quality" value="high" />
The <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://www.adobe.com/products/flashplayer/"><param name="text" value="<html><u>Adobe Flash Plugin</u></html>"><param name="textColor" value="blue"></object> is needed to display this content.
</object>
<!-- <![endif]-->
@ -617,7 +621,7 @@ The <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param
</p>
</div>
<!-- EDIT7 SECTION "Using Advanced features to Record from more than one perspective at once" [17185-17326] -->
<!-- EDIT7 SECTION "Using Advanced features to Record from more than one perspective at once" [17232-17373] -->
<h2><a>More Information</a></h2>
<div>
@ -649,5 +653,5 @@ listeners can be found here.
</p>
</div>
<!-- EDIT8 SECTION "More Information" [17327-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:capture_audio_video_to_a_file?do=export_xhtmlbody">view online version</a></em></p>
<!-- EDIT8 SECTION "More Information" [17374-] -->
<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,7 @@
<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. Combined with screen recording software, you 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 of 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. Internally, Cinematics are implemented as <a href="/com/jme3/gde/docs/jme3/advanced/application_states.html">AppStates</a>.
</p>
<p>
@ -19,12 +19,12 @@ This Node can be the rootNode, or a Node that is attached to the rootNode. </div
</li>
<li><div> Create a Cinematic object for this movie scene. The Cinematic will contain and manage the movie script.</div>
</li>
<li><div> For each line in your script (for each frame in your timeline), add a CinematicEvent to the Cinematic. </div>
<li><div> For each line in your script (for each keyframe in your timeline), add a CinematicEvent to the Cinematic. </div>
</li>
</ol>
</div>
<!-- EDIT1 SECTION "JME3 Cinematics" [1-956] -->
<!-- EDIT1 SECTION "JME3 Cinematics" [1-923] -->
<h2><a>Sample Code</a></h2>
<div>
<ul>
@ -33,7 +33,7 @@ This Node can be the rootNode, or a Node that is attached to the rootNode. </div
</ul>
</div>
<!-- EDIT2 SECTION "Sample Code" [957-1123] -->
<!-- EDIT2 SECTION "Sample Code" [924-1090] -->
<h2><a>How to Use a Cinematic</a></h2>
<div>
@ -42,9 +42,9 @@ This Node can be the rootNode, or a Node that is attached to the rootNode. </div
A Cinematic is like a movie script for a node.
</p>
<pre>Cinematic cinematic = new Cinematic&#40;sceneNode, duration&#41;;
cinematic.addCinematicEvent&#40;starttime1, track1&#41;;
cinematic.addCinematicEvent&#40;starttime2, track2&#41;;
cinematic.addCinematicEvent&#40;starttime2, track3&#41;;
cinematic.addCinematicEvent&#40;starttime1, event1&#41;;
cinematic.addCinematicEvent&#40;starttime2, event2&#41;;
cinematic.addCinematicEvent&#40;starttime2, event3&#41;;
...
stateManager.attach&#40;cinematic&#41;;</pre>
<ol>
@ -60,7 +60,7 @@ stateManager.attach&#40;cinematic&#41;;</pre>
</li>
<li><div> Create one CinematicEvent for each line of your movie script. </div>
<ul>
<li><div> <code>track</code> is one motion of a moving object. You can add several tracks. More details below.</div>
<li><div> <code>event</code> is one motion of a moving object. You can add several events. More details below.</div>
</li>
<li><div> <code>starttime</code> is the time when this particular cinematic event starts on the timeline. Specify the start time in seconds since the beginning of the cinematic.</div>
</li>
@ -85,64 +85,56 @@ stateManager.attach&#40;cinematic&#41;;</pre>
<td>cinematic.pause()</td><td>Pauses the cinematic.</td>
</tr>
</table></div>
<!-- EDIT4 TABLE [2215-2427] -->
<!-- EDIT4 TABLE [2182-2394] -->
</div>
<!-- EDIT3 SECTION "How to Use a Cinematic" [1124-2428] -->
<h2><a>Tracks (CinematicEvents)</a></h2>
<!-- EDIT3 SECTION "How to Use a Cinematic" [1091-2394] -->
<h2><a>Events(CinematicEvents)</a></h2>
<div>
<p>
Just like a movie script consists of lines with instructions to the actors, each Cinematic consists of a series of tracks.
Just like a movie script consists of lines with instructions to the actors, each Cinematic consists of a series of events.
</p>
<p>
Here is the list of available CinematicEvents that you use as tracks. Each track remote-controls scene objects in a different way:
Here is the list of available CinematicEvents that you use as events. Each track remote-controls scene objects in a different way:
</p>
<div><table>
<tr>
<th>Tracks (CinematicEvents)</th><th>Description</th>
<th>Events(CinematicEvents)</th><th>Description</th>
</tr>
<tr>
<td>MotionTrack</td><td>Use a MotionTrack to move a Spatial non-linearly over time. A MotionTrack is based on a list of waypoints in a MotionPath. The curve goes through each waypoint, and you can adjust the tension of the curve to modify the roundedness of the path. This is the motion interpolation you are going to use in most cases. </td>
<td>MotionEvent</td><td>Use a MotionEvent to move a Spatial non-linearly over time. A MotionEvent is based on a list of waypoints in a MotionPath. The curve goes through each waypoint, and you can adjust the tension of the curve to modify the roundedness of the path. This is the motion interpolation you are going to use in most cases. </td>
</tr>
<tr>
<td>PositionTrack</td><td>Use a PositionTrack to move a Spatial linearly over time. This linear interpolation results in straight motion segments between the way points. Use this to make the remote-controlled objects zig-zag from one way point to the other in a straight line.</td>
<td>SoundEvent</td><td>Use a SoundEvent to play a <a href="/com/jme3/gde/docs/jme3/advanced/audio.html">sound</a> at a given time for the given duration.</td>
</tr>
<tr>
<td>RotationTrack</td><td>Use a RotationTrack to change the rotation of a Spatial over time. It spins the Spatial to the given angle in the given amount of time by linearly interpolating the rotation.</td>
<td>GuiEvent</td><td>Displays a <a href="/com/jme3/gde/docs/jme3/advanced/nifty_gui.html">Nifty GUI</a> at a given time for the given duration. Use it to display subtitles or HUD elements. Bind the Nifty <acronym title="Graphical User Interface">GUI</acronym> <acronym title="Extensible Markup Language">XML</acronym> to the cinematic using <code>cinematic.bindUi(&quot;path/to/nifty/file.xml&quot;);</code></td>
</tr>
<tr>
<td>ScaleTrack</td><td>Use a ScaleTrack to change the size of a Spatial over time. It resizes the Spatial in the given amount of time by linearly interpolating the scale.</td>
</tr>
<tr>
<td>SoundTrack</td><td>Use a SoundTrack to play a <a href="/com/jme3/gde/docs/jme3/advanced/audio.html">sound</a> at a given time for the given duration.</td>
</tr>
<tr>
<td>GuiTrack</td><td>Displays a <a href="/com/jme3/gde/docs/jme3/advanced/nifty_gui.html">Nifty GUI</a> at a given time for the given duration. Use it to display subtitles or HUD elements. Bind the Nifty <acronym title="Graphical User Interface">GUI</acronym> <acronym title="Extensible Markup Language">XML</acronym> to the cinematic using <code>cinematic.bindUi(&quot;path/to/nifty/file.xml&quot;);</code></td>
</tr>
<tr>
<td>AnimationTrack</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>
</table></div>
<!-- EDIT6 TABLE [2723-4144] -->
<!-- EDIT6 TABLE [2688-3489] -->
<p>
The jMonkey team can add more types of tracks, just ask in the forum.
Of course one can make is own event implementation, by extending the AbstractCinematicEvent.
</p>
</div>
<!-- EDIT5 SECTION "Tracks (CinematicEvents)" [2429-4218] -->
<h3><a>MotionTrack</a></h3>
<!-- EDIT5 SECTION "Events(CinematicEvents)" [2395-3583] -->
<h3><a>MotionEvent</a></h3>
<div>
<p>
A MotionTrack moves a Spatial along a complex path.
A MotionEvent moves a Spatial along a complex path.
</p>
<pre>MotionTrack track = new MotionTrack&#40;thingNode, path&#41;;</pre>
<pre>MotionEvent events= new MotionEvent &#40;thingNode, path&#41;;</pre>
<p>
Details of the constructor:
@ -156,158 +148,131 @@ Details of the constructor:
<p>
To create a MotionTrack, do the following:
To create a MotionEvent, do the following:
</p>
<ol>
<li><div> <a href="/com/jme3/gde/docs/jme3/advanced/motionpath.html">Create a MotionPath</a></div>
<li><div> <a href="/com/jme3/gde/docs/jme3/advanced/motiontrack.html">Create a MotionEvent</a></div>
</li>
<li><div> Create a MotionTrack based on the MotionPath.</div>
<li><div> Create a MotionEvent based on the MotionPath.</div>
</li>
<li><div> Configure your MotionTrack (see below).</div>
<li><div> Configure your MotionEvent (see below).</div>
</li>
<li><div> Add the MotionTrack to a Cinematic.</div>
<li><div> Add the MotionEvent to a Cinematic.</div>
</li>
</ol>
<div><table>
<tr>
<th>MotionTrack configuration method</th><th>Usage</th>
<th>MotionEvent configuration method</th><th>Usage</th>
</tr>
<tr>
<td>track.setLoopMode(LoopMode.Loop)</td><td>Sets whether the animation along this path should loop (LoopMode.Loop) or play only once (LoopMode.DontLoop).</td>
<td>event.setLoopMode(LoopMode.Loop)</td><td>Sets whether the animation along this path should loop (LoopMode.Loop) or play only once (LoopMode.DontLoop).</td>
</tr>
<tr>
<td>track.setDirectionType(MotionTrack.Direction.None)</td><td>Sets the direction behavior type of the controled node. Direction.None deactivates this feature. You can choose from the following options: LookAt, Path, PathAndRotation, Rotation.</td>
<td>event.setDirectionType(MotionEvent.Direction.None)</td><td>Sets the direction behavior type of the controlled node. Direction.None deactivates this feature. You can choose from the following options: LookAt, Path, PathAndRotation, Rotation.</td>
</tr>
<tr>
<td>track.setDirectionType(MotionTrack.Direction.LookAt)</td><td>The spatial turns (rotates) to keep facing a certain point while moving. Specify the point with the <code>setLookAt()</code> method.</td>
<td>event.setDirectionType(MotionEvent.Direction.LookAt)</td><td>The spatial turns (rotates) to keep facing a certain point while moving. Specify the point with the <code>setLookAt()</code> method.</td>
</tr>
<tr>
<td>track.setDirectionType(MotionTrack.Direction.Path)</td><td>The spatial always faces in the direction of the path while moving.</td>
<td>event.setDirectionType(MotionEvent.Direction.Path)</td><td>The spatial always faces in the direction of the path while moving.</td>
</tr>
<tr>
<td>track.setDirectionType(MotionTrack.Direction.PathAndRotation)</td><td>The spatial faces the direction of the path, plus an added rotation. Use together with the <code>setRotation()</code> method.</td>
<td>event.setDirectionType(MotionEvent.Direction.PathAndRotation)</td><td>The spatial faces the direction of the path, plus an added rotation. Use together with the <code>setRotation()</code> method.</td>
</tr>
<tr>
<td>track.setDirectionType(MotionTrack.Direction.Rotation)</td><td>The spatial spins (rotates) while moving. You describe the spin by a custom quaternion. Use together with the <code>setRotation()</code> method.</td>
<td>event.setDirectionType(MotionEvent.Direction.Rotation)</td><td>The spatial spins (rotates) while moving. You describe the spin by a custom quaternion. Use together with the <code>setRotation()</code> method.</td>
</tr>
<tr>
<td>track.setLookAt(teapot.getWorldTranslation(), Vector3f.UNIT_Y)</td><td>The spatial always faces towards this location. Use together with <code>MotionTrack.Direction.LookAt</code>.</td>
<td>event.setLookAt(teapot.getWorldTranslation(), Vector3f.UNIT_Y)</td><td>The spatial always faces towards this location. Use together with <code>MotionEvent.Direction.LookAt</code>.</td>
</tr>
<tr>
<td>track.setRotation(quaternion)</td><td>Sets the rotation. Use together with <code>MotionTrack.Direction.Rotation</code> or <code>MotionTrack.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>
</table></div>
<!-- EDIT8 TABLE [4701-6109] -->
<!-- EDIT8 TABLE [4069-5478] -->
<p>
<strong>Tip:</strong> Most likely you remote-control more than one object in your scene. Give the tracks and paths useful names such as <code>dragon_track</code>, <code>dragon_path</code>, <code>hero_track</code>, <code>hero_path</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>
</div>
<!-- EDIT7 SECTION "MotionTrack" [4219-6305] -->
<h3><a>PositionTrack</a></h3>
<!-- EDIT7 SECTION "MotionEvent" [3584-5673] -->
<h3><a>SoundEvent</a></h3>
<div>
<p>
A PositionTrack moves a Spatial in a straight line from its current position to the end position.
A SoundEventplays a sound as part of the cinematic.
</p>
<pre>PositionTrack track = new PositionTrack&#40;
thingNode, endPosition, duration, loopMode&#41;;</pre>
<pre>SoundEvent&#40; audioPath, isStream, duration, loopMode &#41;</pre>
<p>
Details of the constructor:
</p>
<ul>
<li><div> <code>thingNode</code> is the Spatial to be moved.</div>
<li><div> <code>audioPath</code> is the path to an audio file as String, e.g. &quot;Sounds/mySound.wav&quot;.</div>
</li>
<li><div> <code>endPosition</code> is the target location as Vector3f. </div>
<li><div> <code>isStream</code> toggles between streaming and buffering. Set to true to stream long audio file, set to false to play short buffered sounds.</div>
</li>
<li><div> <code>duration</code> is the time that it should take from start to end point.</div>
<li><div> <code>duration</code> is the time that it should take to play.</div>
</li>
<li><div> <code>loopMode</code> can be LoopMode.Loop, LoopMode.DontLoop, LoopMode.Cycle.</div>
</li>
</ul>
<p>
The start location is always the current location of the Spatial.
</p>
</div>
<!-- EDIT9 SECTION "PositionTrack" [6306-6882] -->
<h3><a>RotationTrack</a></h3>
<!-- EDIT9 SECTION "SoundEvent" [5674-6204] -->
<h3><a>GuiEvent</a></h3>
<div>
<p>
A RotationTrack remote-controls the rotation of a spatial.
A GuiEventshows or hide a NiftyGUI as part of a cinematic.
</p>
<pre>RotationTrack thingRotationControl = new RotationTrack&#40;
thingNode, endRotation, duration, loopMode&#41;;</pre>
<pre>GuiEvent&#40; screen, duration, loopMode &#41;</pre>
<p>
Details of the constructor:
</p>
<ul>
<li><div> <code>thingNode</code> is the Spatial to be rotated.</div>
</li>
<li><div> <code>endRotation</code> is the target rotation in Quaternion format. </div>
</li>
<li><div> <code>duration</code> is the time that it should take from start to target rotation.</div>
</li>
<li><div> <code>loopMode</code> can be LoopMode.Loop, LoopMode.DontLoop, LoopMode.Cycle.</div>
</li>
</ul>
</div>
<!-- EDIT10 SECTION "RotationTrack" [6883-7386] -->
<h3><a>ScaleTrack</a></h3>
<div>
<p>
You must use this together with bindUI() to specify the Nifty <acronym title="Graphical User Interface">GUI</acronym> <acronym title="Extensible Markup Language">XML</acronym> file that you want to load:
A ScaleTrack remote-controls whether a spatial grows or shrinks.
</p>
<pre>ScaleTrack thingScaleControl = new ScaleTrack&#40;
thingNode, endScale, duration, loopMode&#41;;</pre>
<pre>cinematic.bindUi&#40;&quot;Interface/subtitle.xml&quot;&#41;;</pre>
<p>
Details of the constructor:
</p>
<ul>
<li><div> <code>thingNode</code> is the Spatial to be resized.</div>
</li>
<li><div> <code>endScale</code> is the target Scale in Vector3f format. </div>
<li><div> <code>screen</code> is the name of the Nifty <acronym title="Graphical User Interface">GUI</acronym> screen to load, as String. </div>
</li>
<li><div> <code>duration</code> is the time that it should take from start to target scale.</div>
<li><div> <code>duration</code> is the time that it should take to play.</div>
</li>
<li><div> <code>loopMode</code> can be LoopMode.Loop, LoopMode.DontLoop, LoopMode.Cycle.</div>
</li>
</ul>
</div>
<!-- EDIT11 SECTION "ScaleTrack" [7387-7871] -->
<h3><a>SoundTrack</a></h3>
<!-- EDIT10 SECTION "GuiEvent" [6205-6732] -->
<h3><a>AnimationEvent</a></h3>
<div>
<p>
A SoundTrack plays a sound as part of the cinematic.
An AnimationEvent triggers an animation as part of a cinematic.
</p>
<pre>SoundTrack&#40; audioPath, isStream, duration, loopMode &#41;</pre>
<pre>AnimationEvent&#40; thingNode, animationName, duration, loopMode &#41;</pre>
<p>
Details of the constructor:
</p>
<ul>
<li><div> <code>audioPath</code> is the path to an audio file as String, e.g. &quot;Sounds/mySound.wav&quot;.</div>
<li><div> <code>thingNode</code> is the Spatial whose animation you want to play.</div>
</li>
<li><div> <code>isStream</code> toggles between streaming and buffering. Set to true to stream long audio file, set to false to play short buffered sounds.</div>
<li><div> <code>animationName</code> the name of the animation stored in the animated model that you want to trigger, as a String.</div>
</li>
<li><div> <code>duration</code> is the time that it should take to play.</div>
</li>
@ -316,65 +281,40 @@ Details of the constructor:
</ul>
</div>
<!-- EDIT12 SECTION "SoundTrack" [7872-8404] -->
<h3><a>GuiTrack</a></h3>
<!-- EDIT11 SECTION "AnimationEvent" [6733-7245] -->
<h3><a>Camera Management</a></h3>
<div>
<p>
A GuiTrack shows or hide a NiftyGUI as part of a cinematic.
There is a built in system for camera switching in Cinematics. It based on CameraNode, and the cinematic just enable the given CameraNode control at a given time.
</p>
<pre>GuiTrack&#40; screen, duration, loopMode &#41;</pre>
<p>
First you have to bind a camera to the cinematic with a unique name. You&#039;ll be provided with a CameraNode
You must use this together with bindUI() to specify the Nifty <acronym title="Graphical User Interface">GUI</acronym> <acronym title="Extensible Markup Language">XML</acronym> file that you want to load:
</p>
<pre>cinematic.bindUi&#40;&quot;Interface/subtitle.xml&quot;&#41;;</pre>
<p>
Details of the constructor:
</p>
<ul>
<li><div> <code>screen</code> is the name of the Nifty <acronym title="Graphical User Interface">GUI</acronym> screen to load, as String. </div>
</li>
<li><div> <code>duration</code> is the time that it should take to play.</div>
</li>
<li><div> <code>loopMode</code> can be LoopMode.Loop, LoopMode.DontLoop, LoopMode.Cycle.</div>
</li>
</ul>
</div>
<!-- EDIT13 SECTION "GuiTrack" [8405-8934] -->
<h3><a>AnimationTrack</a></h3>
<div>
<pre> CameraNode camNode = cinematic.bindCamera&#40;&quot;topView&quot;, cam&#41;;</pre>
<p>
An AnimationTrack triggers an animation as part of a cinematic.
then you can do whatever you want with this camera node : place it so that you have a the camera angle you&#039;d like, attach it to a motion event to have some camera scrolling, attach control of your own that give it whatever behavior you&#039;d like.
In the above example, I want it to be a top view of the scene looking at the world origin.
</p>
<pre>AnimationTrack&#40; thingNode, animationName, duration, loopMode &#41;</pre>
<pre> //set its position
camNode.setLocalTranslation&#40;new Vector3f&#40;0, 50, 0&#41;&#41;;
// set it to look at the world origin
camNode.lookAt&#40;Vector3F.ZERO, Vector3f.UNIT_Y&#41;;</pre>
<p>
Then i just have to schedule its activation in the cinematic. I want it to get activated 3 seconds after the start of the cinematic so I just have to do
Details of the constructor:
</p>
<ul>
<li><div> <code>thingNode</code> is the Spatial whose animation you want to play.</div>
</li>
<li><div> <code>animationName</code> the name of the animation stored in the animated model that you want to trigger, as a String.</div>
</li>
<li><div> <code>duration</code> is the time that it should take to play.</div>
</li>
<li><div> <code>loopMode</code> can be LoopMode.Loop, LoopMode.DontLoop, LoopMode.Cycle.</div>
</li>
</ul>
<pre> cinematic.activateCamera&#40;3,???topView???&#41;;</pre>
</div>
<!-- EDIT14 SECTION "AnimationTrack" [8935-9447] -->
<!-- EDIT12 SECTION "Camera Management" [7246-8358] -->
<h3><a>Customizations</a></h3>
<div>
@ -388,12 +328,12 @@ You can also create new CinematicEvent by extending <object classid="java:org.ne
</p>
</div>
<!-- EDIT15 SECTION "Customizations" [9448-10493] -->
<!-- EDIT13 SECTION "Customizations" [8359-9404] -->
<h2><a>Interacting with Cinematics</a></h2>
<div>
</div>
<!-- EDIT16 SECTION "Interacting with Cinematics" [10494-10534] -->
<!-- EDIT14 SECTION "Interacting with Cinematics" [9405-9445] -->
<h3><a>CinematicEventListener</a></h3>
<div>
<pre>CinematicEventListener cel = new CinematicEventListener&#40;&#41; &#123;
@ -415,7 +355,7 @@ You can also create new CinematicEvent by extending <object classid="java:org.ne
cinematic.addListener&#40;cel&#41;;</pre>
</div>
<!-- EDIT17 SECTION "CinematicEventListener" [10535-11030] -->
<!-- EDIT15 SECTION "CinematicEventListener" [9446-9941] -->
<h3><a>Physics Interaction</a></h3>
<div>
@ -425,15 +365,5 @@ Upcoming.
</p>
</div>
<!-- EDIT18 SECTION "Physics Interaction" [11031-11072] -->
<h2><a>More Information</a></h2>
<div>
<p>
See also: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.org/groups/development-discussion-jme3/forum/topic/cinematics-system-for-jme3/"><param name="text" value="<html><u>Cinematics by Nehon</u></html>"><param name="textColor" value="blue"></object>
</p>
</div>
<!-- EDIT19 SECTION "More Information" [11073-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:cinematics?do=export_xhtmlbody">view online version</a></em></p>
<!-- EDIT16 SECTION "Physics Interaction" [9942-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:cinematics?do=export_xhtmlbody">view online version</a></em></p>

@ -8,7 +8,7 @@ The term collision can be used to refer to <a href="/com/jme3/gde/docs/jme3/adva
</p>
<p>
Non-physical collision detection is interesting because it uses less computing resources than physical collision detection. The non-physical calculations are faster because they do not have any side effects such as pushing other objects or bumping off of them. Tasks such as <a href="/com/jme3/gde/docs/jme3/advanced/mouse_picking.html">mouse picking</a> are easily implemented using using mathematical techniques such as ray casting and intersections. Experienced developers optimize their games by finding ways to simulate certain (otherwise expensive physical) interactions in a non-physical way.
Non-physical collision detection is interesting because it uses less computing resources than physical collision detection. The non-physical calculations are faster because they do not have any side effects such as pushing other objects or bumping off of them. Tasks such as <a href="/com/jme3/gde/docs/jme3/advanced/mouse_picking.html">mouse picking</a> are easily implemented using mathematical techniques such as ray casting and intersections. Experienced developers optimize their games by finding ways to simulate certain (otherwise expensive physical) interactions in a non-physical way.
</p>
<p>
@ -16,7 +16,7 @@ Non-physical collision detection is interesting because it uses less computing r
</p>
</div>
<!-- EDIT1 SECTION "Collision and Intersection" [1-1438] -->
<!-- EDIT1 SECTION "Collision and Intersection" [1-1432] -->
<h2><a>Collidable</a></h2>
<div>
@ -48,7 +48,7 @@ Note that jME counts <em>all</em> collisions, this means a ray intersecting a bo
<td>getCollision(i) </td><td>Returns the CollisionResult at index i.</td>
</tr>
</table></div>
<!-- EDIT3 TABLE [2081-2409] -->
<!-- EDIT3 TABLE [2075-2403] -->
<p>
A CollisionResult object contains information about the second party of the collision event.
</p>
@ -75,9 +75,9 @@ A CollisionResult object contains information about the second party of the coll
<td>getTriangleIndex()</td><td>Returns the index of the triangle on the second party&#039;s mesh that was hit.</td>
</tr>
</table></div>
<!-- EDIT4 TABLE [2503-3036] -->
<!-- EDIT4 TABLE [2497-3030] -->
</div>
<!-- EDIT2 SECTION "Collidable" [1439-3037] -->
<!-- EDIT2 SECTION "Collidable" [1433-3031] -->
<h3><a>Code Sample</a></h3>
<div>
@ -133,7 +133,7 @@ Knowing the distance of the collisions is useful for example when you intersect
</p>
</div>
<!-- EDIT5 SECTION "Code Sample" [3038-5576] -->
<!-- EDIT5 SECTION "Code Sample" [3032-5570] -->
<h2><a>Bounding Volumes</a></h2>
<div>
@ -173,7 +173,7 @@ Supported types:
</p>
</div>
<!-- EDIT6 SECTION "Bounding Volumes" [5577-7620] -->
<!-- EDIT6 SECTION "Bounding Volumes" [5571-7614] -->
<h3><a>Usage</a></h3>
<div>
@ -186,7 +186,7 @@ For example you can use Bounding Volumes on custom meshes, or complex non-physic
mesh.updateBound&#40;&#41;;</pre>
</div>
<!-- EDIT7 SECTION "Usage" [7621-7802] -->
<!-- EDIT7 SECTION "Usage" [7615-7796] -->
<h2><a>Mesh and Scene Graph Collision</a></h2>
<div>
@ -196,7 +196,7 @@ One of the supported <code>Collidable</code>s are meshes and scene graph objects
</p>
</div>
<!-- EDIT8 SECTION "Mesh and Scene Graph Collision" [7803-8623] -->
<!-- EDIT8 SECTION "Mesh and Scene Graph Collision" [7797-8617] -->
<h2><a>Intersection</a></h2>
<div>
@ -224,7 +224,7 @@ Rays are used to perform line-of-sight calculations. This means you can detect w
<p>
Learn the details of how to implement <a href="/com/jme3/gde/docs/jme3/advanced/mouse_picking.html">Mouse Picking</a> here.
</p>
<hr/>
<hr />
<p>
TODO:
@ -237,5 +237,5 @@ TODO:
</ul>
</div>
<!-- EDIT9 SECTION "Intersection" [8624-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:collision_and_intersection?do=export_xhtmlbody">view online version</a></em></p>
<!-- EDIT9 SECTION "Intersection" [8618-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:collision_and_intersection?do=export_xhtmlbody">view online version</a></em></p>

@ -267,4 +267,4 @@ Depending on the game genre, the designer can reward the players&#039; intrinsic
</div>
<!-- EDIT10 SECTION "Why Combos?" [7153-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:combo_moves?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:combo_moves?do=export_xhtmlbody">view online version</a></em></p>

@ -87,7 +87,7 @@ Examples: You can write
<p>
The possibilities are endless. <img src="/wiki/lib/images/smileys/icon_smile.gif" class="middle" alt=":-)"/>
The possibilities are endless. <img src="/wiki/lib/images/smileys/icon_smile.gif" class="middle" alt=":-)" />
</p>
</div>
@ -388,4 +388,4 @@ c.steerX&#40;steerX&#41;;</pre>
</div>
<!-- EDIT6 SECTION "Best Practices" [10700-] -->
<p><em><a href="http://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>

@ -5,7 +5,11 @@
<p>
<img src="/wiki/lib/exe/fetch.php">
Use the Mesh class to create custom shapes that go beyond Quad, Box, Cylinder, and Sphere, even procedural shapes are possible. Thank you to KayTrance for providing the sample code!
In this tutorial, we (re)create a very simple rectangular mesh, and we have a look at different ways of coloring it. A flat rectangle may not look useful because it&#039;s exactly the same as a <code>com.jme3.scene.shape.Quad</code>. We choose this simple example in order to show you how to build any shape out of triangles ??? without the distractions of more complex shapes.
</p>
<p>
<strong>Note:</strong> In this tutorial, we (re)create a very simple rectangular mesh (a quad), and we have a look at different ways of coloring it. Coding a custom quad may not be very useful because it&#039;s exactly the same as the built-in <code>com.jme3.scene.shape.Quad</code>. We chose a simple quad to teach you how to build any shape out of triangles, without the distractions of more complex shapes.
</p>
<ul>
<li><div> Full code sample: <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://jmonkeyengine.googlecode.com/svn/branches/stable-alpha4/engine/src/test/jme3test/model/shape/TestCustomMesh.java"><param name="text" value="<html><u>TestCustomMesh.java</u></html>"><param name="textColor" value="blue"></object></div>
@ -13,43 +17,68 @@ In this tutorial, we (re)create a very simple rectangular mesh, and we have a lo
</ul>
</div>
<!-- EDIT1 SECTION "Custom Mesh Shapes" [1-811] -->
<!-- EDIT1 SECTION "Custom Mesh Shapes" [1-834] -->
<h2><a>Polygon Meshes</a></h2>
<div>
<p>
Polygon meshes are made up of triangles. The corners of the triangles are vertices. So, when ever you create a new shape, you break it down into triangles.
Let&#039;s look at a cube. A cube is made up of 6 rectangles. Each rectangle can be broken down into two triangles. This means you need 12 triangles to create a cube mesh. You also need to know the 8 corner coordinates (vertices). The trick is that you have to specify the vertices in a certain order: Each triangle separately, counter-clockwise.
Sounds worse than it is ??? here is an example:
Polygon <a href="/com/jme3/gde/docs/jme3/advanced/mesh.html">mesh</a>es are made up of triangles. The corners of the triangles are called vertices. When ever you create any new shape, you break it down into triangles.
</p>
<p>
<strong>Example:</strong> Let&#039;s look at a cube. A cube is made up of 6 rectangles. Each rectangle can be broken down into two triangles. This means you need 12 triangles to describe a cube mesh. Therefor you must provide the coordinates of the triangles&#039; 8 corners (called vertices).
</p>
<p>
The important thing is that you have to specify the vertices of each triangle in the right order: Each triangle separately, counter-clockwise.
</p>
<p>
Sounds harder than it is ??? let&#039;s create a simple custom mesh, a quad.
</p>
</div>
<!-- EDIT2 SECTION "Polygon Meshes" [812-1383] -->
<!-- EDIT2 SECTION "Polygon Meshes" [835-1518] -->
<h2><a>Creating a Quad Mesh</a></h2>
<div>
<p>
Okay, we want to create a Quad. A quad has four vertices, and is made up of two triangles.
The base class for creating meshes is <code>com.jme3.scene.Mesh</code>.
In this tutorial we want to create a 3x3 Quad. The quad has four vertices, and is made up of two triangles. In our example, we decide that the bottom left corner is at 0/0/0 and the top right is at 3/3/0.
</p>
<pre>Mesh mesh = new Mesh&#40;&#41;;</pre>
<pre>0,3,0--3,3,0
| \ |
| \ |
| \ |
| \ |
| \|
0,0,0--3,0,0</pre>
</div>
<!-- EDIT3 SECTION "Creating a Quad Mesh" [1519-1864] -->
<h3><a>The Mesh Object</a></h3>
<div>
<p>
If you create your own Mesh-based class, replace <code>mesh</code> by <code>this</code> in the following examples:
The base class for creating meshes is <code>com.jme3.scene.Mesh</code>.
</p>
<pre>public class MyMesh extends Mesh &#123; &#125;</pre>
<pre>Mesh mesh = new Mesh&#40;&#41;;</pre>
<p>
Tip: If you create your own Mesh-based class (<code>public class MyMesh extends Mesh { }</code>), replace the variable <code>mesh</code> by <code>this</code> in the following examples.
</p>
</div>
<!-- EDIT3 SECTION "Creating a Quad Mesh" [1384-1766] -->
<h3><a>Vertices</a></h3>
<!-- EDIT4 SECTION "The Mesh Object" [1865-2157] -->
<h3><a>Vertex Coordinates</a></h3>
<div>
<p>
To define your own shape, determine its vertex positions in space. Store them in an array using com.jme3.math.Vector3f. For a Quad, we need four vertices: Bottom left, bottom right, top left, top right. We name the array <code>vertices[]</code>.
To define your own shape, determine the shape&#039;s <strong>vertex coordinates</strong> in 3D space. Store the list of corner positions in an <code>com.jme3.math.Vector3f</code> array. For a Quad, we need four vertices: Bottom left, bottom right, top left, top right. We name the array <code>vertices[]</code>.
</p>
<pre>Vector3f &#91;&#93; vertices = new Vector3f&#91;4&#93;;
@ -59,12 +88,12 @@ vertices&#91;2&#93; = new Vector3f&#40;0,3,0&#41;;
vertices&#91;3&#93; = new Vector3f&#40;3,3,0&#41;;</pre>
</div>
<!-- EDIT4 SECTION "Vertices" [1767-2222] -->
<!-- EDIT5 SECTION "Vertex Coordinates" [2158-2664] -->
<h3><a>Texture Coordinates</a></h3>
<div>
<p>
Next, define the Quad&#039;s 2D texture coordinates for each vertex, in the same order: Bottom left, bottom right, top left, top right. We name this array <code>texCoord[]</code>
Next, we define the Quad&#039;s 2D <strong>texture coordinates</strong> for each vertex, in the same order as the vertices: Bottom left, bottom right, top left, top right. We name this Vector2f array <code>texCoord[]</code>
</p>
<pre>Vector2f&#91;&#93; texCoord = new Vector2f&#91;4&#93;;
@ -73,17 +102,33 @@ texCoord&#91;1&#93; = new Vector2f&#40;1,0&#41;;
texCoord&#91;2&#93; = new Vector2f&#40;0,1&#41;;
texCoord&#91;3&#93; = new Vector2f&#40;1,1&#41;;</pre>
<p>
This syntax means, when you apply a texture to this mesh, the texture will fill the quad from corner to corner at 100% percent size. Especially when you stitch together a larger mesh, you use this to tell the renderer whether, and how exactly, you want to cover the whole mesh. E.g. if you use .5f or 2f as texture coordinates instead of 1f, textures will be stretched or shrunk accordingly.
</p>
</div>
<!-- EDIT5 SECTION "Texture Coordinates" [2223-2608] -->
<!-- EDIT6 SECTION "Texture Coordinates" [2665-3475] -->
<h3><a>Connecting the Dots</a></h3>
<div>
<p>
Next we turn the unrelated coordinates into triangles ??? We define the order in which the mesh is constructed. Think of these indexes as coming in groups of three. Each group of indexes describes one triangle. Note that you must specify the vertices counter-clockwise!
Next we turn these unrelated coordinates into <strong>triangles</strong>: We define the order in which each triangle is constructed. Think of these indexes as coming in groups of three. Each group of indexes describes one triangle. If the corners are identical, you can (and should!) reuse an index for several triangles.
</p>
<p>
Remember that you must specify the vertices counter-clockwise.
</p>
<pre>int &#91;&#93; indexes = &#123; 2,0,1, 1,3,2 &#125;;</pre>
<p>
This syntax means:
</p>
<ul>
<li><div> The indices 0,1,2,3 stand for the four vertices that you specified for the quad in <code>vertices[]</code>.</div>
</li>
<li><div> The 2,0,1 triangle starts at top left, continues bottom left, and ends at bottom right.</div>
</li>
<li><div> The 1,3,2 triangle start at bottom right, continues top right, and ends at top left.</div>
@ -94,18 +139,28 @@ Next we turn the unrelated coordinates into triangles ??? We define the order in
| \ |
0--1\1</pre>
<p>
If the shape is more complex, it has more triangles, and therefor also more vertices/indices. Just continue expanding the list by adding groups of three indices for each triangle. (For example a three-triangle &quot;house&quot; shape has 5 vertices/indices and you&#039;d specify three groups: <code>int [] indexes = { 2,0,1, 1,3,2, 2,3,4 };</code>.)
</p>
<p>
<p><div>If you get the order wrong (clockwise) for some of the triangles, then these triangles face backwards. If the <a href="/com/jme3/gde/docs/jme3/advanced/spatial.html">Spatial</a>&#039;s material uses the default <code>FaceCullMode.Back</code> (see &quot;face culling&quot;), the broken triangles appear as holes in the rendered mesh. You need to identify and fix them in your code.
</div></p>
</p>
</div>
<!-- EDIT6 SECTION "Connecting the Dots" [2609-3204] -->
<!-- EDIT7 SECTION "Connecting the Dots" [3476-4947] -->
<h3><a>Setting the Mesh Buffer</a></h3>
<div>
<p>
The Mesh data is stored in a buffer.
You store the Mesh data in a buffer.
</p>
<ol>
<li><div> Using <code>com.jme3.util.BufferUtils</code>, we create three buffers for the three types of information we have:</div>
<ul>
<li><div> vertex positions,</div>
<li><div> vertex coordinates,</div>
</li>
<li><div> texture coordinates,</div>
</li>
@ -113,11 +168,11 @@ The Mesh data is stored in a buffer.
</li>
</ul>
</li>
<li><div> We assign the data to the appropriate type of buffer inside the mesh object. The three buffer types are taken from an enum in <code>com.jme3.scene.VertexBuffer.Type</code>.</div>
<li><div> We assign the data to the appropriate type of buffer inside the <code>Mesh</code> object. The three buffer types (<code>Position</code>, <code>TextCoord</code>, <code>Index</code>) are taken from an enum in <code>com.jme3.scene.VertexBuffer.Type</code>.</div>
</li>
<li><div> The third parameter describes the number of components of the values. Vertex postions are 3 float values, texture coordinates are 2 float values, and the indices are 3 ints representing 3 vertices in a triangle.</div>
<li><div> The integer parameter describes the number of components of the values. Vertex postions are 3 float values, texture coordinates are 2 float values, and the indices are 3 ints representing 3 vertices in a triangle.</div>
</li>
<li><div> In order for jMonkey to correctly show the mesh in the scene, it needs to know the bounds of our new mesh. This can easily be achieved by calling the updateBound() method on it.</div>
<li><div> To render the mesh in the scene, we need to pre-calculate the bounding volume of our new mesh: Call the <code>updateBound()</code> method on it.</div>
</li>
</ol>
<pre>mesh.setBuffer&#40;Type.Position, 3, BufferUtils.createFloatBuffer&#40;vertices&#41;&#41;;
@ -128,20 +183,20 @@ mesh.updateBound&#40;&#41;;</pre>
<p>
Our Mesh is ready! Now we want to see it.
</p>
</div>
<!-- EDIT7 SECTION "Setting the Mesh Buffer" [3205-4320] -->
<!-- EDIT8 SECTION "Setting the Mesh Buffer" [4948-6071] -->
<h2><a>Using the Mesh in a Scene</a></h2>
<div>
<p>
We create a <code>com.jme3.scene.Geometry</code>, apply a simple color material to it, and attach it to the rootNode to make it appear in the scene.
We create a <code>com.jme3.scene.Geometry</code> from our <code>mesh</code>, apply a simple color material to it, and attach it to the rootNode to make it appear in the scene.
</p>
<pre>Geometry geo = new Geometry&#40;&quot;OurMesh&quot;, mesh&#41;;
Material mat = new Material&#40;assetManager, &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;;
<pre>Geometry geo = new Geometry&#40;&quot;OurMesh&quot;, mesh&#41;; // using our custom mesh object
Material mat = new Material&#40;assetManager,
&quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;;
mat.setColor&#40;&quot;Color&quot;, ColorRGBA.Blue&#41;;
geo.setMaterial&#40;mat&#41;;
rootNode.attachChild&#40;geo&#41;;</pre>
@ -149,43 +204,50 @@ rootNode.attachChild&#40;geo&#41;;</pre>
<p>
Ta-daa!
</p>
</div>
<!-- EDIT8 SECTION "Using the Mesh in a Scene" [4321-4740] -->
<!-- EDIT9 SECTION "Using the Mesh in a Scene" [6072-6547] -->
<h2><a>Dynamic Meshes</a></h2>
<div>
<p>
If modifying a mesh dynamically in a way which would change the model&#039;s bounds then you need to call updateModelBound() on the Geometry object containing the mesh after calling updateBounds() on the mesh object. There is a warning on updateModelBounds about not usually needing to use it but that can be ignored in this special case.
If you are modifying a mesh dynamically in a way which changes the model&#039;s bounds, you need to update it:
</p>
<ol>
<li><div> Call <code>updateBounds()</code> on the mesh object, and then </div>
</li>
<li><div> call <code>updateModelBound()</code> on the Geometry object containing the mesh. </div>
</li>
</ol>
<p>
The updateModelBounds() method warns you about not usually needing to use it, but that can be ignored in this special case.
</p>
</div>
<!-- EDIT9 SECTION "Dynamic Meshes" [4741-5102] -->
<!-- EDIT10 SECTION "Dynamic Meshes" [6548-6942] -->
<h2><a>Optional Mesh Features</a></h2>
<div>
<p>
There are more vertex buffers in a Mesh than the three shown above. For an overview, see also <a href="/com/jme3/gde/docs/jme3/advanced/mesh.html">mesh</a>.
</p>
</div>
<!-- EDIT10 SECTION "Optional Mesh Features" [5103-5241] -->
<!-- EDIT11 SECTION "Optional Mesh Features" [6943-7082] -->
<h3><a>Example: Vertex Colors</a></h3>
<div>
<p>
Vertex coloring is a simple way of coloring meshes. Instead of just assigning one solid color, each vertex (corner) has a color assigned. The faces between the vertices are then colored with a gradient. You can use the same mesh <code>mesh</code> object that you defined above.
Vertex coloring is a simple way of coloring meshes. Instead of just assigning one solid color, each vertex (corner) has a color assigned. The faces between the vertices are then colored with a gradient. For this demo, you can use the same mesh <code>mesh</code> object that you defined above.
</p>
<pre>Geometry geo = new Geometry &#40;&quot;ColoredMesh&quot;, mesh&#41;;
<pre>Geometry geo = new Geometry &#40;&quot;ColoredMesh&quot;, mesh&#41;; // using the custom mesh
Material matVC = new Material&#40;assetManager, &quot;Common/MatDefs/Misc/Unshaded.j3md&quot;&#41;;
matVC.setBoolean&#40;&quot;VertexColor&quot;, true&#41;;</pre>
<p>
You create a float array color buffer:
</p>
<ul>
@ -209,10 +271,11 @@ You create a float array color buffer:
</ul>
<p>
Loop over the colorArray buffer to quickly set some RGBA value for each vertex. As usual, RGBA color values range from 0.0f to 1.0f. <strong>Note that the color values in this example are arbitrarily chosen.</strong> It&#039;s just a quick loop to give every vertex a different RGBA value (a purplish gray, purple, a greenish gray, green, see screenshot), without writing too much code. For your own mesh, you&#039;d assign meaningful values for the color buffer depending on which color you want your mesh to have.
Loop over the colorArray buffer to quickly set some RGBA value for each vertex. As usual, RGBA color values range from 0.0f to 1.0f. <strong>Note that the color values in this example are arbitrarily chosen.</strong> It&#039;s just a quick loop to give every vertex a different RGBA value (a purplish gray, purple, a greenish gray, green, see screenshot), without writing too much code. For your own mesh, you&#039;d assign meaningful values for the color buffer depending on which color you want your mesh to have.
</p>
<pre>for&#40;int i = 0; i &lt; 4; i++&#41;&#123;
<pre>// note: the red and green values are arbitray in this example
for&#40;int i = 0; i &lt; 4; i++&#41;&#123;
// Red value (is increased by .2 on each next vertex here)
colorArray&#91;colorIndex++&#93;= 0.1f+&#40;.2f*i&#41;;
// Green value (is reduced by .2 on each next vertex)
@ -224,7 +287,6 @@ Loop over the colorArray buffer to quickly set some RGBA value for each vertex.
&#125;</pre>
<p>
Next, set the color buffer. An RGBA color value contains four float components, thus the parameter <code>4</code>.
</p>
@ -233,36 +295,38 @@ geo.setMaterial&#40;matVC&#41;;</pre>
<p>
Now you see a gradient color extending from each vertex.
When you run this code, you see a gradient color extending from each vertex.
</p>
</div>
<!-- EDIT11 SECTION "Example: Vertex Colors" [5242-7391] -->
<h3><a>Example: Shaded Mesh with Normals</a></h3>
<!-- EDIT12 SECTION "Example: Vertex Colors" [7083-9361] -->
<h3><a>Example: Using Meshes With Lighting.j3md</a></h3>
<div>
<p>
The examples used the mesh together with the Unshaded.j3md material. If you want to use the Mesh with a Phong illuminated material (such as Lighting.j3md), the mesh needs to include information about its normals. (The Normals encode in which direction a mesh polygon is facing, which is important for calculating light and shadow.)
The previous examples used the mesh together with the <code>Unshaded.j3md</code> material. If you want to use the mesh with a Phong illuminated material (such as <code>Lighting.j3md</code>), the mesh must include information about its Normals. (Normal Vectors encode in which direction a mesh polygon is facing, which is important for calculating light and shadow!)
</p>
<pre>float&#91;&#93; normals = new float&#91;12&#93;;
normals = new float&#91;&#93;&#123;0,0,1, 0,0,1, 0,0,1, 0,0,1&#125;;
mesh.setBuffer&#40;Type.Normal, 3, BufferUtils.createFloatBuffer&#40;normals&#41;&#41;;</pre>
<p>
You need to specify as many normals as the polygon has vertices. For a flat quad, the four normals point in the same direction. In this case, the direction is the Z unit vector (0,0,1), this means our quad is facing the camera.
</p>
You need as many normals as the polygon has vertices. For a flat quad, they point all in the same direction. In this case, the direction is the Z unit vector (Vector3f.UNIT_Z), this means the quad is facing the camera.
<p>
If the mesh is more complex or rounded, calculate cross products of neighbouring vertices to identify normal vectors!
</p>
</div>
<!-- EDIT12 SECTION "Example: Shaded Mesh with Normals" [7392-8163] -->
<!-- EDIT13 SECTION "Example: Using Meshes With Lighting.j3md" [9362-10288] -->
<h3><a>Example: Point Mode</a></h3>
<div>
<p>
Alternatively, you can show the vertices as colored points instead of coloring the faces.
Additionally to coloring the faces as just described, you can hide the faces and show only the vertices as colored corner points.
</p>
<pre>Geometry coloredMesh = new Geometry &#40;&quot;ColoredMesh&quot;, cMesh&#41;;
...
@ -277,39 +341,46 @@ rootNode.attachChild&#40;geo&#41;;</pre>
<p>
This will result in a 10 px dot being rendered for each of the four vertices. The dot has the vertex color you specified above. The Quad&#039;s faces are not rendered at all. This can be used for a special debugging or editing mode.
This will result in a 10 px dot being rendered for each of the four vertices. The dot has the vertex color you specified above. The Quad&#039;s faces are not rendered at all in this mode. You can use this to visualize a special debugging or editing mode in your game.
</p>
</div>
<!-- EDIT13 SECTION "Example: Point Mode" [8164-8819] -->
<!-- EDIT14 SECTION "Example: Point Mode" [10289-11022] -->
<h2><a>Debugging Tip: Culling</a></h2>
<div>
<p>
By default, jME3 optimizes a mesh by culling (not drawing) its backfaces. It determines which side the front or backface of a mesh is by the order of the vertices: The frontface is the one where the vertices are specified counter-clockwise.
By default, jME3 optimizes a mesh by &quot;backface culling&quot;, this means not drawing the inside. It determines the side of a triangle by the order of the vertices: The frontface is the face where the vertices are specified counter-clockwise.
</p>
<p>
This means for you that your custom mesh is invisible when seen from &quot;behind&quot; or from the inside. This may not be a problem, often this is even intended because it&#039;s faster. The player will not look at the inside of most things anyway. For example, if your custom mesh is a closed polyhedron, or a flat wallpaper-like object, then rendering the backfaces (the inside of the pillar, the back of the painting, etc) would indeed be a waste of resources.
This means for you that, by default, your custom mesh is invisible when seen from &quot;behind&quot; or from the inside. This may not be a problem, typically this is even intended, because it&#039;s faster. The player will not look at the inside of most things anyway. For example, if your custom mesh is a closed polyhedron, or a flat wallpaper-like object, then rendering the backfaces (the inside of the pillar, the back of the painting, etc) would indeed be a waste of resources.
</p>
<p>
In case however that your usecase requires the backfaces to be visible, you have two options:
In case however that your usecase requires the backfaces be visible, you have two options:
</p>
<ul>
<li><div> If you have a very simple scene, you can just deactivate backface culling for this one mesh&#039;s material. <br/>
<code>mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);</code></div>
<li><div> If you have a very simple scene, you can simply deactivate backface culling for this one mesh&#039;s material. <pre>mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);</pre>
</div>
</li>
<li><div> The recommended solution is to specify each triangle twice, the second time with the opposite order of vertices. The second, reversed triangle is a second frontface that replaces the culled backface. <br/>
<code>int[] indexes = { 2,0,1, 1,3,2, 2,3,1, 1,0,2 }; </code></div>
<li><div> Another solution for truly double-sided meshes is to specify each triangle twice, the second time with the opposite order of vertices. The second (reversed) triangle is a second frontface that covers up the culled backface. <pre>int[] indexes = { 2,0,1, 1,3,2, 2,3,1, 1,0,2 };</pre>
</div>
</li>
</ul>
<hr />
<p>
See also:
See also: <a href="/com/jme3/gde/docs/jme3/advanced/spatial.html">Spatial</a> ??? contains more info about how to debug custom meshes (that do not render as expected) by changing the default culling behaviour.
</p>
<ul>
<li><div> <a href="/com/jme3/gde/docs/jme3/advanced/spatial.html">Spatial</a> ??? contains more info about how to debug custom meshes (that do not render as expected) by changing the default culling behaviour.</div>
</li>
<li><div> <a href="/com/jme3/gde/docs/jme3/advanced/mesh.html">Mesh</a> ??? more details about advanced Mesh properties</div>
</li>
</ul>
<div><span>
<a href="/wiki/doku.php/tag:spatial?do=showtag&amp;tag=tag%3Aspatial">spatial</a>,
<a href="/wiki/doku.php/tag:node?do=showtag&amp;tag=tag%3Anode">node</a>,
@ -319,5 +390,5 @@ See also: <a href="/com/jme3/gde/docs/jme3/advanced/spatial.html">Spatial</a> ??
</span></div>
</div>
<!-- EDIT14 SECTION "Debugging Tip: Culling" [8820-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:custom_meshes?do=export_xhtmlbody">view online version</a></em></p>
<!-- EDIT15 SECTION "Debugging Tip: Culling" [11023-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:custom_meshes?do=export_xhtmlbody">view online version</a></em></p>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 27 KiB

@ -272,4 +272,4 @@ Then attach the scene processor to the <acronym title="Graphical User Interface"
</div>
<!-- EDIT11 SECTION "See also" [8425-] -->
<p><em><a href="http://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>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 108 KiB

@ -296,7 +296,7 @@ Thanks for your awesome contributions! Keep them coming!
<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/effect/TestMovingParticle.java"><param name="text" value="<html><u>jme3/src/test/jme3test/effect/TestMovingParticle.java</u></html>"><param name="textColor" value="blue"></object> ??? dust, smoke</div>
</li>
</ul>
<hr/>
<hr />
<p>
See also:
@ -318,4 +318,4 @@ See also:
</div>
<!-- EDIT20 SECTION "Particle Emitters: Explosions, Fire, Smoke" [8466-] -->
<p><em><a href="http://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>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 54 KiB

@ -63,12 +63,13 @@ HeightMapGrid adds the possibility of loading terrain tiles on demand instead of
<div>
<p>
<img src="nbdocs:/com/jme3/gde/docs/wp-uploads/2011/06/grid-tiles.jpg">
After playing around with the terrain in jME3, soon comes the requirement of having larger explorable lands. Increasing the size of one TerrainQuad leads to more memory usage, while it will still be easy to reach the worlds boundaries. That???s why TerrainGrid was designed. It extends the TerraindQuad class and uses 4 HeightMaps (dark blue) as the four sub-quad. This means that a terrain of size 513 will use tiles of 257. Also an LRUCache is built into the terrain package, so surrounding tiles (green) can be pre-cached on a different thread, lowering the loading time. The quads are updated as the camera approaches the boundary of the light blue section.
</p>
</div>
<!-- EDIT4 SECTION "Motivation" [2426-3108] -->
<!-- EDIT4 SECTION "Motivation" [2426-3157] -->
<h2><a>Rationale</a></h2>
<div>
@ -84,7 +85,7 @@ There exist also two basic HeightMapGrid implementations:
</ul>
</div>
<!-- EDIT5 SECTION "Rationale" [3109-4319] -->
<!-- EDIT5 SECTION "Rationale" [3158-4368] -->
<h2><a>Usage</a></h2>
<div>
<ol>
@ -111,5 +112,5 @@ Further information about terrain and TerrainQuad can be found in the wiki at:
</ul>
</div>
<!-- EDIT6 SECTION "Usage" [4320-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:endless_terraingrid?do=export_xhtmlbody">view online version</a></em></p>
<!-- EDIT6 SECTION "Usage" [4369-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:endless_terraingrid?do=export_xhtmlbody">view online version</a></em></p>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 17 KiB

@ -47,4 +47,4 @@ You can also change the fade duration using <code>fade.setDuration()</code>.
</div>
<!-- EDIT3 SECTION "Fading in and out" [966-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:fade?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:fade?do=export_xhtmlbody">view online version</a></em></p>

@ -92,4 +92,4 @@ Okay, so you can now start your game in a headless &#039;server mode&#039;, wher
</div>
<!-- EDIT5 SECTION "Next steps" [1391-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:headless_server?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:headless_server?do=export_xhtmlbody">view online version</a></em></p>

@ -232,4 +232,4 @@ When you disable the motor, the chained nodes are exposed to gravity again:
</div>
<!-- EDIT8 SECTION "Apply Physical Forces" [5629-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:hinges_and_joints?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:hinges_and_joints?do=export_xhtmlbody">view online version</a></em></p>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 97 KiB

@ -217,4 +217,4 @@ For HUDs, you basically follow the same instructions as for creating a normal <a
</div>
<!-- EDIT10 SECTION "See also" [5723-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:hud?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:hud?do=export_xhtmlbody">view online version</a></em></p>

@ -385,4 +385,4 @@ The abstraction of separating triggers and mappings has the advantage that you c
</div>
<!-- EDIT15 SECTION "Let Users Remap Keys" [10201-] -->
<p><em><a href="http://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>

@ -359,4 +359,4 @@ The <acronym title="Portable Network Graphics">PNG</acronym> file is in the same
</div>
<!-- EDIT15 SECTION "Related Links" [9445-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:j3m_material_files?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:j3m_material_files?do=export_xhtmlbody">view online version</a></em></p>

@ -234,7 +234,7 @@ JME3 uses some global uniforms for lighting :
</ul>
<p>
these uniforms are passed to the shader without having to declare them in the j3md file, but you have to specify in the technique definition &quot; LightMode MultiPass&quot; see lighting.j3md for more information.
These uniforms are passed to the shader without having to declare them in the j3md file, but you have to specify in the technique definition &quot; LightMode MultiPass&quot; see lighting.j3md for more information.
<br/>
@ -464,4 +464,4 @@ Those attributes are deprecated since GLSL 1.3 (opengl 3), hence JME3 global uni
</div>
<!-- EDIT16 SECTION "Useful links" [12053-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:jme3_shaders?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:jme3_shaders?do=export_xhtmlbody">view online version</a></em></p>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

@ -177,11 +177,11 @@ LightControl lightControl = new LightControl&#40;myLight&#41;;
spatial.addControl&#40;lightControl&#41;; // this spatial controls the position of this light.</pre>
<p>
Obviously, this does apply to AmbientLights which have no position.
Obviously, this does not apply to AmbientLights, which have no position.
</p>
</div>
<!-- EDIT7 SECTION "Light Follows Spatial" [5326-5886] -->
<!-- EDIT7 SECTION "Light Follows Spatial" [5326-5891] -->
<h2><a>Simple Lighting</a></h2>
<div>
@ -240,7 +240,7 @@ These light effects update live when the object or light source moves. If you sh
</p>
</div>
<!-- EDIT8 SECTION "Simple Lighting" [5887-8536] -->
<!-- EDIT8 SECTION "Simple Lighting" [5892-8541] -->
<h2><a>BasicShadowRenderer</a></h2>
<div>
@ -280,8 +280,39 @@ airplane.setShadowMode&#40;ShadowMode.Cast&#41;; // nothing casts shadows
ghost.setShadowMode&#40;ShadowMode.Off&#41;; // ghost is translucent anyway...</pre>
</div>
<!-- EDIT9 SECTION "BasicShadowRenderer" [8537-10206] -->
<h2><a>Parallel-Split Shadow Map</a></h2>
<!-- EDIT9 SECTION "BasicShadowRenderer" [8542-10211] -->
<h2><a>DirectionalLightShadowRenderer</a></h2>
<div>
<p>
Full sample code
</p>
<ul>
<li><div> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/light/TestDirectionalLightShadow.java"><param name="text" value="<html><u>TestDirectionalLightShadow.java</u></html>"><param name="textColor" value="blue"></object></div>
</li>
</ul>
<pre> DirectionalLight sun = new DirectionalLight&#40;&#41;;
sun.setColor&#40;ColorRGBA.White&#41;;
sun.setDirection&#40;cam.getDirection&#40;&#41;&#41;;
rootNode.addLight&#40;sun&#41;;
&nbsp;
/* Drop shadows */
final int SHADOWMAP_SIZE=1024;
DirectionalLightShadowRenderer dlsr = new DirectionalLightShadowRenderer&#40;assetManager, SHADOWMAP_SIZE, 3&#41;;
dlsr.setLight&#40;sun&#41;;
viewPort.addProcessor&#40;dlsr&#41;;
&nbsp;
DirectionalLightShadowFilter dlsf = new DirectionalLightShadowFilter&#40;assetManager, SHADOWMAP_SIZE, 3&#41;;
dlsf.setLight&#40;sun&#41;;
dlsf.setEnabled&#40;true&#41;;
FilterPostProcessor fpp = new FilterPostProcessor&#40;assetManager&#41;;
fpp.addFilter&#40;dlsf&#41;;
viewPort.addProcessor&#40;fpp&#41;;</pre>
</div>
<!-- EDIT10 SECTION "DirectionalLightShadowRenderer" [10212-11184] -->
<h2><a>Parallel-Split Shadow Map (deprecated)</a></h2>
<div>
<p>
@ -344,7 +375,7 @@ As said above, it&#039;s more efficient to specify individual shadow behaviour f
terrain.setShadowMode&#40;ShadowMode.Receive&#41;; </pre>
</div>
<!-- EDIT10 SECTION "Parallel-Split Shadow Map" [10207-11929] -->
<!-- EDIT11 SECTION "Parallel-Split Shadow Map (deprecated)" [11185-12920] -->
<h2><a>Screen Space Ambient Occlusion</a></h2>
<div>
@ -376,5 +407,5 @@ viewPort.addProcessor&#40;fpp&#41;;</pre>
</p>
</div>
<!-- EDIT11 SECTION "Screen Space Ambient Occlusion" [11930-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:light_and_shadow?do=export_xhtmlbody">view online version</a></em></p>
<!-- EDIT12 SECTION "Screen Space Ambient Occlusion" [12921-] -->
<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>

@ -564,4 +564,4 @@ public class TestLoadingScreen1 extends SimpleApplication implements ScreenContr
</div>
<!-- EDIT2 SECTION "Creating the bindings to use the Nifty XML" [4345-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:loading_screen?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:loading_screen?do=export_xhtmlbody">view online version</a></em></p>

@ -180,4 +180,4 @@ Typical problems include:
</div>
<!-- EDIT7 SECTION "More Documentation" [5132-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:localization?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:localization?do=export_xhtmlbody">view online version</a></em></p>

@ -117,4 +117,4 @@ This behaviour can be partially modified by overriding the method handleError in
</div>
<!-- EDIT5 SECTION "Advanced Error Handling" [3469-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:logging?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:logging?do=export_xhtmlbody">view online version</a></em></p>

@ -19,11 +19,11 @@ There are two ways how the camera can do that:
<p>
<strong>Important:</strong> Using third-person view requires you to deactivate the default flyCam (first-person view). This means that you have to configure your own navigation (<a href="/com/jme3/gde/docs/jme3/advanced/input_handling.html">key inputs and analogListener</a>) that make your player character walk. For moving a physical player character, use <code>player.setWalkDirection()</code>, for a non-pysical character you can use <code>player.move()</code>.
<strong>Important:</strong> Using third-person view requires you to deactivate the default flyCam (first-person view). This means that you have to configure your own navigation (<a href="/com/jme3/gde/docs/jme3/advanced/input_handling.html">key inputs and analogListener</a>) that make your player character walk. For moving a physical player character, use <code>player.setWalkDirection()</code>, for a non-physical character you can use <code>player.move()</code>.
</p>
</div>
<!-- EDIT1 SECTION "Making the Camera Follow a 3rd-Person Character" [1-989] -->
<!-- EDIT1 SECTION "Making the Camera Follow a 3rd-Person Character" [1-990] -->
<h2><a>Code Samples</a></h2>
<div>
@ -38,7 +38,7 @@ Press the WASD or arrow keys to move. Drag with the left mouse button to rotate.
</ul>
</div>
<!-- EDIT2 SECTION "Code Samples" [990-1371] -->
<!-- EDIT2 SECTION "Code Samples" [991-1372] -->
<h2><a>Camera Node</a></h2>
<div>
@ -76,7 +76,7 @@ Example: Use with <a href="/com/jme3/gde/docs/jme3/advanced/physics.html">Charac
The camera&#039;s transformation is copied over the spatial&#039;s transformation. Use with first-person flyCam.</td>
</tr>
</table></div>
<!-- EDIT4 TABLE [2445-2956] -->
<!-- EDIT4 TABLE [2446-2957] -->
<p>
<strong>Code sample:</strong>
@ -87,7 +87,7 @@ The camera&#039;s transformation is copied over the spatial&#039;s transformatio
</ul>
</div>
<!-- EDIT3 SECTION "Camera Node" [1372-3197] -->
<!-- EDIT3 SECTION "Camera Node" [1373-3198] -->
<h2><a>Chase Camera</a></h2>
<div>
@ -137,7 +137,7 @@ new KeyTrigger(KeyInput.KEY_SPACE))</td><td>Activate mutiple triggers for the ro
<td>setRotationSensitivity(5f)</td><td>How fast the camera rotates. Use values around &lt;1.0f (all bigger values are ignored).</td>
</tr>
</table></div>
<!-- EDIT6 TABLE [3732-5144] -->
<!-- EDIT6 TABLE [3733-5145] -->
<p>
<strong>Code sample:</strong>
@ -148,7 +148,7 @@ new KeyTrigger(KeyInput.KEY_SPACE))</td><td>Activate mutiple triggers for the ro
</ul>
</div>
<!-- EDIT5 SECTION "Chase Camera" [3198-5387] -->
<!-- EDIT5 SECTION "Chase Camera" [3199-5388] -->
<h2><a>Which to Choose?</a></h2>
<div>
@ -171,7 +171,7 @@ What is the difference of the two code samples above?
<td>Drag-to-Rotate rotates the target and the camera. You always see the target from behind.</td><td>Drag-to-Rotate rotates only the camera. You can see the target from various sides.</td>
</tr>
</table></div>
<!-- EDIT8 TABLE [5473-5944] -->
<!-- EDIT8 TABLE [5474-5945] -->
</div>
<!-- EDIT7 SECTION "Which to Choose?" [5388-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:making_the_camera_follow_a_character?do=export_xhtmlbody">view online version</a></em></p>
<!-- EDIT7 SECTION "Which to Choose?" [5389-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:making_the_camera_follow_a_character?do=export_xhtmlbody">view online version</a></em></p>

@ -190,4 +190,4 @@ You can create your own Material Definitions and place them in your project&#039
</div>
<!-- EDIT6 SECTION "Related Links" [5385-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:material_definitions?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:material_definitions?do=export_xhtmlbody">view online version</a></em></p>

@ -101,12 +101,12 @@ setVector3(&quot;NormalScale&quot;, new Vector3f(0,0,0)); </td>
</tr>
<tr>
<td> Common/MatDefs/Terrain/Terrain.j3md </td><td> Splat textures for e.g. terrains. <br/>
See also: <a href="/com/jme3/gde/docs/jme3/beginner/hello_terrain.html">Hello Terrain</a> </td><td> setTexture(&quot;Texture1&quot;, assetManager.loadTexture(&quot;&quot;)); (red) <br/>
setFloat(&quot;Texture1Scale&quot;,1f); <br/>
setTexture(&quot;Texture2&quot;, assetManager.loadTexture(&quot;&quot;)); (green) <br/>
setFloat(&quot;Texture2Scale&quot;,1f); <br/>
setTexture(&quot;Texture3&quot;, assetManager.loadTexture(&quot;&quot;)); (blue) <br/>
setFloat(&quot;Texture3Scale&quot;,1f); <br/>
See also: <a href="/com/jme3/gde/docs/jme3/beginner/hello_terrain.html">Hello Terrain</a> </td><td> setTexture(&quot;Tex1&quot;, assetManager.loadTexture(&quot;&quot;)); (red) <br/>
setFloat(&quot;Tex1Scale&quot;,1f); <br/>
setTexture(&quot;Tex2&quot;, assetManager.loadTexture(&quot;&quot;)); (green) <br/>
setFloat(&quot;Tex2Scale&quot;,1f); <br/>
setTexture(&quot;Tex3&quot;, assetManager.loadTexture(&quot;&quot;)); (blue) <br/>
setFloat(&quot;Tex3Scale&quot;,1f); <br/>
setTexture(&quot;Alpha&quot;, assetManager.loadTexture(&quot;&quot;)); </td>
</tr>
<tr>
@ -143,9 +143,9 @@ setColor(&quot;GlowColor&quot;, ColorRGBA.White); <br/>
setBoolean(&quot;PointSprite&quot;,true); </td>
</tr>
</table></div>
<!-- EDIT5 TABLE [2975-5491] -->
<!-- EDIT5 TABLE [2975-5467] -->
</div>
<!-- EDIT3 SECTION "Unshaded Coloring and Textures" [1718-5492] -->
<!-- EDIT3 SECTION "Unshaded Coloring and Textures" [1718-5468] -->
<h3><a>Phong Illuminated</a></h3>
<div>
@ -203,7 +203,7 @@ setColor(&quot;Specular&quot;, ColorRGBA.White); <br/>
setBoolean(&quot;WardIso&quot;,true);<sup><a href="#fn__4">4)</a></sup> </td>
</tr>
</table></div>
<!-- EDIT7 TABLE [6152-7870] --><div><table>
<!-- EDIT7 TABLE [6128-7846] --><div><table>
<tr>
<th>Special Illuminated Material Definitions </th><th> Usage </th><th> Material Parameters </th>
</tr>
@ -250,9 +250,9 @@ setBoolean(&quot;WardIso&quot;,true); <br/>
setBoolean(&quot;SphereMap&quot;,true); </td>
</tr>
</table></div>
<!-- EDIT8 TABLE [7872-10158] -->
<!-- EDIT8 TABLE [7848-10134] -->
</div>
<!-- EDIT6 SECTION "Phong Illuminated" [5493-10159] -->
<!-- EDIT6 SECTION "Phong Illuminated" [5469-10135] -->
<h3><a>Other: Test and Debug</a></h3>
<div>
<div><table>
@ -263,14 +263,14 @@ setBoolean(&quot;WardIso&quot;,true); <br/>
<td> Common/MatDefs/Misc/ShowNormals.j3md </td><td> A color gradient calculated from the model&#039;s surface normals. You can use this built-in material to debug the generation of normals in meshes, to preview models that have no material and no lights, or as fall-back default material. This built-in material has no parameters. </td>
</tr>
</table></div>
<!-- EDIT10 TABLE [10193-10564] -->
<!-- EDIT10 TABLE [10169-10540] -->
</div>
<!-- EDIT9 SECTION "Other: Test and Debug" [10160-10565] -->
<!-- EDIT9 SECTION "Other: Test and Debug" [10136-10541] -->
<h2><a>RenderStates</a></h2>
<div>
</div>
<!-- EDIT11 SECTION "RenderStates" [10566-10591] -->
<!-- EDIT11 SECTION "RenderStates" [10542-10567] -->
<h3><a>Transparency</a></h3>
<div>
<div><table>
@ -311,7 +311,7 @@ Deactivate Alpha Testing for gradually <strong>translucent</strong> objects, suc
<td>getAdditionalRenderState().setBlendMode(BlendMode.PremultAlpha);</td><td>Pre-multiplied alpha blending. E.g. if the color of the object has already been multiplied by its alpha, this is used instead of &quot;Alpha&quot; blend mode.</td><td>For use with Premult Alpha textures.</td>
</tr>
</table></div>
<!-- EDIT13 TABLE [10616-13066] -->
<!-- EDIT13 TABLE [10592-13042] -->
<p>
If the DiffuseMap has an alpha channel, use:
@ -332,7 +332,7 @@ Later, put the Geometry (not the Material!) in the appropriate render queue
</ul>
</div>
<!-- EDIT12 SECTION "Transparency" [10592-13365] -->
<!-- EDIT12 SECTION "Transparency" [10568-13341] -->
<h3><a>Culling</a></h3>
<div>
<div><table>
@ -352,9 +352,9 @@ Later, put the Geometry (not the Material!) in the appropriate render queue
<td>getAdditionalRenderState().setFaceCullMode(FaceCullMode.FrontAndBack)</td><td>Culls both backfaces and frontfaces.</td><td>Use this as an efficient way to make an object temporarily invisible, while keeping all its other in-game properties (such as node attachment, collision shapes, interactions, etc) active.</td>
</tr>
</table></div>
<!-- EDIT15 TABLE [13385-14527] -->
<!-- EDIT15 TABLE [13361-14503] -->
</div>
<!-- EDIT14 SECTION "Culling" [13366-14528] -->
<!-- EDIT14 SECTION "Culling" [13342-14504] -->
<h3><a>Miscellaneous</a></h3>
<div>
<div><table>
@ -368,7 +368,7 @@ Later, put the Geometry (not the Material!) in the appropriate render queue
<td>getAdditionalRenderState().setPolyOffset();</td><td>Enable polygon offset.</td><td>Use this when you have meshes that have triangles really close to each over (e.g. <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikipedia.org/wiki/Coplanarity"><param name="text" value="<html><u>Coplanar</u></html>"><param name="textColor" value="blue"></object>), it will shift the depth values to prevent <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://en.wikipedia.org/wiki/Z-fighting"><param name="text" value="<html><u>Z-fighting</u></html>"><param name="textColor" value="blue"></object>.</td>
</tr>
</table></div>
<!-- EDIT17 TABLE [14554-15320] -->
<!-- EDIT17 TABLE [14530-15296] -->
<p>
<strong>Related Links</strong>
@ -389,7 +389,7 @@ Later, put the Geometry (not the Material!) in the appropriate render queue
</span></div>
</div>
<!-- EDIT16 SECTION "Miscellaneous" [14529-] --><div>
<!-- EDIT16 SECTION "Miscellaneous" [14505-] --><div>
<div><sup><a href="#fnt__1">1)</a></sup>
UseAlpha specifies whether DiffuseMap uses the alpha channel</div>
<div><sup><a href="#fnt__2">2)</a></sup>
@ -399,4 +399,4 @@ Minnaert is a shader type.</div>
<div><sup><a href="#fnt__4">4)</a></sup>
WardIso is a shader type.</div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:materials_overview?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:materials_overview?do=export_xhtmlbody">view online version</a></em></p>

@ -12,16 +12,13 @@ All visible game elements in a scene, whether it is a Model or a Shape, are made
</p>
<ul>
<li><div> Meshes are made up of triangles. <br/>
<code>getTriangleCount(???)</code> and <code>getTriangle(???)</code></div>
<li><div> Meshes are made up of triangles: <code>getTriangleCount(???)</code> and <code>getTriangle(???)</code></div>
</li>
<li><div> Each mesh has a unique ID <br/>
<code>getId()</code></div>
<li><div> Each mesh has a unique ID: <code>getId()</code></div>
</li>
<li><div> Meshes have transformations: Location (local translation), rotation, scale.</div>
</li>
<li><div> Meshes have a bounding volume. jME3 can detect intersections (that is, non-physical collisions) between meshes, or between meshes and 2D elements such as rays. <br/>
<code>collideWith()</code>.</div>
<li><div> Meshes have a bounding volume. jME3 can detect intersections (that is, non-physical collisions) between meshes, or between meshes and 2D elements such as rays: <code>collideWith()</code>.</div>
</li>
<li><div> Meshes are locked with <code>setStatic()</code> and unlocked with <code>setDynamic()</code>. </div>
<ul>
@ -31,25 +28,35 @@ All visible game elements in a scene, whether it is a Model or a Shape, are made
</li>
</ul>
</li>
<li><div> (Optional) Meshes can have a LOD (level of detail optimization) that renders more or less details depending on distance from the camera.</div>
</li>
</ul>
<p>
You can use default <a href="/com/jme3/gde/docs/jme3/advanced/shape.html">Shape</a>s as meshes; load <a href="/com/jme3/gde/docs/jme3/advanced/3d_models.html">3D models</a> (i.e. meshes created in external applications); or create free-form <a href="/com/jme3/gde/docs/jme3/advanced/custom_meshes.html">custom meshes</a> programmatically.
You have several options when <a href="/com/jme3/gde/docs/jme3/advanced/spatial.html">creating Geometries from meshes</a>:
</p>
<ul>
<li><div> Use built-in <a href="/com/jme3/gde/docs/jme3/advanced/shape.html">Shape</a>s as meshes; </div>
</li>
<li><div> Load <a href="/com/jme3/gde/docs/jme3/advanced/3d_models.html">3D models</a> (that is, meshes created in external applications); or </div>
</li>
<li><div> Create free-form <a href="/com/jme3/gde/docs/jme3/advanced/custom_meshes.html">custom meshes</a> programmatically. </div>
</li>
</ul>
</div>
<!-- EDIT1 SECTION "Polygon Meshes" [1-1216] -->
<!-- EDIT1 SECTION "Polygon Meshes" [1-1154] -->
<h2><a>Vertex Buffer</a></h2>
<div>
<p>
The VertexBuffer contains a particular type of geometry data used by Meshes. Every VertexBuffer set on a Mesh is sent as an attribute to the vertex shader to be processed.
</p>
</div>
<!-- EDIT2 SECTION "Vertex Buffer" [1155-1354] -->
<h3><a>Mesh Vertex Buffers</a></h3>
<div>
<div><table>
<tr>
<th>Vertex Buffer Type</th><th>Description</th>
@ -97,18 +104,23 @@ The VertexBuffer contains a particular type of geometry data used by Meshes. Eve
<td>Type.BoneIndex </td><td> Bone indices, used with animation</td>
</tr>
</table></div>
<!-- EDIT3 TABLE [1417-2236] --><div><table>
<!-- EDIT4 TABLE [1386-2205] -->
</div>
<!-- EDIT3 SECTION "Mesh Vertex Buffers" [1355-2206] -->
<h3><a>Mesh Properties</a></h3>
<div>
<div><table>
<tr>
<th>Mesh method</th><th>Description</th>
</tr>
<tr>
<td>setLineWidth(1)</td>
<td>setLineWidth(1)</td><td>the thickness of the line if using Mode.Lines</td>
</tr>
<tr>
<td>setPointSize(4.0f)</td>
<td>setPointSize(4.0f)</td><td>the thickness of the point when using Mode.Points</td>
</tr>
<tr>
<td>setBound(boundingVolume)</td>
<td>setBound(boundingVolume)</td><td>if you need to specifiy a custom optimized bounding volume</td>
</tr>
<tr>
<td>setStatic()</td><td>Locks the mesh so you cannot modify it anymore, thus optimizing its data (faster).</td>
@ -117,27 +129,32 @@ The VertexBuffer contains a particular type of geometry data used by Meshes. Eve
<td>setDynamic()</td><td>Unlocks the mesh so you can modified it, but this will un-optimize the data (slower).</td>
</tr>
<tr>
<td>setMode(Mesh.Mode.Points)</td><td> Used to set mesh modes, see below</td>
<td>setMode(Mesh.Mode.Points)</td><td>Used to set mesh rendering modes, see below.</td>
</tr>
<tr>
<td>getId()</td>
<td>getId()</td><td>returns the Mesh ID</td>
</tr>
<tr>
<td>getTriangle(int,tri)</td>
<td>getTriangle(int,tri)</td><td>returns data of triangle number <code>int</code> into variable <code>tri</code></td>
</tr>
<tr>
<td>scaleTextureCoordinates(Vector2f)</td>
<td>scaleTextureCoordinates(Vector2f)</td><td>How the texture will be stretched over the whole mesh.</td>
</tr>
</table></div>
<!-- EDIT4 TABLE [2238-2665] --><div><table>
<!-- EDIT6 TABLE [2234-2957] -->
</div>
<!-- EDIT5 SECTION "Mesh Properties" [2207-2958] -->
<h3><a>Mesh Rendering Modes</a></h3>
<div>
<div><table>
<tr>
<th>Mesh Mode</th><th>Description</th>
</tr>
<tr>
<td>Mesh.Mode.Points</td><td>Show only corner points</td>
<td>Mesh.Mode.Points</td><td>Show only corner points (vertices) of mesh</td>
</tr>
<tr>
<td>Mesh.Mode.Lines</td><td>Show lines</td>
<td>Mesh.Mode.Lines</td><td>Show lines (edges) of mesh</td>
</tr>
<tr>
<td>Mesh.Mode.LineLoop</td><td>?</td>
@ -158,7 +175,17 @@ The VertexBuffer contains a particular type of geometry data used by Meshes. Eve
<td>Mesh.Mode.Hybrid</td><td>?</td>
</tr>
</table></div>
<!-- EDIT5 TABLE [2667-2908] --><div><span>
<!-- EDIT8 TABLE [2991-3267] -->
</div>
<!-- EDIT7 SECTION "Mesh Rendering Modes" [2959-3268] -->
<h3><a>Level of Detail</a></h3>
<div>
<p>
Optionally, custom meshes can have a LOD (level of detail optimization) that renders more or less detail, depending on the distance of the mesh from the camera. You have to specify several vertex buffers, one for each level of detail you want (very far away with few details, close up with all details, and something in the middle). Use <code>setLodLevels(VertexBuffer[] lodLevels)</code>.
</p>
<div><span>
<a href="/wiki/doku.php/tag:spatial?do=showtag&amp;tag=tag%3Aspatial">spatial</a>,
<a href="/wiki/doku.php/tag:node?do=showtag&amp;tag=tag%3Anode">node</a>,
<a href="/wiki/doku.php/tag:mesh?do=showtag&amp;tag=tag%3Amesh">mesh</a>,
@ -167,5 +194,5 @@ The VertexBuffer contains a particular type of geometry data used by Meshes. Eve
</span></div>
</div>
<!-- EDIT2 SECTION "Vertex Buffer" [1217-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:mesh?do=export_xhtmlbody">view online version</a></em></p>
<!-- EDIT9 SECTION "Level of Detail" [3269-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:mesh?do=export_xhtmlbody">view online version</a></em></p>

@ -338,4 +338,4 @@ MonkeyZone is hosted at GoogleCode, where you can check out the jMonkeyEngine <a
</div>
<!-- EDIT14 SECTION "Troubleshooting" [10551-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:monkey_zone?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:monkey_zone?do=export_xhtmlbody">view online version</a></em></p>

@ -118,4 +118,4 @@ In this example, you just print the status at every way point. In a game you cou
</div>
<!-- EDIT6 SECTION "MotionPathListener" [2662-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:motionpath?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:motionpath?do=export_xhtmlbody">view online version</a></em></p>

@ -82,7 +82,7 @@ The following <code>pick target</code> input mapping implements an action that d
</p>
<p>
<strong>Note:</strong> Picking with a visible pouse pointer implies that your application can no longer use the default flyCam where the MouseAxisTrigger rotates the camera. You have to deactivate the flyCam mappings and provide custom mappings. Either different inputs rotate the camera, or the camera is fixed.
<strong>Note:</strong> Picking with a visible mouse pointer implies that your application can no longer use the default flyCam where the MouseAxisTrigger rotates the camera. You have to deactivate the flyCam mappings and provide custom mappings. Either different inputs rotate the camera, or the camera is fixed.
</p>
<ol>
@ -147,4 +147,4 @@ The following example rotates Spatials named &quot;Red Box&quot; or &quot;Blue B
</div>
<!-- EDIT3 SECTION "Pick a Target Using the Mouse Pointer" [3110-] -->
<p><em><a href="http://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>

@ -230,4 +230,4 @@ You have full control to determine which Nodes the camera can see! It can see th
</div>
<!-- EDIT7 SECTION "ViewPort Settings" [5653-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:multiple_camera_views?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:multiple_camera_views?do=export_xhtmlbody">view online version</a></em></p>

@ -6,26 +6,25 @@
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.
</p>
<pre> public void rotateGeography(final Geography goe, final Quaternian rot) {
mainApp.enqueue(new Callable&lt;Spatial&gt;() {
public Spatial call() throws Exception {
return geo.rotate(rot);
}
});
}</pre>
<pre>public void rotateGeometry&#40;final Geometry geo, final Quaternion rot&#41; &#123;
mainApp.enqueue&#40;new Callable&lt;Spatial&gt;&#40;&#41; &#123;
public Spatial call&#40;&#41; throws Exception &#123;
return geo.rotate&#40;rot&#41;;
&#125;
&#125;&#41;;
&#125;</pre>
<p>
Note that this example does not fetch the returned value by calling <code>get()</code> on the Future object returned from <code>enqueue()</code>. This means that the example method <code>rotateGeography()</code> will return immediately and will not wait for the rotation to be processed before continuing.
Note that this example does not fetch the returned value by calling <code>get()</code> on the Future object returned from <code>enqueue()</code>. This means that the example method <code>rotateGeometry()</code> will return immediately and will not wait for the rotation to be processed before continuing.
</p>
<p>
If the processing thread needs to wait or needs the return value then <code>get()</code> or the other methods in the returned Future object such as <code>isDone()</code> can be used.
</p>
</div>
<!-- EDIT1 SECTION "The jME3 Threading Model" [1-1133] -->
<!-- EDIT1 SECTION "The jME3 Threading Model" [1-1092] -->
<h1><a>Multithreading Optimization</a></h1>
<div>
@ -35,7 +34,7 @@ First, make sure you know what <a href="/com/jme3/gde/docs/jme3/advanced/applica
</p>
<p>
More complex games may feature complex mathematical operations or artificially intelligent calculations (such as path finding for several NPCs). If you make many time-intensive calls on the same thread (in the update loop), they will block one another, and thus slow down the game to a degree that makes it unplayable. If your game requires long running tasks, you should run them concurrently on separate threads, which speeds up the application considerably.
More complex games may feature complex mathematical operations or artificial intelligence calculations (such as path finding for several NPCs). If you make many time-intensive calls on the same thread (in the update loop), they will block one another, and thus slow down the game to a degree that makes it unplayable. If your game requires long running tasks, you should run them concurrently on separate threads, which speeds up the application considerably.
</p>
<p>
@ -47,7 +46,7 @@ Effectively, each for-loop in the main update loop might be a chance for multith
</p>
</div>
<!-- EDIT2 SECTION "Multithreading Optimization" [1134-2265] -->
<!-- EDIT2 SECTION "Multithreading Optimization" [1093-2223] -->
<h2><a>Java Multithreading</a></h2>
<div>
@ -66,7 +65,7 @@ The java.util.concurrent package provides a good foundation for multithreading a
</ul>
</div>
<!-- EDIT3 SECTION "Java Multithreading" [2266-3338] -->
<!-- EDIT3 SECTION "Java Multithreading" [2224-3296] -->
<h2><a>Multithreading in jME3</a></h2>
<div>
@ -84,7 +83,7 @@ To avoid slowdown, we decide to keep the pathfinding operations in the NPC Contr
</p>
</div>
<!-- EDIT4 SECTION "Multithreading in jME3" [3339-4011] -->
<!-- EDIT4 SECTION "Multithreading in jME3" [3297-3969] -->
<h3><a>Executor</a></h3>
<div>
@ -111,7 +110,7 @@ In your simple application you can override the destroy method and shutdown the
&#125;</pre>
</div>
<!-- EDIT5 SECTION "Executor" [4012-5087] -->
<!-- EDIT5 SECTION "Executor" [3970-5045] -->
<h3><a>Control Class Fields</a></h3>
<div>
@ -131,7 +130,7 @@ Here we also created the Future variable to track the state of this task.
</p>
</div>
<!-- EDIT6 SECTION "Control Class Fields" [5088-5678] -->
<!-- EDIT6 SECTION "Control Class Fields" [5046-5636] -->
<h3><a>Control Update() Method</a></h3>
<div>
@ -179,7 +178,7 @@ Remember not to mess with the class fields after starting the thread, because th
</p>
</div>
<!-- EDIT7 SECTION "Control Update() Method" [5679-7549] -->
<!-- EDIT7 SECTION "Control Update() Method" [5637-7507] -->
<h3><a>The Callable</a></h3>
<div>
@ -231,7 +230,7 @@ private Callable&lt;MyWayList&gt; findWay = new Callable&lt;MyWayList&gt;&#40;&#
&#125;;</pre>
</div>
<!-- EDIT8 SECTION "The Callable" [7550-9916] -->
<!-- EDIT8 SECTION "The Callable" [7508-9874] -->
<h2><a>Conclusion</a></h2>
<div>
@ -250,5 +249,5 @@ The cool thing about this approach is that every entity creates one self-contain
</span></div>
</div>
<!-- EDIT9 SECTION "Conclusion" [9917-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:multithreading?do=export_xhtmlbody">view online version</a></em></p>
<!-- EDIT9 SECTION "Conclusion" [9875-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:multithreading?do=export_xhtmlbody">view online version</a></em></p>

@ -490,4 +490,4 @@ If you have set up a server in your home network, and the game clients cannot re
</div>
<!-- EDIT26 SECTION "Troubleshooting" [15004-] -->
<p><em><a href="http://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>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 29 KiB

@ -192,4 +192,4 @@ Logger.getLogger(&quot;NiftyInputEventHandlingLog&quot;).setLevel(Level.SEVERE);
</div>
<!-- EDIT8 SECTION "Nifty Logging (Nifty 1.3.1)" [4718-] -->
<p><em><a href="http://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>

@ -318,4 +318,4 @@ You&#039;re done with the basic Nifty <acronym title="Graphical User Interface">
</div>
<!-- EDIT7 SECTION "Next Steps" [9330-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:nifty_gui_java_interaction?do=export_xhtmlbody">view online version</a></em></p>
<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>

@ -639,4 +639,4 @@ Integrate the <acronym title="Graphical User Interface">GUI</acronym> into the g
</div>
<!-- EDIT14 SECTION "Next Steps" [17734-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:nifty_gui_java_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_java_layout?do=export_xhtmlbody">view online version</a></em></p>

@ -89,4 +89,4 @@ Now that you have layed out and integrated the <acronym title="Graphical User In
</div>
<!-- EDIT4 SECTION "Next Steps" [2373-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:nifty_gui_overlay?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:nifty_gui_overlay?do=export_xhtmlbody">view online version</a></em></p>

@ -91,4 +91,4 @@ To handle menu item events (i.e. calling a method when you click on a menu item)
&#125;;</pre>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:nifty_gui_popup_menu?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:nifty_gui_popup_menu?do=export_xhtmlbody">view online version</a></em></p>

@ -108,4 +108,4 @@ Now that you have layed out and integrated the <acronym title="Graphical User In
</div>
<!-- EDIT4 SECTION "Next Steps" [3240-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:nifty_gui_projection?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:nifty_gui_projection?do=export_xhtmlbody">view online version</a></em></p>

@ -323,7 +323,7 @@ Inside myCustomStyles.xml you define styles like this:
Learn more about how to create styles by looking at the <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Build_from_Source"><param name="text" value="<html><u>Nifty GUI source code</u></html>"><param name="textColor" value="blue"></object> for ???nifty-style-black???. Copy it as a template and change it to create your own style.
</p>
<hr/>
<hr />
<p>
Learn more from the NiftyGUI page:
@ -346,4 +346,4 @@ Learn more from the NiftyGUI page:
</div>
<!-- EDIT14 SECTION "Design Your Own Styles" [9494-] -->
<p><em><a href="http://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>

@ -293,8 +293,12 @@ The font used is jME3&#039;s default font &quot;Interface/Fonts/Default.fnt&quot
Before you can use any control, you must load a Control Definition first. Add the following two lines <em>before</em> your screen definitions:
</p>
<pre> <span>&lt;useControls filename=&quot;nifty-default-controls.xml&quot; /&gt;</span>
<span>&lt;useStyles filename=&quot;nifty-default-styles.xml&quot; /&gt;</span></pre>
<pre> <span>&lt;useStyles filename=&quot;nifty-default-styles.xml&quot; /&gt;</span>
<span>&lt;useControls filename=&quot;nifty-default-controls.xml&quot; /&gt;</span></pre>
<p>
Note that the useStyles tag must be the first child of the nifty tag, otherwise you will see an error in design view.
</p>
</div>
@ -347,7 +351,7 @@ Nifty additionally offers many customizable controls such as check boxes, text f
</p>
</div>
<!-- EDIT10 SECTION "Add Controls" [8477-10445] -->
<!-- EDIT10 SECTION "Add Controls" [8477-10564] -->
<h2><a>Intermediate Result</a></h2>
<div>
@ -365,7 +369,7 @@ Compare this result with the layout draft above.
</p>
</div>
<!-- EDIT11 SECTION "Intermediate Result" [10446-10806] -->
<!-- EDIT11 SECTION "Intermediate Result" [10565-10925] -->
<h2><a>Next Steps</a></h2>
<div>
@ -387,5 +391,5 @@ Integrate the <acronym title="Graphical User Interface">GUI</acronym> into the g
</span></div>
</div>
<!-- EDIT12 SECTION "Next Steps" [10807-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:nifty_gui_xml_layout?do=export_xhtmlbody">view online version</a></em></p>
<!-- EDIT12 SECTION "Next Steps" [10926-] -->
<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>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

@ -72,4 +72,4 @@ Test Character - <object classid="java:org.netbeans.modules.javahelp.BrowserDisp
</div>
<!-- EDIT4 SECTION "Troubleshooting" [997-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:ogrecompatibility?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:ogrecompatibility?do=export_xhtmlbody">view online version</a></em></p>

@ -193,4 +193,4 @@ A: TBD</div>
</div>
<!-- EDIT10 SECTION "Configuration" [3905-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:open_game_finder?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:open_game_finder?do=export_xhtmlbody">view online version</a></em></p>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 183 KiB

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 KiB

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 14 KiB

@ -225,7 +225,7 @@ The following effect textures are available by default from <code>test-data.jar<
Browse the full source code of all <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><param name="content" value="http://code.google.com/p/jmonkeyengine/source/browse/#svn%2Ftrunk%2Fengine%2Fsrc%2Ftest%2Fjme3test%2Feffect"><param name="text" value="<html><u>effect examples</u></html>"><param name="textColor" value="blue"></object> here.
</p>
<hr/>
<hr />
<p>
@ -238,4 +238,4 @@ See also: <a href="/com/jme3/gde/docs/jme3/advanced/effects_overview.html">Effec
</div>
<!-- EDIT8 SECTION "Usage Example" [8609-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:particle_emitters?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:particle_emitters?do=export_xhtmlbody">view online version</a></em></p>

@ -21,23 +21,58 @@ If you are looking for info on how to respond to physics events such as collisio
<div>
<p>
jME3 has a complete, slightly adapted but fully wrapped Bullet <acronym title="Application Programming Interface">API</acronym> that uses normal jME math objects (Vector3f, Quaternion etc) as input/output data. All normal bullet objects like RigidBodies, Constraints (called &quot;Joints&quot; in jME3) and the various collision shapes are available, all mesh formats can be converted from jME to bullet.
</p>
Bullet physics runs internally at 60fps by default. This rate is not dependent on the actual framerate and it does not lock the framerate at 60fps. Instead, when the actual fps is higher than the physics framerate the system will display interpolated positions for the physics objects. When the framerate is lower than the physics framerate, the physics space will be stepped multiple times per frame to make up for the missing calculations. You create a Bullet PhysicsSpace in jME3 with a <code>com.jme3.bullet.BulletAppState</code>.
<p>
The PhysicsSpace object is the central object in bullet and all objects have to be added to it so they are physics-enabled. You can create multiple physics spaces as well to have multiple independent physics simulations or to run simulations in the background that you step at a different pace. You can also create a Bullet PhysicsSpace in jME3 with a <code>com.jme3.bullet.BulletAppState</code> which runs a PhysicsSpace along the update loop, which is the easiest way to instantiate a physics space. It can be run in a mode where it runs in parallel to rendering, yet syncs to the update loop so you can apply physics changes safely during the update() calls of Controls and SimpleApplication.
</p>
<p>
Internally, the updating and syncing of the actual physics objects happens in the following way:
The base bullet objects are also available as simple to use controls that can be attached to spatials to directly control these by physics forces and influences. The RigidBodyControl for example includes a simple constructor that automatically creates a hull collision shape or a mesh collision shape based on the given input mass and the mesh of the spatial it is attached to. This makes enabling physics on a Geometry as simple as &quot;spatial.addControl(new RigidBodyControl(1));&quot;
</p>
<ol>
<li><div> collision callbacks (<code>BulletAppState.update()</code>)</div>
<p>
Due to some differences in how bullet and jME handle the scene and other objects relations there is some things to remember about the controls implementation:
</p>
<ul>
<li><div> The collision shape is not automatically updated when the spatial mesh changes</div>
<ul>
<li><div> You can update it by reattaching the control or by using the CollisionShapeFactory yourself.</div>
</li>
<li><div> user update (<code>simpleUpdate</code> in main loop, <code>update()</code> in Controls and AppStates)</div>
</ul>
</li>
<li><div> physics to scenegraph syncing and applying (<code>updateLogicalState()</code>)</div>
<li><div> In bullet the scale parameter is on the collision shape (which equals the mesh in jME3) and not on the RigidBody so you cannot scale a collision shape without scaling any other RigidBody with reference of it</div>
<ul>
<li><div> Note that you should share collision shapes in general and that j3o files loaded from file do that as well when instantiated twice so this is something to consider.</div>
</li>
<li><div> stepping physics (before or in parallel to <code>Application.render()</code>)</div>
</ul>
</li>
</ol>
<li><div> <strong>Physics objects remain in the physics space when their spatials are detached from the scene graph!</strong></div>
<ul>
<li><div> Use PhysicsSpace.remove(physicsObject) or simply physicsControl.setEnabled(false); to remove them from the PhysicsSpace</div>
</li>
</ul>
</li>
<li><div> If you apply forces to the physics object in an update() call they might not get applied because internally bullet still runs at 60fps while your app might run at 120.</div>
<ul>
<li><div> You can use the PhysicsTickListener interface and register with the physics space and use the preTick() method to be sure that you actually apply the force in the right moment.</div>
</li>
<li><div> Reading values from the physics objects in the update loop should always yield correct values but they might not change over several fames due to the same reason.</div>
</li>
</ul>
</li>
<li><div> Reading or writing from the physics objects during the render phase is not recommended as this is when the physics space is stepped and would cause data corruption. This is why the debug display does not work properly in a threaded BulletAppState</div>
</li>
<li><div> Bullet always uses world coordinates, there is no such concept as nodes so the object will be moved into a world location with no regard to its parent spatial.</div>
<ul>
<li><div> You can configure this behavior using the setApplyPhysicsLocal() method on physics controls but remember the physics space still runs in world coordinates so you can visually detach things that will actually still collide in the physics space.</div>
</li>
<li><div> To use the local applying to simulate e.g. the internal physics system of a train passing by, simply create another BulletAppState and add all models with physics controls in local mode to a node. When you move the node the physics will happen all the same but the objects will move along with the node.</div>
</li>
</ul>
</li>
</ul>
<p>
@ -52,8 +87,27 @@ When you use this physics simulation, values correspond to the following units:
</li>
</ul>
<p>
Bullet physics runs internally at 60fps by default. This rate is not dependent on the actual framerate and it does not lock the framerate at 60fps. Instead, when the actual fps is higher than the physics framerate the system will display interpolated positions for the physics objects. When the framerate is lower than the physics framerate, the physics space will be stepped multiple times per frame to make up for the missing calculations.
</p>
<p>
Internally, the updating and syncing of the actual physics objects in the BulletAppState happens in the following way:
</p>
<ol>
<li><div> collision callbacks (<code>BulletAppState.update()</code>)</div>
</li>
<li><div> user update (<code>simpleUpdate</code> in main loop, <code>update()</code> in Controls and AppStates)</div>
</li>
<li><div> physics to scenegraph syncing and applying (<code>updateLogicalState()</code>)</div>
</li>
<li><div> stepping physics (before or in parallel to <code>Application.render()</code>)</div>
</li>
</ol>
</div>
<!-- EDIT2 SECTION "Technical Overview" [868-2043] -->
<!-- EDIT2 SECTION "Technical Overview" [868-5940] -->
<h2><a>Sample Code</a></h2>
<div>
@ -73,7 +127,7 @@ Full code samples are here:
</ul>
</div>
<!-- EDIT3 SECTION "Sample Code" [2044-2643] -->
<!-- EDIT3 SECTION "Sample Code" [5941-6540] -->
<h2><a>Physics Application</a></h2>
<div>
@ -133,7 +187,7 @@ Let&#039;s look at the details:
</p>
</div>
<!-- EDIT4 SECTION "Physics Application" [2644-3845] -->
<!-- EDIT4 SECTION "Physics Application" [6541-7742] -->
<h2><a>Create a CollisionShape</a></h2>
<div>
@ -173,7 +227,7 @@ Disc-shaped objects like wheels, plates. </td>
<td> PlaneCollisionShape() </td><td> A 2D plane. Very fast. </td><td> Flat solid floor or wall. </td>
</tr>
</table></div>
<!-- EDIT6 TABLE [4304-5701] -->
<!-- EDIT6 TABLE [8201-9598] -->
<p>
All non-mesh CollisionShapes can be used for dynamic, kinematic, as well as static Spatials. (Code samples see below)
@ -200,7 +254,7 @@ All non-mesh CollisionShapes can be used for dynamic, kinematic, as well as stat
<strong>Limitations:</strong> Requires heightmap data. Collisions between two mesh-accurate shapes cannot be detected, only non-mesh shapes can collide with this shape.</td><td>Static terrains.</td>
</tr>
</table></div>
<!-- EDIT7 TABLE [5822-7339] -->
<!-- EDIT7 TABLE [9719-11236] -->
<p>
On a CollisionShape, you can apply a few properties
@ -214,7 +268,7 @@ On a CollisionShape, you can apply a few properties
<code>new Vector3f(1f,2f,1f)</code></td>
</tr>
</table></div>
<!-- EDIT8 TABLE [7393-7930] -->
<!-- EDIT8 TABLE [11290-11827] -->
<p>
The mesh-accurate shapes can use a CollisionShapeFactory as constructor (code samples see below).
@ -231,7 +285,7 @@ The mesh-accurate shapes can use a CollisionShapeFactory as constructor (code sa
</p>
</div>
<!-- EDIT5 SECTION "Create a CollisionShape" [3846-8600] -->
<!-- EDIT5 SECTION "Create a CollisionShape" [7743-12497] -->
<h3><a>CollisionShape Code Samples</a></h3>
<div>
<ul>
@ -262,7 +316,7 @@ The mesh-accurate shapes can use a CollisionShapeFactory as constructor (code sa
</ul>
</div>
<!-- EDIT9 SECTION "CollisionShape Code Samples" [8601-9727] -->
<!-- EDIT9 SECTION "CollisionShape Code Samples" [12498-13624] -->
<h2><a>Create PhysicsControl</a></h2>
<div>
@ -283,7 +337,7 @@ Solid immobile floors, walls, static obstacles.</td>
<td>GhostControl</td><td>Use for collision and intersection detection between physical objects. A GhostControl itself is <em>non-solid</em> and invisible. GhostControl moves with the Spatial it is attached to. Use GhostControls to <a href="/com/jme3/gde/docs/jme3/advanced/physics_listeners.html">implement custom game interactions</a> by adding it to a visible Geometry. </td><td>A monster&#039;s &quot;aggro radius&quot;, CharacterControl collisions, motion detectors, photo-electric alarm sensors, poisonous or radioactive perimeters, life-draining ghosts, etc. </td>
</tr>
</table></div>
<!-- EDIT11 TABLE [10119-11098] --><div><table>
<!-- EDIT11 TABLE [14016-14995] --><div><table>
<tr>
<th>Special PhysicsControls</th><th> Usage</th><th> Examples </th>
</tr>
@ -298,14 +352,14 @@ PhysicsVehicleWheel</td><td> Special Control used for <a href="/com/jme3/gde/doc
<td>RagDollControl</td><td>Special Control used for <a href="/com/jme3/gde/docs/jme3/advanced/ragdoll.html">collapsing, flailing, or falling characters</a> </td><td>Falling persons, animals, robots, &quot;Rag dolls&quot;</td>
</tr>
</table></div>
<!-- EDIT12 TABLE [11100-11612] -->
<!-- EDIT12 TABLE [14997-15509] -->
<p>
Click the links for details on the special PhysicsControls. This article is about RigidBodyControl.
</p>
</div>
<!-- EDIT10 SECTION "Create PhysicsControl" [9728-11714] -->
<!-- EDIT10 SECTION "Create PhysicsControl" [13625-15611] -->
<h3><a>PhysicsControls Code Samples</a></h3>
<div>
@ -344,7 +398,7 @@ gameLevel.addControl&#40;new RigidBodyControl&#40;0.0f&#41;&#41;; // explicit ze
</p>
</div>
<!-- EDIT13 SECTION "PhysicsControls Code Samples" [11715-13294] -->
<!-- EDIT13 SECTION "PhysicsControls Code Samples" [15612-17191] -->
<h2><a>Add PhysicsControl to Spatial</a></h2>
<div>
@ -361,7 +415,7 @@ For each physical Spatial in the scene:
</ol>
</div>
<!-- EDIT14 SECTION "Add PhysicsControl to Spatial" [13295-13542] -->
<!-- EDIT14 SECTION "Add PhysicsControl to Spatial" [17192-17439] -->
<h2><a>Add PhysicsControl to PhysicsSpace</a></h2>
<div>
@ -388,7 +442,7 @@ myThing_geo.removeFromParent&#40;&#41;;</pre>
</p>
</div>
<!-- EDIT15 SECTION "Add PhysicsControl to PhysicsSpace" [13543-14358] -->
<!-- EDIT15 SECTION "Add PhysicsControl to PhysicsSpace" [17440-18255] -->
<h2><a>Changing the Scale of a PhysicsControl</a></h2>
<div>
@ -427,7 +481,7 @@ With the corresponding output below:
</p>
</div>
<!-- EDIT16 SECTION "Changing the Scale of a PhysicsControl" [14359-16109] -->
<!-- EDIT16 SECTION "Changing the Scale of a PhysicsControl" [18256-20006] -->
<h3><a>PhysicsSpace Code Samples</a></h3>
<div>
@ -457,9 +511,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>
</tr>
</table></div>
<!-- EDIT18 TABLE [16336-17543] -->
<!-- EDIT18 TABLE [20233-21440] -->
</div>
<!-- EDIT17 SECTION "PhysicsSpace Code Samples" [16110-17544] -->
<!-- EDIT17 SECTION "PhysicsSpace Code Samples" [20007-21441] -->
<h2><a>Specify Physical Properties</a></h2>
<div>
@ -499,7 +553,7 @@ This setting has an impact on performance, so use it sparingly. </td><td> Brick:
Rubber ball: 1.0f </td>
</tr>
</table></div>
<!-- EDIT20 TABLE [17769-19279] -->
<!-- EDIT20 TABLE [21666-23176] -->
<p>
On a RigidBodyControl, you can apply the following physical forces:
@ -520,9 +574,9 @@ On a RigidBodyControl, you can apply the following physical forces:
(See detailed explanation below.) </td>
</tr>
</table></div>
<!-- EDIT21 TABLE [19350-19960] -->
<!-- EDIT21 TABLE [23247-23857] -->
</div>
<!-- EDIT19 SECTION "Specify Physical Properties" [17545-19960] -->
<!-- EDIT19 SECTION "Specify Physical Properties" [21442-23857] -->
<h3><a>Kinematic vs Dynamic vs Static</a></h3>
<div>
@ -572,7 +626,7 @@ setKinematic(true);</td><td>setMass(1f); <br/>
setKinematic(false);</td>
</tr>
</table></div>
<!-- EDIT23 TABLE [20197-21256] -->
<!-- EDIT23 TABLE [24094-25153] -->
</div>
<h4><a>When Do I Use Kinematic Objects?</a></h4>
@ -595,7 +649,7 @@ setKinematic(false);</td>
</p>
</div>
<!-- EDIT22 SECTION "Kinematic vs Dynamic vs Static" [19961-22362] -->
<!-- EDIT22 SECTION "Kinematic vs Dynamic vs Static" [23858-26259] -->
<h2><a>Forces: Moving Dynamic Objects</a></h2>
<div>
@ -633,7 +687,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>
</tr>
</table></div>
<!-- EDIT25 TABLE [22468-23457] -->
<!-- EDIT25 TABLE [26365-27354] -->
<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.
@ -667,13 +721,13 @@ removeCollideWithGroup(COLLISION_GROUP_01)</td><td>Collision Groups are integer
<td> setSleepingThreshold(float,float)</td><td>Sets the sleeping thresholds which define when the object gets deactivated to save resources. The first value is the linear threshold and the second the angular. Low values keep the object active when it barely moves (slow precise performance), high values put the object to sleep immediately (imprecise fast performance). (?) </td>
</tr>
<tr>
<td> setCcdMotionThreshold(0f) </td><td>Sets the amount of motion that has to happen in one physics tick to trigger the continuous motion detection in movign obejcts that push one another. This avoids the problem of fast objects moving through other objects. Set to zero to disable (default).</td>
<td> setCcdMotionThreshold(0f) </td><td>Sets the amount of motion that has to happen in one physics tick to trigger the continuous motion detection in moving objects that push one another. This avoids the problem of fast objects moving through other objects. Set to zero to disable (default).</td>
</tr>
<tr>
<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 behaviours such as objects passign 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>
</table></div>
<!-- EDIT26 TABLE [23875-25831] -->
<!-- EDIT26 TABLE [27772-29727] -->
<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.
@ -681,7 +735,7 @@ removeCollideWithGroup(COLLISION_GROUP_01)</td><td>Collision Groups are integer
</p>
</div>
<!-- EDIT24 SECTION "Forces: Moving Dynamic Objects" [22363-26173] -->
<!-- EDIT24 SECTION "Forces: Moving Dynamic Objects" [26260-30069] -->
<h2><a>Best Practices</a></h2>
<div>
<ul>
@ -717,8 +771,8 @@ removeCollideWithGroup(COLLISION_GROUP_01)</td><td>Collision Groups are integer
</span></div>
</div>
<!-- EDIT27 SECTION "Best Practices" [26174-] --><div>
<!-- EDIT27 SECTION "Best Practices" [30070-] --><div>
<div><sup><a href="#fnt__1">1)</a></sup>
Inertia is calculated for kinematic objects, and you need mass to do that.</div>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:physics?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:physics?do=export_xhtmlbody">view online version</a></em></p>

@ -256,4 +256,4 @@ myNode.getControl&#40;RigidBodyControl.class&#41;.setCollideWithGroups&#40;Physi
</div>
<!-- EDIT13 SECTION "Collision Groups" [8417-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:physics_listeners?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:physics_listeners?do=export_xhtmlbody">view online version</a></em></p>

@ -270,7 +270,7 @@ manager.loadTexture(&quot;Textures/foam.png&quot;) )</td><td>This foam texture w
You should also add audio nodes with water sounds to complete the effect.
</p>
<pre>AudioNode waves = new AudioNode&#40;assetManager, &quot;Sound/Environment/Ocean Waves.ogg&quot;, false&#41;;
<pre>AudioNode waves = new AudioNode&#40;assetManager, &quot;Sounds/Environment/Ocean Waves.ogg&quot;, false&#41;;
waves.setLooping&#40;true&#41;;
audioRenderer.playSource&#40;waves&#41;;</pre>
@ -278,7 +278,7 @@ audioRenderer.playSource&#40;waves&#41;;</pre>
See also: <a href="/com/jme3/gde/docs/jme3/advanced/audio.html">audio</a>.
</p>
<hr/>
<hr />
<p>
See also:
@ -292,4 +292,4 @@ See also:
</div>
<!-- EDIT13 SECTION "Sound Effects" [9633-] -->
<p><em><a href="http://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>

@ -214,4 +214,4 @@ If you experience weird behaviour in a ragdoll ??? such as exploding into pieces
</div>
<!-- EDIT10 SECTION "Best Practices" [7147-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:ragdoll?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:ragdoll?do=export_xhtmlbody">view online version</a></em></p>

@ -69,4 +69,4 @@ VertexTextureFetch, FloatTexture, TextureCompressionLATC]</pre>
</div>
<!-- EDIT2 SECTION "Examples" [732-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:read_graphic_card_capabilites?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:read_graphic_card_capabilites?do=export_xhtmlbody">view online version</a></em></p>

@ -56,4 +56,4 @@ If desired, attach the camNode to a MotionTrack to let it travel along waypoints
</div>
<!-- EDIT4 SECTION "Moving the Camera" [1172-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:remote-controlling_the_camera?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:remote-controlling_the_camera?do=export_xhtmlbody">view online version</a></em></p>

@ -167,7 +167,7 @@ To make a custom class savable:
<p>
<p><div>As with all serialization, remember that if you ever change data types in custom classes, the updated read() methods will no longer be able to read your old files.
<p><div>As with all serialization, remember that if you ever change data types in custom classes, the updated read() methods will no longer be able to read your old files. Also there has to be a constructor that takes no Parameters.
</div></p>
</p>
<div><span>
@ -190,4 +190,4 @@ To make a custom class savable:
</div>
<!-- EDIT5 SECTION "Custom Savable Class" [3303-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:save_and_load?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:save_and_load?do=export_xhtmlbody">view online version</a></em></p>

@ -24,4 +24,4 @@ The screenshot is saved to the user directory.
</p>
</div>
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:screenshots?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:screenshots?do=export_xhtmlbody">view online version</a></em></p>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 90 KiB

@ -196,4 +196,4 @@ rootNode.attachChild&#40;geom&#41;; // attach geometry to a n
</div>
<!-- EDIT6 SECTION "See also" [5360-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:shape?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:shape?do=export_xhtmlbody">view online version</a></em></p>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 100 KiB

@ -99,4 +99,4 @@ Box or Sphere?
</div>
<!-- EDIT3 SECTION "Creating the Textures" [1263-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:sky?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:sky?do=export_xhtmlbody">view online version</a></em></p>

@ -89,20 +89,21 @@ The polygon <a href="/com/jme3/gde/docs/jme3/advanced/mesh.html">Mesh</a> inside
<p>
Cloned spatials share the same mesh, while each cloned spatial can have its own local transformation (translation, rotation, and scale) in the scene. This means you only use <code>clone()</code> on spatials whose meshes never change. The most common use case for cloning is when you use several Spatials that are based on the same <a href="/com/jme3/gde/docs/jme3/advanced/shape.html">Shape</a>s.
Cloned spatials share the same mesh, while each cloned spatial can have its own local transformation (translation, rotation, and scale) in the scene. This means you only use <code>clone()</code> on spatials whose meshes never change. The most common use case for cloning is when you use several Spatials that are based on the same <a href="/com/jme3/gde/docs/jme3/advanced/shape.html">Shape</a>s (e.g. trees, crates).
</p>
<p>
The second use case is: When you load a model using <code>loadModel()</code> from the AssetManager, you may get a <code>clone()</code>ed object. In particular:
The second use case is: When you load a model using <code>loadModel()</code> from the AssetManager, you may automatically get a <code>clone()</code>ed object. In particular:
</p>
<ul>
<li><div> If the model is not animated (it has no <code><a href="/com/jme3/gde/docs/jme3/advanced/animation.html">AnimControl</a></code>), you get a clone. All clones share one mesh object. (Uses less memory)</div>
<li><div> If the model is not animated (it has no <code><a href="/com/jme3/gde/docs/jme3/advanced/animation.html">AnimControl</a></code>), jME loads a clone. All clones share one mesh object in order to use less memory.</div>
</li>
<li><div> If the model is animated (it has a <code><a href="/com/jme3/gde/docs/jme3/advanced/animation.html">AnimControl</a></code>), then <code>loadModel()</code> duplicates the mesh for each loaded instance. (Uses more memory)</div>
<li><div> If the model is animated (it has a <code><a href="/com/jme3/gde/docs/jme3/advanced/animation.html">AnimControl</a></code>), then <code>loadModel()</code> duplicates the mesh for each loaded instance. (Uses more memory, but can animate.)</div>
</li>
</ul>
<p>
Usually there is no need to manually use any of the <code>clone()</code> methods on models. Using the <a href="/com/jme3/gde/docs/jme3/advanced/asset_manager.html">Asset Manager</a>&#039;s <code>loadModel()</code> method will automatically do the right thing for your models.
</p>
@ -112,7 +113,7 @@ Usually there is no need to manually use any of the <code>clone()</code> methods
</p>
</div>
<!-- EDIT5 SECTION "What is a Clone?" [3729-4984] -->
<!-- EDIT5 SECTION "What is a Clone?" [3729-5049] -->
<h2><a>How to Add Fields and Methods to a Spatial</a></h2>
<div>
@ -127,15 +128,15 @@ You can include custom user data ???that is, custom Java objects and methods???
</p>
<p>
This first example adds an integer field named <code>health</code> to the Spatial <code>player_node</code>, and initializes it to 100.
This first example adds an integer field named <code>health</code> to the Spatial <code>playerNode</code>, and initializes it to 100.
</p>
<pre>player_node.setUserData&#40;&quot;health&quot;, 100&#41;;</pre>
<pre>playerNode.setUserData&#40;&quot;health&quot;, 100&#41;;</pre>
<p>
The second example adds a set of custom accessor methods to the player object. You create a <a href="/com/jme3/gde/docs/jme3/advanced/custom_controls.html">custom PlayerControl() class</a> and you add this control to the Spatial:
</p>
<pre>player_node.addControl&#40;new PlayerControl&#40;&#41;&#41;;</pre>
<pre>playerNode.addControl&#40;new PlayerControl&#40;&#41;&#41;;</pre>
<p>
In your PlayerControl() class, you define custom methods that set and get your user data in the <code>spatial</code> object. For example, the control could add accessors that set and get the player&#039;s health:
@ -148,11 +149,11 @@ public void setHealth&#40;int h&#41; &#123;
&#125;</pre>
<p>
Elsewhere in your code, you can access this data wherever you have access to the Spatial <code>player_node</code>.
Elsewhere in your code, you can access this data wherever you have access to the Spatial <code>playerNode</code>.
</p>
<pre>health = player_node.getControl&#40;PlayerControl.class&#41;.getHealth&#40;&#41;;
<pre>health = playerNode.getControl&#40;PlayerControl.class&#41;.getHealth&#40;&#41;;
...
player_node.getControl&#40;PlayerControl.class&#41;.setHealth&#40;99&#41;;</pre>
playerNode.getControl&#40;PlayerControl.class&#41;.setHealth&#40;99&#41;;</pre>
<ul>
<li><div> You can add as many data objects (of String, Boolean, Integer, Float, Array types) to a Spatial as you want. Just make sure to label them with unique case-sensitive strings (<code>health</code>, <code>Inventory</code>, <code>equipment</code>, etc). </div>
</li>
@ -171,7 +172,7 @@ This is how you list all data keys that are already defined for one Spatial:
&#125;</pre>
</div>
<!-- EDIT6 SECTION "How to Add Fields and Methods to a Spatial" [4985-7561] -->
<!-- EDIT6 SECTION "How to Add Fields and Methods to a Spatial" [5050-7620] -->
<h2><a>How to Access a Named Sub-Mesh</a></h2>
<div>
@ -196,7 +197,7 @@ In the following example, the Node <code>house</code> is the loaded model. The s
<pre>Geometry submesh = &#40;Geometry&#41; houseScene.getChild&#40;&quot;door 12&quot;&#41;;</pre>
</div>
<!-- EDIT7 SECTION "How to Access a Named Sub-Mesh" [7562-8364] -->
<!-- EDIT7 SECTION "How to Access a Named Sub-Mesh" [7621-8423] -->
<h2><a>What is Culling?</a></h2>
<div>
@ -205,18 +206,22 @@ There are two types of culling: Face culling, and view frustrum culling.
</p>
<p>
<strong>Face culling</strong> refers to not drawing certain polygons of a mesh. The &quot;inside&quot; of the mesh (the so called backface) is never visible to the player, and as an optimization, game engines skip calculating backfaces by default. You may want to deactivate Face Culling while debugging custom meshes, so you can see them in case you turned them inside-out by accident.
<strong>Face culling</strong> means not drawing certain polygons of a mesh. Face culling behaviour is a property of the material.
</p>
<p>
Usage: The &quot;inside&quot; of a mesh (the so called backface) is typically never visible to the player, and as an optimization, the <code>Back</code> mode skips calculating all backfaces by default. Activating the <code>Off</code> or <code>Front</code> modes can be useful when you are debugging <a href="/com/jme3/gde/docs/jme3/advanced/custom_meshes.html">custom meshes</a> and try to identify accidental inside-out faces.
</p>
<p>
You can switch the com.jme3.material.RenderState.FaceCullMode to
You can switch the com.jme3.material.RenderState.FaceCullMode to either:
</p>
<ul>
<li><div> <code>FaceCullMode.Back</code> (default) ??? only the frontsides of a mesh are drawn. This is the normal behaviour. </div>
<li><div> <code>FaceCullMode.Back</code> (default) ??? Only the frontsides of a mesh are drawn. Backface culling is the default behaviour. </div>
</li>
<li><div> <code>FaceCullMode.Front</code> ??? only the backsides of meshes are drawn. The mesh will probably turn invisible. Useful if you are debugging a hand-made mesh and try to identify accidental inside-out faces.</div>
<li><div> <code>FaceCullMode.Front</code> ??? Only the backsides of a mesh are drawn. A mesh with frontface culling will most likely be invisible. Used for debugging &quot;inside-out&quot; custom meshes.</div>
</li>
<li><div> <code>FaceCullMode.FrontAndBack</code> ??? The mesh becomes invisible. </div>
<li><div> <code>FaceCullMode.FrontAndBack</code> ??? Use this to make a mesh temporarily invisible. </div>
</li>
<li><div> <code>FaceCullMode.Off</code> ??? Every side of the mesh is drawn. Looks normal, but slows down large scenes.</div>
</li>
@ -255,7 +260,7 @@ Example:
<pre>spatial.setCullHint&#40;CullHint.Never&#41;; // always drawn</pre>
</div>
<!-- EDIT8 SECTION "What is Culling?" [8365-10701] -->
<!-- EDIT8 SECTION "What is Culling?" [8424-10857] -->
<h2><a>See also</a></h2>
<div>
<ul>
@ -273,5 +278,5 @@ Example:
</span></div>
</div>
<!-- EDIT9 SECTION "See also" [10702-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:spatial?do=export_xhtmlbody">view online version</a></em></p>
<!-- EDIT9 SECTION "See also" [10858-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:spatial?do=export_xhtmlbody">view online version</a></em></p>

@ -185,4 +185,4 @@ Remember, to navigate in the scene, click and drag (!) the mouse, or press the W
</div>
<!-- EDIT6 SECTION "Navigation" [6020-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:swing_canvas?do=export_xhtmlbody">view online version</a></em></p>
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:swing_canvas?do=export_xhtmlbody">view online version</a></em></p>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 11 KiB

@ -305,4 +305,4 @@ PS: As an alternative to an image-based height map, you can also generate a Hill
</div>
<!-- EDIT9 SECTION "Code Sample: Terrain.j3md" [9436-] -->
<p><em><a href="http://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>

@ -127,12 +127,9 @@ public class HelloTerrainCollision extends SimpleApplication
terrain.addControl&#40;control&#41;;
&nbsp;
/** 6. Add physics: */
// We set up collision detection for the scene by creating a
// compound collision shape and a static RigidBodyControl with mass zero.*/
CollisionShape terrainShape =
CollisionShapeFactory.createMeshShape&#40;&#40;Node&#41; terrain&#41;;
landscape = new RigidBodyControl&#40;terrainShape, 0&#41;;
terrain.addControl&#40;landscape&#41;;
// We set up collision detection for the scene by creating a static
RigidBodyControl with mass zero.*/
terrain.addControl&#40;new RigidBodyControl&#40;0&#41;&#41;;
&nbsp;
// We set up collision detection for the player by creating
// a capsule collision shape and a CharacterControl.
@ -213,12 +210,12 @@ Compile and run the code. You should see a terrain. You can use the WASD keys an
</p>
</div>
<!-- EDIT2 SECTION "Sample Code" [402-8791] -->
<!-- EDIT2 SECTION "Sample Code" [402-8616] -->
<h2><a>Understanding the Code</a></h2>
<div>
</div>
<!-- EDIT3 SECTION "Understanding the Code" [8792-8824] -->
<!-- EDIT3 SECTION "Understanding the Code" [8617-8649] -->
<h3><a>The Terrain Code</a></h3>
<div>
@ -236,7 +233,7 @@ Read <a href="/com/jme3/gde/docs/jme3/beginner/hello_terrain.html">Hello Terrain
</ol>
</div>
<!-- EDIT4 SECTION "The Terrain Code" [8825-9281] -->
<!-- EDIT4 SECTION "The Terrain Code" [8650-9106] -->
<h3><a>The Collision Detection Code</a></h3>
<div>
@ -260,7 +257,7 @@ Read <a href="/com/jme3/gde/docs/jme3/beginner/hello_collision.html">Hello Colli
</ol>
</div>
<!-- EDIT5 SECTION "The Collision Detection Code" [9282-10182] -->
<!-- EDIT5 SECTION "The Collision Detection Code" [9107-10007] -->
<h3><a>Combining the Two</a></h3>
<div>
@ -270,18 +267,13 @@ Here are the changed parts to combine the two:
</p>
<ol>
<li><div> The CollisionShapeFactory creates the CollisionShape <code>terrainShape</code> for the <code>terrain</code> node.</div>
<li><div> You create a static (zero-mass) RigidBodyControl. </div>
</li>
<li><div> Out of the <code>terrainShape</code>, you create a static (zero-mass) RigidBodyControl <code>landscape</code>. </div>
</li>
<li><div> Add the <code>landscape</code> control to the <code>terrain</code> to make it physical.</div>
<li><div> Add the control to the <code>terrain</code> to make it physical.</div>
</li>
</ol>
<pre>/** 6. Add physics: */
CollisionShape terrainShape =
CollisionShapeFactory.createMeshShape&#40;&#40;Node&#41; terrain&#41;;
landscape = new RigidBodyControl&#40;terrainShape, 0&#41;;
terrain.addControl&#40;landscape&#41;; </pre>
terrain.addControl&#40;new RigidBodyControl&#40;0&#41;&#41;; </pre>
<p>
You attach the <code>terrain</code> and the first-person <code>player</code> to the rootNode, and to the physics space, to make them appear in the game world.
@ -290,7 +282,7 @@ You attach the <code>terrain</code> and the first-person <code>player</code> to
bulletAppState.getPhysicsSpace&#40;&#41;.add&#40;player&#41;;</pre>
</div>
<!-- EDIT6 SECTION "Combining the Two" [10183-11031] -->
<!-- EDIT6 SECTION "Combining the Two" [10008-10557] -->
<h2><a>Conclusion</a></h2>
<div>
@ -302,7 +294,7 @@ You see that you can combine snippets of sample code (such as HelloTerrain and H
<p>
You should spawn high up in the area and fall down to the map, giving you a few seconds to survey the area. Then walk around and see how you like the lay of the land.
</p>
<hr/>
<hr />
<p>
See also:
@ -320,5 +312,5 @@ See also:
</span></div>
</div>
<!-- EDIT7 SECTION "Conclusion" [11032-] -->
<p><em><a href="http://jmonkeyengine.org/wiki/doku.php/jme3:advanced:terrain_collision?do=export_xhtmlbody">view online version</a></em></p>
<!-- EDIT7 SECTION "Conclusion" [10558-] -->
<p><em><a href="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:terrain_collision?do=export_xhtmlbody">view online version</a></em></p>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save