Преглед изворни кода

dokuwiki converter: force eol around code delimiter.

David Bernard пре 9 година
родитељ
комит
0e5d22c1ae
100 измењених фајлова са 3585 додато и 561 уклоњено
  1. 4 1
      src/docs/asciidoc/bsd_license.adoc
  2. 68 1
      src/docs/asciidoc/jm3/solutions.adoc
  3. 6 2
      src/docs/asciidoc/jme3/advanced/3d_models.adoc
  4. 26 3
      src/docs/asciidoc/jme3/advanced/animation.adoc
  5. 4 1
      src/docs/asciidoc/jme3/advanced/anisotropic_filtering.adoc
  6. 21 6
      src/docs/asciidoc/jme3/advanced/application_states.adoc
  7. 16 1
      src/docs/asciidoc/jme3/advanced/appstatesdemo.adoc
  8. 67 11
      src/docs/asciidoc/jme3/advanced/asset_manager.adoc
  9. 8 0
      src/docs/asciidoc/jme3/advanced/atom_framework/atomcore/net.adoc
  10. 52 12
      src/docs/asciidoc/jme3/advanced/audio.adoc
  11. 69 2
      src/docs/asciidoc/jme3/advanced/audio_environment_presets.adoc
  12. 41 1
      src/docs/asciidoc/jme3/advanced/bloom_and_glow.adoc
  13. 8 0
      src/docs/asciidoc/jme3/advanced/building_recast.adoc
  14. 11 3
      src/docs/asciidoc/jme3/advanced/bullet_multithreading.adoc
  15. 10 2
      src/docs/asciidoc/jme3/advanced/camera.adoc
  16. 20 0
      src/docs/asciidoc/jme3/advanced/capture_audio_video_to_a_file.adoc
  17. 48 8
      src/docs/asciidoc/jme3/advanced/cinematics.adoc
  18. 15 3
      src/docs/asciidoc/jme3/advanced/collision_and_intersection.adoc
  19. 21 1
      src/docs/asciidoc/jme3/advanced/combo_moves.adoc
  20. 53 14
      src/docs/asciidoc/jme3/advanced/custom_controls.adoc
  21. 93 13
      src/docs/asciidoc/jme3/advanced/custom_meshes.adoc
  22. 57 13
      src/docs/asciidoc/jme3/advanced/debugging.adoc
  23. 12 0
      src/docs/asciidoc/jme3/advanced/effects_overview.adoc
  24. 4 0
      src/docs/asciidoc/jme3/advanced/fade.adoc
  25. 10 2
      src/docs/asciidoc/jme3/advanced/headless_server.adoc
  26. 28 4
      src/docs/asciidoc/jme3/advanced/hinges_and_joints.adoc
  27. 26 6
      src/docs/asciidoc/jme3/advanced/hud.adoc
  28. 44 8
      src/docs/asciidoc/jme3/advanced/input_handling.adoc
  29. 29 1
      src/docs/asciidoc/jme3/advanced/j3m_material_files.adoc
  30. 56 0
      src/docs/asciidoc/jme3/advanced/jme3_shadernodes.adoc
  31. 48 0
      src/docs/asciidoc/jme3/advanced/jme3_shaders.adoc
  32. 18 2
      src/docs/asciidoc/jme3/advanced/jme3_srgbpipeline.adoc
  33. 18 6
      src/docs/asciidoc/jme3/advanced/level_of_detail.adoc
  34. 45 9
      src/docs/asciidoc/jme3/advanced/light_and_shadow.adoc
  35. 28 1
      src/docs/asciidoc/jme3/advanced/loading_screen.adoc
  36. 51 15
      src/docs/asciidoc/jme3/advanced/localization.adoc
  37. 32 8
      src/docs/asciidoc/jme3/advanced/logging.adoc
  38. 9 1
      src/docs/asciidoc/jme3/advanced/making_the_camera_follow_a_character.adoc
  39. 38 6
      src/docs/asciidoc/jme3/advanced/material_definitions.adoc
  40. 84 24
      src/docs/asciidoc/jme3/advanced/material_specification.adoc
  41. 15 3
      src/docs/asciidoc/jme3/advanced/materials_overview.adoc
  42. 10 3
      src/docs/asciidoc/jme3/advanced/motionpath.adoc
  43. 9 1
      src/docs/asciidoc/jme3/advanced/mouse_picking.adoc
  44. 64 8
      src/docs/asciidoc/jme3/advanced/multiple_camera_views.adoc
  45. 25 1
      src/docs/asciidoc/jme3/advanced/multithreading.adoc
  46. 125 25
      src/docs/asciidoc/jme3/advanced/networking.adoc
  47. 5 1
      src/docs/asciidoc/jme3/advanced/nifty_gui.adoc
  48. 9 1
      src/docs/asciidoc/jme3/advanced/nifty_gui_best_practices.adoc
  49. 59 3
      src/docs/asciidoc/jme3/advanced/nifty_gui_java_interaction.adoc
  50. 76 16
      src/docs/asciidoc/jme3/advanced/nifty_gui_java_layout.adoc
  51. 14 2
      src/docs/asciidoc/jme3/advanced/nifty_gui_overlay.adoc
  52. 13 2
      src/docs/asciidoc/jme3/advanced/nifty_gui_popup_menu.adoc
  53. 4 0
      src/docs/asciidoc/jme3/advanced/nifty_gui_projection.adoc
  54. 48 4
      src/docs/asciidoc/jme3/advanced/nifty_gui_scenarios.adoc
  55. 56 0
      src/docs/asciidoc/jme3/advanced/nifty_gui_xml_layout.adoc
  56. 30 6
      src/docs/asciidoc/jme3/advanced/particle_emitters.adoc
  57. 106 30
      src/docs/asciidoc/jme3/advanced/physics.adoc
  58. 32 8
      src/docs/asciidoc/jme3/advanced/physics_listeners.adoc
  59. 12 0
      src/docs/asciidoc/jme3/advanced/post-processor_water.adoc
  60. 32 4
      src/docs/asciidoc/jme3/advanced/ragdoll.adoc
  61. 18 3
      src/docs/asciidoc/jme3/advanced/read_graphic_card_capabilites.adoc
  62. 8 0
      src/docs/asciidoc/jme3/advanced/recast.adoc
  63. 14 2
      src/docs/asciidoc/jme3/advanced/remote-controlling_the_camera.adoc
  64. 15 3
      src/docs/asciidoc/jme3/advanced/save_and_load.adoc
  65. 4 0
      src/docs/asciidoc/jme3/advanced/screenshots.adoc
  66. 39 7
      src/docs/asciidoc/jme3/advanced/shape.adoc
  67. 4 0
      src/docs/asciidoc/jme3/advanced/sky.adoc
  68. 38 6
      src/docs/asciidoc/jme3/advanced/spatial.adoc
  69. 9 1
      src/docs/asciidoc/jme3/advanced/statsview.adoc
  70. 28 0
      src/docs/asciidoc/jme3/advanced/steer_behaviours.adoc
  71. 42 10
      src/docs/asciidoc/jme3/advanced/swing_canvas.adoc
  72. 16 1
      src/docs/asciidoc/jme3/advanced/terrain.adoc
  73. 20 4
      src/docs/asciidoc/jme3/advanced/terrain_collision.adoc
  74. 8 1
      src/docs/asciidoc/jme3/advanced/texture_atlas.adoc
  75. 4 0
      src/docs/asciidoc/jme3/advanced/traverse_scenegraph.adoc
  76. 66 10
      src/docs/asciidoc/jme3/advanced/vehicles.adoc
  77. 26 3
      src/docs/asciidoc/jme3/advanced/video.adoc
  78. 61 1
      src/docs/asciidoc/jme3/advanced/walking_character.adoc
  79. 34 6
      src/docs/asciidoc/jme3/advanced/water.adoc
  80. 8 0
      src/docs/asciidoc/jme3/atomixtuts/cardsgame/ai.adoc
  81. 8 0
      src/docs/asciidoc/jme3/atomixtuts/cardsgame/assets.adoc
  82. 52 0
      src/docs/asciidoc/jme3/atomixtuts/cardsgame/programming.adoc
  83. 45 1
      src/docs/asciidoc/jme3/beginner/hello_animation.adoc
  84. 93 21
      src/docs/asciidoc/jme3/beginner/hello_asset.adoc
  85. 93 21
      src/docs/asciidoc/jme3/beginner/hello_asset_pt.adoc
  86. 55 7
      src/docs/asciidoc/jme3/beginner/hello_audio.adoc
  87. 86 10
      src/docs/asciidoc/jme3/beginner/hello_collision.adoc
  88. 20 4
      src/docs/asciidoc/jme3/beginner/hello_effects.adoc
  89. 33 5
      src/docs/asciidoc/jme3/beginner/hello_input_system-pt.adoc
  90. 33 5
      src/docs/asciidoc/jme3/beginner/hello_input_system.adoc
  91. 5 2
      src/docs/asciidoc/jme3/beginner/hello_input_system/timekeypressed.adoc
  92. 5 1
      src/docs/asciidoc/jme3/beginner/hello_main_event_loop.adoc
  93. 5 1
      src/docs/asciidoc/jme3/beginner/hello_main_event_loop_pt.adoc
  94. 67 11
      src/docs/asciidoc/jme3/beginner/hello_material.adoc
  95. 103 23
      src/docs/asciidoc/jme3/beginner/hello_node.adoc
  96. 96 20
      src/docs/asciidoc/jme3/beginner/hello_node_pl.adoc
  97. 103 23
      src/docs/asciidoc/jme3/beginner/hello_node_pt.adoc
  98. 103 23
      src/docs/asciidoc/jme3/beginner/hello_node_zh.adoc
  99. 49 9
      src/docs/asciidoc/jme3/beginner/hello_physics.adoc
  100. 27 7
      src/docs/asciidoc/jme3/beginner/hello_picking.adoc

+ 4 - 1
src/docs/asciidoc/bsd_license.adoc

@@ -3,7 +3,9 @@
 == jME's BSD License
 
 [source]
+
 ----
+
 Copyright (c) 2003-2012 jMonkeyEngine
 All rights reserved.
  
@@ -33,4 +35,5 @@ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-----
+
+----

+ 68 - 1
src/docs/asciidoc/jm3/solutions.adoc

@@ -22,7 +22,9 @@ First, one must declare another Geometry, for example, a red cube:
 
 
 [source,java]
+
 ----
+
 protected Geometry redCube;
 
 public void simpleInitApp() {
@@ -43,12 +45,16 @@ public void simpleInitApp() {
     // Makes the red cube appear on screen
     rootNode.attachChild(redCube);
 }
+
 ----
+
 To have the red cube spin twice as fast as the other cube, simply make it rotate on the same axis but with double the value:
 
 
 [source,java]
+
 ----
+
 public void simpleUpdate(float tpf) {
     // make the player rotate
     player.rotate(0, 2*tpf, 0);
@@ -56,15 +62,19 @@ public void simpleUpdate(float tpf) {
     // make the red cube rotate twice as fast the player
     redCube.rotate(0, 4*tpf, 0);
 }
+
 ----
 
+
 === Exercise 3
 
 One possible solution is to shrink or grow depending on current size. The cube may start by either growing or shrinking. If the cube is growing, it will start shrinking instead only when it reaches a size large enough. If the cube is shrinking, it will start growing again, only when the size is small enough. In short, the cube should switch between growing and shrinking when it reaches a specified maximum and minimum sizes. The following code is an example of this solution:
 
 
 [source,java]
+
 ----
+
 private boolean grow = true;
 ...
 public void simpleUpdate(float tpf) {
@@ -81,7 +91,9 @@ public void simpleUpdate(float tpf) {
                 grow = true;
         }
 }
+
 ----
+
 The cube starts by growing, and when it reaches a size larger than 120% its original size, it starts shrinking instead. The cube will then keep shrinking, until it reaches a size smaller than 80% its original size, which will make it start growing again, and so on.
 
 
@@ -89,7 +101,9 @@ Another approach is to switch between shrinking and growing every chosen unit of
 
 
 [source,java]
+
 ----
+
 // Time passed
 private float timeVar = 0;
 ...
@@ -103,7 +117,9 @@ public void simpleUpdate(float tpf) {
         timeVar = 0;
     }
 }
+
 ----
+
 The cube grows for 2 two seconds, then shrinks for another 2 seconds, and repeats indefinitely.
 
 
@@ -111,7 +127,9 @@ Another approach is to set the cube scale as the result of a sine wave. This res
 
 
 [source,java]
+
 ----
+
 public void simpleUpdate(float tpf) {
     float timeInSec = timer.getTimeInSeconds();
     float initScale = 1;
@@ -120,7 +138,9 @@ public void simpleUpdate(float tpf) {
     float scale = initScale + amplitude * FastMath.sin(timeInSec * angularFrequency);
     player.setLocalScale(scale);
 }
+
 ----
+
 The cube should repeatedly and smoothly grow and shrink and have maximum and minimum scale of 0.5 and 1.5 its original size. The following variables can change the scale behavior:
 
 
@@ -135,21 +155,31 @@ Same logic! Use a timeVar, and make the Material declaration + initialization li
 
 
 [source,java]
+
 ----
+
 protected Material mat;
+
 ----
+
 As global var, then the initialization cuts off the Material bit:
 
 
 [source,java]
+
 ----
+
 mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
+
 ----
+
 And then the simpleUpdate()
 
 
 [source,java]
+
 ----
+
 public void simpleUpdate(float tpf) {
     timeVar += tpf;
     if (timeVar > 1) {
@@ -157,21 +187,27 @@ public void simpleUpdate(float tpf) {
         timeVar= 0;
     }
 }
+
 ----
 
+
 === Exercise 5
 
 A possible solution is to change the rotation axis of player from y to x, and make it move along the z axis:
 
 
 [source,java]
+
 ----
+
 public void simpleUpdate(float tpf) {
     // make the player rotate
     player.rotate(2*tpf, 0, 0);
     player.move(0, 0, 2*tpf);
 }
+
 ----
+
 The above code should make the player roll towards the camera.
 
 
@@ -185,7 +221,9 @@ First, add the mappings for the Up and Down actions to the initKeys() method:
 
 
 [source,java]
+
 ----
+
 private void initKeys() {
     ...
     inputManager.addMapping("Up", new KeyTrigger(KeyInput.KEY_H));
@@ -193,12 +231,16 @@ private void initKeys() {
     ...
     inputManager.addListener(combinedListener, new String[]{"Left", "Right", "Up", "Down", "Rotate"});
 }
+
 ----
+
 Then implement the actions in the onAnalog() method:
 
 
 [source,java]
+
 ----
+
 public void onAnalog(String name, float value, float tpf) {
     if (isRunning) {
         ...
@@ -214,7 +256,9 @@ public void onAnalog(String name, float value, float tpf) {
         ...
     }
 }
+
 ----
+
 This should enable cube to move upwards, if the H key is pressed, and downwards, if the L key is pressed.
 
 
@@ -225,7 +269,9 @@ Following the proposed solution 1, add new mappings for the mouse wheel in the i
 
 
 [source,java]
+
 ----
+
 private void initKeys() {
     ...
     inputManager.addMapping("Up", new KeyTrigger(KeyInput.KEY_H),
@@ -234,7 +280,9 @@ private void initKeys() {
                                     new MouseAxisTrigger(MouseInput.AXIS_WHEEL, false));
     ...
 }
+
 ----
+
 Now you should be able to scroll the cube up or down with the mouse wheel.
 
 
@@ -254,9 +302,13 @@ You can jump right off and obtain the hit object's material, by acessing the “
 
 
 [source,java]
+
 ----
+
 Material g = closest.getGeometry().getMaterial();
+
 ----
+
 It's the same as going through the two steps hinted in the tips: `Geometry g = closest.getGeometry(); Material material = g.getMaterial();`
 Finally, you need only add this line: `material.setColor(“Color, ColorRGBA.randomColor())` , which will change the material from the hit object to a random color!
 
@@ -265,11 +317,15 @@ The lines can be added anywhere within the `if (results.size() > 0)` block, a
 
 
 [source,java]
+
 ----
+
 Material material = closest.getGeometry().getMaterial();
 material.setColor("Color", ColorRGBA.randomColor());
+
 ----
 
+
 === Exercise 2
 
 First of all, we need some light shed to make the model visible! Add a simple DirectionalLight like previously showed.
@@ -277,24 +333,34 @@ Then, declare a `Spatial golem` variable outside of methods. Then initialize gol
 
 
 [source,java]
+
 ----
+
 golem = assetManager.loadModel("Models/Oto/Oto.mesh.xml");
+
 ----
+
 Now we need him to show up! So we need to attach him: but the rootNode won't do, because we're checking collision with it's child, the shootables node! So we attach it to shootables!
 
 
 [source,java]
+
 ----
+
 shootables.attachChild(golem);
+
 ----
 
+
 === Exercise 3
 
 Here is my code, it works and it is well commented.
 
 
 [source,java]
+
 ----
+
 package jme3test.helloworld;
 
 import com.jme3.app.SimpleApplication;
@@ -446,4 +512,5 @@ public class HelloPicking extends SimpleApplication
 	return golem;
     }
 }
-----
+
+----

+ 6 - 2
src/docs/asciidoc/jme3/advanced/3d_models.adoc

@@ -15,8 +15,12 @@ To use 3D models in a jME3 application:
 .  Save the files into a subdirectory of your jME3 project's `assets` directory.
 .  In your code, you use the <<asset_manager#,Asset Manager>> to load models as <<spatial#,Spatial>>s into a jME application. 
 [source,java]
-----Spatial model = assetManager.loadModel(
-    "Models/MonkeyHead/MonkeyHead.mesh.xml" );----
+
+----
+Spatial model = assetManager.loadModel(
+    "Models/MonkeyHead/MonkeyHead.mesh.xml" );
+----
+
 .  (For the release build:) Use the jMonkeyEngine SDK to convert models to .j3o format. You don't need this step as long you still develop and test the aplication within the jMonkeyEngine SDK.
 
 

+ 26 - 3
src/docs/asciidoc/jme3/advanced/animation.adoc

@@ -55,13 +55,17 @@ Create one `com.jme3.animation.AnimControl` object in your JME3 application for
 
 
 [source,java]
+
 ----
+
   AnimControl playerControl; // you need one Control per model
   Node player = (Node) assetManager.loadModel("Models/Oto/Oto.mesh.xml"); // load a model
   playerControl = player.getControl(AnimControl.class); // get control over this model
   playerControl.addListener(this); // add listener
+
 ----
 
+
 === Animation Channels
 
 An Animation Control has several Animation Channels (`com.jme3.animation.AnimChannel`). Each channel can play one animation sequence at a time. 
@@ -71,11 +75,15 @@ There often are situations where you want to run several animation sequences at
 
 
 [source,java]
+
 ----
+
   AnimChannel channel_walk = playerControl.createChannel();
   AnimChannel channel_jump = playerControl.createChannel();
   ...
+
 ----
+
 To reset a Control, call `control.clearChannels();`
 
 
@@ -253,7 +261,9 @@ In this short example, we define the space key to trigger playing the “Walk an
 
 
 [source,java]
+
 ----
+
   public void simpleInitApp() {
     ...
     inputManager.addMapping("Walk", new KeyTrigger(KeyInput.KEY_SPACE));
@@ -271,16 +281,22 @@ In this short example, we define the space key to trigger playing the “Walk an
       }
     }
   };
+
 ----
 
+
 == Animation Event Listener
 
 A jME3 application that contains animations can implement the `com.jme3.animation.AnimEventListener` interface.
 
 
 [source,java]
-----public class HelloAnimation extends SimpleApplication
-                     implements AnimEventListener { ... }----
+
+----
+public class HelloAnimation extends SimpleApplication
+                     implements AnimEventListener { ... }
+----
+
 This optional Listener enables you to respond to animation start and end events, onAnimChange() and onAnimCycleDone().
 
 
@@ -298,7 +314,9 @@ You have access to the following objects:
 *  The name of the animation that has just finished playing.
 
 [source,java]
+
 ----
+
   public void onAnimCycleDone(AnimControl control, AnimChannel channel, String animName) {
     // test for a condition you are interested in, e.g. ...
     if (animName.equals("Walk")) {
@@ -306,8 +324,10 @@ You have access to the following objects:
       channel.setAnim("Stand", 0.50f);
     }
   }
+
 ----
 
+
 === Responding to Animation Start
 
 The onAnimChange() event is invoked every time before an animation is set by the user to be played on a given channel (`channel.setAnim()`).
@@ -321,7 +341,9 @@ You have access to the following objects
 *  The name of the animation that will start playing.
 
 [source,java]
+
 ----
+
   public void onAnimChange(AnimControl control, AnimChannel channel, String animName) {
     // test for a condition you are interested in, e.g. ...
     if (animName.equals("Walk")) {
@@ -329,4 +351,5 @@ You have access to the following objects
       channel.setAnim("Reset", 0.50f);
     }
   }
-----
+
+----

+ 4 - 1
src/docs/asciidoc/jme3/advanced/anisotropic_filtering.adoc

@@ -19,7 +19,9 @@ Example how to set AnisotropicFiltering = 4 for all textures:
 
 
 [source,java]
+
 ----
+
         AssetEventListener asl = new AssetEventListener() {
             public void assetLoaded(AssetKey key) {
 //                throw new UnsupportedOperationException("Not supported yet.");
@@ -39,4 +41,5 @@ Example how to set AnisotropicFiltering = 4 for all textures:
         };
         
         assetManager.addAssetEventListener(asl);
-----
+
+----

+ 21 - 6
src/docs/asciidoc/jme3/advanced/application_states.adoc

@@ -91,8 +91,12 @@ a|Usage
 a|initialize(asm,app)
 a|When this AppState is added to the game, the RenderThread initializes the AppState and then calls this method. You can modify the scene graph from here (e.g. attach nodes). To get access to the main app, call: 
 [source,java]
-----super.initialize(stateManager, app);
-this.app = (SimpleApplication) app;----
+
+----
+super.initialize(stateManager, app);
+this.app = (SimpleApplication) app;
+----
+
 
 a|cleanup()
 a|This method is executed after you remove the AppState from the game. Here you implement clean-up code for when this state is detached. You can modify the scene graph from here (e.g. detach nodes).
@@ -132,7 +136,9 @@ Definition:
 
 
 [source,java]
-----public class MyAppState extends AbstractAppState {
+
+----
+public class MyAppState extends AbstractAppState {
 
     private SimpleApplication app;
 
@@ -179,7 +185,9 @@ Definition:
       x.setUserData(...);                                 // call some methods...
     }
     
-}----
+}
+----
+
 
 == Pausing and Unpausing
 
@@ -227,7 +235,11 @@ You can use custom accessors to get data from AppStates, to set data in AppState
 
 
 [source,java]
-----this.app.getStateManager().getState(MyAppState.class).doSomeCustomStuffInThisState();----
+
+----
+this.app.getStateManager().getState(MyAppState.class).doSomeCustomStuffInThisState();
+----
+
 
 === Initialize Familiar Class Fields
 
@@ -235,7 +247,9 @@ To access class fields of the SimpleApplication the way you are used to, initial
 
 
 [source,java]
+
 ----
+
 private SimpleApplication app;
 private Node              rootNode;
 private AssetManager      assetManager;
@@ -257,4 +271,5 @@ public class MyAppState extends AbstractAppState {
     this.physics      = this.stateManager.getState(BulletAppState.class);
   }
 }
-----
+
+----

+ 16 - 1
src/docs/asciidoc/jme3/advanced/appstatesdemo.adoc

@@ -26,7 +26,9 @@ There are four files, Main.java, GameRunningState.java, StartScreenState.java, S
 == Main.java
 
 [source,java]
+
 ----
+
 package chapter04.appstatedemo;
 
 import com.jme3.app.SimpleApplication;
@@ -118,12 +120,16 @@ public class Main extends SimpleApplication {
 
 }
  
+
 ----
 
+
 == GameRunningState.java
 
 [source,java]
+
 ----
+
 package chapter04.appstatedemo;
 
 import com.jme3.app.Application;
@@ -211,12 +217,16 @@ public class GameRunningState extends AbstractAppState {
   }
 
 }
+
 ----
 
+
 == SettingsScreenState.java
 
 [source,java]
+
 ----
+
 package chapter04.appstatedemo;
 
 import com.jme3.app.Application;
@@ -301,12 +311,16 @@ public class SettingsScreenState extends AbstractAppState {
   }
   
 }
+
 ----
 
+
 == StartScreenState.java
 
 [source,java]
+
 ----
+
 package chapter04.appstatedemo;
 
 import com.jme3.app.Application;
@@ -391,4 +405,5 @@ public StartScreenState(SimpleApplication app){
   }
   
 }
-----
+
+----

+ 67 - 11
src/docs/asciidoc/jme3/advanced/asset_manager.adoc

@@ -20,7 +20,9 @@ Advanced users can write a custom build and packaging script, and can register c
 ==== Context
 
 [source]
+
 ----
+
 jMonkeyProjects/MyGame/assets/    # You store assets in subfolders here! <------
 jMonkeyProjects/MyGame/build/     # SDK generates built classes here (*)
 jMonkeyProjects/MyGame/build.xml  # You customize Ant build script here
@@ -29,7 +31,9 @@ jMonkeyProjects/MyGame/dist/      # SDK generates executable distribution here (
 jMonkeyProjects/MyGame/src/       # You store Java sources here
 jMonkeyProjects/MyGame/test/      # You store test classes here (optional)
 (*) Managed by jMonkeyEngine SDK -- don't edit!
+
 ----
+
 See also <<jme3/intermediate/best_practices#,Best Practices>>.
 
 
@@ -46,8 +50,12 @@ Here is an example how you load assets using the AssetManager. This lines loads
 
 
 [source,java]
-----Material mat = (Material) assetManager.loadAsset(
-    new AssetKey("Common/Materials/RedColor.j3m"));----
+
+----
+Material mat = (Material) assetManager.loadAsset(
+    new AssetKey("Common/Materials/RedColor.j3m"));
+----
+
 This Material is “somewhere in the jME3 JAR; the default Asset Manager is configured to handle a `Common/…` path correctly, so you don't have to specify the whole path when referring to built-in assets (such as default Materials).
 
 
@@ -67,7 +75,9 @@ This is our recommended directory structure for storing assets:
 
 
 [source]
+
 ----
+
 jMonkeyProjects/MyGame/src/...           # Packages, .java source code.
 jMonkeyProjects/MyGame/assets/...        # The assets directory:
 jMonkeyProjects/MyGame/assets/Interface/   # .font, .jpg, .png, .xml
@@ -78,7 +88,9 @@ jMonkeyProjects/MyGame/assets/Scenes/      # .j3o
 jMonkeyProjects/MyGame/assets/Shaders/     # .j3f, .vert, .frag
 jMonkeyProjects/MyGame/assets/Sounds/      # .ogg, .wav
 jMonkeyProjects/MyGame/assets/Textures/    # .jpg, .png; also .mesh.xml+.material, .mtl+.obj, .blend (!) 
+
 ----
+
 These subdirectories are just the most common examples. 
 
 
@@ -99,51 +111,75 @@ Creating a material instance with the definition “Unshaded.j3md:
 
 
 [source,java]
+
 ----
+
 Material mat_brick = new Material( 
     assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
+
 ----
+
 Applying a texture to the material:
 
 
 [source,java]
+
 ----
+
 mat_brick.setTexture("ColorMap", 
     assetManager.loadTexture("Textures/Terrain/BrickWall/BrickWall.jpg"));
+
 ----
+
 Loading a font:
 
 
 [source,java]
+
 ----
+
 guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
+
 ----
+
 Loading a model:
 
 
 [source,java]
+
 ----
+
 Spatial ninja = assetManager.loadModel("Models/Ninja/Ninja.mesh.xml");
+
 ----
+
 Loading a scene from an Ogre3D dotScene file stored inside a zip:
 
 
 [source,java]
+
 ----
+
 assetManager.registerLocator("town.zip", ZipLocator.class);
 Spatial scene = assetManager.loadModel("main.scene");
 rootNode.attachChild(scene);
+
 ----
+
 Alternatively to ZipLocator, there is also a HttpZipLocator that can stream models from a zip file online:
 
 
 [source,java]
+
 ----
+
 assetManager.registerLocator("http://jmonkeyengine.googlecode.com/files/wildhouse.zip", 
                              HttpZipLocator.class);
 Spatial scene = assetManager.loadModel("main.scene");
 rootNode.attachChild(scene);
+
 ----
+
 jME3 also offers a ClasspathLocator, ZipLocator, FileLocator, HttpZipLocator, and UrlLocator (see `com.jme3.asset.plugins`). 
 
 
@@ -161,25 +197,41 @@ a| Solution!
 a| Load a model with materials 
 a| Use the asset manager's `loadModel()` method and attach the Spatial to the rootNode. 
 [source,java]
-----Spatial elephant = assetManager.loadModel("Models/Elephant/Elephant.mesh.xml");
-rootNode.attachChild(elephant);----
+
+----
+Spatial elephant = assetManager.loadModel("Models/Elephant/Elephant.mesh.xml");
+rootNode.attachChild(elephant);
+----
+
 [source,java]
-----Spatial elephant = assetManager.loadModel("Models/Elephant/Elephant.j3o");
-rootNode.attachChild(elephant);----
+
+----
+Spatial elephant = assetManager.loadModel("Models/Elephant/Elephant.j3o");
+rootNode.attachChild(elephant);
+----
+
 
 a| Load a model without materials 
 a| If you have a model without materials, you have to add a default material to make it visible. 
 [source,java]
-----Spatial teapot = assetManager.loadModel("Models/Teapot/Teapot.obj");
+
+----
+Spatial teapot = assetManager.loadModel("Models/Teapot/Teapot.obj");
 Material mat = new Material(assetManager, "Common/MatDefs/Misc/ShowNormals.j3md");
 teapot.setMaterial(mat);
-rootNode.attachChild(teapot);----
+rootNode.attachChild(teapot);
+----
+
 
 a| Load a scene 
 a| You load scenes just like you load models: 
 [source,java]
-----Spatial scene = assetManager.loadModel("Scenes/house/main.scene");
-rootNode.attachChild(scene);----
+
+----
+Spatial scene = assetManager.loadModel("Scenes/house/main.scene");
+rootNode.attachChild(scene);
+----
+
 
 |===
 
@@ -193,12 +245,16 @@ My game runs fine when I run it right from the jMonkeyEngine SDK. But when I run
 
 
 [source]
-----com.jme3.asset.DesktopAssetManager loadAsset
+
+----
+com.jme3.asset.DesktopAssetManager loadAsset
 WARNING: Cannot locate resource: Scenes/town/main.scene
 com.jme3.app.Application handleError
 SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
 java.lang.NullPointerException
+
 ----
+
 *Reason:*
 
 

+ 8 - 0
src/docs/asciidoc/jme3/advanced/atom_framework/atomcore/net.adoc

@@ -38,7 +38,9 @@ You can include Optional modules like Kryo (Kryonet), ProtocolBuffer, Zay-ES whi
 ==== A simple network application
 
 [source,java]
+
 ----
+
 class Client implement NetworkService{
      DObject dobj;
 
@@ -50,9 +52,13 @@ class Client implement NetworkService{
          dobj.mirror(service);
     }
 }
+
 ----
+
 [source,java]
+
 ----
+
 class Server implement NetworkService{
      DObject dobj;
 
@@ -65,8 +71,10 @@ class Server implement NetworkService{
          dobj.mirror(service);
     }
 }
+
 ----
 
+
 === Under the curtain
 
 

+ 52 - 12
src/docs/asciidoc/jme3/advanced/audio.adoc

@@ -21,11 +21,19 @@ The main jME audio class to look at is `com.jme3.audio.AudioNode`. When creating
 
 *  *Buffered:* By default, a new audio node is buffered. This means jME3 loads the whole file into memory before playing. Use this for short sounds. You create a buffered sound  by setting the boolean to false, or using no boolean at all: 
 [source,java]
-----AudioNode boom = new AudioNode(assetManager, "Sound/boom.wav");
-AudioNode boom = new AudioNode(assetManager, "Sound/boom.wav", false);----
+
+----
+AudioNode boom = new AudioNode(assetManager, "Sound/boom.wav");
+AudioNode boom = new AudioNode(assetManager, "Sound/boom.wav", false);
+----
+
 *  *Streamed:* If it is a long file such as music or a dialog, you stream the audio. Streaming means, you load and play in parallel until the sound is done. You cannot loop streams. You create a streamed sound by setting the boolean to true:
 [source,java]
-----AudioNode music = new AudioNode(assetManager, "Sound/music.wav", true);----
+
+----
+AudioNode music = new AudioNode(assetManager, "Sound/music.wav", true);
+----
+
 
 
 == Getting AudioNode Properties
@@ -143,11 +151,23 @@ You play, pause, and stop a node called myAudioNode by using the respective of t
 
 
 [source,java]
-----myAudioNode.play();----
+
+----
+myAudioNode.play();
+----
+
 [source,java]
-----myAudioNode.pause();----
+
+----
+myAudioNode.pause();
+----
+
 [source,java]
-----myAudioNode.stop();----
+
+----
+myAudioNode.stop();
+----
+
 *Note:* Whether an Audio Node plays continuously or only once, depends on the Loop properties you have set above!
 
 
@@ -155,7 +175,11 @@ You can also start playing instances of an AudioNode. Use the `playInstance()` m
 
 
 [source,java]
-----myAudioNode.playInstance();----
+
+----
+myAudioNode.playInstance();
+----
+
 
 == The Audio Listener
 
@@ -163,15 +187,19 @@ The default AudioListener object `listener` in `SimpleApplication` is the user's
 
 
 [source,java]
+
 ----
+
   @Override
   public void simpleUpdate(float tpf) {
     // first-person: keep the audio listener moving with the camera
     listener.setLocation(cam.getLocation());
     listener.setRotation(cam.getRotation());
   }
+
 ----
 
+
 == Setting Audio Environment Properties
 
 Optionally, You can choose from the following environmental presets from `com.jme3.audio.Environment`. This presets influence subtle echo effects (reverb) that evoke associations of different environments in your users. That is, it makes you scene sound “indoors or “outdoors etc. You use Audio Environments together with `setReverbEnabled(true)` on positional AudioNodes (see above).
@@ -256,17 +284,29 @@ a|0.0006f
 .  Activate a Environment preset
 **  Either use a default, e.g. make you scene sounds like a dungeon environment: 
 [source,java]
-----audioRenderer.setEnvironment(new Environment(Environment.Dungeon));----
+
+----
+audioRenderer.setEnvironment(new Environment(Environment.Dungeon));
+----
+
 **  Or activate <<jme3/advanced/audio_environment_presets#,custom environment settings>> in the Environment constructor:
 [source,java]
-----audioRenderer.setEnvironment(
+
+----
+audioRenderer.setEnvironment(
         new Environment( density, diffusion, gain, gainHf, decayTime, decayHf,
-                reflGain, reflDelay, lateGain, lateDelay ) );----
+                reflGain, reflDelay, lateGain, lateDelay ) );
+----
+
 
 .  Activate 3D audio for certain sounds: 
 [source,java]
-----footstepsAudio.setPositional(true);
-footstepsAudio.setReverbEnabled(true);----
+
+----
+footstepsAudio.setPositional(true);
+footstepsAudio.setReverbEnabled(true);
+----
+
 
 `com.​jme3.​audio.Environment`…<<jme3/advanced/audio_environment_presets#,examples of custom audio environment presets>>
 

+ 69 - 2
src/docs/asciidoc/jme3/advanced/audio_environment_presets.adoc

@@ -9,18 +9,24 @@ Usage:
 
 
 [source,java]
+
 ----
+
 Environment Generic = new Environment(
     new float[]{ 0, 7.5f, 1f, -1000, -100, 0, 1.49f, 0.83f, 1f, -2602,
                  0.007f, 0f, 0f, 0f, 200, 0.011f, 0f, 0f, 0f, 0.250f,
                  0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
 audioRenderer.setEnvironment(myEnvironment);
+
 ----
 
+
 == Castle
 
 [source,java]
+
 ----
+
 CastleSmallRoom    = new Environment ( new float[]{ 26, 8.3f, 0.890f, -1000, -800, -2000, 1.22f, 0.83f, 0.31f, -100, 0.022f, 0f, 0f, 0f, 600, 0.011f, 0f, 0f, 0f, 0.138f, 0.080f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20} );
 CastleShortPassage = new Environment ( new float[]{ 26, 8.3f, 0.890f, -1000, -1000, -2000, 2.32f, 0.83f, 0.31f, -100, 0.007f, 0f, 0f, 0f, 200, 0.023f, 0f, 0f, 0f, 0.138f, 0.080f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20} );
 CastleMediumroom   = new Environment ( new float[]{ 26, 8.3f, 0.930f, -1000, -1100, -2000, 2.04f, 0.83f, 0.46f, -400, 0.022f, 0f, 0f, 0f, 400, 0.011f, 0f, 0f, 0f, 0.155f, 0.030f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20} );
@@ -30,12 +36,16 @@ CastleHall         = new Environment ( new float[]{ 26, 8.3f, 0.810f, -1000, -11
 CastleCupboard     = new Environment ( new float[]{ 26, 8.3f, 0.890f, -1000, -1100, -2000, 0.67f, 0.87f, 0.31f, 300, 0.010f, 0f, 0f, 0f, 1100, 0.007f, 0f, 0f, 0f, 0.138f, 0.080f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20} );
 CastleCourtyard    = new Environment ( new float[]{ 26, 8.3f, 0.420f, -1000, -700, -1400, 2.13f, 0.61f, 0.23f, -1300, 0.160f, 0f, 0f, 0f, -300, 0.036f, 0f, 0f, 0f, 0.250f, 0.370f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x1f} );
 CastleAlcove       = new Environment ( new float[]{ 26, 8.3f, 0.890f, -1000, -600, -2000, 1.64f, 0.87f, 0.31f, 00, 0.007f, 0f, 0f, 0f, 300, 0.034f, 0f, 0f, 0f, 0.138f, 0.080f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20} );
+
 ----
 
+
 == Warehouse, Factory
 
 [source,java]
+
 ----
+
 FactoryAlcove       = new Environment ( new float[]{ 26, 1.8f, 0.590f, -1200, -200, -600, 3.14f, 0.65f, 1.31f, 300, 0.010f, 0f, 0f, 0f, 000, 0.038f, 0f, 0f, 0f, 0.114f, 0.100f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20} );
 FactoryShortpassage = new Environment ( new float[]{ 26, 1.8f, 0.640f, -1200, -200, -600, 2.53f, 0.65f, 1.31f, 0, 0.010f, 0f, 0f, 0f, 200, 0.038f, 0f, 0f, 0f, 0.135f, 0.230f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20} ) );
 FactoryMediumroom   = new Environment ( new float[]{ 26, 1.9f, 0.820f, -1200, -200, -600, 2.76f, 0.65f, 1.31f, -1100, 0.022f, 0f, 0f, 0f, 300, 0.023f, 0f, 0f, 0f, 0.174f, 0.070f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20} );
@@ -45,12 +55,16 @@ FactoryHall         = new Environment ( new float[]{ 26, 1.9f, 0.750f, -1000, -3
 FactoryCupboard     = new Environment ( new float[]{ 26, 1.7f, 0.630f, -1200, -200, -600, 0.49f, 0.65f, 1.31f, 200, 0.010f, 0f, 0f, 0f, 600, 0.032f, 0f, 0f, 0f, 0.107f, 0.070f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20} );
 FactoryCourtyard    = new Environment ( new float[]{ 26, 1.7f, 0.570f, -1000, -1000, -400, 2.32f, 0.29f, 0.56f, -1300, 0.140f, 0f, 0f, 0f, -800, 0.039f, 0f, 0f, 0f, 0.250f, 0.290f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20} );
 FactorySmallroom    = new Environment ( new float[]{ 26, 1.8f, 0.820f, -1000, -200, -600, 1.72f, 0.65f, 1.31f, -300, 0.010f, 0f, 0f, 0f, 500, 0.024f, 0f, 0f, 0f, 0.119f, 0.070f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20} );
+
 ----
 
+
 == Ice Palace
 
 [source,java]
+
 ----
+
 IcepalaceAlcove       = new Environment ( new float[]{ 26, 2.7f, 0.840f, -1000, -500, -1100, 2.76f, 1.46f, 0.28f, 100, 0.010f, 0f, 0f, 0f, -100, 0.030f, 0f, 0f, 0f, 0.161f, 0.090f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20} );
 IcepalaceShortpassage = new Environment ( new float[]{ 26, 2.7f, 0.750f, -1000, -500, -1100, 1.79f, 1.46f, 0.28f, -600, 0.010f, 0f, 0f, 0f, 100, 0.019f, 0f, 0f, 0f, 0.177f, 0.090f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20} ) );
 IcepalaceMediumroom   = new Environment ( new float[]{ 26, 2.7f, 0.870f, -1000, -500, -700, 2.22f, 1.53f, 0.32f, -800, 0.039f, 0f, 0f, 0f, 100, 0.027f, 0f, 0f, 0f, 0.186f, 0.120f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20} );
@@ -60,12 +74,16 @@ IcepalaceHall         = new Environment ( new float[]{ 26, 2.9f, 0.760f, -1000,
 IcepalaceCupboard     = new Environment ( new float[]{ 26, 2.7f, 0.830f, -1000, -600, -1300, 0.76f, 1.53f, 0.26f, 100, 0.012f, 0f, 0f, 0f, 600, 0.016f, 0f, 0f, 0f, 0.143f, 0.080f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20} );
 IcepalaceCourtyard    = new Environment ( new float[]{ 26, 2.9f, 0.590f, -1000, -1100, -1000, 2.04f, 1.20f, 0.38f, -1000, 0.173f, 0f, 0f, 0f, -1000, 0.043f, 0f, 0f, 0f, 0.235f, 0.480f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20} );
 IcepalaceSmallroom    = new Environment ( new float[]{ 26, 2.7f, 0.840f, -1000, -500, -1100, 1.51f, 1.53f, 0.27f, -100, 0.010f, 0f, 0f, 0f, 300, 0.011f, 0f, 0f, 0f, 0.164f, 0.140f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20} );
+
 ----
 
+
 == Space Station
 
 [source,java]
+
 ----
+
 SpacestationAlcove       = new Environment ( new float[]{ 26, 1.5f, 0.780f, -1000, -300, -100, 1.16f, 0.81f, 0.55f, 300, 0.007f, 0f, 0f, 0f, 000, 0.018f, 0f, 0f, 0f, 0.192f, 0.210f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20} );
 SpacestationMediumroom   = new Environment ( new float[]{ 26, 1.5f, 0.750f, -1000, -400, -100, 3.01f, 0.50f, 0.55f, -800, 0.034f, 0f, 0f, 0f, 100, 0.035f, 0f, 0f, 0f, 0.209f, 0.310f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20} );
 SpacestationShortpassage = new Environment ( new float[]{ 26, 1.5f, 0.870f, -1000, -400, -100, 3.57f, 0.50f, 0.55f, 0, 0.012f, 0f, 0f, 0f, 100, 0.016f, 0f, 0f, 0f, 0.172f, 0.200f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20} );
@@ -74,12 +92,16 @@ SpacestationLargeroom    = new Environment ( new float[]{ 26, 1.8f, 0.810f, -100
 SpacestationHall         = new Environment ( new float[]{ 26, 1.9f, 0.870f, -1000, -400, -100, 7.11f, 0.38f, 0.61f, -1500, 0.100f, 0f, 0f, 0f, -400, 0.047f, 0f, 0f, 0f, 0.250f, 0.250f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20} );
 SpacestationCupboard     = new Environment ( new float[]{ 26, 1.4f, 0.560f, -1000, -300, -100, 0.79f, 0.81f, 0.55f, 300, 0.007f, 0f, 0f, 0f, 500, 0.018f, 0f, 0f, 0f, 0.181f, 0.310f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20} );
 SpacestationSmallroom    = new Environment ( new float[]{ 26, 1.5f, 0.700f, -1000, -300, -100, 1.72f, 0.82f, 0.55f, -200, 0.007f, 0f, 0f, 0f, 300, 0.013f, 0f, 0f, 0f, 0.188f, 0.260f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20} );
+
 ----
 
+
 == Wooden Hut or Ship
 
 [source,java]
+
 ----
+
 WoodenAlcove           = new Environment ( new float[]{ 26, 7.5f, 1f, -1000, -1800, -1000, 1.22f, 0.62f, 0.91f, 100, 0.012f, 0f, 0f, 0f, -300, 0.024f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f} );
 WoodenShortpassage     = new Environment ( new float[]{ 26, 7.5f, 1f, -1000, -1800, -1000, 1.75f, 0.50f, 0.87f, -100, 0.012f, 0f, 0f, 0f, -400, 0.024f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f} );
 WoodenMediumroom       = new Environment ( new float[]{ 26, 7.5f, 1f, -1000, -2000, -1100, 1.47f, 0.42f, 0.82f, -100, 0.049f, 0f, 0f, 0f, -100, 0.029f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f} );
@@ -89,47 +111,63 @@ WoodenHall             = new Environment ( new float[]{ 26, 7.5f, 1f, -1000, -22
 WoodenCupboard         = new Environment ( new float[]{ 26, 7.5f, 1f, -1000, -1700, -1000, 0.56f, 0.46f, 0.91f, 100, 0.012f, 0f, 0f, 0f, 100, 0.028f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f} );
 WoodenSmallroom        = new Environment ( new float[]{ 26, 7.5f, 1f, -1000, -1900, -1000, 0.79f, 0.32f, 0.87f, 00, 0.032f, 0f, 0f, 0f, -100, 0.029f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f} );
 WoodenCourtyard        = new Environment ( new float[]{ 26, 7.5f, 0.650f, -1000, -2200, -1000, 1.79f, 0.35f, 0.79f, -500, 0.123f, 0f, 0f, 0f, -2000, 0.032f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f} );
+
 ----
 
+
 == Sport
 
 [source,java]
+
 ----
+
 SportEmptystadium      = new Environment ( new float[]{ 26, 7.2f, 1f, -1000, -700, -200, 6.26f, 0.51f, 1.10f, -2400, 0.183f, 0f, 0f, 0f, -800, 0.038f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x20} );
 SportSquashcourt       = new Environment ( new float[]{ 26, 7.5f, 0.750f, -1000, -1000, -200, 2.22f, 0.91f, 1.16f, -700, 0.007f, 0f, 0f, 0f, -200, 0.011f, 0f, 0f, 0f, 0.126f, 0.190f, 0.250f, 0f, -5f, 7176.9f, 211.2f, 0f, 0x20} );
 SportSmallswimmingpool = new Environment ( new float[]{ 26, 36.2f, 0.700f, -1000, -200, -100, 2.76f, 1.25f, 1.14f, -400, 0.020f, 0f, 0f, 0f, -200, 0.030f, 0f, 0f, 0f, 0.179f, 0.150f, 0.895f, 0.190f, -5f, 5000f, 250f, 0f, 0x0} );
 SportLargeswimmingpool = new Environment ( new float[]{ 26, 36.2f, 0.820f, -1000, -200, 0, 5.49f, 1.31f, 1.14f, -700, 0.039f, 0f, 0f, 0f, -600, 0.049f, 0f, 0f, 0f, 0.222f, 0.550f, 1.159f, 0.210f, -5f, 5000f, 250f, 0f, 0x0} );
 SportGymnasium         = new Environment ( new float[]{ 26, 7.5f, 0.810f, -1000, -700, -100, 3.14f, 1.06f, 1.35f, -800, 0.029f, 0f, 0f, 0f, -500, 0.045f, 0f, 0f, 0f, 0.146f, 0.140f, 0.250f, 0f, -5f, 7176.9f, 211.2f, 0f, 0x20} );
 SportFullstadium       = new Environment ( new float[]{ 26, 7.2f, 1f, -1000, -2300, -200, 5.25f, 0.17f, 0.80f, -2000, 0.188f, 0f, 0f, 0f, -1100, 0.038f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x20} );
+
 ----
 
+
 == Pipes
 
 [source,java]
+
 ----
+
 Sewerpipe    = new Environment ( new float[]{ 21, 1.7f, 0.800f, -1000, -1000, 0, 2.81f, 0.14f, 1f, 429, 0.014f, 0f, 0f, 0f, 1023, 0.021f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
 PipeSmall    = new Environment ( new float[]{ 26, 50.3f, 1f, -1000, -900, -1300, 5.04f, 0.10f, 0.10f, -600, 0.032f, 0f, 0f, 0f, 800, 0.015f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 2854.4f, 20f, 0f, 0x3f} );
 PipeLongthin = new Environment ( new float[]{ 26, 1.6f, 0.910f, -1000, -700, -1100, 9.21f, 0.18f, 0.10f, -300, 0.010f, 0f, 0f, 0f, -300, 0.022f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 2854.4f, 20f, 0f, 0x0} );
 PipeLarge    = new Environment ( new float[]{ 26, 50.3f, 1f, -1000, -900, -1300, 8.45f, 0.10f, 0.10f, -800, 0.046f, 0f, 0f, 0f, 400, 0.032f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 2854.4f, 20f, 0f, 0x3f} );
 PipeResonant = new Environment ( new float[]{ 26, 1.3f, 0.910f, -1000, -700, -1100, 6.81f, 0.18f, 0.10f, -300, 0.010f, 0f, 0f, 0f, 00, 0.022f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 2854.4f, 20f, 0f, 0x0} );
+
 ----
 
+
 == Moods
 
 [source,java]
+
 ----
+
 Heaven    = new Environment ( new float[]{ 26, 19.6f, 0.940f, -1000, -200, -700, 5.04f, 1.12f, 0.56f, -1230, 0.020f, 0f, 0f, 0f, 200, 0.029f, 0f, 0f, 0f, 0.250f, 0.080f, 2.742f, 0.050f, -2f, 5000f, 250f, 0f, 0x3f} );
 Hell      = new Environment ( new float[]{ 26, 100f, 0.570f, -1000, -900, -700, 3.57f, 0.49f, 2f, -10000, 0.020f, 0f, 0f, 0f, 300, 0.030f, 0f, 0f, 0f, 0.110f, 0.040f, 2.109f, 0.520f, -5f, 5000f, 139.5f, 0f, 0x40} );
 Memory    = new Environment ( new float[]{ 26, 8f, 0.850f, -1000, -400, -900, 4.06f, 0.82f, 0.56f, -2800, 0f, 0f, 0f, 0f, 100, 0f, 0f, 0f, 0f, 0.250f, 0f, 0.474f, 0.450f, -10f, 5000f, 250f, 0f, 0x0} );
 Drugged   = new Environment ( new float[]{ 23, 1.9f, 0.500f, -1000, 0, 0, 8.39f, 1.39f, 1f, -115, 0.002f, 0f, 0f, 0f, 985, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 1f, -5f, 5000f, 250f, 0f, 0x1f} );
 Dizzy     = new Environment ( new float[]{ 24, 1.8f, 0.600f, -1000, -400, 0, 17.23f, 0.56f, 1f, -1713, 0.020f, 0f, 0f, 0f, -613, 0.030f, 0f, 0f, 0f, 0.250f, 1f, 0.810f, 0.310f, -5f, 5000f, 250f, 0f, 0x1f} );
 Psychotic = new Environment ( new float[]{ 25, 1f, 0.500f, -1000, -151, 0, 7.56f, 0.91f, 1f, -626, 0.020f, 0f, 0f, 0f, 774, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 4f, 1f, -5f, 5000f, 250f, 0f, 0x1f} );
+
 ----
 
+
 == Car Racing
 
 [source,java]
+
 ----
+
 DrivingCommentator    = new Environment ( new float[]{ 26, 3f, 0f, 1000, -500, -600, 2.42f, 0.88f, 0.68f, -1400, 0.093f, 0f, 0f, 0f, -1200, 0.017f, 0f, 0f, 0f, 0.250f, 1f, 0.250f, 0f, -10f, 5000f, 250f, 0f, 0x20} );
 DrivingPitgarage       = new Environment ( new float[]{ 26, 1.9f, 0.590f, -1000, -300, -500, 1.72f, 0.93f, 0.87f, -500, 0f, 0f, 0f, 0f, 200, 0.016f, 0f, 0f, 0f, 0.250f, 0.110f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x0} );
 DrivingIncarRacer      = new Environment ( new float[]{ 26, 1.1f, 0.800f, -1000, 0, -200, 0.17f, 2f, 0.41f, 500, 0.007f, 0f, 0f, 0f, -300, 0.015f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 10268.2f, 251f, 0f, 0x20} );
@@ -138,12 +176,16 @@ DrivingIncarLuxury     = new Environment ( new float[]{ 26, 1.6f, 1f, -1000, -20
 DrivingFullgrandstand  = new Environment ( new float[]{ 26, 8.3f, 1f, -1000, -1100, -400, 3.01f, 1.37f, 1.28f, -900, 0.090f, 0f, 0f, 0f, -1500, 0.049f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 10420.2f, 250f, 0f, 0x1f} );
 DrivingEmptygrandstand = new Environment ( new float[]{ 26, 8.3f, 1f, -1000, 0, -200, 4.62f, 1.75f, 1.40f, -1363, 0.090f, 0f, 0f, 0f, -1200, 0.049f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 10420.2f, 250f, 0f, 0x1f} );
 DrivingTunnel          = new Environment ( new float[]{ 26, 3.1f, 0.810f, -1000, -800, -100, 3.42f, 0.94f, 1.31f, -300, 0.051f, 0f, 0f, 0f, -300, 0.047f, 0f, 0f, 0f, 0.214f, 0.050f, 0.250f, 0f, -5f, 5000f, 155.3f, 0f, 0x20} );
+
 ----
 
+
 == City
 
 [source,java]
+
 ----
+
 CityIndoors   = new Environment ( new float[]{ 16, 7.5f, 0.500f, -1000, -800, 0, 1.49f, 0.67f, 1f, -2273, 0.007f, 0f, 0f, 0f, -1691, 0.011f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
 CityStreets   = new Environment ( new float[]{ 26, 3f, 0.780f, -1000, -300, -100, 1.79f, 1.12f, 0.91f, -1100, 0.046f, 0f, 0f, 0f, -1400, 0.028f, 0f, 0f, 0f, 0.250f, 0.200f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x20} );
 CitySubway    = new Environment ( new float[]{ 26, 3f, 0.740f, -1000, -300, -100, 3.01f, 1.23f, 0.91f, -300, 0.046f, 0f, 0f, 0f, 200, 0.028f, 0f, 0f, 0f, 0.125f, 0.210f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x20} );
@@ -151,22 +193,30 @@ CityMuseum    = new Environment ( new float[]{ 26, 80.3f, 0.820f, -1000, -1500,
 CityLibrary   = new Environment ( new float[]{ 26, 80.3f, 0.820f, -1000, -1100, -2100, 2.76f, 0.89f, 0.41f, -900, 0.029f, 0f, 0f, -0f, -100, 0.020f, 0f, 0f, 0f, 0.130f, 0.170f, 0.250f, 0f, -5f, 2854.4f, 107.5f, 0f, 0x0} );
 CityUnderpass = new Environment ( new float[]{ 26, 3f, 0.820f, -1000, -700, -100, 3.57f, 1.12f, 0.91f, -800, 0.059f, 0f, 0f, 0f, -100, 0.037f, 0f, 0f, 0f, 0.250f, 0.140f, 0.250f, 0f, -7f, 5000f, 250f, 0f, 0x20} );
 CityAbandoned = new Environment ( new float[]{ 26, 3f, 0.690f, -1000, -200, -100, 3.28f, 1.17f, 0.91f, -700, 0.044f, 0f, 0f, 0f, -1100, 0.024f, 0f, 0f, 0f, 0.250f, 0.200f, 0.250f, 0f, -3f, 5000f, 250f, 0f, 0x20} );
+
 ----
 
+
 == Small Indoor Rooms
 
 [source,java]
+
 ----
+
 Room         = new Environment ( new float[]{ 2, 1.9f, 1f, -1000, -454, 0, 0.40f, 0.83f, 1f, -1646, 0.002f, 0f, 0f, 0f, 53, 0.003f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
 Bathroom     = new Environment ( new float[]{ 3, 1.4f, 1f, -1000, -1200, 0, 1.49f, 0.54f, 1f, -370, 0.007f, 0f, 0f, 0f, 1030, 0.011f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
 Livingroom   = new Environment ( new float[]{ 4, 2.5f, 1f, -1000, -6000, 0, 0.50f, 0.10f, 1f, -1376, 0.003f, 0f, 0f, 0f, -1104, 0.004f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
 Paddedcell   = new Environment ( new float[]{ 1, 1.4f, 1f, -1000, -6000, 0, 0.17f, 0.10f, 1f, -1204, 0.001f, 0f, 0f, 0f, 207, 0.002f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
-Stoneroom    = new Environment ( new float[]{ 5, 11.6f, 1f, -1000, -300, 0, 2.31f, 0.64f, 1f, -711, 0.012f, 0f, 0f, 0f, 83, 0.017f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );----
+Stoneroom    = new Environment ( new float[]{ 5, 11.6f, 1f, -1000, -300, 0, 2.31f, 0.64f, 1f, -711, 0.012f, 0f, 0f, 0f, 83, 0.017f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
+----
+
 
 == Medium-Sized Indoor Rooms
 
 [source,java]
+
 ----
+
 Workshop     = new Environment ( new float[]{ 26, 1.9f, 1f, -1000, -1700, -800, 0.76f, 1f, 1f, 0, 0.012f, 0f, 0f, 0f, 100, 0.012f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x0} );
 Schoolroom   = new Environment ( new float[]{ 26, 1.86f, 0.690f, -1000, -400, -600, 0.98f, 0.45f, 0.18f, 300, 0.017f, 0f, 0f, 0f, 300, 0.015f, 0f, 0f, 0f, 0.095f, 0.140f, 0.250f, 0f, -5f, 7176.9f, 211.2f, 0f, 0x20} );
 Practiseroom = new Environment ( new float[]{ 26, 1.86f, 0.870f, -1000, -800, -600, 1.12f, 0.56f, 0.18f, 200, 0.010f, 0f, 0f, 0f, 300, 0.011f, 0f, 0f, 0f, 0.095f, 0.140f, 0.250f, 0f, -5f, 7176.9f, 211.2f, 0f, 0x20} );
@@ -174,12 +224,16 @@ Outhouse     = new Environment ( new float[]{ 26, 80.3f, 0.820f, -1000, -1900, -
 Caravan      = new Environment ( new float[]{ 26, 8.3f, 1f, -1000, -2100, -1800, 0.43f, 1.50f, 1f, 0, 0.012f, 0f, 0f, 0f, 600, 0.012f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x1f} );
 Dustyroom    = new Environment ( new float[]{ 26, 1.8f, 0.560f, -1000, -200, -300, 1.79f, 0.38f, 0.21f, -600, 0.002f, 0f, 0f, 0f, 200, 0.006f, 0f, 0f, 0f, 0.202f, 0.050f, 0.250f, 0f, -10f, 13046f, 163.3f, 0f, 0x20} );
 Chapel       = new Environment ( new float[]{ 26, 19.6f, 0.840f, -1000, -500, 0, 4.62f, 0.64f, 1.23f, -700, 0.032f, 0f, 0f, 0f, -200, 0.049f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0.110f, -5f, 5000f, 250f, 0f, 0x3f} );
+
 ----
 
+
 == Large Indoor Rooms
 
 [source,java]
+
 ----
+
 Auditorium     = new Environment ( new float[]{ 6, 21.6f, 1f, -1000, -476, 0, 4.32f, 0.59f, 1f, -789, 0.020f, 0f, 0f, 0f, -289, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
 Concerthall    = new Environment ( new float[]{ 7, 19.6f, 1f, -1000, -500, 0, 3.92f, 0.70f, 1f, -1230, 0.020f, 0f, 0f, 0f, -02, 0.029f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
 Cave           = new Environment ( new float[]{ 8, 14.6f, 1f, -1000, 0, 0, 2.91f, 1.30f, 1f, -602, 0.015f, 0f, 0f, 0f, -302, 0.022f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x1f} );
@@ -187,22 +241,30 @@ Arena          = new Environment ( new float[]{ 9, 36.2f, 1f, -1000, -698, 0, 7.
 Hangar         = new Environment ( new float[]{ 10, 50.3f, 1f, -1000, -1000, 0, 10.05f, 0.23f, 1f, -602, 0.020f, 0f, 0f, 0f, 198, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
 DomeTomb       = new Environment ( new float[]{ 26, 51.8f, 0.790f, -1000, -900, -1300, 4.18f, 0.21f, 0.10f, -825, 0.030f, 0f, 0f, 0f, 450, 0.022f, 0f, 0f, 0f, 0.177f, 0.190f, 0.250f, 0f, -5f, 2854.4f, 20f, 0f, 0x0} );
 DomeSaintPauls = new Environment ( new float[]{ 26, 50.3f, 0.870f, -1000, -900, -1300, 10.48f, 0.19f, 0.10f, -1500, 0.090f, 0f, 0f, 0f, 200, 0.042f, 0f, 0f, 0f, 0.250f, 0.120f, 0.250f, 0f, -5f, 2854.4f, 20f, 0f, 0x3f} );
+
 ----
 
+
 == Hallways, Alleys
 
 [source,java]
+
 ----
+
 Carpettedhallway = new Environment ( new float[]{ 11, 1.9f, 1f, -1000, -4000, 0, 0.30f, 0.10f, 1f, -1831, 0.002f, 0f, 0f, 0f, -1630, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
 Hallway          = new Environment ( new float[]{ 12, 1.8f, 1f, -1000, -300, 0, 1.49f, 0.59f, 1f, -1219, 0.007f, 0f, 0f, 0f, 441, 0.011f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
 Stonecorridor    = new Environment ( new float[]{ 13, 13.5f, 1f, -1000, -237, 0, 2.70f, 0.79f, 1f, -1214, 0.013f, 0f, 0f, 0f, 395, 0.020f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
 Alley            = new Environment ( new float[]{ 14, 7.5f, 0.300f, -1000, -270, 0, 1.49f, 0.86f, 1f, -1204, 0.007f, 0f, 0f, 0f, -4, 0.011f, 0f, 0f, 0f, 0.125f, 0.950f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
+
 ----
 
+
 == Outdoors
 
 [source,java]
+
 ----
+
 Backyard      = new Environment ( new float[]{ 26, 80.3f, 0.450f, -1000, -1200, -600, 1.12f, 0.34f, 0.46f, -700, 0.069f, 0f, 0f, -0f, -300, 0.023f, 0f, 0f, 0f, 0.218f, 0.340f, 0.250f, 0f, -5f, 4399.1f, 242.9f, 0f, 0x0} );
 Plain         = new Environment ( new float[]{ 19, 42.5f, 0.210f, -1000, -2000, 0, 1.49f, 0.50f, 1f, -2466, 0.179f, 0f, 0f, 0f, -1926, 0.100f, 0f, 0f, 0f, 0.250f, 1f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
 Rollingplains = new Environment ( new float[]{ 26, 80.3f, 0f, -1000, -3900, -400, 2.13f, 0.21f, 0.46f, -1500, 0.300f, 0f, 0f, -0f, -700, 0.019f, 0f, 0f, 0f, 0.250f, 1f, 0.250f, 0f, -5f, 4399.1f, 242.9f, 0f, 0x0} );
@@ -213,12 +275,17 @@ Forest        = new Environment ( new float[]{ 15, 38f, 0.300f, -1000, -3300, 0,
 Mountains     = new Environment ( new float[]{ 17, 100f, 0.270f, -1000, -2500, 0, 1.49f, 0.21f, 1f, -2780, 0.300f, 0f, 0f, 0f, -1434, 0.100f, 0f, 0f, 0f, 0.250f, 1f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x1f} );
 Quarry        = new Environment ( new float[]{ 18, 17.5f, 1f, -1000, -1000, 0, 1.49f, 0.83f, 1f, -10000, 0.061f, 0f, 0f, 0f, 500, 0.025f, 0f, 0f, 0f, 0.125f, 0.700f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
 Parkinglot    = new Environment ( new float[]{ 20, 8.3f, 1f, -1000, 0, 0, 1.65f, 1.50f, 1f, -1363, 0.008f, 0f, 0f, 0f, -1153, 0.012f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x1f} );
+
 ----
 
+
 == Water
 
 [source,java]
+
 ----
+
 Underwater     = new Environment ( new float[]{ 22, 1.8f, 1f, -1000, -4000, 0, 1.49f, 0.10f, 1f, -449, 0.007f, 0f, 0f, 0f, 1700, 0.011f, 0f, 0f, 0f, 0.250f, 0f, 1.180f, 0.348f, -5f, 5000f, 250f, 0f, 0x3f} );
 Smallwaterroom = new Environment ( new float[]{ 26, 36.2f, 0.700f, -1000, -698, 0, 1.51f, 1.25f, 1.14f, -100, 0.020f, 0f, 0f, 0f, 300, 0.030f, 0f, 0f, 0f, 0.179f, 0.150f, 0.895f, 0.190f, -7f, 5000f, 250f, 0f, 0x0} );
-----
+
+----

+ 41 - 1
src/docs/asciidoc/jme3/advanced/bloom_and_glow.adoc

@@ -20,12 +20,16 @@ image:jme3/advanced/nobloomsky.png[No bloom,with="",height=""]image:jme3/advance
 .  Add the processor to the viewPort
 
 [source,java]
+
 ----
+
  FilterPostProcessor fpp=new FilterPostProcessor(assetManager);
  BloomFilter bloom=new BloomFilter();
  fpp.addFilter(bloom);
  viewPort.addProcessor(fpp);
+
 ----
+
 Here are the parameters that you can tweak :
 
 [cols="4", options="header"]
@@ -84,7 +88,9 @@ The tank material looks like this :
 
 
 [source]
+
 ----
+
 Material My Material : Common/MatDefs/Light/Lighting.j3md {
      MaterialParameters {
         SpecularMap : Models/HoverTank/tank_specular.png
@@ -98,7 +104,9 @@ Material My Material : Common/MatDefs/Light/Lighting.j3md {
         Specular : 1.0 1.0 1.0 1.0
      }
 }
+
 ----
+
 The glow map is defined here : *GlowMap : Models/HoverTank/tank_glow_map_highres.png*
 
 
@@ -111,12 +119,16 @@ The glow map is defined here : *GlowMap : Models/HoverTank/tank_glow_map_highres
 .  Add the processor to the viewPort
 
 [source]
+
 ----
+
   FilterPostProcessor fpp=new FilterPostProcessor(assetManager);
   BloomFilter bf=new BloomFilter(BloomFilter.GlowMode.Objects);
   fpp.addFilter(bf);
   viewPort.addProcessor(fpp);
+
 ----
+
 Here is the result : +
 
 image:jme3/advanced/tanlglow1.png[Glowing hover tank,with="",height=""]
@@ -139,7 +151,9 @@ In this case you'll need to use the glow color parameter.
 .  Add the processor to the viewPort
 
 [source]
+
 ----
+
     Material mat = new Material(getAssetManager(), "Common/MatDefs/Misc/SolidColor.j3md");
     mat.setColor("Color", ColorRGBA.Green);
     mat.setColor("GlowColor", ColorRGBA.Green);
@@ -147,7 +161,9 @@ In this case you'll need to use the glow color parameter.
     bloom= new BloomFilter(BloomFilter.GlowMode.Objects);        
     fpp.addFilter(bloom);
     viewPort.addProcessor(fpp);
+
 ----
+
 Here is the result on Oto's plasma ball (before and after) : +
 
 
@@ -170,10 +186,14 @@ You can reduce the size of the bloom sampling just by using the setDownSamplingF
 
 
 [source,java]
+
 ----
+
  BloomFilter bloom=new BloomFilter();
  bloom.setDownSamplingFactor(2.0f); 
+
 ----
+
 In this example the sampling size is divided by 4 (width/2,height/2), resulting in less work to blur the scene.
 The resulting texture is then up sampled to the screen size using hardware bilinear filtering. this results in a wider blur range.
 
@@ -186,9 +206,13 @@ You can use only one bloom filter for both effects like that
 
 
 [source,java]
+
 ----
+
 BloomFilter bloom=new BloomFilter(BloomFilter.GlowMode.SceneAndObjects);
+
 ----
+
 However, note that both effects will share the same values of attribute, and sometimes, it won't be what you need.
 
 
@@ -200,7 +224,9 @@ In your material definition you need to add those lines in the MaterialParameter
 
 
 [source]
+
 ----
+
  MaterialParameters {
         
         ....
@@ -210,12 +236,16 @@ In your material definition you need to add those lines in the MaterialParameter
         // The glow color of the object
         Color GlowColor
     }
+
 ----
+
 Then add the following technique : 
 
 
 [source]
+
 ----
+
     Technique Glow {
 
         LightMode SinglePass
@@ -232,7 +262,9 @@ Then add the following technique :
             HAS_GLOWCOLOR : GlowColor
         }
     }
+
 ----
+
 Then you can use this material with the BloomFilter
 
 
@@ -243,13 +275,21 @@ If you are using a glow map, remove the texture from the material.
 
 
 [source]
+
 ----
+
 material.clearTextureParam("GlowMap");
+
 ----
+
 If you are using a glow color, set it to black
 
 
 [source]
+
 ----
+
 material.setColor("GlowColor",ColorRGBA.Black);
-----<tags><tag target="documentation" /><tag target="effect" /><tag target="light" /></tags>
+
+----
+<tags><tag target="documentation" /><tag target="effect" /><tag target="light" /></tags>

+ 8 - 0
src/docs/asciidoc/jme3/advanced/building_recast.adoc

@@ -63,11 +63,15 @@ Example of method in wrapper:
 
 
 [source,java]
+
 ----
+
 SWIGEXPORT jint JNICALL Java_com_jme3_ai_navigation_utils_RecastJNI_rcIntArray_1size(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
  ...
 }
+
 ----
+
 The Recast_wrap.cxx uses SWIG wrapper so for declaring method in wrapper you must first use the keyword `SWIGEXPORT` then returning type (for more information on returning types see link:http://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/types.html[link]), then again keyword `JNICALL` and then as the name of method `Java_com_jme3_ai_navigation_utils_RecastJNI_` + `name of class` + `name of method`, after that, there goes list of parameters needed for the function (for more information see link:http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/functions.html[link]). In body of method write how the function should be used.
 
 
@@ -85,7 +89,9 @@ The following script was used for generating wrapper:
 
 
 [source]
+
 ----
+
 %module Recast
 %include "carrays.i"
 %array_class(double, DoubleArray);
@@ -147,7 +153,9 @@ The following script was used for generating wrapper:
     System.load("Recast");
   }
 %}
+
 ----
+
 If there are more headers at some moment, include them in both places.
 
 

+ 11 - 3
src/docs/asciidoc/jme3/advanced/bullet_multithreading.adoc

@@ -15,7 +15,11 @@ A SimpleApplication with a BulletAppState allows setting the threading type via
 
 
 [source]
-----setThreadingType(ThreadingType type);----
+
+----
+setThreadingType(ThreadingType type);
+----
+
  where ThreadingType can be either SEQUENTIAL or PARALLEL. By default, it's SEQUENTIAL.
 
 
@@ -23,9 +27,13 @@ You can activate PARALLEL threading in the simpleInitApp() method:
 
 
 [source,java]
-----bulletAppState = new BulletAppState();
+
+----
+bulletAppState = new BulletAppState();
 bulletAppState.setThreadingType(BulletAppState.ThreadingType.PARALLEL);
-stateManager.attach(bulletAppState);----
+stateManager.attach(bulletAppState);
+----
+
 Now the physics update happens in parallel to render(), that is, after the user's changes in the update() call have been applied. During update() the physics update loop pauses. This way the loop logic is still maintained: the user can set and change values in physics and scenegraph objects before render() and physicsUpdate() are called in parallel. This allows you to use physics methods in update() as if it was single-threaded.
 
 [cols="2", options="header"]

+ 10 - 2
src/docs/asciidoc/jme3/advanced/camera.adoc

@@ -83,11 +83,15 @@ The `flyCam` class field gives you access to an AppState that extends the defaul
 
 
 [source]
+
 ----
+
 Q  W             up   forw
 A  S  D    -->  left  back  right 
 Z               down  
-----[cols="2", options="header"]
+
+----
+[cols="2", options="header"]
 |===
 
 a|Method
@@ -117,10 +121,14 @@ jME3 also supports an optional Chase Cam that can follow a moving target Spatial
 
 
 [source,java]
+
 ----
+
 flyCam.setEnabled(false);
 ChaseCamera chaseCam = new ChaseCamera(cam, target, inputManager);
-----[cols="2", options="header"]
+
+----
+[cols="2", options="header"]
 |===
 
 a|Method

+ 20 - 0
src/docs/asciidoc/jme3/advanced/capture_audio_video_to_a_file.adoc

@@ -28,9 +28,13 @@ Add the following code to your `simpleInitApp()` method.
 
 
 [source,java]
+
 ----
+
 stateManager.attach(new VideoRecorderAppState()); //start recording
+
 ----
+
 The game will run slow, but the recording will be in high-quality and
 normal speed. Recording starts when the state is
 attached, and ends when the application quits or the state is detached.
@@ -83,9 +87,13 @@ The steps are:
 
 
 [source,java]
+
 ----
+
 yourApp.setTimer(new IsoTimer(desiredFramesPerSecond));
+
 ----
+
 This causes jMonkeyEngine to take as much time as it needs to fully
 calculate every frame of the video and audio.  You will see your game
 speed up and slow down depending on how computationally demanding your
@@ -94,10 +102,14 @@ sychronized and will run at exactly the fps which you specified.
 
 
 [source,java]
+
 ----
+
 captureVideo(yourApp, targetVideoFile);
 captureAudio(yourApp, targetAudioFile);
+
 ----
+
 These will cause the app to record audio and video when it is run.
 Audio and video will stop being recorded when the app stops. Your
 audio will be recorded as a 44,100 Hz linear PCM wav file, while the
@@ -143,7 +155,9 @@ from one of jMonkeyEngine3's advanced demo applications.
 
 
 [source,java]
+
 ----
+
 import java.io.File;
 import java.io.IOException;
 
@@ -181,8 +195,10 @@ public class Basic {
 	System.out.println(audio.getCanonicalPath());
     }
 }
+
 ----
 
+
 === How it works
 
 A standard JME3 application that extends `SimpleApplication` or
@@ -241,7 +257,9 @@ distribution.
 
 
 [source,java]
+
 ----
+
 package com.aurellem.capture.examples;
 
 import java.io.File;
@@ -549,7 +567,9 @@ public class Advanced extends SimpleApplication {
 	}
 
 }
+
 ----
+
 image:http///www.youtube.com/v/oCEfK0yhDrY?.swf[oCEfK0yhDrY?.swf,with="400",height=""]
 
 

+ 48 - 8
src/docs/asciidoc/jme3/advanced/cinematics.adoc

@@ -30,13 +30,17 @@ A Cinematic is like a movie script for a node.
 
 
 [source,java]
-----Cinematic cinematic = new Cinematic(sceneNode, duration);
+
+----
+Cinematic cinematic = new Cinematic(sceneNode, duration);
 cinematic.addCinematicEvent(starttime1, event1);
 cinematic.addCinematicEvent(starttime2, event2);
 cinematic.addCinematicEvent(starttime2, event3);
 ...
 stateManager.attach(cinematic);
+
 ----
+
 .  Create one Cinematic per scripted scene.
 **  `sceneNode` is the node containing the scene (can be the rootNode).
 **  `duration` is the duration of the whole scene in seconds.
@@ -103,7 +107,11 @@ A MotionEvent moves a Spatial along a complex path.
 
 
 [source,java]
-----MotionEvent events= new MotionEvent (thingNode, path);----
+
+----
+MotionEvent events= new MotionEvent (thingNode, path);
+----
+
 Details of the constructor:
 
 
@@ -159,7 +167,11 @@ A SoundEventplays a sound as part of the cinematic.
 
 
 [source,java]
-----SoundEvent( audioPath, isStream, duration, loopMode )----
+
+----
+SoundEvent( audioPath, isStream, duration, loopMode )
+----
+
 Details of the constructor:
 
 
@@ -175,12 +187,20 @@ A GuiEventshows or hide a NiftyGUI as part of a cinematic.
 
 
 [source,java]
-----GuiEvent( screen, duration, loopMode )----
+
+----
+GuiEvent( screen, duration, loopMode )
+----
+
 You must use this together with bindUI() to specify the Nifty +++<abbr title="Graphical User Interface">GUI</abbr>+++ XML file that you want to load:
 
 
 [source,java]
-----cinematic.bindUi("Interface/subtitle.xml");----
+
+----
+cinematic.bindUi("Interface/subtitle.xml");
+----
+
 Details of the constructor:
 
 
@@ -195,7 +215,11 @@ An AnimationEvent triggers an animation as part of a cinematic.
 
 
 [source,java]
-----AnimationEvent( thingNode, animationName, duration, loopMode )----
+
+----
+AnimationEvent( thingNode, animationName, duration, loopMode )
+----
+
 Details of the constructor:
 
 
@@ -214,28 +238,40 @@ First you have to bind a camera to the cinematic with a unique name. You'll be p
 
 
 [source,java]
+
 ----
+
  CameraNode camNode = cinematic.bindCamera("topView", cam);
+
 ----
+
 then you can do whatever you want with this camera node : place it so that you have a the camera angle you'd like, attach it to a motion event to have some camera scrolling, attach control of your own that give it whatever behavior you'd like.
 In the above example, I want it to be a top view of the scene looking at the world origin.
 
 
 [source,java]
+
 ----
+
  //set its position
  camNode.setLocalTranslation(new Vector3f(0, 50, 0));
  // set it to look at the world origin
  camNode.lookAt(Vector3F.ZERO, Vector3f.UNIT_Y);
+
 ----
+
 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 
 
 
 [source,java]
+
 ----
+
  cinematic.activateCamera(3,”topView”);
+
 ----
 
+
 === Customizations
 
 You can extend individual CinematicEvents. The link:https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-examples/src/main/java/jme3test/animation/SubtitleTrack.java[SubtitleTrack.java example] shows how to extend a GuiTrack to script subtitles. See how the subtitles are used in the link:https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-examples/src/main/java/jme3test/animation/TestCinematic.java[TestCinematic.java example].
@@ -251,7 +287,9 @@ You can also create new CinematicEvent by extending link:https://github.com/jMon
 === CinematicEventListener
 
 [source,java]
-----CinematicEventListener cel = new CinematicEventListener() {
+
+----
+CinematicEventListener cel = new CinematicEventListener() {
   public void onPlay(CinematicEvent cinematic) {
     chaseCam.setEnabled(false);
     System.out.println("play");
@@ -267,7 +305,9 @@ You can also create new CinematicEvent by extending link:https://github.com/jMon
     System.out.println("stop");
   }
 }
-cinematic.addListener(cel);----
+cinematic.addListener(cel);
+----
+
 
 === Physics Interaction
 

+ 15 - 3
src/docs/asciidoc/jme3/advanced/collision_and_intersection.adoc

@@ -78,7 +78,9 @@ The following code snippet can be triggered by listeners (e.g. after an input ac
 
 
 [source,java]
+
 ----
+
   // Calculate detection results
   CollisionResults results = new CollisionResults();
   a.collideWith(b, results);
@@ -94,12 +96,16 @@ The following code snippet can be triggered by listeners (e.g. after an input ac
   } else {
     // how to react when no collision occured
   }
-}----
+}
+----
+
 You can also loop over all results and trigger different reactions depending on what was hit and where it was hit. In this example, we simply print info about them.
 
 
 [source,java]
+
 ----
+
   // Calculate Results
   CollisionResults results = new CollisionResults();
   a.collideWith(b, results);
@@ -117,7 +123,9 @@ You can also loop over all results and trigger different reactions depending on
     System.out.println("  Party " + party + " was hit at " + pt + ", " + dist + " wu away.");
     System.out.println("  The hit triangle #" + tri + " has a normal vector of " + norm);
   }
+
 ----
+
 Knowing the distance of the collisions is useful for example when you intersect Lines and Rays with other objects.
 
 
@@ -154,8 +162,12 @@ For example you can use Bounding Volumes on custom meshes, or complex non-physic
 
 
 [source,java]
-----mesh.setBound(new BoundingSphere());
-mesh.updateBound();----
+
+----
+mesh.setBound(new BoundingSphere());
+mesh.updateBound();
+----
+
 
 == Mesh and Scene Graph Collision
 

+ 21 - 1
src/docs/asciidoc/jme3/advanced/combo_moves.adoc

@@ -36,7 +36,9 @@ For example:
 
 
 [source,java]
+
 ----
+
 inputManager.addMapping("Left",    new KeyTrigger(KeyInput.KEY_LEFT));
 inputManager.addMapping("Right",   new KeyTrigger(KeyInput.KEY_RIGHT));
 inputManager.addMapping("Up",      new KeyTrigger(KeyInput.KEY_UP));
@@ -44,8 +46,10 @@ inputManager.addMapping("Down",    new KeyTrigger(KeyInput.KEY_DOWN));
 inputManager.addMapping("Attack1", new KeyTrigger(KeyInput.KEY_SPACE));
 ...
 inputManager.addListener(this, "Left", "Right", "Up", "Down", "Attack1");
+
 ----
 
+
 == Define Combos
 
 For each of  your combo moves, you specify the series of inputs that will trigger it. The order in which you define them is the order the player has to press them for the step to be recorded. When all steps have been recorded, the combo is triggered. 
@@ -55,22 +59,30 @@ The following example shows how a fireball combo move is triggered by pressing t
 
 
 [source,java]
+
 ----
+
 ComboMove fireball = new ComboMove("Fireball");
 fireball.press("Down").notPress("Right").done();
 fireball.press("Right", "Down").done();
 fireball.press("Right").notPress("Down").done();
 fireball.notPress("Right", "Down").done();
 fireball.setUseFinalState(false);
+
 ----
+
 Also create a ComboMoveExecution object for each ComboMove. You need it later to execute the detected combo.
 
 
 [source,java]
+
 ----
+
 ComboMoveExecution fireballExec = new ComboMoveExecution(fireball);
+
 ----
 
+
 === ComboMove Class Methods
 
 Use the following ComboMove methods to specify the combo:
@@ -144,7 +156,9 @@ We also track the cast time of a combo to determine if it has timed out (see upd
 
 
 [source,java]
+
 ----
+
 private HashSet<String> pressedMappings = new HashSet<String>();
 private ComboMove currentMove = null;
 private float currentMoveCastTime = 0;
@@ -186,15 +200,19 @@ public void onAction(String name, boolean isPressed, float tpf) {
         currentMoveCastTime = currentMove.getCastTime();
     }
 }
+
 ----
 
+
 == Execute Combos in the Update Loop
 
 Now that you have detected the current move, you want to execute it. You do that in the update loop.
 
 
 [source,java]
+
 ----
+
 @Override
 public void simpleUpdate(float tpf){
     time += tpf;
@@ -210,7 +228,9 @@ public void simpleUpdate(float tpf){
             currentMove = null;
         }
     }
-}----
+}
+----
+
 Test `currentMove.getMoveName()` and proceed to call methods that implement any special actions and bonuses. This is up to you and depends individually on your game.
 
 

+ 53 - 14
src/docs/asciidoc/jme3/advanced/custom_controls.adoc

@@ -22,7 +22,11 @@ For example, one NPC can be controlled by a PhysicsControl instance and an AICon
 
 .  Add an instance of the Control to a spatial to give it this behavior. The spatial's game state is updated automatically from now on. 
 [source,java]
-----spatial.addControl(myControl);----
+
+----
+spatial.addControl(myControl);
+----
+
 
 To implement game logic for a type of spatial, you will either extend AbstractControl (most common case), or implement the Control interface, as explained in this article.
 
@@ -86,7 +90,9 @@ Usage: Your custom subclass implements the three methods `controlUpdate()`, `con
 
 
 [source,java]
+
 ----
+
 public class MyControl extends AbstractControl implements Savable, Cloneable {
   private int index; // can have custom fields -- example 
   
@@ -151,7 +157,9 @@ public class MyControl extends AbstractControl implements Savable, Cloneable {
       // ex.getCapsule(this).write(...);
   }
   
-}----
+}
+----
+
 See also:
 
 
@@ -178,14 +186,20 @@ Usage example:
 
 
 [source,java]
-----public interface MyControlInterface extends Control {
+
+----
+public interface MyControlInterface extends Control {
     public void setSomething(int x); // optionally, add custom methods
-}----
+}
+----
+
 2. Create custom Controls implementing your Control interface.
 
 
 [source,java]
-----public class MyControl extends MyCustomClass implements MyControlInterface {
+
+----
+public class MyControl extends MyCustomClass implements MyControlInterface {
 
     protected Spatial spatial;
 
@@ -250,7 +264,9 @@ Usage example:
         spatial = (Spatial) ic.readSavable("spatial", null);
         // read custom variables ....
     }
-}----
+}
+----
+
 
 == Best Practices
 
@@ -259,7 +275,9 @@ Here an example from the link:http://code.google.com/p/monkeyzone/[MonkeyZone] c
 
 
 [source,java]
+
 ----
+
 public class CharacterAnimControl implements Control {
   ...
   public void setSpatial(Spatial spatial) {
@@ -268,41 +286,62 @@ public class CharacterAnimControl implements Control {
     characterControl = spatial.getControl(CharacterControl.class);
     ...
   }
-}----
+}
+----
+
 *Tip:* You can create custom Control interfaces so a set of different Controls provide the same methods and can be accessed with the interface class type.
 
 
 [source,java]
-----public interface ManualControl extends Control {
+
+----
+public interface ManualControl extends Control {
     public void steerX(float value);
     public void steerY(float value);
     public void moveX(float value);
     public void moveY(float value);
     public void moveZ(float value);
    ...
-}----
+}
+----
+
 Then you create custom sub-Controls and implement the methods accordingly to the context:
 
 
 [source,java]
-----public class ManualVehicleControl   extends ManualControl {...}----
+
+----
+public class ManualVehicleControl   extends ManualControl {...}
+----
+
  and
 
 
 [source,java]
-----public class ManualCharacterControl extends ManualControl {...}----
+
+----
+public class ManualCharacterControl extends ManualControl {...}
+----
+
 Then add the appropriate controls to spatials:
 
 
 [source,java]
+
 ----
+
 characterSpatial.addControl(new ManualCharacterControl());
 ...
 vehicleSpatial.addControl(new ManualVehicleControl());
-...----
+...
+----
+
 *Tip:* Use the getControl() method on a Spatial to get a specific Control object, and activate its behaviour!
 
 
 [source,java]
-----ManualControl c = mySpatial.getControl(ManualControl.class);
-c.steerX(steerX);----
+
+----
+ManualControl c = mySpatial.getControl(ManualControl.class);
+c.steerX(steerX);
+----

+ 93 - 13
src/docs/asciidoc/jme3/advanced/custom_meshes.adoc

@@ -35,13 +35,17 @@ In this tutorial we want to create a 3x3 Quad. The quad has four vertices, and i
 
 
 [source]
-----0,3,0--3,3,0
+
+----
+0,3,0--3,3,0
 | \        |
 |   \      |
 |     \    |
 |       \  |
 |         \|
-0,0,0--3,0,0----
+0,0,0--3,0,0
+----
+
 
 === The Mesh Object
 
@@ -49,7 +53,11 @@ The base class for creating meshes is `com.jme3.scene.Mesh`.
 
 
 [source,java]
-----Mesh mesh = new Mesh();----
+
+----
+Mesh mesh = new Mesh();
+----
+
 Tip: If you create your own Mesh-based class (`public class MyMesh extends Mesh {  }`), replace the variable `mesh` by `this` in the following examples.
 
 
@@ -60,27 +68,35 @@ To define your own shape, determine the shape's *vertex coordinates* in 3D space
 
 
 [source,java]
+
 ----
+
 Vector3f [] vertices = new Vector3f[4];
 vertices[0] = new Vector3f(0,0,0);
 vertices[1] = new Vector3f(3,0,0);
 vertices[2] = new Vector3f(0,3,0);
 vertices[3] = new Vector3f(3,3,0);
+
 ----
 
+
 === Texture Coordinates
 
 Next, we define the Quad's 2D *texture coordinates* for each vertex, in the same order as the vertices: Bottom left, bottom right, top left, top right. We name this Vector2f array `texCoord[]`
 
 
 [source,java]
+
 ----
+
 Vector2f[] texCoord = new Vector2f[4];
 texCoord[0] = new Vector2f(0,0);
 texCoord[1] = new Vector2f(1,0);
 texCoord[2] = new Vector2f(0,1);
 texCoord[3] = new Vector2f(1,1);
+
 ----
+
 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.
 
 
@@ -94,9 +110,13 @@ Remember that you must specify the vertices counter-clockwise.
 
 
 [source,java]
+
 ----
+
 int [] indexes = { 2,0,1, 1,3,2 };
+
 ----
+
 This syntax means:
 
 
@@ -105,12 +125,16 @@ This syntax means:
 *  The 1,3,2 triangle start at bottom right, continues top right, and ends at top left.
 
 [source]
+
 ----
+
 2\2--3
 | \  | Counter-clockwise
 |  \ |
 0--1\1
+
 ----
+
 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 “house shape has 5 vertices/indices and you'd specify three groups: `int [] indexes = { 2,0,1, 1,3,2, 2,3,4 };`.) 
 
 
@@ -133,12 +157,16 @@ You store the Mesh data in a buffer.
 .  To render the mesh in the scene, we need to pre-calculate the bounding volume of our new mesh: Call the `updateBound()` method on it.
 
 [source,java]
+
 ----
+
 mesh.setBuffer(Type.Position, 3, BufferUtils.createFloatBuffer(vertices));
 mesh.setBuffer(Type.TexCoord, 2, BufferUtils.createFloatBuffer(texCoord));
 mesh.setBuffer(Type.Index,    3, BufferUtils.createIntBuffer(indexes));
 mesh.updateBound();
+
 ----
+
 Our Mesh is ready! Now we want to see it.
 
 
@@ -149,14 +177,18 @@ We create a `com.jme3.scene.Geometry` and `com.jme3.material.Material`from our `
 
 
 [source,java]
+
 ----
+
 Geometry geo = new Geometry("OurMesh", mesh); // using our custom mesh object
 Material mat = new Material(assetManager, 
     "Common/MatDefs/Misc/Unshaded.j3md");
 mat.setColor("Color", ColorRGBA.Blue);
 geo.setMaterial(mat);
 rootNode.attachChild(geo);
+
 ----
+
 Library for assetManager?
 Ta-daa!
 
@@ -168,7 +200,9 @@ We created a quad Mesh it can be replace by a Quad such as :
 
 
 [source,java]
+
 ----
+
 Quad quad = new Quad(1,1); // replace the definition of Vertex and Textures Coordinates plus indexes
 Geometry geo = new Geometry("OurQuad", quad); // using Quad object
 Material mat = new Material(assetManager, 
@@ -176,16 +210,22 @@ Material mat = new Material(assetManager,
 mat.setColor("Color", ColorRGBA.Blue);
 geo.setMaterial(mat);
 rootNode.attachChild(geo);
+
 ----
+
 If you want to change the Textures Coordinates, in order to change the scale of the texture, use :
 
 
 [source,java]
+
 ----
+
 Quad quad = new Quad(1,1);
 quad.scaleTextureCoordinates(new Vector2f(width , height));
+
 ----
 
+
 == Dynamic Meshes
 
 If you are modifying a mesh dynamically in a way which changes the model's bounds, you need to update it:
@@ -213,32 +253,50 @@ Vertex coloring is a simple way of coloring meshes. Instead of just assigning on
 
 
 [source,java]
-----Geometry geo = new Geometry ("ColoredMesh", mesh); // using the custom mesh
+
+----
+Geometry geo = new Geometry ("ColoredMesh", mesh); // using the custom mesh
 Material matVC = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
-matVC.setBoolean("VertexColor", true);----
+matVC.setBoolean("VertexColor", true);
+----
+
 You create a float array color buffer:
 
 
 *  Assign 4 color values, RGBA, to each vertex.
 **  To loop over the 4 color values, use a color index 
 [source,java]
-----int colorIndex = 0;----
+
+----
+int colorIndex = 0;
+----
+
 
 *  The color buffer contains four color values for each vertex.
 **  The Quad in this example has 4 vertices. 
 [source,java]
-----float[] colorArray = new float[4*4];
+
+----
+float[] colorArray = new float[4*4];
+
 ----
+
 **  Tip: If your mesh has a different number of vertices, you would write: 
 [source,java]
-----float[] colorArray = new float[yourVertexCount * 4]----
+
+----
+float[] colorArray = new float[yourVertexCount * 4]
+----
+
 
 
 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. *Note that the color values in this example are arbitrarily chosen.* It'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'd assign meaningful values for the color buffer depending on which color you want your mesh to have.
 
 
 [source,java]
+
 ----
+
 // note: the red and green values are arbitray in this example
 for(int i = 0; i < 4; i++){
    // Red value (is increased by .2 on each next vertex here)
@@ -249,14 +307,20 @@ for(int i = 0; i < 4; i++){
    colorArray[colorIndex++]= 0.5f;
    // Alpha value (no transparency set here)
    colorArray[colorIndex++]= 1.0f;
-}----
+}
+----
+
 Next, set the color buffer. An RGBA color value contains four float components, thus the parameter `4`.
 
 
 [source,java]
-----mesh.setBuffer(Type.Color, 4, colorArray);
+
+----
+mesh.setBuffer(Type.Color, 4, colorArray);
 geo.setMaterial(matVC);
+
 ----
+
 When you run this code, you see a gradient color extending from each vertex.
 
 
@@ -267,11 +331,15 @@ The previous examples used the mesh together with the `Unshaded.j3md` material.
 
 
 [source,java]
+
 ----
+
 float[] normals = new float[12];
 normals = new float[]{0,0,1, 0,0,1, 0,0,1, 0,0,1};
 mesh.setBuffer(Type.Normal, 3, BufferUtils.createFloatBuffer(normals));
+
 ----
+
 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. 
 
 
@@ -285,7 +353,9 @@ Additionally to coloring the faces as just described, you can hide the faces and
 
 
 [source,java]
-----Geometry coloredMesh = new Geometry ("ColoredMesh", cMesh);
+
+----
+Geometry coloredMesh = new Geometry ("ColoredMesh", cMesh);
 ...
 mesh.setMode(Mesh.Mode.Points);
 mesh.setPointSize(10f);
@@ -295,7 +365,9 @@ Geometry points = new Geometry("Points", mesh);
 points.setMaterial(mat);
 rootNode.attachChild(points);
 rootNode.attachChild(geo);
+
 ----
+
 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'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.
 
 
@@ -313,10 +385,18 @@ In case however that your usecase requires the backfaces be visible, you have tw
 
 *  If you have a very simple scene, you can simply deactivate backface culling for this one mesh's material. 
 [source]
-----mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);----
+
+----
+mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);
+----
+
 *  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. 
 [source]
-----int[] indexes = { 2,0,1, 1,3,2, 2,3,1, 1,0,2 };----
+
+----
+int[] indexes = { 2,0,1, 1,3,2, 2,3,1, 1,0,2 };
+----
+
 '''
 
 See also: 

+ 57 - 13
src/docs/asciidoc/jme3/advanced/debugging.adoc

@@ -29,7 +29,9 @@ The coordinate axes (com.jme3.scene.debug.Arrow) help you see the cardinal direc
 
 
 [source,java]
+
 ----
+
 private void attachCoordinateAxes(Vector3f pos){
   Arrow arrow = new Arrow(Vector3f.UNIT_X);
   arrow.setLineWidth(4); // make arrow thicker
@@ -52,7 +54,9 @@ private Geometry putShape(Mesh shape, ColorRGBA color){
   g.setMaterial(mat);
   rootNode.attachChild(g);
   return g;
-}----
+}
+----
+
 
 === Wireframe Grid
 
@@ -60,7 +64,9 @@ Use a wireframe grid (com.jme3.scene.debug.Grid) as a ruler or simple floor.
 
 
 [source,java]
+
 ----
+
 private Geometry attachGrid(Vector3f pos, float size, ColorRGBA color){
   Geometry g = new Geometry("wireframe grid", new Grid(size, size, 0.2f) );
   Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
@@ -70,7 +76,9 @@ private Geometry attachGrid(Vector3f pos, float size, ColorRGBA color){
   g.center().move(pos);
   rootNode.attachChild(g);
   return g;
-}----
+}
+----
+
 
 === Wireframe Cube
 
@@ -78,7 +86,9 @@ Use a wireframe cube (com.jme3.scene.debug.WireBox) as a stand-in object to see
 
 
 [source,java]
+
 ----
+
 public Geometry attachWireBox(Vector3f pos, float size, ColorRGBA color){
   Geometry g = new Geometry("wireframe cube", new WireBox(size, size, size));
   Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
@@ -88,7 +98,9 @@ public Geometry attachWireBox(Vector3f pos, float size, ColorRGBA color){
   g.setLocalTranslation(pos);
   rootNode.attachChild(g);
   return g;
-}----
+}
+----
+
 
 === Wireframe Sphere
 
@@ -96,7 +108,9 @@ Use a wireframe sphere (com.jme3.scene.debug.WireSphere) as a stand-in object to
 
 
 [source,java]
+
 ----
+
 private Geometry attachWireSphere(Vector3f pos, float size, ColorRGBA color){
   Geometry g = new Geometry("wireframe sphere", new WireSphere(size));
   Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
@@ -106,7 +120,9 @@ private Geometry attachWireSphere(Vector3f pos, float size, ColorRGBA color){
   g.setLocalTranslation(pos);
   rootNode.attachChild(g);
   return g;
-}----
+}
+----
+
 
 == Wireframe for Physics
 
@@ -114,7 +130,11 @@ You can display a wireframe of the (usually invisible) collision shape around al
 
 
 [source,java]
-----physicsSpace.enableDebug(assetManager);----
+
+----
+physicsSpace.enableDebug(assetManager);
+----
+
 With debugging enabled, colors are used to indicate various types of physical objects:
 
 
@@ -131,14 +151,18 @@ Making the skeleton visible inside animated models can be handy for debugging an
 
 
 [source,java]
+
 ----
+
      SkeletonDebugger skeletonDebug = 
          new SkeletonDebugger("skeleton", control.getSkeleton());
      Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
      mat.setColor("Color", ColorRGBA.Green);
      mat.getAdditionalRenderState().setDepthTest(false);
      skeletonDebug.setMaterial(mat);
-     player.attachChild(skeletonDebug);----
+     player.attachChild(skeletonDebug);
+----
+
 
 == Example: Toggle Wireframe on Model
 
@@ -150,11 +174,17 @@ Then you can add a switch to toggle the model's wireframe on and off, like this:
 
 .  Create a key input trigger that switches between the two materials: E.g. we toggle when the T key is pressed: 
 [source,java]
-----    inputManager.addMapping("toggle wireframe", new KeyTrigger(KeyInput.KEY_T));
-    inputManager.addListener(actionListener, "toggle wireframe");----
+
+----
+    inputManager.addMapping("toggle wireframe", new KeyTrigger(KeyInput.KEY_T));
+    inputManager.addListener(actionListener, "toggle wireframe");
+----
+
 .  Now add the toggle action to the action listener 
 [source,java]
+
 ----
+
   private ActionListener actionListener = new ActionListener() {
     @Override
     public void onAction(String name, boolean pressed, float tpf) {
@@ -165,10 +195,14 @@ Then you can add a switch to toggle the model's wireframe on and off, like this:
       }
       // else ... other input tests.
     }
-  };----
+  };
+----
+
 .  Alternatively you could traverse over the whole scene and toggle for all Geometry objects in there if you don't want to create a new SceneProcessor 
 [source,java]
+
 ----
+
   private ActionListener actionListener = new ActionListener() {
     boolean wireframe = false; 
     
@@ -186,7 +220,9 @@ Then you can add a switch to toggle the model's wireframe on and off, like this:
       }
       // else ... other input tests.
     }
-  };----
+  };
+----
+
 
 TIP :: To set the line width of wireframe display, use mesh.setLineWidth(lineWidth). Default line width is 1.
 
@@ -198,7 +234,9 @@ To display the wireframe of the entire scene instead on one material at a time,
 
 
 [source,java]
-----public class WireProcessor implements SceneProcessor {    
+
+----
+public class WireProcessor implements SceneProcessor {    
     
     RenderManager renderManager;
     Material wireMaterial;
@@ -236,12 +274,18 @@ To display the wireframe of the entire scene instead on one material at a time,
         renderManager.setForcedMaterial(null);
     }
     
-}----
+}
+----
+
 Then attach the scene processor to the +++<abbr title="Graphical User Interface">GUI</abbr>+++ Viewport.
 
 
 [source,java]
-----getViewPort().addProcessor(new WireProcessor());----
+
+----
+getViewPort().addProcessor(new WireProcessor());
+----
+
 
 == See also
 

+ 12 - 0
src/docs/asciidoc/jme3/advanced/effects_overview.adoc

@@ -16,7 +16,9 @@ jME3 supports several types of special effects: Post-Processor Filters, ScenePro
 === Particle Emitter
 
 [source,java]
+
 ----
+
 public class MyGame extends SimpleApplication {
   public void simpleInitApp() {
     ParticleEmitter pm = new ParticleEmitter("my particle effect", Type.Triangle, 60);
@@ -28,12 +30,16 @@ public class MyGame extends SimpleApplication {
     rootNode.attachChild(pm); // attach one or more emitters to any node
   }
 }
+
 ----
 
+
 === Scene Processor
 
 [source,java]
+
 ----
+
 public class MyGame extends SimpleApplication {
     private BasicShadowRenderer bsr;
     
@@ -42,12 +48,16 @@ public class MyGame extends SimpleApplication {
         bsr.setDirection(new Vector3f(.3f, -0.5f, -0.5f));
         viewPort.addProcessor(bsr); // add one or more sceneprocessor to viewport
     }
+
 ----
 
+
 === Post-Processor Filter
 
 [source,java]
+
 ----
+
 public class MyGame extends SimpleApplication {
     private FilterPostProcessor fpp; // one FilterPostProcessor per app
     private SomeFilter sf;           // one or more Filters per app
@@ -59,8 +69,10 @@ public class MyGame extends SimpleApplication {
         sf = new SomeFilter();
         fpp.addFilter(sf);  // add one or more Filters to FilterPostProcessor
     }
+
 ----
 
+
 == Water
 
 

+ 4 - 0
src/docs/asciidoc/jme3/advanced/fade.adoc

@@ -16,7 +16,9 @@ The effect uses com.jme3.post.FilterPostProcessor and com.jme3.post.filters.Fade
 .  Add the FilterPostProcessor to the default viewPort.
 
 [source,java]
+
 ----
+
 private FilterPostProcessor fpp;
 private FadeFilter fade;
 public void simpleInitApp() {
@@ -27,8 +29,10 @@ public void simpleInitApp() {
   viewPort.addProcessor(fpp);
   ...
 }
+
 ----
 
+
 == Fading in and out
 
 Now call the `fade.fadeIn()` and `fade.fadeOut()` methods to trigger the effect.

+ 10 - 2
src/docs/asciidoc/jme3/advanced/headless_server.adoc

@@ -26,11 +26,15 @@ First, let's take a look at the default way of creating a new game (in its simpl
 
 
 [source,java]
+
 ----
+
 public static void main(String[] args) {
   Application app = new Main();
   app.start();
-}----
+}
+----
+
 
 == Headless Server Code
 
@@ -38,14 +42,18 @@ Now, with a simple change you can start your game in Headless mode. This means t
 
 
 [source,java]
+
 ----
+
 import com.jme3.system.JmeContext;
 import com.jme3.system.JmeContext.Type;
 
 public static void main(String[] args) {
   Application app = new Main();
   app.start(JmeContext.Type.Headless);
-}----
+}
+----
+
 
 == Next steps
 

+ 28 - 4
src/docs/asciidoc/jme3/advanced/hinges_and_joints.adoc

@@ -37,14 +37,18 @@ The hookNode is the fixed point from which the pendulum hangs. It has no mass.
 
 
 [source,java]
+
 ----
+
 Node hookNode=PhysicsTestHelper.createPhysicsTestNode(
     assetManager, new BoxCollisionShape(new Vector3f( .1f, .1f, .1f)),0);
 hookNode.getControl(RigidBodyControl.class).setPhysicsLocation(new Vector3f(0f,0,0f));
 
 rootNode.attachChild(hookNode);
 getPhysicsSpace().add(hookNode);
+
 ----
+
 For a rope bridge, there would be two fixed nodes where the bridge is attached to the mountainside.
 
 
@@ -55,13 +59,17 @@ The pendulumNode is the dynamic part of the construction. It has a mass.
 
 
 [source,java]
+
 ----
+
 Node pendulumNode=PhysicsTestHelper.createPhysicsTestNode(
     assetManager, new BoxCollisionShape(new Vector3f( .3f, .3f, .3f)),1);
 pendulumNode.getControl(RigidBodyControl.class).setPhysicsLocation(new Vector3f(0f,-1,0f));
 rootNode.attachChild(pendulumNode);
 getPhysicsSpace().add(pendulumNode);
+
 ----
+
 For a rope bridge, each set of planks would be one dynamic node. 
 
 
@@ -94,7 +102,9 @@ You create the HingeJoint after you have created the nodes that are to be chaine
 
 
 [source,java]
+
 ----
+
 private HingeJoint joint;
 ...
   public void simpleInitApp() {
@@ -108,7 +118,9 @@ private HingeJoint joint;
                      new Vector3f(0f, 1f, 0f),  // pivot point local to B 
                      Vector3f.UNIT_Z,           // DoF Axis of A (Z axis)
                      Vector3f.UNIT_Z  );        // DoF Axis of B (Z axis)
+
 ----
+
 The pivot point's position will be at `(0,0,0)` in the global 3D space. In A's local space that is at `(0,0,0)` and in B's local space (remember B's position was set to `(0,-1,0)`) that is at `(0,1,0)`.
 
 
@@ -127,7 +139,11 @@ Remember to add all joint objects to the physicsSpace, just like you would do wi
 
 
 [source,java]
-----bulletAppState.getPhysicsSpace().add(joint);----
+
+----
+bulletAppState.getPhysicsSpace().add(joint);
+----
+
 *Tip:* If you want the joint to be visible, attach a geometry to the dynamic node, and translate it to its start position.
 
 
@@ -144,8 +160,12 @@ The method to call on the joint is `enableMotor()`.
 
 
 [source,java]
-----joint.enableMotor(true, 1, .1f);
-joint.enableMotor(true, -1, .1f);----
+
+----
+joint.enableMotor(true, 1, .1f);
+joint.enableMotor(true, -1, .1f);
+----
+
 .  Switch the motor on by supplying `true`
 .  Specify the velocity with which the joint should rotate around the specified axis. 
 **  Use positive and negative numbers to change direction.
@@ -156,4 +176,8 @@ When you disable the motor, the chained nodes are exposed to gravity again:
 
 
 [source,java]
-----joint.enableMotor(false, 0, 0);----<tags><tag target="documentation" /><tag target="physics" /><tag target="joint" /></tags>
+
+----
+joint.enableMotor(false, 0, 0);
+----
+<tags><tag target="documentation" /><tag target="physics" /><tag target="joint" /></tags>

+ 26 - 6
src/docs/asciidoc/jme3/advanced/hud.adoc

@@ -69,7 +69,11 @@ The BitmapTexts and Pictures appear as 2 dimensional element on the screen.
 
 
 [source,java]
-----setDisplayStatView(false); setDisplayFps(false);----
+
+----
+setDisplayStatView(false); setDisplayFps(false);
+----
+
 
 
 
@@ -80,13 +84,17 @@ A simple image can be displayed using `com.jme3.ui.Picture`.
 
 
 [source,java]
-----Picture pic = new Picture("HUD Picture");
+
+----
+Picture pic = new Picture("HUD Picture");
 pic.setImage(assetManager, "Textures/ColoredTex/Monkey.png", true);
 pic.setWidth(settings.getWidth()/2);
 pic.setHeight(settings.getHeight()/2);
 pic.setPosition(settings.getWidth()/4, settings.getHeight()/4);
 guiNode.attachChild(pic);
+
 ----
+
 When you set the last boolean in setImage() to true, the alpha channel of your image is rendered transparent/translucent.
 
 
@@ -97,20 +105,28 @@ You use `com.jme3.font.BitmapText` to display text on the screen.
 
 
 [source,java]
+
 ----
+
 BitmapText hudText = new BitmapText(guiFont, false);          
 hudText.setSize(guiFont.getCharSet().getRenderedSize());      // font size
 hudText.setColor(ColorRGBA.Blue);                             // font color
 hudText.setText("You can write any string here");             // the text
 hudText.setLocalTranslation(300, hudText.getLineHeight(), 0); // position
 guiNode.attachChild(hudText);
+
 ----
+
 The BitmapFont object `guiFont` is a default font provided by SimpleApplication. Copy you own fonts as .fnt plus .png files into the `assets/Interface/Fonts` directory and load them like this:
 
 
 [source]
-----BitmapFont myFont = assetManager.loadFont("Interface/Fonts/Console.fnt");
-hudText = new BitmapText(myFont, false);----
+
+----
+BitmapFont myFont = assetManager.loadFont("Interface/Fonts/Console.fnt");
+hudText = new BitmapText(myFont, false);
+----
+
 
 === Positioning HUD Elements
 
@@ -134,13 +150,17 @@ Use the update loop to keep the content up-to-date.
 
 
 [source,java]
-----public void simpleUpdate(float tpf) {
+
+----
+public void simpleUpdate(float tpf) {
   ...
   hudText.setText("Score: " + score);
   ...
   picture.setImage(assetManager, "Interface/statechange.png", true);
   ...
-}----
+}
+----
+
 
 == Advanced HUD: Nifty GUI
 

+ 44 - 8
src/docs/asciidoc/jme3/advanced/input_handling.adoc

@@ -125,7 +125,11 @@ In your IDE, use code completion to quickly look up Trigger literals. In the jMo
 == 2. Remove Default Trigger Mappings
 
 [source]
-----inputManager.deleteMapping( SimpleApplication.INPUT_MAPPING_MEMORY );----[cols="3", options="header"]
+
+----
+inputManager.deleteMapping( SimpleApplication.INPUT_MAPPING_MEMORY );
+----
+[cols="3", options="header"]
 |===
 
 a|Default Mapping
@@ -160,23 +164,31 @@ Give the mapping a meaningful name. The name should reflect the action, not the
 
 
 [source,java]
+
 ----
+
 inputManager.addMapping("Pause Game", new KeyTrigger(KeyInput.KEY_P));
 inputManager.addMapping("Rotate",     new KeyTrigger(KeyInput.KEY_SPACE));
 ...
+
 ----
+
 There are cases where you may want to provide more then one trigger for one action. For example, some users prefer the WASD keys to navigate, while others prefer the arrow keys. Add several triggers for one mapping, by separating the Trigger objects with commas:
 
 
 [source,java]
+
 ----
+
 inputManager.addMapping("Left",  new KeyTrigger(KeyInput.KEY_A), 
                                  new KeyTrigger(KeyInput.KEY_LEFT)); // A and left arrow
 inputManager.addMapping("Right", new KeyTrigger(KeyInput.KEY_D), 
                                  new KeyTrigger(KeyInput.KEY_RIGHT)); // D and right arrow
                                  ...
+
 ----
 
+
 == 4. Create Listeners
 
 The jME3 input manager supports two types of event listeners for inputs: AnalogListener and ActionListener. You can use one or both listeners in the same application. Add one or both of the following code snippets to your main SimpleApplication-based class to activate the listeners.
@@ -202,12 +214,16 @@ The jME3 input manager supports two types of event listeners for inputs: AnalogL
 *  
 
 [source,java]
+
 ----
+
 private ActionListener actionListener = new ActionListener() {
   public void onAction(String name, boolean keyPressed, float tpf) {
      /** TODO: test for mapping names and implement actions */
   }
-};----
+};
+----
+
 
 === AnalogListener
 
@@ -224,12 +240,16 @@ private ActionListener actionListener = new ActionListener() {
 
 
 [source,java]
+
 ----
+
 private AnalogListener analogListener = new AnalogListener() {
   public void onAnalog(String name, float keyPressed, float tpf) {
      /** TODO: test for mapping names and implement actions */
   }
-};----
+};
+----
+
 
 == 4. Register Mappings to Listeners
 
@@ -240,12 +260,20 @@ In the following example, you register the “Pause Game mapping to the `actionL
 
 
 [source,java]
-----inputManager.addListener(actionListener, new String[]{"Pause Game"});----
+
+----
+inputManager.addListener(actionListener, new String[]{"Pause Game"});
+----
+
 In the following example, you register navigational mappings to the `analogListener` object, because walking is a continuous action. Players typically keep the key pressed to express continuity, for example when they want to “walk on or “accelerate.
 
 
 [source,java]
-----inputManager.addListener(analogListener, new String[]{"Left", "Right"});----
+
+----
+inputManager.addListener(analogListener, new String[]{"Left", "Right"});
+----
+
 As you see, you can add several listeners in one String array. You can call the addListener() method more than once, each time with a subset of your list, if that helps you keep you code tidy. Again, the Listeners do not care about actual which keys are configured, you only register named trigger mappings.
 
 
@@ -271,7 +299,9 @@ In the most common case, you want an action to be triggered once, in the moment
 
 
 [source,java]
-----private ActionListener actionListener = new ActionListener() {
+
+----
+private ActionListener actionListener = new ActionListener() {
     public void onAction(String name, boolean keyPressed, float tpf) {
 
       if (name.equals("Pause Game") && !keyPressed) { // test?
@@ -282,15 +312,19 @@ In the most common case, you want an action to be triggered once, in the moment
 
     }
   };
+
 ----
 
+
 === AnalogListener
 
 The following example shows how you define actions with an AnalogListener. These actions are triggered continuously, as long (intensity `value`) as the named key or mouse button is down. Use this listeners for semi-automatic weapons and navigational actions.
 
 
 [source,java]
-----private AnalogListener analogListener = new AnalogListener() {
+
+----
+private AnalogListener analogListener = new AnalogListener() {
     public void onAnalog(String name, float value, float tpf) {
 
       if (name.equals("Rotate")) {         // test?
@@ -300,7 +334,9 @@ The following example shows how you define actions with an AnalogListener. These
       if ...
 
     }
-  };----
+  };
+----
+
 
 == Let Users Remap Keys
 

+ 29 - 1
src/docs/asciidoc/jme3/advanced/j3m_material_files.adoc

@@ -15,7 +15,9 @@ If you want to colorize simple shapes (one texture all around), then .j3m are th
 .  Place the file in your project's `assets/Materials/` directory, e.g. `MyGame/src/assets/Materials/SimpleBump.j3m`
 .  Edit the file and add content using the following Syntax, e.g.:
 [source]
+
 ----
+
 Material shiny bumpy rock : Common/MatDefs/Light/Lighting.j3md {
      MaterialParameters {
          Shininess: 8.0
@@ -26,8 +28,10 @@ Material shiny bumpy rock : Common/MatDefs/Light/Lighting.j3md {
          Specular : 0.0 0.0 0.0 1.0
      }
 }
+
 ----
 
+
 How to this file is structured:
 
 
@@ -51,7 +55,11 @@ This is how you use the prepared .j3m Material on a Spatial. Since you have save
 
 
 [source,java]
-----myGeometry.setMaterial(assetManager.loadMaterial("Materials/SimpleBump.j3m"));----
+
+----
+myGeometry.setMaterial(assetManager.loadMaterial("Materials/SimpleBump.j3m"));
+----
+
 *Tip:* In the jMonkeyEngine SDK, open Windows&gt;Palette and drag the `JME Material: Set J3M` snippet into your code.
 
 
@@ -232,19 +240,25 @@ a| Enable point sprite rendering for point meshes
 === Example 1: Shiny
 
 [source,java]
+
 ----
+
 Spatial signpost = (Spatial) assetManager.loadAsset(
     new OgreMeshKey("Models/Sign Post/Sign Post.mesh.xml", null));
 signpost.setMaterial( assetManager.loadMaterial(
     new AssetKey("Models/Sign Post/Sign Post.j3m")));
 TangentBinormalGenerator.generate(signpost);
 rootNode.attachChild(signpost);
+
 ----
+
 The file `assets/Models/Sign Post/Sign Post.j3m` contains:
 
 
 [source]
+
 ----
+
 Material Signpost : Common/MatDefs/Light/Lighting.j3md {
     MaterialParameters {
          Shininess: 4.0
@@ -257,7 +271,9 @@ Material Signpost : Common/MatDefs/Light/Lighting.j3md {
          Specular : 1.0 1.0 1.0 1.0
     }
 }
+
 ----
+
 The JPG files are in the same directory, `assets/Models/Sign Post/…`.
 
 
@@ -265,18 +281,24 @@ The JPG files are in the same directory, `assets/Models/Sign Post/…`.
 === Example 2: Repeating Texture
 
 [source,java]
+
 ----
+
 Material mat = assetManager.loadMaterial(
     "Textures/Terrain/Pond/Pond.j3m");
 mat.setColor("Ambient", ColorRGBA.DarkGray);
 mat.setColor("Diffuse", ColorRGBA.White);
 mat.setBoolean("UseMaterialColors", true);
+
 ----
+
 The file `assets/Textures/Terrain/Pond/Pond.j3m` contains:
 
 
 [source]
+
 ----
+
 Material Pong Rock : Common/MatDefs/Light/Lighting.j3md {
      MaterialParameters {
          Shininess: 8.0
@@ -284,7 +306,9 @@ Material Pong Rock : Common/MatDefs/Light/Lighting.j3md {
          NormalMap:  Repeat Textures/Terrain/Pond/Pond_normal.png
      }
 }
+
 ----
+
 The PNG files are in the same directory, `assets/Textures/Terrain/Pond/`
 
 
@@ -295,7 +319,9 @@ The file `assets/Models/Tree/Leaves.j3m` contains:
 
 
 [source]
+
 ----
+
 Material Leaves : Common/MatDefs/Light/Lighting.j3md {
 
     Transparent On
@@ -316,7 +342,9 @@ Material Leaves : Common/MatDefs/Light/Lighting.j3md {
         FaceCull Off
     }
 }
+
 ----
+
 The PNG file is in the same directory, `assets/Models/Tree/…`
 
 

+ 56 - 0
src/docs/asciidoc/jme3/advanced/jme3_shadernodes.adoc

@@ -71,7 +71,9 @@ global structure should look like this :+
 
 
 [source,java]
+
 ----
+
 ShaderNodeDefinitions{
       ShaderNodeDefinition <NodeDefName>{
             Type : <ShaderType> 
@@ -97,7 +99,9 @@ ShaderNodeDefinitions{
       }]
       [...]
 }
+
 ----
+
 All that is not between [] is mandatory.+
 
 
@@ -135,7 +139,9 @@ Here is a typical shader node definition
 
 
 [source,java]
+
 ----
+
 ShaderNodeDefinitions{
      ShaderNodeDefinition LightMapping{
         Type: Fragment
@@ -157,8 +163,10 @@ ShaderNodeDefinitions{
         }
     }   
 }    
+
 ----
 
+
 ==== Declare an array
 
 To declare an array you have to specify its size between square brackets.+
@@ -171,9 +179,13 @@ _Example_
 
 
 [source]
+
 ----
+
       float myArray[10]
+
 ----
+
 this will declare a float array with 10 elements.
 Any material parameter mapped with this array should be of FloatArray type and it's size will be assumed as 10 when the shader is generated.+
 
@@ -187,9 +199,13 @@ _Example_
 
 
 [source]
+
 ----
+
      float myArray[NumberOfElements]
+
 ----
+
 This declares a float array with the size depending on the value of the NumberOfElement material parameter.+
 
 NumberOfElement *HAS* to be declared in the material definition as a material parameter. It will be mapped to a define and used in the shader.
@@ -211,11 +227,15 @@ Here is a the code of the LightMap.frag shader.+
 
 
 [source,java]
+
 ----
+
 void main(){
     color *= texture2D(lightMap, texCoord);
 }
+
 ----
+
 Very simple, it's just a texture fetch, but of course anything can be done.+
 
 *Do not declare uniforms, attributes or varyings in a shader node code*, the Generator will handle this, just use the inputs and outputs and optional local variables you may need.
@@ -234,7 +254,9 @@ Here is how a ShaderNode declaration should look :
 
 
 [source,java]
+
 ----
+
 ShaderNode <ShaderNodeName>{
      Definition : <DefinitionName> [: <DefinitionPath>]
      [Condition : <ActivationCondition>]
@@ -247,7 +269,9 @@ ShaderNode <ShaderNodeName>{
           [...]
      }]
 }
+
 ----
+
 *  +++<u>ShaderNode</u>+++ the shader node block
 **  *ShaderNodeName* the name of this shader node, can be anything, but has to be *unique* in the shader scope
 
@@ -264,11 +288,15 @@ ShaderNode <ShaderNodeName>{
 
 
 [source,java]
+
 ----
+
         #if defined(COLOR) || defined(COLORMAP)
             ...
         #endif
+
 ----
+
 *  +++<u>InputMapping</u>+++ the wiring of the inputs of this node, coming from previous node's outputs or from built in glsl inputs.
 **  *InputVariableName* : the name of the variable to map as declared in the definition.
 **  *Swizzle* : Swizling for the preceding variable. More information on glsl swizzling on this page link:http://www.opengl.org/wiki/GLSL_Type[http://www.opengl.org/wiki/GLSL_Type]
@@ -297,7 +325,9 @@ Here is an example of a very simple Material definition that just displays a sol
 
 
 [source,java]
+
 ----
+
 MaterialDef Simple {
     MaterialParameters {
         Color Color
@@ -332,7 +362,9 @@ MaterialDef Simple {
         }
     }
 }
+
 ----
+
 This Material definition has one Default technique with 2 node declarations.+
 
 +++<u>*CommonVert Definition*</u>++++
@@ -342,7 +374,9 @@ here is the definition content (Common/MatDefs/ShaderNodes/Common/CommonVert.j3s
 
 
 [source,java]
+
 ----
+
 ShaderNodesDefinitions {
     ShaderNodeDefinition CommonVert {
         Type: Vertex
@@ -375,17 +409,23 @@ ShaderNodesDefinitions {
         }
     }
 }
+
 ----
 
+
 here is the shader Node code ( Common/MatDefs/ShaderNodes/Common/commonVert.vert)
 
 
 [source,java]
+
 ----
+
 void main(){
     projPosition = worldViewProjectionMatrix * vec4(modelPosition, 1.0);
 }
+
 ----
+
 As you can see all the inputs and outputs are not used. that's because most of them are attributes meant to be passed to the fragment shader as varyings. all the wiring will be handled by the generator only if those variables are used in an input or output mapping.+
 
 
@@ -414,7 +454,9 @@ here is the definition content (Common/MatDefs/ShaderNodes/Basic/ColorMult.j3sn)
 
 
 [source,java]
+
 ----
+
 ShaderNodeDefinitions{
     ShaderNodeDefinition ColorMult {      
         Type: Fragment
@@ -434,16 +476,22 @@ ShaderNodeDefinitions{
         }
     }
 }
+
 ----
+
 here is the shader Node code (Common/MatDefs/ShaderNodes/Basic/colorMult.frag)
 
 
 [source,java]
+
 ----
+
 void main(){
     outColor = color1 * color2;
 }
+
 ----
+
 +++<u>*ColorMult input mapping*</u>++++
 
 All inputs are mapped here :
@@ -469,8 +517,10 @@ Vertex Shader (glsl 1.0)
 
 
 [source,java]
+
 ----
 
+
 uniform mat4 g_WorldViewProjectionMatrix;
 
 attribute vec4 inPosition;
@@ -491,7 +541,9 @@ void main(){
 
         gl_Position = Global_position;
 }
+
 ----
+
 All materials parameter, world parameters, attributes varying are declared first. then for each shader node, the declarative part is appended.+
 
 For the main function, for each shader node, the input mappings are declared and assigned, the output are declared.+
@@ -510,8 +562,10 @@ Fragment Shader (glsl 1.0)
 
 
 [source,java]
+
 ----
 
+
 uniform vec4 m_Color;
 
 void main(){
@@ -527,7 +581,9 @@ void main(){
 
         gl_FragColor = Global_color;
 }
+
 ----
+
 Same as for the Vertex shader. note that the color1 is not declared, because it's directly replaced by the material parameter.
 
 

+ 48 - 0
src/docs/asciidoc/jme3/advanced/jme3_shaders.adoc

@@ -74,7 +74,9 @@ Vertex Shader : +
 
 
 [source,java]
+
 ----
+
 //the global uniform World view projection matrix
 //(more on global uniforms below)
 uniform mat4 g_WorldViewProjectionMatrix;
@@ -90,20 +92,26 @@ void main(){
     //The multiplication must be done in this order.
     gl_Position = g_WorldViewProjectionMatrix * vec4(inPosition, 1.0);
 }
+
 ----
+
 Fragment Shader : +
 
 
 
 [source,java]
+
 ----
+
 void main(){
     //returning the color of the pixel (here solid blue)
     //- gl_FragColor is the standard GLSL variable that holds the pixel
     //color. It must be filled in the Fragment Shader.
     gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0);
 }
+
 ----
+
 For example applying this shader to a sphere would render a solid blue sphere on screen.+
 
 +
@@ -124,7 +132,9 @@ For example let’s have a look at the SolidColor.j3md file : +
 
 
 [source,java]
+
 ----
+
 MaterialDef Solid Color {
     //This is the complete list of user defined uniforms to be used in the
     //shaders
@@ -145,7 +155,9 @@ MaterialDef Solid Color {
     Technique FixedFunc {
     }
 }
+
 ----
+
 For more information on JME3 material system, i suggest you read this link:http://jmonkeyengine.org/groups/development-discussion-jme3/forum/topic/jmonkeyengine3-material-system-full-explanation[topic].+
 
 +
@@ -213,12 +225,16 @@ Any uniform has to be declared in the material definition file (.j3md) in the 
 
 
 [source,java]
+
 ----
+
     MaterialParameters {
         Vector4 Color
         Texture2D ColorMap
     }
+
 ----
+
 You can also pass some define to your vertex/fragment programs to know if an uniform as been declared. +
 
 You simply add it in the Defines section of your Technique in the definition file. +
@@ -226,11 +242,15 @@ You simply add it in the Defines section of your Technique in the definition fil
 
 
 [source,java]
+
 ----
+
     Defines {
         COLORMAP : ColorMap
     }
+
 ----
+
 For integer and floating point parameters, the define will contain the value that was set.+
 
 For all other types of parameters, the value 1 is defined.+
@@ -245,10 +265,14 @@ there are setXXXX methods for any type of uniform you want to pass.+
 
 
 [source,java]
+
 ----
+
    material.setColor("Color", new ColorRGBA(1.0f, 0.0f, 0.0f, 1.0f); // red color
    material.setTexture("ColorMap", myTexture); // bind myTexture for that sampler uniform
+
 ----
+
 To use this uniform in the shader, you need to declare it in the .frag or .vert files (depending on where you need it).
 You can make use of the defines here and later in the code:
 *Note that the “m_ prefix specifies that the uniform is a material parameter.*+
@@ -256,12 +280,16 @@ You can make use of the defines here and later in the code:
 
 
 [source,java]
+
 ----
+
    uniform vec4 m_Color;
    #ifdef COLORMAP
      uniform sampler2D m_ColorMap;
    #endif
+
 ----
+
 The uniforms will be populated at runtime with the value you sent.
 
 
@@ -286,41 +314,57 @@ We need to pass 2 new parameters to the Lighting.j3md definition, MaterialParame
 
 
 [source,java]
+
 ----
+
 // Keying Map
 Texture2D KeyMap
 
 // Key Color 
 Color KeyColor
+
 ----
+
 Below, add a new Define in the main Technique section:
 
 
 [source,java]
+
 ----
+
 KEYMAP : KeyMap
+
 ----
+
 In the Lighting.frag file, define the new uniforms:
 
 
 [source,java]
+
 ----
+
 #ifdef KEYMAP
   uniform sampler2D m_KeyMap;
   uniform vec4 m_KeyColor;
 #endif
+
 ----
+
 Further, when obtaining the diffuseColor from the DiffuseMap texture, check
 if we need to blend it:
 
 
 [source,java]
+
 ----
+
     #ifdef KEYMAP
       vec4 keyColor = texture2D(m_KeyMap, newTexCoord);
       diffuseColor.rgb = (1.0-keyColor.a) * diffuseColor.rgb + keyColor.a * m_KeyColor.rgb;
     #endif
+
 ----
+
 This way, a transparent pixel in the KeyMap texture doesn't modify the color. +
 
 A black pixel replaces it for the m_KeyColor and values in between are blended.+
@@ -340,14 +384,18 @@ A result preview can be seen here: link:http://wstaw.org/m/2011/10/24/plasma-des
 *  That’s it!!
 
 [source,java]
+
 ----
+
     // A cube
     Box box= new Box(Vector3f.ZERO, 1f,1f,1f);
     Geometry cube = new Geometry("box", box);
     Material mat = new Material(assetManager,"Path/To/My/materialDef.j3md");
     cube.setMaterial(mat);
     rootNode.attachChild(cube);
+
 ----
+
 +
 
 

+ 18 - 2
src/docs/asciidoc/jme3/advanced/jme3_srgbpipeline.adoc

@@ -72,11 +72,15 @@ use this in the main() method of your application :
 
 
 [source,java]
+
 ----
+
 AppSettings settings = new AppSettings(true);
 settings.setGammaCorrection(true);
 app.setSettings(settings);
+
 ----
+
 This setting is also exposed in the Settings dialog displayed when you launch a jME application.+
 
 image:http///i.imgur.com/Lya1ldH.png[Lya1ldH.png,with="400",height=""]
@@ -93,7 +97,11 @@ You can enable or disable the Gamma correction of the rendered output by using
 
 
 [source,java]
-----renderer.setMainFrameBufferSrgb(boolean srgb)----
+
+----
+renderer.setMainFrameBufferSrgb(boolean srgb)
+----
+
 This will be ignored if the hardware doesn't have the GL_ARB_framebuffer_sRGB or the GL_EXT_texture_sRGB.
 This can be toggled at run time.
 
@@ -112,7 +120,11 @@ You can enable or disable texture linearization by using
 
 
 [source,java]
-----renderer.setLinearizeSrgbImages(boolean linearize)----
+
+----
+renderer.setLinearizeSrgbImages(boolean linearize)
+----
+
 This will be ignored if the hardware doesn't have the GL_ARB_framebuffer_sRGB or the GL_EXT_texture_sRGB.
 
 
@@ -163,10 +175,14 @@ For example here is how the NormalMap parameter is declared in the lighting mate
 
 
 [source]
+
 ----
+
  // Normal map
  Texture2D NormalMap -LINEAR
+
 ----
+
 When a texture is assigned to this material param by using material.setTexture(“NormalMap, myNormalTexture), the color space of this texture's image will be forced to linear. 
 So if you make your own material and want to use Gamma Correction, make sure you properly mark your textures as in the proper color space.
 

+ 18 - 6
src/docs/asciidoc/jme3/advanced/level_of_detail.adoc

@@ -100,8 +100,12 @@ The `jme3tools.optimize.LodGenerator` utility class helps you generate LODs for
 
 
 [source,java]
-----LodGenerator lod = new LodGenerator(geometry);
-lod.bakeLods(reductionMethod,reductionValue);----
+
+----
+LodGenerator lod = new LodGenerator(geometry);
+lod.bakeLods(reductionMethod,reductionValue);
+----
+
 The LODs are stored inside the Geometry object. 
 
 
@@ -109,8 +113,12 @@ The LODs are stored inside the Geometry object.
 
 
 [source,java]
-----LodGenerator lod = new LodGenerator(myPrettyGeo);
-lod.bakeLods(LodGenerator.TriangleReductionMethod.PROPORTIONAL,0.5f);----
+
+----
+LodGenerator lod = new LodGenerator(myPrettyGeo);
+lod.bakeLods(LodGenerator.TriangleReductionMethod.PROPORTIONAL,0.5f);
+----
+
 
 == Activate the LOD Control
 
@@ -118,9 +126,13 @@ After generating the LODs for the geometry, you create and add a `com.jme3.scene
 
 
 [source,java]
-----LodControl lc = new LodControl();
+
+----
+LodControl lc = new LodControl();
 myPrettyGeo.addControl(lc);
-rootNode.attachChild(myPrettyGeo);----
+rootNode.attachChild(myPrettyGeo);
+----
+
 The LodControl internally gets the camera from the game's viewport to calculate the distance to this geometry. Depending on the distance, the LodControl selects an appropriate level of detail, and passes more (or less) detailed vertex data to the renderer. 
 
 

+ 45 - 9
src/docs/asciidoc/jme3/advanced/light_and_shadow.adoc

@@ -57,11 +57,15 @@ A PointLight has a location and shines from there in all directions as far as it
 
 
 [source,java]
-----PointLight lamp_light = new PointLight();
+
+----
+PointLight lamp_light = new PointLight();
 lamp_light.setColor(ColorRGBA.Yellow);
 lamp_light.setRadius(4f);
 lamp_light.setPosition(new Vector3f(lamp_geo.getLocalTranslation()));
-rootNode.addLight(lamp_light);----
+rootNode.addLight(lamp_light);
+----
+
 
 === DirectionalLight
 
@@ -77,10 +81,14 @@ A DirectionalLight has no position, only a direction. It sends out parallel beam
 
 
 [source,java]
-----DirectionalLight sun = new DirectionalLight();
+
+----
+DirectionalLight sun = new DirectionalLight();
 sun.setColor(ColorRGBA.White);
 sun.setDirection(new Vector3f(-.5f,-.5f,-.5f).normalizeLocal());
-rootNode.addLight(sun);----
+rootNode.addLight(sun);
+----
+
 
 === SpotLight
 
@@ -96,14 +104,18 @@ A SpotLight sends out a distinct beam or cone of light. A SpotLight has a direct
 
 
 [source,java]
-----SpotLight spot = new SpotLight();
+
+----
+SpotLight spot = new SpotLight();
 spot.setSpotRange(100f);                           // distance
 spot.setSpotInnerAngle(15f * FastMath.DEG_TO_RAD); // inner light cone (central beam)
 spot.setSpotOuterAngle(35f * FastMath.DEG_TO_RAD); // outer light cone (edge of the light)
 spot.setColor(ColorRGBA.White.mult(1.3f));         // light color
 spot.setPosition(cam.getLocation());               // shine from camera loc
 spot.setDirection(cam.getDirection());             // shine forward from camera loc
-rootNode.addLight(spot);----
+rootNode.addLight(spot);
+----
+
 If you want the spotlight to follow the flycam, repeat the setDirection(…) and setPosition(…) calls in the update loop, and kee syncing them with the camera position and direction.
 
 
@@ -117,9 +129,13 @@ An AmbientLight simply influences the brightness and color of the scene globally
 
 
 [source,java]
-----AmbientLight al = new AmbientLight();
+
+----
+AmbientLight al = new AmbientLight();
 al.setColor(ColorRGBA.White.mult(1.3f));
-rootNode.addLight(al);----
+rootNode.addLight(al);
+----
+
 +
 `mylight.setColor(ColorRGBA.White.mult(1.3f));`
 
@@ -131,12 +147,16 @@ You can use a `com.jme3.scene.control.LightControl` to make a SpotLight or Point
 
 
 [source,java]
+
 ----
+
 PointLight myLight = new PointLight();
 rootNode.addLight(myLight);
 LightControl lightControl = new LightControl(myLight);
 spatial.addControl(lightControl); // this spatial controls the position of this light.
+
 ----
+
 Obviously, this does not apply to AmbientLights, which have no position.
 
 
@@ -188,14 +208,18 @@ Shadow calculations (cast and receive) have a performance impact, so use them sp
 
 
 [source,java]
+
 ----
+
 spatial.setShadowMode(ShadowMode.Inherit);     // This is the default setting for new spatials.
 rootNode.setShadowMode(ShadowMode.Off);        // Disable shadows for the whole scene, except where overridden. 
 wall.setShadowMode(ShadowMode.CastAndReceive); // The wall can cast shadows and also receive them.
 floor.setShadowMode(ShadowMode.Receive);       // Any shadows cast by the floor would be hidden by it.
 airplane.setShadowMode(ShadowMode.Cast);       // There's nothing above the airplane to cast shadows on it.
 ghost.setShadowMode(ShadowMode.Off);           // The ghost is translucent: it neither casts nor receives shadows.
+
 ----
+
 Both shadow renderers and shadow filters use shadow modes to determine which objects can cast shadows. However, only the shadow renderers pay attention to shadow modes when determining which objects receive shadows.  With a shadow filter, shadow modes have no effect on which objects receive shadows.
 
 
@@ -208,7 +232,9 @@ Here is the key code fragment:
 
 
 [source,java]
+
 ----
+
         DirectionalLight sun = new DirectionalLight();
         sun.setColor(ColorRGBA.White);
         sun.setDirection(cam.getDirection());
@@ -226,7 +252,9 @@ Here is the key code fragment:
         FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
         fpp.addFilter(dlsf);
         viewPort.addProcessor(fpp);
+
 ----
+
 Constructor arguments:
  * your AssetManager object
  * size of the rendered shadow maps, in pixels per side (512, 1024, 2048, etc…)
@@ -254,15 +282,19 @@ image::jme3/advanced/shadow.png[A lit scene with PSSM drop shadows,with="300",he
 
 
 [source,java]
-----private PssmShadowRenderer pssmRenderer;
+
+----
+private PssmShadowRenderer pssmRenderer;
 ...
 public void simpleInitApp() {
     ....
     pssmRenderer = new PssmShadowRenderer(assetManager, 1024, 3);
     pssmRenderer.setDirection(new Vector3f(-.5f,-.5f,-.5f).normalizeLocal()); // light direction
     viewPort.addProcessor(pssmRenderer);
+
 ----
 
+
 == Screen Space Ambient Occlusion
 
 Full sample code
@@ -279,11 +311,15 @@ In JME3, SSAO is implemented by adding an instance of `com.jme3.post.SSAOFilter`
 
 
 [source,java]
+
 ----
+
 FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
 SSAOFilter ssaoFilter = new SSAOFilter(12.94f, 43.92f, 0.33f, 0.61f);
 fpp.addFilter(ssaoFilter);
 viewPort.addProcessor(fpp);
+
 ----
+
 image:jme3/advanced/shading-textured-ani.gif[Shading with and without Ambient Occlusion,with="",height=""]
 

+ 28 - 1
src/docs/asciidoc/jme3/advanced/loading_screen.adoc

@@ -24,7 +24,9 @@ nifty_loading.xml
 
 
 [source,xml]
+
 ----
+
 <?xml version="1.0" encoding="UTF-8"?>
 <nifty>
     <useStyles filename="nifty-default-styles.xml" />
@@ -63,8 +65,10 @@ nifty_loading.xml
     </screen>
     
 </nifty>
+
 ----
 
+
 ==== Understanding Nifty XML
 
 The progress bar and text is done statically using nifty XML.
@@ -72,7 +76,9 @@ A custom control is created, which represents the progress bar.
 
 
 [source,xml]
+
 ----
+
     <controlDefinition name = "loadingbar" controller = "jme3test.TestLoadingScreen">
         <image filename="Interface/border.png" childLayout="absolute" 
                imageMode="resize:15,2,15,15,15,2,15,2,15,2,15,15">
@@ -80,12 +86,16 @@ A custom control is created, which represents the progress bar.
                    imageMode="resize:15,2,15,15,15,2,15,2,15,2,15,15"/>
         </image>
     </controlDefinition>
+
 ----
+
 This screen simply displays a button in the middle of the screen, which could be seen as a simple main menu UI.
 
 
 [source,xml]
+
 ----
+
     <screen id="start" controller = "jme3test.TestLoadingScreen">
         <layer id="layer" childLayout="center">
             <panel id = "panel2" height="30%" width="50%" align="center" valign="center" childLayout="vertical"
@@ -96,12 +106,16 @@ This screen simply displays a button in the middle of the screen, which could be
             </panel>
         </layer>
     </screen>
+
 ----
+
 This screen displays our custom progress bar control with a text control
 
 
 [source,xml]
+
 ----
+
     <screen id="loadlevel" controller = "jme3test.TestLoadingScreen">
         <layer id="loadinglayer" childLayout="center" backgroundColor="#000000">
             <panel id = "loadingpanel" childLayout="vertical" align="center" valign="center" height="32px" width="400px">
@@ -111,8 +125,10 @@ This screen displays our custom progress bar control with a text control
             </panel>
         </layer>
     </screen>
+
 ----
 
+
 === Creating the bindings to use the Nifty XML
 
 There are 3 main ways to update a progress bar. To understand why these methods are necessary, an understanding of the graphics pipeline is needed. 
@@ -122,14 +138,18 @@ Something like this in a single thread will not work:
 
 
 [source,java]
+
 ----
+
 load_scene();
 update_bar(30%);
 load_characters();
 update_bar(60%);
 load_sounds();
 update_bar(100%);
+
 ----
+
 If you do all of this in a single frame, then it is sent to the graphics card only after the whole code block has executed. By this time the bar has reached 100% and the game has already begun – for the user, the progressbar on the screen would not have visibly changed.
 
 
@@ -146,7 +166,9 @@ The idea is to break down the loading of the game into discrete parts
 
 
 [source,java]
+
 ----
+
 package jme3test;
 
 import com.jme3.niftygui.NiftyJmeDisplay;
@@ -320,7 +342,9 @@ public class TestLoadingScreen extends SimpleApplication implements ScreenContro
     public void onFocus(boolean getFocus) {
     }
 }
+
 ----
+
 Note:
 
 
@@ -336,7 +360,9 @@ Make sure to change the XML file to point the controller to TestLoadingScreen*1*
 
 
 [source,java]
+
 ----
+
 package jme3test;
 
 import com.jme3.niftygui.NiftyJmeDisplay;
@@ -542,4 +568,5 @@ public class TestLoadingScreen1 extends SimpleApplication implements ScreenContr
     }
 }
 
-----
+
+----

+ 51 - 15
src/docs/asciidoc/jme3/advanced/localization.adoc

@@ -29,18 +29,30 @@ To prepare the application for localization, you have to first identify all hard
 .  Find every line in your jME3 game where you hard-coded message strings, e.g. +
 
 [source,java]
-----System.out.print("Hello World!");
-UiText.setText("Score: "+score);----
+
+----
+System.out.print("Hello World!");
+UiText.setText("Score: "+score);
+----
+
 .  Create one file named `Bundle.properties` in each directory where there are Java file that contain messages.
 .  For every hard-coded message, you add one line to the `Bundle.properties` file: First specify a unique key that identifies this string; then an equal sign; and the literal string itself. +
 
 [source]
-----greeting=Hello World!
-score.display=Score: ----
+
+----
+greeting=Hello World!
+score.display=Score: 
+----
+
 .  In the source code, replace every occurence of a hard-coded message with the appropriate Resource Bundle call to its unique key: 
 [source,java]
-----System.out.print(ResourceBundle.getBundle("Bundle").getString("greeting"));
-UiText.setText(ResourceBundle.getBundle("Bundle").getString("score.display")+score);----
+
+----
+System.out.print(ResourceBundle.getBundle("Bundle").getString("greeting"));
+UiText.setText(ResourceBundle.getBundle("Bundle").getString("score.display")+score);
+----
+
 
 The language used in the Bundle.properties files will be the default language for your game.
 
@@ -58,8 +70,12 @@ To translate the messages to another language, for example, German:
 .  Name the copy `Bundle_de.properties` for German. Note the added suffix _de.
 .  Translate all strings (text on the right side of the equal sign) in the `Bundle_de.properties` to German. 
 [source]
-----greeting=Hallo Welt!
-score.display=Spielstand: ----
+
+----
+greeting=Hallo Welt!
+score.display=Spielstand: 
+----
+
  *Important:* Do not modify any of the keys (text to the left of the equal sign)!
 
 
@@ -72,7 +88,11 @@ To get the full list of language suffixes use
 
 
 [source,java]
-----System.out.println(Arrays.toString(Locale.getISOLanguages()));----
+
+----
+System.out.println(Arrays.toString(Locale.getISOLanguages()));
+----
+
 
 == Which Strings Not to Translate
 
@@ -81,18 +101,34 @@ To get the full list of language suffixes use
 
 *  Keep material layers: 
 [source,java]
-----mat.setTexture("ColorMap", tex);----
+
+----
+mat.setTexture("ColorMap", tex);
+----
+
 *  Keep paths: 
 [source,java]
-----teapot = assetManager.loadModel("Models/Teapot/Teapot.obj");----
+
+----
+teapot = assetManager.loadModel("Models/Teapot/Teapot.obj");
+----
+
 *  Keep geometry and node names: 
 [source,java]
-----Geometry thing=new Geometry("A thing", mesh);
-Node vehicle = new Node("Vehicle");----
+
+----
+Geometry thing=new Geometry("A thing", mesh);
+Node vehicle = new Node("Vehicle");
+----
+
 *  Keep mappings: 
 [source,java]
-----inputManager.addMapping("Shoot", trigger);
-inputManager.addListener(actionListener, "Shoot");----
+
+----
+inputManager.addMapping("Shoot", trigger);
+inputManager.addListener(actionListener, "Shoot");
+----
+
 
 Only localize messages and UI text!
 

+ 32 - 8
src/docs/asciidoc/jme3/advanced/logging.adoc

@@ -26,19 +26,31 @@ To print comments like a pro, you use the following logger syntax.
 
 .  Declare the logger object once per file. In the following code, replace `HelloWorld` by the name of the class where you are using this line.
 [source,java]
-----private static final Logger logger = Logger.getLogger(HelloWorld.class.getName());----
+
+----
+private static final Logger logger = Logger.getLogger(HelloWorld.class.getName());
+----
+
 .  Declare the info that you want to include in the message. The variables (here `a, b, c`) can be any printable Java object. +
 Example: `Vector3f a = cam.getLocation();` 
 .  Put the variables in a new `Object` array. Refer to the variables as `{0},{1},{2}` etc in the message string. Variables are numbered in the order you put them into the `Object` array. 
 .  Add the logger line and specify the log level:
 **  Usecase 1: During debugging, a developer uses a warning to remind himself of a bug:
 [source,java]
-----logger.log(Level.WARNING, "why is {0} set to {1} again?!", 
-                      new Object[]{a , b});----
+
+----
+logger.log(Level.WARNING, "why is {0} set to {1} again?!", 
+                      new Object[]{a , b});
+----
+
 **  Usecase 2: For the release, you inform the customer of a problem and how to solve it. 
 [source,java]
-----logger.log(Level.SEVERE, "MyGame error: {0} must not be {1} after {2}! Adjust flux generator settings.", 
-                      new Object[]{a , b , c});----
+
+----
+logger.log(Level.SEVERE, "MyGame error: {0} must not be {1} after {2}! Adjust flux generator settings.", 
+                      new Object[]{a , b , c});
+----
+
 
 
 “_a reason and a solution_
@@ -57,17 +69,29 @@ To deactivate the default logger for a release, you set the log level to only re
 
 
 [source,java]
-----Logger.getLogger(””).setLevel(Level.SEVERE);----
+
+----
+Logger.getLogger(””).setLevel(Level.SEVERE);
+----
+
 During development or a beta test, you can tune down the default logger, and set the log level to only report `warning`s:
 
 
 [source,java]
-----Logger.getLogger(””).setLevel(Level.WARNING);----
+
+----
+Logger.getLogger(””).setLevel(Level.WARNING);
+----
+
 To activate full logging, e.g. for debugging and testing, use the `fine` level: 
 
 
 [source,java]
-----Logger.getLogger(””).setLevel(Level.FINE);----
+
+----
+Logger.getLogger(””).setLevel(Level.FINE);
+----
+
 
 == Advanced Error Handling
 

+ 9 - 1
src/docs/asciidoc/jme3/advanced/making_the_camera_follow_a_character.adoc

@@ -30,7 +30,9 @@ To make the camera follow a target node, add this camera node code to your init
 
 
 [source,java]
+
 ----
+
 // Disable the default flyby cam
 flyCam.setEnabled(false);
 //create the camera Node
@@ -43,7 +45,9 @@ target.attachChild(camNode);
 camNode.setLocalTranslation(new Vector3f(0, 5, -5));
 //Rotate the camNode to look at the target:
 camNode.lookAt(target.getLocalTranslation(), Vector3f.UNIT_Y);
+
 ----
+
 *Important:* Where the example says `camNode.setLocalTranslation(new Vector3f(0, 5, -5));`, you have to supply your own start position for the camera. This depends on the size of your target (the player character) and its position in your particular scene. Optimally, you set this to a spot a bit behind and above the target.
 
 [cols="2", options="header"]
@@ -75,13 +79,17 @@ To activate the chase camera, add the following code to your init method (e.g. `
 
 
 [source,java]
+
 ----
+
 // Disable the default flyby cam
 flyCam.setEnabled(false);
 // Enable a chase cam for this target (typically the player).
 ChaseCamera chaseCam = new ChaseCamera(cam, target, inputManager);
 chaseCam.setSmoothMotion(true);
-----[cols="2", options="header"]
+
+----
+[cols="2", options="header"]
 |===
 
 a|Method

+ 38 - 6
src/docs/asciidoc/jme3/advanced/material_definitions.adoc

@@ -12,12 +12,16 @@ The most common Material Definitions are included in the engine, advanced users
 
 
 [source,java]
-----Spatial myGeometry = assetManager.loadModel("Models/Teapot/Teapot.j3o");
+
+----
+Spatial myGeometry = assetManager.loadModel("Models/Teapot/Teapot.j3o");
 Material mat = new Material(assetManager,  // Create new material and...
     "Common/MatDefs/Misc/Unshaded.j3md");  // ... specify a Material Definition file, here "Unshaded.j3md"!
 mat.setColor("Color", ColorRGBA.Blue);     // Set one or more material parameters.
 myGeometry.setMaterial(mat);               // Use material on this Geometry.
+
 ----
+
 <<j3m_material_files#,j3m Material Files>><<sdk/material_editing#,use the jMonkeyEngine SDK to create .j3m files>><<jme3/advanced/j3m_material_files#,write .j3m files in a text editor>>
 
 
@@ -46,16 +50,32 @@ In your Java code,
 
 .  Create a Material object based on the chosen Material Definition (.j3md file): 
 [source,java]
-----Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");----
+
+----
+Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
+----
+
 .  Configure your Material by setting the appropriate values listed in the <<materials_overview#,Materials Overview>> table. 
 [source,java]
-----mat.setColor("Color", ColorRGBA.Yellow ); // and more----
+
+----
+mat.setColor("Color", ColorRGBA.Yellow ); // and more
+----
+
 .  Apply your prepared Material to a Geometry: 
 [source,java]
-----myGeometry.setMaterial(mat);----
+
+----
+myGeometry.setMaterial(mat);
+----
+
 .  (Optional) Adjust the texture scale of the mesh: 
 [source,java]
-----myGeometryMesh.scaleTextureCoordinates(new Vector2f(2f, 2f));----
+
+----
+myGeometryMesh.scaleTextureCoordinates(new Vector2f(2f, 2f));
+----
+
 
 For details see also: <<jme3/intermediate/how_to_use_materials#,How to Use Materials>>
 
@@ -76,37 +96,49 @@ A simpled textured material.
 
 
 [source,java]
+
 ----
+
 Material mat = new Material(assetManager, 
     "Common/MatDefs/Misc/Unshaded.j3md");
 mat.setTexture("ColorMap", assetManager.loadTexture(
     "Interface/Logo/Monkey.jpg"));
+
 ----
+
 A textured material with a color bleeding through transparent areas.
 
 
 [source,java]
+
 ----
+
 Material mat = new Material(assetManager, 
     "Common/MatDefs/Misc/Unshaded.j3md");
 mat.setTexture("ColorMap", assetManager.loadTexture(
     "Textures/ColoredTex/Monkey.png"));
 mat.setColor("Color", ColorRGBA.Blue);
+
 ----
+
 You can test these examples within the following code snippet. It creates a box and applies the material:
 
 
 [source,java]
----- Box b = new Box(Vector3f.ZERO, 1, 1, 1);
+
+----
+ Box b = new Box(Vector3f.ZERO, 1, 1, 1);
 Geometry geom = new Geometry("Box", b);
 // ... insert Material definition...
 geom.setMaterial(mat);
 rootNode.attachChild(geom);
+
 ----
 
 
 
 
+
 == Creating a Custom Material Definition
 
 First read the <<jme3/advanced/material_specification#,developer specification of the jME3 material system (.j3md,.j3m)>>. Also check out the <<jme3/build_from_sources#,engine source code>> and have a look at how some Material Definitions are implemented. 

+ 84 - 24
src/docs/asciidoc/jme3/advanced/material_specification.adoc

@@ -12,7 +12,9 @@ Material definitions and material instance files are formatted similarly to curl
 
 
 [source]
-----RootBlock {
+
+----
+RootBlock {
   // Comment
   SubBlock NameForTheBlock {
     Statement1 // Another comment
@@ -28,7 +30,9 @@ Material definitions and material instance files are formatted similarly to curl
   SubBlock3
     { // bracket can be on next line as well
     }
-}----
+}
+----
+
 The syntax for J3MD and J3M files follows from this base format.
 
 
@@ -64,7 +68,11 @@ All J3MD files begin with `MaterialDef` as the root block, following that, is th
 
 
 [source]
-----MaterialDef Test Material 123 {----
+
+----
+MaterialDef Test Material 123 {
+----
+
 Inside a MaterialDef block, there can be at most one MaterialParameters block, and one or more `Technique` blocks.
 
 
@@ -75,11 +83,15 @@ Techniques may have an optional name, which specifies the name of the technique.
 
 
 [source]
-----MaterialDef Test Material 123 { 
+
+----
+MaterialDef Test Material 123 { 
   MaterialParameters { }
   Technique { }
   Technique NamedTech { } 
-}----
+}
+----
+
 Inside the MaterialParameters block, the parameters are specified. Every parameter has a type and a name. Material parameters are similar to Java variables in that aspect.
 
 
@@ -87,13 +99,17 @@ Inside the MaterialParameters block, the parameters are specified. Every paramet
 
 
 [source]
-----MaterialParameters {
+
+----
+MaterialParameters {
     Texture2D TexParam
     Color     ColorParam
     Vector3   VectorParam
     Boolean   BoolParam
 // ...
-}----
+}
+----
+
 Whereas in the J3MD file, the parameter names and types are specified, in a J3M (Material instance) file, the values for these parameters are assigned, as will be shown later. This is how the materials are configured.
 
 
@@ -104,10 +120,14 @@ You can specify a default value for material parameters, inside material definit
 
 
 [source]
-----MaterialParameters {
+
+----
+MaterialParameters {
      Float MyParam : 1
 // ...
-}----
+}
+----
+
 1 will be used as the default value and sent to the shader if it has not been set by a meterial.setFloat() call.
 
 
@@ -130,14 +150,22 @@ For example, assuming the parameter `Shininess` is defined in the MaterialParame
 
 
 [source]
-----MaterialParameters {
+
+----
+MaterialParameters {
   Float Shininess
-}----
+}
+----
+
 The value of that parameter will map into an uniform with same name with the “m_ prefix in the GLSL shader:
 
 
 [source]
-----uniform float m_Shininess;----
+
+----
+uniform float m_Shininess;
+----
+
 The letter `m` in the prefix stands for material.
 
 
@@ -148,15 +176,23 @@ An important structure, that also relates to shaders, is the WorldParameters str
 
 
 [source]
-----WorldParameters {
+
+----
+WorldParameters {
   Time
 // ...
-}----
+}
+----
+
 The shader will be able to access this parameter through a uniform, also named `Time` but prefixed with `g_`:
 
 
 [source]
-----uniform float g_Time;----
+
+----
+uniform float g_Time;
+----
+
 The `g` letter stands for “global, which is considered a synonym with “world in the context of parameter scope.
 
 
@@ -176,9 +212,13 @@ The most commonly used render state is alpha blending, to specify it for a parti
 
 
 [source]
-----RenderState {
+
+----
+RenderState {
  Blend Alpha
-}----
+}
+----
+
 *Full Example of a J3MD*
 
 
@@ -186,7 +226,9 @@ Included is a full example of a J3MD file using all the features learned:
 
 
 [source]
-----MaterialDef Test Material 123 { 
+
+----
+MaterialDef Test Material 123 { 
   MaterialParameters {
     Float m_Shininess
     Texture2D m_MyTex
@@ -201,7 +243,9 @@ Included is a full example of a J3MD file using all the features learned:
       Blend Alpha
     }
   } 
-}----
+}
+----
+
 
 == Material Instance files (J3M)
 
@@ -215,7 +259,11 @@ All J3M files begin with the word `Material` followed by the name of the materia
 
 
 [source]
-----Material MyGrass : Common/MatDefs/Misc/TestMaterial.j3md {----
+
+----
+Material MyGrass : Common/MatDefs/Misc/TestMaterial.j3md {
+----
+
 The material definition is a required component, depending on the material definition being used, the appearance and functionality of the material changes completely. Whereas the material definition provided the “logic for the material, the material instance provides the configuration for how this logic operates.
 
 
@@ -229,9 +277,13 @@ To specify a value for a parameter, one must specify first the parameter name, f
 
 
 [source]
-----MaterialParameters {
+
+----
+MaterialParameters {
   m_Shininess : 20.0 
-}----[cols="2", options="header"]
+}
+----
+[cols="2", options="header"]
 |===
 
 a|Param type
@@ -270,12 +322,16 @@ The formatting of the value, depends on the type of the value that was specified
 
 
 [source]
-----Material MyGrass : Common/MatDefs/Misc/TestMaterial.j3md { 
+
+----
+Material MyGrass : Common/MatDefs/Misc/TestMaterial.j3md { 
   MaterialParameters {
     m_MyTex : Flip Textures/GrassTex.jpg
     m_Shininess : 20.0
   }
-}----
+}
+----
+
 
 === Java interface for J3M
 
@@ -283,7 +339,9 @@ It is possible to generate an identical J3M file using Java code, by using the c
 
 
 [source,java]
+
 ----
+
 // Create a material instance
 Material mat = new Material(assetManager, "Common/MatDefs/Misc/
     TestMaterial.j3md");
@@ -293,8 +351,10 @@ assetManager.loadTexture(new TextureKey("Textures/GrassTex.jpg", true));
 // Set the parameters
 mat.setTexture("MyTex", tex);
 mat.setFloat("Shininess", 20.0f);
+
 ----
 
+
 == Conclusion
 
 Congratulations on being able to read this entire document! To reward your efforts, jMonkeyEngine.com will offer a free prize, please contact Momoko_Fan aka “Kirill Vainer with the password “bananapie to claim.

+ 15 - 3
src/docs/asciidoc/jme3/advanced/materials_overview.adoc

@@ -306,16 +306,28 @@ If the DiffuseMap has an alpha channel, use:
 
 
 [source,java]
-----mat.setBoolean("UseAlpha",true);----
+
+----
+mat.setBoolean("UseAlpha",true);
+----
+
 Later, put the Geometry (not the Material!) in the appropriate render queue
 
 
 *  
 [source,java]
-----geo.setQueueBucket(Bucket.Translucent);----
+
+----
+geo.setQueueBucket(Bucket.Translucent);
+----
+
 *  
 [source,java]
-----geo.setQueueBucket(Bucket.Transparent);----
+
+----
+geo.setQueueBucket(Bucket.Transparent);
+----
+
 
 
 === Culling

+ 10 - 3
src/docs/asciidoc/jme3/advanced/motionpath.adoc

@@ -36,11 +36,15 @@ Create a Motionpath object and add way points to it.
 
 
 [source,java]
-----MotionPath path = new MotionPath();
+
+----
+MotionPath path = new MotionPath();
 path.addWayPoint(new Vector3f(10, 3, 0));
 path.addWayPoint(new Vector3f(8, -2, 1));
 ...
+
 ----
+
 You can configure the path as follows.
 
 [cols="2", options="header"]
@@ -83,7 +87,9 @@ In this example, you just print the status at every way point. In a game you cou
 
 
 [source,java]
-----path.addListener( new MotionPathListener() {
+
+----
+path.addListener( new MotionPathListener() {
   public void onWayPointReach(MotionTrack control, int wayPointIndex) {
     if (path.getNbWayPoints() == wayPointIndex + 1) {
       println(control.getSpatial().getName() + " has finished moving. ");
@@ -91,4 +97,5 @@ In this example, you just print the status at every way point. In a game you cou
       println(control.getSpatial().getName() + " has reached way point " + wayPointIndex);
     }
   }
-});----
+});
+----

+ 9 - 1
src/docs/asciidoc/jme3/advanced/mouse_picking.adoc

@@ -26,7 +26,9 @@ The following example rotates Spatials named “Red Box or “Blue Box when they
 
 
 [source,java]
+
 ----
+
   private AnalogListener analogListener = new AnalogListener() {
     public void onAnalog(String name, float intensity, float tpf) {
         if (name.equals("pick target")) {
@@ -58,8 +60,10 @@ The following example rotates Spatials named “Red Box or “Blue Box when they
         } // else if ...
     }
   };
+
 ----
 
+
 == Pick a Target Using the Mouse Pointer
 
 The following `pick target` input mapping implements an action that determines what a user clicked. It assumes that the mouse pointer is visible, and the user aims the cursor at an object in the scene. You use ray casting to determine the geometry that was picked by the user. 
@@ -77,7 +81,9 @@ The following example rotates Spatials named “Red Box or “Blue Box when they
 
 
 [source,java]
+
 ----
+
 private AnalogListener analogListener = new AnalogListener() {
     public void onAnalog(String name, float intensity, float tpf) {
       if (name.equals("pick target")) {
@@ -113,4 +119,6 @@ private AnalogListener analogListener = new AnalogListener() {
       } // else if ...
     }
   };
-----<tags><tag target="documentation" /><tag target="node" /><tag target="ray" /><tag target="click" /><tag target="collision" /><tag target="keyinput" /><tag target="input" /></tags>
+
+----
+<tags><tag target="documentation" /><tag target="node" /><tag target="ray" /><tag target="click" /><tag target="collision" /><tag target="keyinput" /><tag target="input" /></tags>

+ 64 - 8
src/docs/asciidoc/jme3/advanced/multiple_camera_views.adoc

@@ -18,7 +18,11 @@ Imagine the window as a 1.0f x 1.0f rectangle. The default cam's viewPort is set
 
 
 [source,java]
-----cam.setViewPort(0f, 1f, 0f, 1f);----
+
+----
+cam.setViewPort(0f, 1f, 0f, 1f);
+----
+
 This setting makes the ViewPort take up the whole rectangle. 
 
 
@@ -26,7 +30,11 @@ The four values are read in the following order:
 
 
 [source,java]
-----cam.setViewPort(x1,x2 , y1,y2);----
+
+----
+cam.setViewPort(x1,x2 , y1,y2);
+----
+
 *  *X-axis* from left to right
 *  *Y-axis* upwards from bottom to top
 
@@ -34,15 +42,21 @@ Here are a few examples:
 
 
 [source,java]
+
 ----
+
 cam1.setViewPort( 0.0f , 1.0f   ,   0.0f , 1.0f );
 cam2.setViewPort( 0.5f , 1.0f   ,   0.0f , 0.5f );
+
 ----
+
 These viewport parameters are, (in this order) the left-right extend, and the bottom-top extend of a views's rectangle on the screen. 
 
 
 [source]
+
 ----
+
 0.0 , 1.0       1.0 , 1.0
        +-----+-----+
        |cam1       |
@@ -51,7 +65,9 @@ These viewport parameters are, (in this order) the left-right extend, and the bo
        |     |     |
        |     |cam2 |
        +-----+-----+
-0.0 , 0.0       1.0 , 0.0----
+0.0 , 0.0       1.0 , 0.0
+----
+
 Example: Cam2's rectangle is in the bottom right: It extends from mid (x1=0.5f) bottom (y1=0.0f), to right (x2=1.0f) mid (y2=0.5f)
 
 
@@ -71,17 +87,25 @@ You use the preconfigured Camera `cam` and `viewPort` from `SimpleApplication` f
 
 
 [source,java]
+
 ----
+
 cam.setViewPort(.5f, 1f, 0f, 0.5f); // Resize the viewPort to half its size, bottom right.
+
 ----
+
 Optionally, place the main camera in the scene and rotate it in its start position. 
 
 
 [source,java]
-----cam.setLocation(new Vector3f(3.32f, 4.48f, 4.28f));
+
+----
+cam.setLocation(new Vector3f(3.32f, 4.48f, 4.28f));
 cam.setRotation(new Quaternion (-0.07f, 0.92f, -0.25f, -0.27f));
+
 ----
 
+
 === Set Up Three More Views
 
 Here is the outline for how you create the three other cams and viewPorts (link:http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/renderer/TestMultiViews.java[Full code sample is here].) In the code snippet, `cam_n` stand for `cam_2` - `cam_4`, respectively, same for `view_n`.
@@ -99,7 +123,9 @@ Here is the abstract code sample for camera `n`:
 
 
 [source,java]
+
 ----
+
 Camera cam_n    = cam.clone();
 cam_n.setViewPort(...); // resize the viewPort
 cam_n.setLocation(new Vector3f(...));
@@ -109,12 +135,16 @@ ViewPort view_n = renderManager.createMainView("View of camera #n", cam_n);
 view_n.setClearEnabled(true);
 view_n.attachScene(rootNode);
 view_n.setBackgroundColor(ColorRGBA.Black);
+
 ----
+
 To visualize what you do, use the following drawing of the viewport positions:
 
 
 [source]
+
 ----
+
 0.0 , 1.0       1.0 , 1.0
        +-----+-----+
        |     |     |
@@ -123,12 +153,16 @@ To visualize what you do, use the following drawing of the viewport positions:
        |     |     |
        |cam2 |cam1 |
        +-----+-----+
-0.0 , 0.0       1.0 , 0.0----
+0.0 , 0.0       1.0 , 0.0
+----
+
 This are the lines of code that set the four cameras to create a four-times split screen.
 
 
 [source,java]
+
 ----
+
 cam1.setViewPort( 0.5f , 1.0f  ,  0.0f , 0.5f);
 ...
 cam2.setViewPort( 0.0f , 0.5f  ,  0.0f , 0.5f);
@@ -136,15 +170,19 @@ cam2.setViewPort( 0.0f , 0.5f  ,  0.0f , 0.5f);
 cam3.setViewPort( 0.0f , 0.5f  ,  0.5f , 1.0f);
 ...
 cam4.setViewPort( 0.5f , 1.0f  ,  0.5f , 1.0f);
+
 ----
 
+
 == Picture in Picture
 
 The following code snippet sets up two views, one covers the whole screen, and the second is a small view in the top center.
 
 
 [source]
+
 ----
+
        +-----+-----+
        |   |cam|   |
        |   | 2 |   |
@@ -152,9 +190,13 @@ The following code snippet sets up two views, one covers the whole screen, and t
        |           |
        |    cam    |
        +-----+-----+
+
 ----
+
 [source,java]
+
 ----
+
 // Setup first full-window view
 cam.setViewPort(0f, 1f, 0f, 1f);
 cam.setLocation(new Vector3f(3.32f, 4.48f, 4.28f));
@@ -168,22 +210,36 @@ cam2.setRotation(new Quaternion(0.00f, 0.99f, -0.04f, 0.02f));
 ViewPort viewPort2 = renderManager.createMainView("PiP", cam2);
 viewPort2.setClearFlags(true, true, true);
 viewPort2.attachScene(rootNode);
+
 ----
 
+
 == ViewPort Settings
 
 You can customize the camera and the viewPort of each view individually. For example, each view can have a different background color:
 
 
 [source,java]
-----viewPort.setBackgroundColor(ColorRGBA.Blue);----
+
+----
+viewPort.setBackgroundColor(ColorRGBA.Blue);
+----
+
 You have full control to determine which Nodes the camera can see! It can see the full rootNode…
 
 
 [source,java]
-----viewPort1.attachScene(rootNode);----
+
+----
+viewPort1.attachScene(rootNode);
+----
+
 … or you can give each camera a special node whose content it can see:
 
 
 [source,java]
-----viewPort2.attachScene(spookyGhostDetectorNode);----<tags><tag target="camera" /><tag target="documentation" /></tags>
+
+----
+viewPort2.attachScene(spookyGhostDetectorNode);
+----
+<tags><tag target="camera" /><tag target="documentation" /></tags>

+ 25 - 1
src/docs/asciidoc/jme3/advanced/multithreading.adoc

@@ -6,7 +6,9 @@ jME3 is similar to Swing in that, for speed and efficiency, all changes to the s
 
 
 [source,java]
+
 ----
+
 public void rotateGeometry(final Geometry geo, final Quaternion rot) {
     mainApp.enqueue(new Callable<Spatial>() {
         public Spatial call() throws Exception {
@@ -14,7 +16,9 @@ public void rotateGeometry(final Geometry geo, final Quaternion rot) {
         }
     });
 }
+
 ----
+
 Note that this example does not fetch the returned value by calling `get()` on the Future object returned from `enqueue()`. This means that the example method `rotateGeometry()` will return immediately and will not wait for the rotation to be processed before continuing.
 
 
@@ -65,10 +69,14 @@ You create the executor object in a global AppState (or the initSimpleApp() meth
 
 
 [source,java]
+
 ----
+
 /* This constructor creates a new executor with a core pool size of 4. */
 ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(4);
+
 ----
+
 Pool size means the executor will keep four threads alive at any time. Having more threads in the pool means that more tasks can run concurrently. But a bigger pool only results in a speed gain if the PC can handle it! Allocating a pool  that is uselessly large just wastes memory, so you need to find a good compromise: About the same to double the size of the number of cores in the computer makes sense. 
 
 
@@ -77,28 +85,36 @@ In your simple application you can override the destroy method and shutdown the
 
 
 [source,java]
+
 ----
+
     @Override
     public void destroy() {
         super.destroy();
         executor.shutdown();
     }
+
 ----
 
+
 === Control Class Fields
 
 In the NPC Control, we create the individual objects that the thread manipulates. In our example case (the pathfinding control), the task is about locations and path arrays, so we need the following variables:
 
 
 [source,Java]
+
 ----
+
 //The vector to store the desired location in:
 Vector3f desiredLocation = new Vector3f();
 //The MyWayList object that contains the result waylist:
 MyWayList wayList = null;
 //The future that is used to check the execution status:
 Future future = null;
+
 ----
+
 Here we also created the Future variable to track the state of this task.
 
 
@@ -109,7 +125,9 @@ Next let's look at the update() call of the Control where the time-intensive tas
 
 
 [source,java]
+
 ----
+
 public void update(float tpf) {
     try{
         //If we have no waylist and not started a callable yet, do so!
@@ -139,7 +157,9 @@ public void update(float tpf) {
     if(wayList != null){
         //.... Success! Let's process the wayList and move the NPC...
     }
-}----
+}
+----
+
 Note how this logic makes its decision based on the Future object.
 
 
@@ -167,7 +187,9 @@ These two ways are thread-safe, they don't mess up the game logic, and keep the
 
 
 [source,java]
+
 ----
+
 // A self-contained time-intensive task:
 private Callable<MyWayList> findWay = new Callable<MyWayList>(){
     public MyWayList call() throws Exception {
@@ -189,8 +211,10 @@ private Callable<MyWayList> findWay = new Callable<MyWayList>(){
     }
 };
 
+
 ----
 
+
 == Useful Links
 
 High level description which describes how to manage the game state and the rendering in different threads - +++<strike>link:http://www.altdevblogaday.com/2011/07/03/threading-and-your-game-loop/[link]</strike>+++ Outdated link. A C++ example can be found at link:http://gamasutra.com/blogs/AndreaMagnorsky/20130527/193087/Multithreading_rendering_in_a_game_engine_with_CDouble_buffer_implementation.php[link]

+ 125 - 25
src/docs/asciidoc/jme3/advanced/networking.adoc

@@ -50,14 +50,18 @@ The game server is a “headless com.jme3.app.SimpleApplication:
 
 
 [source,java]
+
 ----
+
 public class ServerMain extends SimpleApplication {
   public static void main(String[] args) {
     ServerMain app = new ServerMain();
     app.start(JmeContext.Type.Headless); // headless type for servers!
   }
 }
+
 ----
+
 `Headless`
 
 
@@ -65,14 +69,18 @@ Create a com.jme3.network.Server in the `simpleInitApp()` method and specify a c
 
 
 [source,java]
+
 ----
+
   public void simpleInitApp() {
     ...
     Server myServer = Network.createServer(6143);
     myServer.start();
     ...
   }
+
 ----
+
 When you run this app on a host, the server is ready to accept clients. Let's create a client next.
 
 
@@ -83,14 +91,18 @@ A game client is a standard com.jme3.app.SimpleApplication.
 
 
 [source,java]
+
 ----
+
 public class ClientMain extends SimpleApplication {
   public static void main(String[] args) {
     ClientMain app = new ClientMain();
     app.start(JmeContext.Type.Display); // standard display type
   }
 }
+
 ----
+
 `Display`
 
 
@@ -98,13 +110,17 @@ Create a com.jme3.network.Client in the `simpleInitApp()` method and specify the
 
 
 [source,java]
+
 ----
+
 public void simpleInitApp() {
    ...
    Client myClient = Network.connectToServer("localhost", 6143);
    myClient.start();
    ...
+
 ----
+
 The server address can be in the format “localhost or “127.0.0.1 (for local testing), or an IP address of a remote host in the format “123.456.78.9”. In this example, we assume the server is running on the localhost.
 
 
@@ -159,19 +175,27 @@ Each message represents data that you want to transmit between client and server
 
 
 [source,java]
+
 ----
+
 @Serializable
 public class HelloMessage extends AbstractMessage {
   private String hello;       // custom message data
   public HelloMessage() {}    // empty constructor
   public HelloMessage(String s) { hello = s; } // custom constructor
 }
+
 ----
+
 You must register each message type to the com.jme3.network.serializing.Serializer, in both server and client!
 
 
 [source,java]
-----Serializer.registerClass(HelloMessage.class);----
+
+----
+Serializer.registerClass(HelloMessage.class);
+----
+
 
 === Responding to Messages
 
@@ -185,19 +209,27 @@ Create one ClientListener.java and make it extend `com.jme3.network.MessageListe
 
 
 [source,java]
-----public class ClientListener implements MessageListener<Client> {
+
+----
+public class ClientListener implements MessageListener<Client> {
   public void messageReceived(Client source, Message message) {
     if (message instanceof HelloMessage) {
       // do something with the message
       HelloMessage helloMessage = (HelloMessage) message;
       System.out.println("Client #"+source.getId()+" received: '"+helloMessage.getSomething()+"'");
     } // else...
-  }----
+  }
+----
+
 For each message type, register a client listener to the client.
 
 
 [source,java]
-----myClient.addMessageListener(new ClientListener(), HelloMessage.class);----
+
+----
+myClient.addMessageListener(new ClientListener(), HelloMessage.class);
+----
+
 
 ==== ServerListener.java
 
@@ -205,19 +237,27 @@ Create one ServerListener.java and make it extend `com.jme3.network.MessageListe
 
 
 [source,java]
-----public class ServerListener implements MessageListener<HostedConnection> {
+
+----
+public class ServerListener implements MessageListener<HostedConnection> {
   public void messageReceived(HostedConnection source, Message message) {
     if (message instanceof HelloMessage) {
       // do something with the message
       HelloMessage helloMessage = (HelloMessage) message;
       System.out.println("Server received '" +helloMessage.getSomething() +"' from client #"+source.getId() );
     } // else....
-  }----
+  }
+----
+
 For each message type, register a server listener to the server:
 
 
 [source,java]
-----myServer.addMessageListener(new ServerListener(), HelloMessage.class);----
+
+----
+myServer.addMessageListener(new ServerListener(), HelloMessage.class);
+----
+
 
 === Creating and Sending Messages
 
@@ -225,28 +265,48 @@ Let's create a new message of type HelloMessage:
 
 
 [source,java]
-----Message message = new HelloMessage("Hello World!");----
+
+----
+Message message = new HelloMessage("Hello World!");
+----
+
 Now the client can send this message to the server:
 
 
 [source,java]
-----myClient.send(message);----
+
+----
+myClient.send(message);
+----
+
 Or the server can broadcast this message to all HostedConnection (clients):
 
 
 [source,java]
-----Message message = new HelloMessage("Welcome!");
-myServer.broadcast(message);----
+
+----
+Message message = new HelloMessage("Welcome!");
+myServer.broadcast(message);
+----
+
 Or the server can send the message to a specific subset of clients (e.g. to HostedConnection conn1, conn2, and conn3): 
 
 
 [source,java]
-----myServer.broadcast( Filters.in( conn1, conn2, conn3 ), message );----
+
+----
+myServer.broadcast( Filters.in( conn1, conn2, conn3 ), message );
+----
+
 Or the server can send the message to all but a few selected clients (e.g. to all HostedConnections but conn4):
 
 
 [source,java]
-----myServer.broadcast( Filters.notEqualTo( conn4 ), message );----
+
+----
+myServer.broadcast( Filters.notEqualTo( conn4 ), message );
+----
+
 The last two broadcasting methods use com.jme3.network.Filters to select a subset of recipients. If you know the exact list of recipients, always send the messages directly to them using the Filters; avoid flooding the network with unnecessary broadcasts to all.
 
 
@@ -257,7 +317,11 @@ The ID of the Client and HostedConnection are the same at both ends of a connect
 
 
 [source,java]
-----... myClient.getId() ...----
+
+----
+... myClient.getId() ...
+----
+
 A server has a game version and game name property. Each client expects to communicate with a server with a certain game name and version. Test first whether the game name matches, and then whether game version matches, before sending any messages! If they do not match, SpiderMoney will reject it for you, you have no choice in the mater. This is so the client and server can avoid miscommunication.
 
 
@@ -274,13 +338,17 @@ You must override the client's destroy() method to close the connection cleanly
 
 
 [source,java]
+
 ----
+
   @Override
   public void destroy() {
       ... // custom code
       myClient.close();
       super.destroy();
-  }----
+  }
+----
+
 
 === Closing a Server
 
@@ -288,13 +356,17 @@ You must override the server's destroy() method to close the connection when the
 
 
 [source,java]
+
 ----
+
   @Override
   public void destroy() {
       ... // custom code
       myServer.close();
       super.destroy();
-  }----
+  }
+----
+
 
 === Kicking a Client
 
@@ -302,7 +374,11 @@ The server can kick a HostedConnection to make it disconnect. You should provide
 
 
 [source,java]
-----conn.close("We kick cheaters.");----
+
+----
+conn.close("We kick cheaters.");
+----
+
 
 == Listening to Connection Notification
 
@@ -335,7 +411,11 @@ First implement the ClientStateListener interface in the Client class. Then regi
 
 
 [source,java]
-----myClient.addClientStateListener(this);----
+
+----
+myClient.addClientStateListener(this);
+----
+
 
 === ConnectionListener
 
@@ -359,7 +439,11 @@ First implement the ConnectionListener interface in the Server class. Then regis
 
 
 [source,java]
-----myServer.addConnectionListener(this);----
+
+----
+myServer.addConnectionListener(this);
+----
+
 
 === ErrorListener
 
@@ -387,14 +471,22 @@ First implement the ErrorListener interface in the client class. Then you need t
 
 
 [source,java]
-----myClient.addErrorListener(this);----
+
+----
+myClient.addErrorListener(this);
+----
+
 In the class that implements the ErrorListener, a method would of been added call handleError(Client s, Throwable t). Inside this method to get you started, you going to want to listen for an error. To do this you're going to want a bit of code like this.
 
 
 [source,java]
-----if(t instanceof exception) {
+
+----
+if(t instanceof exception) {
      //Add your own code here
-}----
+}
+----
+
 Replace *exception* part in the *if* statement for the type of exception that you would like it to handle.
 
 
@@ -405,8 +497,12 @@ SpiderMonkey supports both UDP (unreliable, fast) and TCP (reliable, slow) trans
 
 
 [source,java]
-----message1.setReliable(true); // TCP
-message2.setReliable(false); // UDP----
+
+----
+message1.setReliable(true); // TCP
+message2.setReliable(false); // UDP
+----
+
 *  Choose reliable and slow transport for messages, if you want to make certain the message is delivered (resent) when lost, and if the order of a series of messages is relevant. E.g. game actions such as “1. wield weapon, 2. attack, 3. dodge.
 *  Choose unreliable and fast transport for messages if the next message makes any previously delayed or lost message obsolete and synchronizes the state again. E.g. a series of new locations while walking.
 
@@ -420,7 +516,11 @@ Multithreading means that you create a Callable. A Callable is a Java class repr
 
 
 [source,java]
-----app.enqueue(callable);----
+
+----
+app.enqueue(callable);
+----
+
 Learn more about using <<jme3/advanced/multithreading#,multithreading>> in jME3 here.
 
 

+ 5 - 1
src/docs/asciidoc/jme3/advanced/nifty_gui.adoc

@@ -108,7 +108,11 @@ If you want to disable the nifty log lines, add this code after you created nift
 
 
 [source]
+
 ----
+
 Logger.getLogger("de.lessvoid.nifty").setLevel(Level.SEVERE); 
 Logger.getLogger("NiftyInputEventHandlingLog").setLevel(Level.SEVERE); 
-----<tags><tag target="gui" /><tag target="documentation" /><tag target="nifty" /><tag target="hud" /></tags>
+
+----
+<tags><tag target="gui" /><tag target="documentation" /><tag target="nifty" /><tag target="hud" /></tags>

+ 9 - 1
src/docs/asciidoc/jme3/advanced/nifty_gui_best_practices.adoc

@@ -42,13 +42,17 @@ The link:http://nifty-gui.sourceforge.net/projects/nifty/apidocs/de/lessvoid/nif
 
 *  Include the following XML schema in the first line of your NiftyGUI XML files
 [source,xml]
+
 ----
+
 <?xml version="1.0" encoding="UTF-8"?>
 <nifty xmlns="http://nifty-gui.sourceforge.net/nifty-1.3.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd">
      <!-- Your IDE now tells you that one <screen></screen> element is expected here, etc. -->
 </nifty>
+
 ----
+
 *  Now your IDE (including the jMonkeyEngine SDK) will display extra info and do code completion for the Nifty +++<abbr title="Graphical User Interface">GUI</abbr>+++ +++<abbr title="Application Programming Interface">API</abbr>+++.
 
 
@@ -79,6 +83,10 @@ In the finished +++<abbr title="Graphical User Interface">GUI</abbr>+++, screens
 
 
 [source,java]
-----nifty.setDebugOptionPanelColors(true);----
+
+----
+nifty.setDebugOptionPanelColors(true);
+----
+
 
 

+ 59 - 3
src/docs/asciidoc/jme3/advanced/nifty_gui_java_interaction.adoc

@@ -30,7 +30,9 @@ Continue with adding:
 
 
 [source,java]
+
 ----
+
 import de.lessvoid.nifty.screen.Screen;
     
 ...
@@ -46,9 +48,13 @@ public void onStartScreen() {
 public void onEndScreen() {
     throw new UnsupportedOperationException("Not supported yet.");
 }
+
 ----
+
 [source,java]
-----/*
+
+----
+/*
  * To change this template, choose Tools | Templates
  * and open the template in the editor.
  */
@@ -95,26 +101,36 @@ public class MyStartScreen extends AbstractAppState implements ScreenController
         throw new UnsupportedOperationException("Not supported yet.");
     }
 }
+
 ----
+
 The name and package of your custom ScreenController class (here `mygame.MyStartScreen`) goes into the controller parameter of the respective XML screen it belongs to. For example:
 
 
 [source,xml]
+
 ----
+
 <nifty>
   <screen id="start" controller="mygame.MyStartScreen">
       <!-- layer and panel code ... -->
   </screen>
 </nifty>
+
 ----
+
 Or the same in a Java syntax, respectively:
 
 
 [source,java]
+
 ----
+
   nifty.addScreen("start", new ScreenBuilder("start") {{
       controller(new mygame.MyStartScreen())}});
+
 ----
+
 Now the Java class `MyStartScreen` and this +++<abbr title="Graphical User Interface">GUI</abbr>+++ screen (`start`) are connected. For this example you can also connect the `hud` screen to MyStartScreen.
 
 
@@ -150,7 +166,9 @@ In the following example, we call the `startGame()` method when the player click
 
 
 [source,xml]
+
 ----
+
         <panel id="panel_bottom_left" height="50%" width="50%" valign="center" childLayout="center">  
           <control name="button" label="Start" id="StartButton" align="center" valign="center" 
           visibleToMouse="true" > 
@@ -164,12 +182,16 @@ In the following example, we call the `startGame()` method when the player click
             <interact onClick="quitGame()"/>
           </control>
         </panel>
+
 ----
+
 Or the same in a Java syntax, respectively:
 
 
 [source,java]
+
 ----
+
 control(new ButtonBuilder("StartButton", "Start") {{
   alignCenter();
   valignCenter();
@@ -188,12 +210,16 @@ control(new ButtonBuilder("QuitButton", "Quit") {{
   visibleToMouse(true);
   interactOnClick("quitGame()");
 }});
+
 ----
+
 Back in the MyStartScreen class, you specify what the `startGame()` and `quitGame()` methods do. As you see, you can pass String arguments (here `hud`) in the method call. You also see that you have access to the app object.
 
 
 [source,java]
+
 ----
+
 public class MyStartScreen implements ScreenController {
   ...
 
@@ -209,7 +235,9 @@ public class MyStartScreen implements ScreenController {
   
   ...
 }
+
 ----
+
 The startGame() example simply switches the +++<abbr title="Graphical User Interface">GUI</abbr>+++ to the `hud` screen when the user clicks Start. Of course, in a real game, you would perform more steps here: Load the game level, switch to in-game input and navigation handling, set a custom `running` boolean to true, attach custom in-game AppStates – and lots more.
 
 
@@ -226,32 +254,44 @@ First define a Java method in the screen controller, in this example, `getPlayer
 
 
 [source,java]
+
 ----
+
 public class MySettingsScreen implements ScreenController {
   ...
   public String getPlayerName(){
     return System.getProperty("user.name");
   }
 }
+
 ----
+
 Nifty uses `${CALL.getPlayerName()}` to get the return value of the getPlayerName() method from your ScreenController Java class.
 
 
 [source,xml]
+
 ----
+
 <text text="${CALL.getPlayerName()}'s Cool Game" font="Interface/Fonts/Default.fnt" width="100%" height="100%" />
+
 ----
+
 Or the same in a Java syntax, respectively:
 
 
 [source,java]
-----text(new TextBuilder() {{
+
+----
+text(new TextBuilder() {{
   text("${CALL.getPlayerName()}'s Cool Game");
   font("Interface/Fonts/Default.fnt");
   height("100%");
   width("100%");
 }});
+
 ----
+
 You can use this for Strings and numeric values (e.g. when you read settings from a file, you display the results in the +++<abbr title="Graphical User Interface">GUI</abbr>+++) and also for methods with side effects.
 
 
@@ -265,37 +305,53 @@ Here's an example of how to change an image called `playerhealth`:
 
 
 [source,java]
+
 ----
+
 // load or create new image
 NiftyImage img = nifty.getRenderEngine().createImage("Interface/Images/face2.png", false);
 // find old image
 Element niftyElement = nifty.getCurrentScreen().findElementByName("playerhealth");
 // swap old with new image
 niftyElement.getRenderer(ImageRenderer.class).setImage(img);
+
 ----
+
 The same is valid for other elements, for example a text label “score:
 
 
 [source,java]
+
 ----
+
 // find old text
 Element niftyElement = nifty.getCurrentScreen().findElementByName("score");
 // swap old with new text
 niftyElement.getRenderer(TextRenderer.class).setText("124");
+
 ----
+
 Similarly, to change the onClick() event of an element, create an `ElementInteraction` object:
 
 
 [source,java]
+
 ----
+
 Element niftyElement = nifty.getCurrentScreen().findElementByName("myElement");
 niftyElement.getElementInteraction().getPrimary().setOnMouseOver(new NiftyMethodInvoker(nifty, "myCustomMethod()", this));
+
 ----
+
 For this to work, there already needs to be a (possibly inactive) `&lt;interact /&gt;` tag inside your xml element:
 
 
 [source,xml]
-----<interact onClick="doNothing()"/>----
+
+----
+<interact onClick="doNothing()"/>
+----
+
 
 == Next Steps
 

+ 76 - 16
src/docs/asciidoc/jme3/advanced/nifty_gui_java_layout.adoc

@@ -33,7 +33,9 @@ Just so you get a quick picture what Nifty +++<abbr title="Graphical User Interf
 
 
 [source,java]
-----package mygame;
+
+----
+package mygame;
  
 import com.jme3.app.SimpleApplication;
 import com.jme3.niftygui.NiftyJmeDisplay;
@@ -96,7 +98,9 @@ public class Main extends SimpleApplication {
  
     nifty.gotoScreen("Screen_ID"); // start the screen
     }
-}----
+}
+----
+
 
 == Implement Your GUI Layout
 
@@ -118,7 +122,9 @@ The following minimal Java file contains a start screen and a HUD screen. (Neith
 
 
 [source,java]
+
 ----
+
 nifty.addScreen("start", new ScreenBuilder("start"){{
     controller(new DefaultScreenController());
     // <!-- ... -->
@@ -128,7 +134,9 @@ nifty.addScreen("hud", new ScreenBuilder("hud"){{
     controller(new DefaultScreenController());
     // <!-- ... -->
   }}.build(nifty));
+
 ----
+
 Every Nifty +++<abbr title="Graphical User Interface">GUI</abbr>+++ must have a start screen. The others (in this example, the HUD screen) are optional. 
 
 
@@ -139,7 +147,9 @@ The following Java code shows how we add layers to the start screen and HUD scre
 
 
 [source,java]
+
 ----
+
 nifty.addScreen("start", new ScreenBuilder("start"){{
         controller(new DefaultScreenController());
  
@@ -159,12 +169,18 @@ nifty.addScreen("start", new ScreenBuilder("start"){{
          }});
          // layer added
  
-      }}.build(nifty));----
+      }}.build(nifty));
+----
+
 Repeat the same, but use 
 
 
 [source]
-----nifty.addScreen("hud", new ScreenBuilder("hud"){{----
+
+----
+nifty.addScreen("hud", new ScreenBuilder("hud"){{
+----
+
  for the HUD screen.
 
 
@@ -178,7 +194,9 @@ A panel is the inner-most container (that will contain the actual content: text,
 
 
 [source,java]
+
 ----
+
     nifty.addScreen("start", new ScreenBuilder("start") {{
         controller(new DefaultScreenController());
         layer(new LayerBuilder("background") {{
@@ -234,12 +252,16 @@ A panel is the inner-most container (that will contain the actual content: text,
         }});
 
     }}.build(nifty));
+
 ----
+
 The following panels go into in the `hud` screen:
 
 
 [source,Java]
+
 ----
+
     nifty.addScreen("hud", new ScreenBuilder("hud") {{
         controller(new DefaultScreenController());
 
@@ -291,7 +313,9 @@ The following panels go into in the `hud` screen:
                 }});
             }}); // panel added
         }});
-    }}.build(nifty));----
+    }}.build(nifty));
+----
+
 Try the sample. Remember to activate a screen using `nifty.gotoScreen(“start);` or `hud` respectively.
 The result should look as follows:
 
@@ -314,7 +338,9 @@ The start-background.png image is a fullscreen background picture. In the `start
 
 
 [source,java]
+
 ----
+
     nifty.addScreen("start", new ScreenBuilder("start") {{
         controller(new DefaultScreenController());
         layer(new LayerBuilder("background") {{
@@ -327,12 +353,16 @@ The start-background.png image is a fullscreen background picture. In the `start
             }});
 
         }});
+
 ----
+
 The hud-frame.png image is a transparent frame that we use as HUD decoration. In the `hud` screen, add the following image element:
 
 
 [source,java]
-----    nifty.addScreen("hud", new ScreenBuilder("hud") {{
+
+----
+    nifty.addScreen("hud", new ScreenBuilder("hud") {{
         controller(new DefaultScreenController());
 
         layer(new LayerBuilder("background") {{
@@ -344,13 +374,17 @@ The hud-frame.png image is a transparent frame that we use as HUD decoration. In
                 filename("Interface/tutorial/hud-frame.png");
             }});
 
-        }});----
+        }});
+----
+
 The face1.png image is an image that you want to use as a status icon. 
 In the `hud` screen's `foreground` layer, add the following image element:
 
 
 [source,java]
-----                panel(new PanelBuilder("panel_top_right2") {{
+
+----
+                panel(new PanelBuilder("panel_top_right2") {{
                     childLayoutCenter();
                     backgroundColor("#44f8");
                     height("15%");
@@ -365,7 +399,9 @@ In the `hud` screen's `foreground` layer, add the following image element:
                         width("30%");
                     }});
                     
-                }});----
+                }});
+----
+
 This image is scaled to use 50% of the height and 30% of the width of its container.
 
 
@@ -376,7 +412,9 @@ The game title is a typical example of static text. In the `start` screen, add t
 
 
 [source,java]
+
 ----
+
            // panel added
             panel(new PanelBuilder("panel_top") {{
                 childLayoutCenter();
@@ -393,12 +431,16 @@ The game title is a typical example of static text. In the `start` screen, add t
                     width("100%");
                 }});
                 
-            }});----
+            }});
+----
+
 For longer pieces of static text, such as an introduction, you can use wrap=“true. Add the following text element to the `Start screen`:
 
 
 [source,java]
+
 ----
+
             panel(new PanelBuilder("panel_mid") {{
                 childLayoutCenter();
                 alignCenter();
@@ -415,7 +457,9 @@ For longer pieces of static text, such as an introduction, you can use wrap=“t
                     width("100%");
                 }});
 
-            }});----
+            }});
+----
+
 The font used is jME3's default font “Interface/Fonts/Default.fnt which is included in the jMonkeyEngine.JAR. You can add your own fonts to your own `assets/Interface` directory.
 
 
@@ -426,9 +470,13 @@ Before you can use any control, you must load a Control Definition first. Add th
 
 
 [source,java]
+
 ----
+
     nifty.loadStyleFile("nifty-default-styles.xml");
-    nifty.loadControlFile("nifty-default-controls.xml");----
+    nifty.loadControlFile("nifty-default-controls.xml");
+----
+
 
 ==== Label Control
 
@@ -437,7 +485,9 @@ In the `hud` screen's `foreground` layer, add the following text element:
 
 
 [source,java]
-----                panel(new PanelBuilder("panel_top_right1") {{
+
+----
+                panel(new PanelBuilder("panel_top_right1") {{
                     childLayoutCenter();
                     backgroundColor("#00f8");
                     height("15%");
@@ -448,7 +498,9 @@ In the `hud` screen's `foreground` layer, add the following text element:
                         text("123"); 
                         width("100%"); 
                         height("100%");
-                    }});----
+                    }});
+----
+
 Note that the width and height do not scale the bitmap font, but make indirectly certain it is centered. If you want a different size for the font, you need to provide an extra bitmap font (they come with fixes sizes and don't scale well).
 
 
@@ -459,7 +511,9 @@ Our +++<abbr title="Graphical User Interface">GUI</abbr>+++ plan asks for two bu
 
 
 [source,java]
+
 ----
+
                 panel(new PanelBuilder("panel_bottom_left") {{
                     childLayoutCenter();
                     valignCenter();
@@ -492,7 +546,9 @@ Our +++<abbr title="Graphical User Interface">GUI</abbr>+++ plan asks for two bu
                       width("50%");
                     }});
 
-                }});----
+                }});
+----
+
 Note that these controls don't do anything yet – we'll get to that soon.
 
 
@@ -548,7 +604,11 @@ Example:
 
 
 [source,java]
-----nifty.registerMouseCursor("hand", "Interface/mouse-cursor-hand.png", 5, 4);----
+
+----
+nifty.registerMouseCursor("hand", "Interface/mouse-cursor-hand.png", 5, 4);
+----
+
 
 == Next Steps
 

+ 14 - 2
src/docs/asciidoc/jme3/advanced/nifty_gui_overlay.adoc

@@ -32,7 +32,9 @@ This code shows you how to overlay anything on the screen with the +++<abbr titl
 
 
 [source,java]
+
 ----
+
 NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(
     assetManager, inputManager, audioRenderer, guiViewPort);
 /** Create a new NiftyGUI object */
@@ -44,12 +46,18 @@ nifty.fromXml("Interface/tutorial/step2/screen.xml", "start");
 guiViewPort.addProcessor(niftyDisplay);
 // disable the fly cam
 flyCam.setDragToRotate(true);
+
 ----
+
 Currently you do not have a ScreenController – we will create one in the next exercise. As soon  as you have a screen controller, you will use the commented variant of the XML loading method:
 
 
 [source,java]
-----nifty.fromXml("Interface/helloworld.xml", "start", new MySettingsScreen());----
+
+----
+nifty.fromXml("Interface/helloworld.xml", "start", new MySettingsScreen());
+----
+
 The `MySettingsScreen` class is a custom de.lessvoid.nifty.screen.ScreenController in which you will implement your +++<abbr title="Graphical User Interface">GUI</abbr>+++ behaviour. 
 
 
@@ -58,7 +66,11 @@ simply added to whatever XML data has been loaded before.
 
 
 [source,java]
-----nifty.addXml("Interface/mysecondscreen.xml");----
+
+----
+nifty.addXml("Interface/mysecondscreen.xml");
+----
+
 
 == Next Steps
 

+ 13 - 2
src/docs/asciidoc/jme3/advanced/nifty_gui_popup_menu.adoc

@@ -7,7 +7,9 @@ The popup element needs to be placed _outside_ of any screen!
 
 
 [source,xml]
+
 ----
+
 <useControls filename="nifty-default-controls.xml"/>
 ...
 <popup id="niftyPopupMenu" childLayout="absolute-inside"
@@ -15,7 +17,9 @@ The popup element needs to be placed _outside_ of any screen!
   <interact onClick="closePopup()" onSecondaryClick="closePopup()" onTertiaryClick="closePopup()" />
   <control id="#menu" name="niftyMenu" />
 </popup>
-...----
+...
+----
+
 A brief explanation of some the attributes above:
 
 
@@ -28,7 +32,9 @@ The Java code within your defined ScreenController implementation:
 
 
 [source,java]
+
 ----
+
 private Element popup;
 ...
 public void createMyPopupMenu(){
@@ -60,7 +66,9 @@ private class menuItem {
     this.name = name;
   }
 }
+
 ----
+
 *  The createMyPopupMenu() method creates the menu with set width so that you can populate it.
 *  The showMenu() method is called by something to trigger the menu (i.e. could be a Key or some other method).
 *  Note: if you want to be able to access the popup via your id, use createPopupWithId(id, id) instead.
@@ -69,7 +77,9 @@ To handle menu item events (i.e. calling a method when you click on a menu item)
 
 
 [source,java]
+
 ----
+
   private class MenuItemActivatedEventSubscriber 
     implements EventTopicSubscriber<MenuItemActivatedEvent> {
     
@@ -81,4 +91,5 @@ To handle menu item events (i.e. calling a method when you click on a menu item)
        }
     }
   };
-----
+
+----

+ 4 - 0
src/docs/asciidoc/jme3/advanced/nifty_gui_projection.adoc

@@ -34,7 +34,9 @@ You can project the Nifty +++<abbr title="Graphical User Interface">GUI</abbr>++
 
 
 [source,java]
+
 ----
+
 /** Create a special viewport for the Nifty GUI */
 ViewPort niftyView = renderManager.createPreView("NiftyView", new Camera(1024, 768));
 niftyView.setClearEnabled(true);
@@ -62,7 +64,9 @@ Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
 mat.setTexture("m_ColorMap", niftytex); /** Here comes the texture! */
 geom.setMaterial(mat);
 rootNode.attachChild(geom);
+
 ----
+
 The MySettingsScreen class is a custom de.lessvoid.nifty.screen.ScreenController in which you implement your +++<abbr title="Graphical User Interface">GUI</abbr>+++ behaviour.  The variable `data` contains an object that you use to exchange state info with the game. See <<nifty_gui_java_interaction#,Nifty GUI Java Interaction>> for details on how to create this class.
 
 

+ 48 - 4
src/docs/asciidoc/jme3/advanced/nifty_gui_scenarios.adoc

@@ -39,7 +39,9 @@ This gives the ScreenController access to the application object and to the upda
 
 
 [source,java]
+
 ----
+
 public class StartScreenState extends AbstractAppState {
 
   private ViewPort viewPort;
@@ -81,12 +83,16 @@ public StartScreenState(SimpleApplication app){
     super.cleanup();
   }
   
-}----
+}
+----
+
 
 
 
 [source,java]
+
 ----
+
 public class TestNiftyGui extends SimpleApplication {
   public void simpleInitApp() {
      StartScreenState startScreenState = new StartScreenState(this);
@@ -95,8 +101,10 @@ public class TestNiftyGui extends SimpleApplication {
      nifty.fromXml("Interface/myGui.xml", "start", startScreenState); //one of the XML screen elements needs to reference StartScreenState controller class
   }
 }
+
 ----
 
+
 == Know Your Variables
 [cols="2", options="header"]
 |===
@@ -158,13 +166,17 @@ Here is an example that moves a panel when the startScreen opens. You place an &
 
 
 [source,xml]
+
 ----
+
 <panel height="25%" width="35%" ...>
   <effect>
     <onStartScreen name="move" mode="in" direction="top" length="300" startDelay="0" inherit="true"/>
   </effect>
 </panel>
+
 ----
+
 Learn more from the NiftyGUI page:
 
 
@@ -177,7 +189,9 @@ Playing sounds using Nifty is also possible with a `playSound` effect as trigger
 
 
 [source,xml]
+
 ----
+
 <registerSound id="myclick" filename="Interface/sounds/ButtonClick.ogg" />
 ...
 <label>
@@ -185,8 +199,10 @@ Playing sounds using Nifty is also possible with a `playSound` effect as trigger
     <onClick name="playSound" sound="myclick"/>
   </effect>
 </label>
+
 ----
 
+
 == Pass ClickLoc From Nifty to Java
 
 After a mouse click, you may want to record the 2D clickLoc and send this info to your Java application. Typical ScreenController methods however only have a String argument. You'd have to convert the String to ints.
@@ -196,18 +212,26 @@ To pass the clickLoc as two ints, you can use the special `(int x, int y)` synta
 
 
 [source,java]
+
 ----
+
   public void clicked(int x, int y) {
     // here you can use the x and y of the clickLoc
   }
+
 ----
+
 In the Nifty +++<abbr title="Graphical User Interface">GUI</abbr>+++ screen code (e.g. XML file) you must call the `(int x, int y)` method _without_ any parameters! 
 
 
 [source,xml]
+
 ----
+
 <interact onClick="clicked()"/>  
+
 ----
+
 You can name the method (here `clicked`) what ever you like, as long as you keep the argument syntax.
 
 
@@ -219,7 +243,9 @@ The following code sample shows how you can load several XML files into one nift
 
 
 [source,java]
+
 ----
+
 NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager, inputManager, audioRenderer, viewPort);
 Nifty nifty = niftyDisplay.getNifty();
 nifty.addXml("Interface/Screens/OptionsScreen.xml");
@@ -230,8 +256,10 @@ OptionsScreenControl optionsControl = (OptionsScreenControl) nifty.getScreen("op
 stateManager.attach(screenControl);
 stateManager.attach(optionsControl);
 guiViewPort.addProcessor(niftyDisplay);
+
 ----
 
+
 == Register additional explicit screen controllers
 
 In addition to the `nifty.addXml()` methods to attach many nifty XML files, there exists a `nifty.registerScreenController()` method to explicitly attach more screen controllers. 
@@ -241,31 +269,45 @@ The following code sample shows how you can explicitly attach several screen con
 
 
 [source,java]
+
 ----
+
 NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager, inputManager, audioRenderer, viewPort);
 Nifty nifty = niftyDisplay.getNifty();
 
 nifty.registerScreenController(new OptionsScreenController(randomConstructorArgument));
 nifty.addXml("Interface/Screens/OptionsScreen.xml");
+
 ----
 
+
 == Design Your Own Styles
 
 By default, your Nifty XML screens use the built.in styles:
 
 
 [source,xml]
----- <useStyles filename="nifty-default-styles.xml" /> ----
+
+----
+ <useStyles filename="nifty-default-styles.xml" /> 
+----
+
 But you can switch to a set of custom styles in your game project's asset directory like this:
 
 
 [source,xml]
----- <useStyles filename="Interface/Styles/myCustomStyles.xml" /> ----
+
+----
+ <useStyles filename="Interface/Styles/myCustomStyles.xml" /> 
+----
+
 Inside myCustomStyles.xml you define styles like this:
 
 
 [source,xml]
-----	
+
+----
+	
 <?xml version="1.0" encoding="UTF-8"?>
 <nifty-styles>
   <useStyles filename="Interface/Styles/Font/myCustomFontStyle.xml" />
@@ -273,7 +315,9 @@ Inside myCustomStyles.xml you define styles like this:
   <useStyles filename="Interface/Styles/Label/myCustomLabelStyle.xml" />
   ...
 </nifty-styles>
+
 ----
+
 Learn more about how to create styles by looking at the link:http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Build_from_Source[Nifty GUI source code] for “nifty-style-black”. Copy it as a template and change it to create your own style.
 
 '''

+ 56 - 0
src/docs/asciidoc/jme3/advanced/nifty_gui_xml_layout.adoc

@@ -66,7 +66,9 @@ The following minimal XML file contains a start screen and a HUD screen. (Neithe
 
 
 [source,xml]
+
 ----
+
 <?xml version="1.0" encoding="UTF-8"?>
 <nifty xmlns="http://nifty-gui.sourceforge.net/nifty-1.3.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd">
   <screen id="start">
@@ -77,7 +79,9 @@ The following minimal XML file contains a start screen and a HUD screen. (Neithe
   </screen>
 </nifty>
 
+
 ----
+
 Every Nifty +++<abbr title="Graphical User Interface">GUI</abbr>+++ must have a start screen. The others (in this example, the HUD screen) are optional. 
 
 
@@ -92,7 +96,9 @@ Delete all from the file and add following code:
 
 
 [source,xml]
+
 ----
+
 <nifty>
   <screen id="start">
     <layer id="background" backgroundColor="#000f">
@@ -111,7 +117,9 @@ Delete all from the file and add following code:
     </layer>
   </screen>
 </nifty>
+
 ----
+
 In a layer, you can now add panels and arrange them. Panels are containers that mark the areas where you want to display text, images, or controls (buttons etc) later. 
 
 
@@ -122,7 +130,9 @@ A panel is the inner-most container (that will contain the actual content: text,
 
 
 [source,xml]
+
 ----
+
       <panel id="panel_top" height="25%" width="75%" align="center" childLayout="center"
              backgroundColor="#f008">  
       </panel>
@@ -138,12 +148,16 @@ A panel is the inner-most container (that will contain the actual content: text,
              backgroundColor="#88f8">  
         </panel>
       </panel>
+
 ----
+
 The following panels go into in the `hud` screen's `foreground` layer:
 
 
 [source,xml]
+
 ----
+
       <panel id="panel_left" width="80%" height="100%" childLayout="vertical" 
       backgroundColor="#0f08">  
         <!-- spacer -->
@@ -160,7 +174,9 @@ The following panels go into in the `hud` screen's `foreground` layer:
              backgroundColor="#88f8">  
         </panel>
       </panel>
+
 ----
+
 The result should look as follows:
 
 
@@ -182,40 +198,56 @@ The link:http://hub.jmonkeyengine.org/wiki/lib/exe/fetch.php/jme3:advanced:start
 
 
 [source,xml]
+
 ----
+
     <layer id="background" childLayout="center">
         <image filename="Interface/start-background.png"></image>
     </layer>
+
 ----
+
 The link:http://hub.jmonkeyengine.org/wiki/lib/exe/fetch.php/jme3:advanced:hud-frame.png[hud-frame.png] image is a transparent frame that we use as HUD decoration. Add it to `Interface`. In the `hud` screen, add the following image element:
 
 
 [source,xml]
+
 ----
+
     <layer id="background" childLayout="center">
         <image filename="Interface/hud-frame.png"></image>
     </layer>
+
 ----
+
 In order to make the hud-frame.png independent of the screen resolution you are using, you could use the `imageMode` attribute on the image element link:http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Resizable_Images_(ImageMode%3Dresize)_explained[ Resizable Images (ImageMode=resize) explained]
 
 
 [source,xml]
+
 ----
+
     <layer id="background" childLayout="center">
         <image filename="Interface/hud-frame.png" imageMode="resize:40,490,110,170,40,560,40,270,40,560,40,40" width="100%" height="100%"/>
     </layer>
+
 ----
+
 The link:http://hub.jmonkeyengine.org/wiki/lib/exe/fetch.php/jme3:advanced:face1.png[face1.png] image is an image that you want to use as a status icon. Add it to `Interface`.
 In the `hud` screen's `foreground` layer, add the following image element:
 
 
 [source,xml]
+
 ----
+
         <panel id="panel_top_right2" width="100%" height="15%" childLayout="center">
             <image filename="Interface/face1.png" valign="center" align="center" height="50%" width="30%" >
             </image>  
         </panel>
+
 ----
+
 This image is scaled to use 50% of the height and 30% of the width of its container.
 
 
@@ -226,22 +258,30 @@ The game title is a typical example of static text. In the `start` screen, add t
 
 
 [source,xml]
+
 ----
+
       <panel id="panel_top" height="25%" width="75%" align="center" childLayout="center">  
           <text text="My Cool Game" font="Interface/Fonts/Default.fnt" width="100%" height="100%" />
       </panel>
+
 ----
+
 For longer pieces of static text, such as an introduction, you can use wrap=“true. Add the following text element to the `Start screen`:
 
 
 [source,xml]
+
 ----
+
       <panel id="panel_mid" height="50%" width="75%" align="center" childLayout="center">       
         <text text="Here goes some text describing the game and the rules and stuff. Incidentally, 
          the text is quite long and needs to wrap at the end of lines. ..." 
         font="Interface/Fonts/Default.fnt" width="100%" height="100%" wrap="true" />
       </panel>
+
 ----
+
 The font used is jME3's default font “Interface/Fonts/Default.fnt which is included in the jMonkeyEngine.JAR. You can add your own fonts to your own `assets/Interface/Fonts` directory.
 Adjust the path to your font-name.
 
@@ -253,10 +293,14 @@ Before you can use any control, you must load a Control Definition first. Add th
 
 
 [source,xml]
+
 ----
+
   <useStyles filename="nifty-default-styles.xml" />
   <useControls filename="nifty-default-controls.xml" />
+
 ----
+
 Note that the useStyles tag must be the first child of the nifty tag, otherwise you will see an error in design view.
 
 
@@ -268,11 +312,15 @@ In the `hud` screen's `foreground` layer, add the following text element:
 
 
 [source,xml]
+
 ----
+
         <panel id="panel_top_right" height="100%" width="15%" childLayout="center">  
             <control name="label" color="#000" text="123" width="100%" height="100%" />
         </panel>
+
 ----
+
 Note that the width and height do not scale the bitmap font, but indirectly make certain it is centered. If you want a different size for the font, you need to provide an extra bitmap font (they come with fixed sizes and don't scale well).
 
 
@@ -283,7 +331,9 @@ Our +++<abbr title="Graphical User Interface">GUI</abbr>+++ plan asks for two bu
 
 
 [source,xml]
+
 ----
+
         <panel id="panel_bottom_left" height="50%" width="50%" valign="center" childLayout="center">  
           <control name="button" label="Start" id="StartButton" align="center" valign="center"> 
           </control>
@@ -292,7 +342,9 @@ Our +++<abbr title="Graphical User Interface">GUI</abbr>+++ plan asks for two bu
           <control name="button" label="Quit" id="QuitButton" align="center" valign="center"> 
           </control>
         </panel>
+
 ----
+
 Note that these controls don't do anything yet – we'll get to that soon.
 
 
@@ -303,7 +355,9 @@ Your screen.xml should look like this:
 
 
 [source,xml]
+
 ----
+
 <?xml version="1.0" encoding="UTF-8"?>
 <nifty xmlns="http://nifty-gui.sourceforge.net/nifty-1.3.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd">
   <useStyles filename="nifty-default-styles.xml" />
@@ -347,8 +401,10 @@ Your screen.xml should look like this:
     </layer>
   </screen>
 </nifty>
+
 ----
 
+
 ==== Other Controls
 
 Nifty additionally offers many customizable controls such as check boxes, text fields, menus, chats, tabs, … See also link:http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Elements[Elements] on the Nifty +++<abbr title="Graphical User Interface">GUI</abbr>+++ site.

+ 30 - 6
src/docs/asciidoc/jme3/advanced/particle_emitters.adoc

@@ -17,18 +17,34 @@ image:jme3/advanced/explosion-5.png[explosion-5.png,with="150",height="100"]  im
 
 .  Create one emitter for each effect: 
 [source,java]
-----ParticleEmitter explosion = new ParticleEmitter(
-"My explosion effect", Type.Triangle, 30);----
+
+----
+ParticleEmitter explosion = new ParticleEmitter(
+"My explosion effect", Type.Triangle, 30);
+----
+
 .  Attach the emitter to the rootNode and position it in the scene: 
 [source,java]
-----rootNode.attachChild(explosion);
-explosion.setLocalTranslation(bomb.getLocalTranslation());----
+
+----
+rootNode.attachChild(explosion);
+explosion.setLocalTranslation(bomb.getLocalTranslation());
+----
+
 .  Trigger the effect by calling 
 [source,java]
-----explosion.emitAllParticles()----
+
+----
+explosion.emitAllParticles()
+----
+
 .  End the effect by calling 
 [source,java]
-----explosion.killAllParticles()----
+
+----
+explosion.killAllParticles()
+----
+
 
 Choose one of the following mesh shapes
 
@@ -146,7 +162,9 @@ Use the common Particle.j3md Material Definition and a texture to specify the sh
 
 
 [source,java]
+
 ----
+
     Material flash_mat = new Material(
         assetManager, "Common/MatDefs/Misc/Particle.j3md");
     flash_mat.setTexture("Texture",
@@ -155,7 +173,9 @@ Use the common Particle.j3md Material Definition and a texture to specify the sh
     flash.setImagesX(2); // columns
     flash.setImagesY(2); // rows
     flash.setSelectRandomImage(true);
+
 ----
+
 The effect texture can be one image, or contain a sprite animation – a series of slightly different pictures in equally spaced rows and columns. If you choose the sprite animation:
 
 
@@ -219,7 +239,9 @@ a| image:http///jmonkeyengine.googlecode.com/svn/trunk/engine/test-data/Effects/
 == Usage Example
 
 [source,java]
+
 ----
+
     ParticleEmitter fire = new ParticleEmitter("Emitter", Type.Triangle, 30);
     Material mat_red = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
     mat_red.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/flame.png"));
@@ -235,7 +257,9 @@ a| image:http///jmonkeyengine.googlecode.com/svn/trunk/engine/test-data/Effects/
     fire.setHighLife(3f);
     fire.getParticleInfluencer().setVelocityVariation(0.3f);
     rootNode.attachChild(fire);
+
 ----
+
 Browse the full source code of all link:https://github.com/jMonkeyEngine/jmonkeyengine/tree/master/jme3-examples/src/main/java/jme3test/effect[effect examples] here.
 
 '''

+ 106 - 30
src/docs/asciidoc/jme3/advanced/physics.adoc

@@ -86,18 +86,30 @@ Do the following once per application to gain access to the `physicsSpace` objec
 .  Make your application extend `com.jme3.app.SimpleApplication`.
 .  Create a BulletAppState field: 
 [source,java]
-----private BulletAppState bulletAppState;----
+
+----
+private BulletAppState bulletAppState;
+----
+
 .  Initialize your bulletAppState and attach it to the state manager: 
 [source,java]
-----public void simpleInitApp() {
+
+----
+public void simpleInitApp() {
     bulletAppState = new BulletAppState();
-    stateManager.attach(bulletAppState);----
+    stateManager.attach(bulletAppState);
+----
+
 
 `BulletAppState`
 
 
 [source,java]
-----BulletAppState bas = app.getStateManager().getState(BulletAppState.class);----
+
+----
+BulletAppState bas = app.getStateManager().getState(BulletAppState.class);
+----
+
 
 
 
@@ -214,7 +226,11 @@ The mesh-accurate shapes can use a CollisionShapeFactory as constructor (code sa
 
 
 [source,java]
-----bulletAppState.getPhysicsSpace().enableDebug(assetManager);----
+
+----
+bulletAppState.getPhysicsSpace().enableDebug(assetManager);
+----
+
 
 
 
@@ -223,28 +239,52 @@ The mesh-accurate shapes can use a CollisionShapeFactory as constructor (code sa
 
 *  One way of using a constructor and a Geometry's mesh for static Spatials:
 [source,java]
-----MeshCollisionShape level_shape = 
-    new MeshCollisionShape(level_geo.getMesh());----
+
+----
+MeshCollisionShape level_shape = 
+    new MeshCollisionShape(level_geo.getMesh());
+----
+
 *  One way of using a constructor and a Geometry's mesh for dynamic Spatials:
 [source,java]
-----HullCollisionShape shape = 
-    new HullCollisionShape(katamari_geo.getMesh());----
+
+----
+HullCollisionShape shape = 
+    new HullCollisionShape(katamari_geo.getMesh());
+----
+
 *  Creating a dynamic compound shape for a whole Node and subnodes:
 [source,java]
-----CompoundCollisionShape myComplexShape =
-    CollisionShapeFactory.createMeshShape((Node) myComplexGeometry );----
+
+----
+CompoundCollisionShape myComplexShape =
+    CollisionShapeFactory.createMeshShape((Node) myComplexGeometry );
+----
+
 *  Creating a dynamic HullCollisionShape shape (or CompoundCollisionShape with HullCollisionShapes as children) for a Geometry:
 [source,java]
-----CollisionShape shape = 
-    CollisionShapeFactory.createDynamicMeshShape(spaceCraft);----
+
+----
+CollisionShape shape = 
+    CollisionShapeFactory.createDynamicMeshShape(spaceCraft);
+----
+
 *  An angular, non-mesh-accurate compound shape:
 [source,java]
-----CompoundCollisionShape boxShape =
-    CollisionShapeFactory.createBoxShape((Node) crate_geo);----
+
+----
+CompoundCollisionShape boxShape =
+    CollisionShapeFactory.createBoxShape((Node) crate_geo);
+----
+
 *  A round, non-mesh-accurate compound shape: 
 [source,java]
-----SphereCollisionShape sphereShape =
-    new SphereCollisionShape(1.0f);----
+
+----
+SphereCollisionShape sphereShape =
+    new SphereCollisionShape(1.0f);
+----
+
 
 
 == Create PhysicsControl
@@ -300,11 +340,19 @@ The most commonly used physics control is RigidBodyControl.  The RigidBodyContro
 
 
 [source,java]
-----RigidBodyControl myThing_phys = 
-    new RigidBodyControl( myThing_shape , 123.0f ); // dynamic----
+
+----
+RigidBodyControl myThing_phys = 
+    new RigidBodyControl( myThing_shape , 123.0f ); // dynamic
+----
+
 [source,java]
-----RigidBodyControl myDungeon_phys = 
-    new RigidBodyControl( myDungeon_shape , 0.0f ); // static ----
+
+----
+RigidBodyControl myDungeon_phys = 
+    new RigidBodyControl( myDungeon_shape , 0.0f ); // static 
+----
+
 
 
 
@@ -312,16 +360,24 @@ The following creates a box Geometry with the correct default BoxCollisionShape:
 
 
 [source,java]
+
 ----
+
 Box b = new Box(1,1,1);
 Geometry box_geo = new Geometry("Box", b);
-box_geo.addControl(new RigidBodyControl( 1.0f )); // explicit non-zero mass, implicit BoxCollisionShape----
+box_geo.addControl(new RigidBodyControl( 1.0f )); // explicit non-zero mass, implicit BoxCollisionShape
+----
+
 The following creates a MeshCollisionShape for a whole loaded (static) scene:
 
 
 [source,java]
-----...
-gameLevel.addControl(new RigidBodyControl(0.0f)); // explicit zero mass, implicit MeshCollisionShape----
+
+----
+...
+gameLevel.addControl(new RigidBodyControl(0.0f)); // explicit zero mass, implicit MeshCollisionShape
+----
+
 
 
 
@@ -333,7 +389,11 @@ For each physical Spatial in the scene:
 
 .  Add a PhysicsControl to a Spatial. 
 [source,java]
-----myThing_geo.addControl(myThing_phys);----
+
+----
+myThing_geo.addControl(myThing_phys);
+----
+
 .  Remember to also attach the Spatial to the rootNode, as always!
 
 
@@ -344,12 +404,20 @@ The PhysicsSpace is an object in BulletAppState that is like a rootNode for Phys
 
 *  Just like you add the Geometry to the rootNode, you add its PhysicsControl to the PhysicsSpace. 
 [source,java]
-----bulletAppState.getPhysicsSpace().add(myThing_phys); 
-rootNode.attachChild(myThing_geo); ----
+
+----
+bulletAppState.getPhysicsSpace().add(myThing_phys); 
+rootNode.attachChild(myThing_geo); 
+----
+
 *  When you remove a Geometry from the scene and detach it from the rootNode, also remove the PhysicsControl from the PhysicsSpace: 
 [source,java]
-----bulletAppState.getPhysicsSpace().remove(myThing_phys);
-myThing_geo.removeFromParent();----
+
+----
+bulletAppState.getPhysicsSpace().remove(myThing_phys);
+myThing_geo.removeFromParent();
+----
+
 
 _PhysicsControl__Geometry_
 
@@ -367,7 +435,9 @@ When you import a model from blender, it often comes as a Node (even if it only
 
 
 [source,java]
+
 ----
+
 // Doesn't scale
 // This modified version contains Node -> Geometry (name = "MonkeyHeadGeom")
 Spatial model = assetManager.loadModel("Models/MonkeyHead.j3o"); model.addControl(new RigidBodyControl(0));
@@ -383,7 +453,9 @@ geom.addControl(new RigidBodyControl(0));
 // Works great (scaling of a MeshCollisionShape)	
 geom.getControl(RigidBodyControl.class).getCollisionShape().setScale(new Vector3f(2, 2, 2));
 bulletAppState.getPhysicsSpace().add(geom);
+
 ----
+
 With the corresponding output below:
 link:http://i.imgur.com/fAXlF.png[External Link]
 link:http://i.imgur.com/Josua.png[External Link]
@@ -644,7 +716,11 @@ a|Bullet does not use the full collision shape for continuous collision detectio
 *  *Eject?* If you have physical nodes jittering wildy and being ejected “for no apparent reason, it means you have created an impossible state – solid objects overlapping. This can happen when you position solid spatials too close to other solid spatials, e.g. when moving them with setLocalTranslation(). +
 *Solution:* Use the debug mode to make CollisionShapes visible and verify that CollisionShapes do not overlap. 
 [source,java]
-----bulletAppState.getPhysicsSpace().enableDebug(assetManager);----
+
+----
+bulletAppState.getPhysicsSpace().enableDebug(assetManager);
+----
+
 
 *  *Buggy?* If you get weird behaviour, such as physical nodes passing through one another, or getting stuck for no reason. +
 *Solution:* Look at the physics space accessors and change the acuracy and other parameters.

+ 32 - 8
src/docs/asciidoc/jme3/advanced/physics_listeners.adoc

@@ -25,7 +25,9 @@ The shape of the ghost depends on the CollisionShape that you gave the GhostCont
 
 
 [source,java]
+
 ----
+
 GhostControl ghost = new GhostControl(
   new BoxCollisionShape(new Vector3f(1,1,1)));  // a box-shaped ghost
 Node node = new Node("a ghost-controlled thing");
@@ -35,7 +37,9 @@ node.addControl(ghost);                         // the ghost follows this node
 // attach everything to activate it
 rootNode.attachChild(node);
 getPhysicsSpace().add(ghost);
-----[cols="2", options="header"]
+
+----
+[cols="2", options="header"]
 |===
 
 a|Ghost methods
@@ -78,8 +82,12 @@ Here's is the declaration of an examplary Physics Control that listens to ticks.
 
 
 [source,java]
-----public class MyCustomControl
-    extends RigidBodyControl implements PhysicsTickListener { ... }----
+
+----
+public class MyCustomControl
+    extends RigidBodyControl implements PhysicsTickListener { ... }
+----
+
 When you implement the interface, you have to implement `physicsTick()` and `preTick()` methods.
 
 
@@ -90,7 +98,9 @@ The tpf value is time per frame in seconds. You can use it as a factor to time a
 
 
 [source,java]
+
 ----
+
 @override
 public void prePhysicsTick(PhysicsSpace space, float tpf){
   // apply state changes ...
@@ -99,8 +109,10 @@ public void prePhysicsTick(PhysicsSpace space, float tpf){
 public void physicsTick(PhysicsSpace space, float tpf){
   // poll game state ...
 }
+
 ----
 
+
 == Physics Collision Listener
 
 
@@ -125,12 +137,16 @@ You need to add the PhysicsCollisionListener to the physics space before collisi
 
 
 [source,java]
-----public class MyCustomControl extends RigidBodyControl
+
+----
+public class MyCustomControl extends RigidBodyControl
     implements PhysicsCollisionListener {
     public MyCustomControl() {
         bulletAppState.getPhysicsSpace().addCollisionListener(this);
         ...
-    }----
+    }
+----
+
 To respond to the PhysicsCollisionEvent you now have to override the `collision()` method in MyCustomControl. This gives you access to the `event` object. Mostly you will be interested in the identity of any two nodes that collided: `event.getNodeA()` and `event.getNodeB()`.
 
 
@@ -138,7 +154,9 @@ After you identify the colliding nodes, specify the action to trigger when this
 
 
 [source,java]
+
 ----
+
     public void collision(PhysicsCollisionEvent event) {
         if ( event.getNodeA().getName().equals("player") ) {
             final Node node = event.getNodeA();
@@ -147,7 +165,9 @@ After you identify the colliding nodes, specify the action to trigger when this
             final Node node = event.getNodeB();
             /** ... do something with the node ... */
         }
-    }----
+    }
+----
+
 
 
 
@@ -196,5 +216,9 @@ For example, for a click-to-select, you only care if the selection ray collides
 
 
 [source,java]
-----myNode.getControl(RigidBodyControl.class).setCollisionGroup(PhysicsCollisionObject.COLLISION_GROUP_02);
-myNode.getControl(RigidBodyControl.class).setCollideWithGroups(PhysicsCollisionObject.COLLISION_GROUP_02);----<tags><tag target="documentation" /><tag target="physics" /><tag target="collision" /><tag target="forces" /><tag target="interaction" /></tags>
+
+----
+myNode.getControl(RigidBodyControl.class).setCollisionGroup(PhysicsCollisionObject.COLLISION_GROUP_02);
+myNode.getControl(RigidBodyControl.class).setCollideWithGroups(PhysicsCollisionObject.COLLISION_GROUP_02);
+----
+<tags><tag target="documentation" /><tag target="physics" /><tag target="collision" /><tag target="forces" /><tag target="interaction" /></tags>

+ 12 - 0
src/docs/asciidoc/jme3/advanced/post-processor_water.adoc

@@ -60,7 +60,9 @@ This is how you use the water filter post-processor code in your code:
 
 
 [source,java]
+
 ----
+
 private FilterPostProcessor fpp;
 private WaterFilter water;
 private Vector3f lightDir = new Vector3f(-4.9f, -1.3f, 5.9f); // same as light source
@@ -76,7 +78,9 @@ public void simpleInitApp() {
   viewPort.addProcessor(fpp);
   ...
 }
+
 ----
+
 Usually you make the water reflect everything attached to the rootNode. But you can also give a custom node (a subnode of the rootNode) to the WaterFilter constructor that has only a subset of scene nodes attached. This would be a relevant optimization if you have lots of nodes that are far away from the water, or covered, and will never be reflected.
 
 
@@ -87,7 +91,9 @@ If you want waves, set the water height in the update loop. We reuse the initial
 
 
 [source,java]
+
 ----
+
 private float time = 0.0f;
 private float waterHeight = 0.0f; 
 
@@ -98,8 +104,10 @@ public void simpleUpdate(float tpf) {
   waterHeight = (float) Math.cos(((time * 0.6f) % FastMath.TWO_PI)) * 1.5f;
   water.setWaterHeight(initialWaterHeight + waterHeight);
 }
+
 ----
 
+
 === Optional: Water Wave and Color Effects
 
 
@@ -279,11 +287,15 @@ You should also add audio nodes with water sounds to complete the effect.
 
 
 [source,java]
+
 ----
+
 AudioNode waves = new AudioNode(assetManager, "Sounds/Environment/Ocean Waves.ogg", false);
 waves.setLooping(true);
 audioRenderer.playSource(waves);
+
 ----
+
 See also: <<jme3/advanced/audio#,audio>>. 
 
 '''

+ 32 - 4
src/docs/asciidoc/jme3/advanced/ragdoll.adoc

@@ -37,7 +37,9 @@ Since you're just creating the ragdoll for this example, all the limbs have the
 
 
 [source,java]
+
 ----
+
 private Node createLimb(float width, float height, Vector3f location, boolean rotate) {
         int axis = rotate ? PhysicsSpace.AXIS_X : PhysicsSpace.AXIS_Y;
         CapsuleCollisionShape shape = new CapsuleCollisionShape(width, height, axis);
@@ -47,7 +49,9 @@ private Node createLimb(float width, float height, Vector3f location, boolean ro
         node.addControl(rigidBodyControl);
         return node;
 }
+
 ----
+
 You write a custom helper method to initialize the limbs. Look at the screenshot above for orientation.
 
 
@@ -57,7 +61,9 @@ You write a custom helper method to initialize the limbs. Look at the screenshot
 *  The shoulders and hips are _vertical_ cylinders, this is why we set the rotation to true.
 
 [source,java]
+
 ----
+
 Node shoulders = createLimb(0.2f, 1.0f, new Vector3f( 0.00f, 1.5f, 0), true);
 Node     uArmL = createLimb(0.2f, 0.5f, new Vector3f(-0.75f, 0.8f, 0), false);
 Node     uArmR = createLimb(0.2f, 0.5f, new Vector3f( 0.75f, 0.8f, 0), false);
@@ -69,7 +75,9 @@ Node     uLegL = createLimb(0.2f, 0.5f, new Vector3f(-0.25f,-1.2f, 0), false);
 Node     uLegR = createLimb(0.2f, 0.5f, new Vector3f( 0.25f,-1.2f, 0), false);
 Node     lLegL = createLimb(0.2f, 0.5f, new Vector3f(-0.25f,-2.2f, 0), false);
 Node     lLegR = createLimb(0.2f, 0.5f, new Vector3f( 0.25f,-2.2f, 0), false);
+
 ----
+
 You now have the outline of a person. But if you ran the application now, the individual limbs would fall down independently of one another – the ragdoll is still lacking joints.
 
 
@@ -83,7 +91,9 @@ As before, you write a small helper method. This time its purpose is to quickly
 *  Use a ConeJoint, a special joint that approximates the degree of freedom that limbs typically have. The ConeJoint constructor requires the two nodes, and the two local pivot coordinates that we just determined.
 *  Set the joints limits to allow swinging, but not twisting.
 [source,java]
-----private PhysicsJoint join(Node A, Node B, Vector3f connectionPoint) {
+
+----
+private PhysicsJoint join(Node A, Node B, Vector3f connectionPoint) {
         Vector3f pivotA = A.worldToLocal(connectionPoint, new Vector3f());
         Vector3f pivotB = B.worldToLocal(connectionPoint, new Vector3f());
         ConeJoint joint = new ConeJoint(A.getControl(RigidBodyControl.class),
@@ -91,13 +101,17 @@ As before, you write a small helper method. This time its purpose is to quickly
                                         pivotA, pivotB);
         joint.setLimit(1f, 1f, 0);
         return joint;
-}----
+}
+----
+
 
 Use the helper method to connect all limbs with joints where they belong, at one end of the limb.
 
 
 [source,java]
+
 ----
+
 join(body,  shoulders, new Vector3f( 0.00f,  1.4f, 0));
 join(body,       hips, new Vector3f( 0.00f, -0.5f, 0));
 join(uArmL, shoulders, new Vector3f(-0.75f,  1.4f, 0));
@@ -107,7 +121,9 @@ join(uArmR,     lArmR, new Vector3f( 0.75f,  0.4f, 0));
 join(uLegL,      hips, new Vector3f(-0.25f, -0.5f, 0));
 join(uLegR,      hips, new Vector3f( 0.25f, -0.5f, 0));
 join(uLegL,     lLegL, new Vector3f(-0.25f, -1.7f, 0));
-join(uLegR,     lLegR, new Vector3f( 0.25f, -1.7f, 0));----
+join(uLegR,     lLegR, new Vector3f( 0.25f, -1.7f, 0));
+----
+
 Now the ragdoll is connected. If you ran the app now, the doll would collapse, but the limbs would stay together.
 
 
@@ -118,7 +134,9 @@ We create one (non-physical) Node named ragDoll, and attach all other nodes to i
 
 
 [source,java]
+
 ----
+
 ragDoll.attachChild(shoulders);
 ragDoll.attachChild(body);
 ragDoll.attachChild(hips);
@@ -129,26 +147,36 @@ ragDoll.attachChild(lArmR);
 ragDoll.attachChild(uLegL);
 ragDoll.attachChild(uLegR);
 ragDoll.attachChild(lLegL);
-ragDoll.attachChild(lLegR);----
+ragDoll.attachChild(lLegR);
+----
+
 To use the ragdoll in a scene, we attach its main node to the rootNode, and to the PhysicsSpace.
 
 
 [source,java]
+
 ----
+
 rootNode.attachChild(ragDoll);
 bulletAppState.getPhysicsSpace().addAll(ragDoll);
+
 ----
 
+
 == Applying Forces
 
 To pull the doll up, you could add an input handler that triggers the following action:
 
 
 [source,java]
+
 ----
+
 Vector3f upforce = new Vector3f(0, 200, 0);
 shoulders.applyContinuousForce(true, upforce);
+
 ----
+
 We can use the action to pick the doll up and put it back on its feet, or what ever. Read more about <<jme3/advanced/physics#forcesmoving_physical_objects,Forces>> here.
 
 

+ 18 - 3
src/docs/asciidoc/jme3/advanced/read_graphic_card_capabilites.adoc

@@ -9,9 +9,13 @@ You can read (and print) the capabilities of the user's graphic card using the `
 
 
 [source,java]
+
 ----
+
 Collection<Caps> caps = renderer.getCaps();
-Logger.getLogger(HelloWorld.class.getName()).log(Level.INFO, “Caps: {0}”, caps.toString());----
+Logger.getLogger(HelloWorld.class.getName()).log(Level.INFO, “Caps: {0}”, caps.toString());
+----
+
 *Note:* Replace `HelloWorld` by the name of the class where you are using this line.
 
 
@@ -22,7 +26,9 @@ A newer graphic card has modern capabilities, for example OpenGL 2.1 and NonPowe
 
 
 [source]
+
 ----
+
 INFO: Running on jMonkeyEngine 3.0.0 
 INFO: Using LWJGL 2.8.2
 INFO: Selected display mode: 1280 x 720 x 0 @0Hz
@@ -38,12 +44,16 @@ OpenGL20, OpenGL21, ARBprogram, GLSL100, GLSL110, GLSL120,
 VertexTextureFetch, TextureArray, FloatTexture, 
 FloatColorBuffer, FloatDepthBuffer, PackedFloatTexture, SharedExponentTexture, PackedFloatColorBuffer, 
 TextureCompressionLATC, NonPowerOfTwoTextures, MeshInstancing]
+
 ----
+
 Here is an example of the capabilities of an semi-old graphic card that only supports OpenGL 2.0. If you use OpenGL 2.1 features you need to decide whether to branch to a low-quality replacement of the unsupported features (if you still want to support this card); or whether the game will not start at all and displays an error message explaining the user what capabilities his hardware is missing to be able to play the game.
 
 
 [source]
-----INFO: Running on jMonkey Engine 3 
+
+----
+INFO: Running on jMonkey Engine 3 
 INFO: Using LWJGL 2.7.1
 INFO: Selected display mode: 1024 x 768 x 0 @0Hz
 INFO: Adapter: null
@@ -57,13 +67,18 @@ INFO: Capabilities: [FrameBuffer, FrameBufferMRT, FrameBufferMultisample,
 OpenGL20, ARBprogram, GLSL100, GLSL110, GLSL120, 
 VertexTextureFetch, FloatTexture, 
 TextureCompressionLATC, NonPowerOfTwoTextures]
+
 ----
+
 This next example is lacking `NonPowerOfTwoTextures`, this tells you that this user's graphic card cannot handle textures with sizes that are not square powers of two (such as “128x128).
 
 
 [source]
+
 ----
+
 INFO: Capabilities: [FrameBuffer, FrameBufferMRT, FrameBufferMultisample, 
 OpenGL20, ARBprogram, GLSL100, GLSL110, GLSL120, 
 VertexTextureFetch, FloatTexture, TextureCompressionLATC]
-----
+
+----

+ 8 - 0
src/docs/asciidoc/jme3/advanced/recast.adoc

@@ -43,7 +43,9 @@ In next code is described how the user should build navigation mesh, and query f
 
 
 [source,java]
+
 ----
+
 // Step 1. Initialize build config.
 Config config = new Config();
 
@@ -220,7 +222,9 @@ if (status.isFailed()) {
     System.out.println("Could not init Detour navmesh query");
     return;
 }
+
 ----
+
 After this (if everything is successful) you can use methods in `query` that was created for path-finding purposes.
 
 
@@ -251,12 +255,16 @@ Instructions for downloading and setting it up:
 *  In Java project in class `com.jme3.ai.navigation.utils.RecastJNI.java` change +++<abbr title="Uniform Resource Locator">URL</abbr>+++ to where your build of C++ project is.
 
 [source,java]
+
 ----
+
 static {
     // the URL that needs to be changed
     System.load(".../jNavigationNative.dll");
 }
+
 ----
+
 If there is problem with building C++ project see <<jme3/advanced/building_recast#,link>>.
 
 

+ 14 - 2
src/docs/asciidoc/jme3/advanced/remote-controlling_the_camera.adoc

@@ -11,17 +11,27 @@ You can steer the camera using <<cinematics#,Cinematics>>:
 .  Create a Cinematic.
 .  Create a CameraNode and bind the camera object to the Cinematic. Note that we also give the camera node a name in this step. 
 [source,java]
-----CameraNode camNode = cinematic.bindCamera("topView", cam);----
+
+----
+CameraNode camNode = cinematic.bindCamera("topView", cam);
+----
+
 .  Position the camera node in its start location.
 .  Use activateCamera() to give the control of the camera to this node. You now see the scene from this camera's point of view. For example to see through the camera node named “topView, 6 seconds after the start of the cinematic, you'd write 
 [source,java]
-----cinematic.activateCamera(6, "topView");----
+
+----
+cinematic.activateCamera(6, "topView");
+----
+
 
 
 === Code Sample
 
 [source,java]
+
 ----
+
 flyCam.setEnabled(false);
 Cinematic cinematic = new Cinematic(rootNode, 20);
 
@@ -32,8 +42,10 @@ camNodeTop.getControl(0).setEnabled(false);
 CameraNode camNodeSide = cinematic.bindCamera("sideView", cam);
 camNodeSide.setControlDir(ControlDirection.CameraToSpatial);
 camNodeSide.getControl(0).setEnabled(false);
+
 ----
 
+
 == Moving the Camera
 
 If desired, attach the camNode to a MotionTrack to let it travel along waypoints. This is demonstrated in the link:http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/animation/TestCinematic.java[TestCameraMotionPath.java example].

+ 15 - 3
src/docs/asciidoc/jme3/advanced/save_and_load.adoc

@@ -29,7 +29,9 @@ The following example overrides `stop()` in SimpleApplication to save the rootNo
 
 
 [source,java]
+
 ----
+
   /* This is called when the user quits the app. */
   @Override
   public void stop() {
@@ -42,7 +44,9 @@ The following example overrides `stop()` in SimpleApplication to save the rootNo
       Logger.getLogger(Main.class.getName()).log(Level.SEVERE, "Error: Failed to save game!", ex);
     }
     super.stop(); // continue quitting the game
-  }----
+  }
+----
+
 
 == Loading a Node
 
@@ -50,7 +54,9 @@ The following example overrides `simpleInitApp()` in SimpleApplication to load `
 
 
 [source,java]
-----  @Override
+
+----
+  @Override
   public void simpleInitApp() {
      String userHome = System.getProperty("user.home");
      assetManager.registerLocator(userHome, FileLocator.class);
@@ -58,7 +64,9 @@ The following example overrides `simpleInitApp()` in SimpleApplication to load `
      loadedNode.setName("loaded node");
      rootNode.attachChild(loadedNode);
   }
-   ----
+   
+----
+
 
 
@@ -80,7 +88,9 @@ So every time you create a custom Control or custom user data class, remember to
 
 
 [source,java]
+
 ----
+
 import com.jme3.export.InputCapsule;
 import com.jme3.export.JmeExporter;
 import com.jme3.export.JmeImporter;
@@ -112,7 +122,9 @@ public class MyCustomClass implements Savable {
         someJmeObject  = capsule.readSavable("someJmeObject",  new Material());
     }
 }
+
 ----
+
 To make a custom class savable:
 
 

+ 4 - 0
src/docs/asciidoc/jme3/advanced/screenshots.adoc

@@ -9,10 +9,14 @@ You activate this feature as follows in your simpleInitApp() method:
 
 
 [source,java]
+
 ----
+
 ScreenshotAppState screenShotState = new ScreenshotAppState();
 this.stateManager.attach(screenShotState);
+
 ----
+
 The default screenshot key is KeyInput.KEY_SYSRQ, alos known as “System Request / Print Screen key. On Mac keyboards, this key does not exist, so on Mac +++<abbr title="Operating System">OS</abbr>+++ you take screenshots using Command+Shift+3 (fullscreen) or Command+Shift+4 (windowed: press space to select a window and then click).
 
 

+ 39 - 7
src/docs/asciidoc/jme3/advanced/shape.adoc

@@ -107,32 +107,64 @@ Create the Mesh shape:
 
 
 [source,java]
-----Sphere mesh = new Sphere(32, 32, 10, false, true);----
+
+----
+Sphere mesh = new Sphere(32, 32, 10, false, true);
+----
+
 [source,java]
-----Dome mesh = new Dome(Vector3f.ZERO, 2, 4, 1f,false); // Pyramid----
+
+----
+Dome mesh = new Dome(Vector3f.ZERO, 2, 4, 1f,false); // Pyramid
+----
+
 [source,java]
-----Dome mesh = new Dome(Vector3f.ZERO, 2, 32, 1f,false); // Cone----
+
+----
+Dome mesh = new Dome(Vector3f.ZERO, 2, 32, 1f,false); // Cone
+----
+
 [source,java]
-----Dome mesh = new Dome(Vector3f.ZERO, 32, 32, 1f,false); // Small hemisphere----
+
+----
+Dome mesh = new Dome(Vector3f.ZERO, 32, 32, 1f,false); // Small hemisphere
+----
+
 [source,java]
-----Dome mesh = new Dome(Vector3f.ZERO, 32, 32, 1000f,true); // SkyDome----
+
+----
+Dome mesh = new Dome(Vector3f.ZERO, 32, 32, 1000f,true); // SkyDome
+----
+
 [source,java]
-----PQTorus mesh = new PQTorus(5,3, 2f, 1f, 32, 32); // Spiral torus----
+
+----
+PQTorus mesh = new PQTorus(5,3, 2f, 1f, 32, 32); // Spiral torus
+----
+
 [source,java]
-----PQTorus mesh = new PQTorus(3,8, 2f, 1f, 32, 32); // Flower torus----
+
+----
+PQTorus mesh = new PQTorus(3,8, 2f, 1f, 32, 32); // Flower torus
+----
+
 Use one of the above examples together with the following geometry in a scene:
 
 
 [source,java]
+
 ----
+
 Geometry geom = new Geometry("A shape", mesh); // wrap shape into geometry
 Material mat = new Material(assetManager,      
     "Common/MatDefs/Misc/ShowNormals.j3md");   // create material
 geom.setMaterial(mat);                         // assign material to geometry
 // if you want, transform (move, rotate, scale) the geometry.
 rootNode.attachChild(geom);                    // attach geometry to a node
+
 ----
 
+
 == See also
 
 * <<jme3/intermediate/optimization#,Optimization>> – The GeometryBatchFactory class combines several of your shapes with the same texture into one mesh with one texture.

+ 4 - 0
src/docs/asciidoc/jme3/advanced/sky.adoc

@@ -17,10 +17,14 @@ Adding a sky is extremely easy using the `com.jme3.util.SkyFactory`.
 
 
 [source,java]
+
 ----
+
 rootNode.attachChild(SkyFactory.createSky(
             assetManager, "Textures/Sky/Bright/BrightSky.dds", false));
+
 ----
+
 To add a sky you need to supply:
 
 

+ 38 - 6
src/docs/asciidoc/jme3/advanced/spatial.adoc

@@ -100,33 +100,49 @@ This first example adds an integer field named `health` to the Spatial `playerNo
 
 
 [source,java]
-----playerNode.setUserData("health", 100);----
+
+----
+playerNode.setUserData("health", 100);
+----
+
 The second example adds a set of custom accessor methods to the player object. You create a <<custom_controls#,custom PlayerControl() class>> and you add this control to the Spatial:
 
 
 [source,java]
-----playerNode.addControl(new PlayerControl());----
+
+----
+playerNode.addControl(new PlayerControl());
+----
+
 In your PlayerControl() class, you define custom methods that set and get your user data in the `spatial` object. For example, the control could add accessors that set and get the player's health:
 
 
 [source,java]
+
 ----
+
 public int getHealth() {
   return (Integer)spatial.getUserData("health");
 }
 public void setHealth(int h) {
   spatial.setUserData("health",h);
 }
+
 ----
+
 Elsewhere in your code, you can access this data wherever you have access to the Spatial `playerNode`. 
 
 
 [source,java]
+
 ----
+
 health = playerNode.getControl(PlayerControl.class).getHealth();
 ...
 playerNode.getControl(PlayerControl.class).setHealth(99);
+
 ----
+
 *  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 (`health`, `Inventory`, `equipment`, etc). 
 *  The saved data can even be a custom Java object if you make the custom Java class <<jme3/advanced/save_and_load#custom_savable_class,implement the Savable interface>>! 
 *  When you save a Spatial as a .j3o file, the custom data is saved, too, and all Savables are restored the next time you load the .j3o! 
@@ -135,9 +151,13 @@ This is how you list all data keys that are already defined for one Spatial:
 
 
 [source,java]
-----for(String key : spatial.getUserDataKeys()){
+
+----
+for(String key : spatial.getUserDataKeys()){
     System.out.println(spatial.getName()+"'s keys: "+key);
-}----
+}
+----
+
 
 == How to Access a Named Sub-Mesh
 
@@ -152,10 +172,14 @@ In the following example, the Node `house` is the loaded model. The sub-meshes i
 
 
 [source,java]
+
 ----
+
 Geometry submesh = (Geometry) houseScene.getChild("door 12");
+
 ----
 
+
 == What is Culling?
 
 There are two types of culling: Face culling, and view frustrum culling.
@@ -179,7 +203,11 @@ Example:
 
 
 [source,java]
-----material.getAdditionalRenderState().setFaceCullMode(FaceCullMode.FrontAndBack);----
+
+----
+material.getAdditionalRenderState().setFaceCullMode(FaceCullMode.FrontAndBack);
+----
+
 *View frustum culling* refers to not drawing (and not even calculating) certain whole models in the scene. At any given moment, half of the scene is behind the player and out of sight anyway. View frustum culling is an optimization to not calculate scene elements that are not visible – elements that are “outside the view frustrum.
 
 
@@ -195,7 +223,11 @@ Example:
 
 
 [source,java]
-----spatial.setCullHint(CullHint.Never); // always drawn----
+
+----
+spatial.setCullHint(CullHint.Never); // always drawn
+----
+
 
 == See also
 

+ 9 - 1
src/docs/asciidoc/jme3/advanced/statsview.adoc

@@ -14,7 +14,9 @@ The StatsView + FpsView look like this example:
 
 
 [source]
+
 ----
+
 FrameBuffers (M) = 2
 FrameBuffers (F) = 2
 FrameBuffers (S) = 2
@@ -29,19 +31,25 @@ Uniforms = 31
 Triangles = 582
 Vertices = 1148
 Frames per Second: 30
+
 ----
 
+
 == On/Off
 
 You switch the StatsView on an off in the simpleInitApp() method by setting a boolean:
 
 
 [source,java]
----- 
+
+----
+ 
 setDisplayFps(false);       // to hide the FPS
 setDisplayStatView(false);  // to hide the statistics 
+
 ----
 
+
 == Terminology
 
 Types of items counted:

+ 28 - 0
src/docs/asciidoc/jme3/advanced/steer_behaviours.adoc

@@ -85,7 +85,9 @@ Once we know which container fits better for our agent, We create a new instance
 
 
 [source,java]
+
 ----
+
 SimpleMainBehaviour mainBehavior = new SimpleMainBehavior(myAgent);
     CompoundSteeringBehavior steer = new CompoundSteeringBehavior(myAgent);
     //BalancedCompoundSteeringBehavior steer = new BalancedCompoundSteeringBehavior(myAgent);
@@ -93,12 +95,16 @@ SimpleMainBehaviour mainBehavior = new SimpleMainBehavior(myAgent);
     steer.addSteerBehavior(steerBehavior2);
 mainBehaviour.addBehavior(steer);
 myAgent.setMainBehavior(mainBehavior);
+
 ----
 
 
 
+
 [source,java]
+
 ----
+
 SimpleMainBehaviour mainBehavior = new SimpleMainBehavior(myAgent);
     CompoundSteeringBehavior steer = new CompoundSteeringBehavior(myAgent);
         BalancedCompoundSteeringBehavior nestedSteer = new BalancedCompoundSteeringBehavior(myAgent);
@@ -107,8 +113,10 @@ SimpleMainBehaviour mainBehavior = new SimpleMainBehavior(myAgent);
     steer.addSteerBehavior(steerBehavior2);
 mainBehavior.addBehavior(steer);
 myAgent.setMainBehavior(mainBehavior);
+
 ----
 
+
 == Prioritizing behaviors
 
 You can assign priority layers: The steering controller first checks the higher layer to see if all the behaviors returns a value higher than `minLengthToInvalidSteer`, if so it uses that layer. Otherwise, it moves on to the second layer, and so on.
@@ -138,14 +146,18 @@ Example:
 
 
 [source,java]
+
 ----
+
     Plane horizontalPlane = new Plane(new Vector3f(0,1,0), 0);
     
     steerBehavior1.setupStrengthControl(0.5f); //Force reduced a 50%
     steerBehavior2.setupStrengthControl(horizontalPlane); //Force contained in the XZ plane
     steerContainer.setupStrengthControl(horizontalPlane, 2f); //Contained in the XZ plane and increased a 100%
+
 ----
 
+
 == Implementing your own steer behavior
 
 To benefit from all the features, you have to create a new class that extends from `AbstractStrengthSteeringBehavior`.
@@ -155,7 +167,9 @@ The responsible for the agent's acceleration is the vector returned in the `calc
 
 
 [source,java]
+
 ----
+
     @Override
     protected Vector3f calculateRawSteering() {
         Vector3f steerForce = Vector3f.ZERO;
@@ -164,23 +178,29 @@ The responsible for the agent's acceleration is the vector returned in the `calc
         
         return steerForce;
     }
+
 ----
+
 In addition, you can change a brake factor which will reduce the resultant velocity for the agent:
 
 
 [source,java]
+
 ----
+
     @Override
     protected Vector3f calculateRawSteering(){
         this.setBrakingFactor(0.5f); //The agent's velocity will be reduced a 50%
         return Vector3f.ZERO;
     }
+
 ----
 
 
 
 
 
+
 === Strict arguments
 
 To ensure that the behavior will work as you had planned it to work It's recommended to create your own link:http://docs.oracle.com/javase/7/docs/api/java/lang/IllegalArgumentException.html[IllegalArgumentException] class. To do this, create your own container class extending from `com.jme3.ai.agents.behaviors.npc.steering.SteeringExceptions`; Each exception inside the container class extends from `SteeringBehaviorException`. Furthermore, It will help users to recognize better which is the origin of any problem.
@@ -190,7 +210,9 @@ Example:
 
 
 [source,java]
+
 ----
+
     public class CustomSteeringExceptions extends SteeringExceptions  {
     
         public static class CustomRuntimeException extends SteeringBehaviorException {
@@ -199,16 +221,22 @@ Example:
     
         // ... other exceptions ...
     }
+
 ----
+
 [source,java]
+
 ----
+
     public SteerBehaviorConstructor(Agent agent, int value, Spatial spatial) {
         super(agent, spatial);
         if(value > 5) throw new CustomSteeringExceptions.customRuntimeException ("Value must be lower than 5");
         this.value = value;
     }
+
 ----
 
+
 == Useful links
 
 java steer behaviors project: link:http://jmesteer.bdevel.org/[jmesteer.bdevel.org]

+ 42 - 10
src/docs/asciidoc/jme3/advanced/swing_canvas.adoc

@@ -31,13 +31,17 @@ The camera's default behaviour in SimpleApplication is to capture the mouse, whi
 
 
 [source,java]
+
 ----
+
 public void simpleInitApp() {
   // activate windowed input behaviour
   flyCam.setDragToRotate(true);
   // Set up inputs and load your scene as usual
   ...
-}----
+}
+----
+
 In short: The first thing that is different is the `main()` method. We don't call start() on the SwingCanvasTest object as usual. Instead we create a Runnable() that creates and opens a standard Swing jFrame. In the runnable, we also create our SwingCanvasTest game with special settings, create a Canvas for it, and add that to the jFrame. Then we call startCanvas().
 
 
@@ -51,7 +55,9 @@ In the SwingCanvasTest's main() method, create a queued runnable(). It will cont
 
 
 [source,java]
+
 ----
+
   public static void main(String[] args) {
     java.awt.EventQueue.invokeLater(new Runnable() {
       public void run() {
@@ -59,11 +65,13 @@ In the SwingCanvasTest's main() method, create a queued runnable(). It will cont
       }
     });
   }
+
 ----
 
 
 
 
+
 === Creating the Canvas
 
 Here in the `run()` method, we start the jME application, create its canvas, create a Swing frame, and add everything together. +
@@ -73,20 +81,28 @@ Specify the com.jme3.system.AppSettings so jME knows the size of the Swing panel
 
 
 [source,java]
-----AppSettings settings = new AppSettings(true);
+
+----
+AppSettings settings = new AppSettings(true);
 settings.setWidth(640);
-settings.setHeight(480);----
+settings.setHeight(480);
+----
+
 We create our canvas application SwingCanvasTest, and give it the settings. We manually create a canvas for this game and configure the com.jme3.system.JmeCanvasContext. The method setSystemListener() makes sure that the listener receives events relating to context creation, update, and destroy.
 
 
 [source,java]
-----SwingCanvasTest canvasApplication = new SwingCanvasTest();
+
+----
+SwingCanvasTest canvasApplication = new SwingCanvasTest();
 canvasApplication.setSettings(settings);
 canvasApplication.createCanvas(); // create canvas!
 JmeCanvasContext ctx = (JmeCanvasContext) canvasApplication.getContext();
 ctx.setSystemListener(canvasApplication);
 Dimension dim = new Dimension(640, 480);
-ctx.getCanvas().setPreferredSize(dim);----
+ctx.getCanvas().setPreferredSize(dim);
+----
+
 Note that we have not called start() on the application, as we would usually do in the main() method. We will call startCanvas() later instead.
 
 
@@ -98,8 +114,12 @@ Which ever you do, let's call the jFrame `window`.
 
 
 [source,java]
-----JFrame window = new JFrame("Swing Application");
-window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);----
+
+----
+JFrame window = new JFrame("Swing Application");
+window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+----
+
 We create a standard JPanel inside the JFrame. Give it any Layout you wish – here we use a simple Flow Layout. Where the code sample says “Some Swing Component, this is where you add your buttons and controls. +
 +
 
@@ -107,26 +127,38 @@ The important step is to add() the canvas component into the panel, like all the
 
 
 [source,java]
-----JPanel panel = new JPanel(new FlowLayout()); // a panel
+
+----
+JPanel panel = new JPanel(new FlowLayout()); // a panel
 // add all your Swing components ...
 panel.add(new JButton("Some Swing Component"));
 ...
 // add the JME canvas
 panel.add(ctx.getCanvas());
+
 ----
+
 OK, the jFrame and the panel are ready. We add the panel into the jFrame, and pack everything together. Set the window's visibility to true make it appear.
 
 
 [source,java]
+
 ----
+
 window.add(panel);
 window.pack();
-window.setVisible(true);----
+window.setVisible(true);
+----
+
 Remember that we haven't called start() on the jME appliation yet? For the canvas, there is a special `startCanvas()` method that you must call now:
 
 
 [source,java]
-----canvasApplication.startCanvas();----
+
+----
+canvasApplication.startCanvas();
+----
+
 Clean, build, and run!
 
 

+ 16 - 1
src/docs/asciidoc/jme3/advanced/terrain.adoc

@@ -159,7 +159,9 @@ First, we load our textures and the heightmap texture for the terrain
 
 
 [source,java]
+
 ----
+
 // Create material from Terrain Material Definition
 matRock = new Material(assetManager, "Common/MatDefs/Terrain/Terrain.j3md");
 // Load alpha map (for splat textures)
@@ -181,16 +183,22 @@ Texture rock = assetManager.loadTexture("Textures/Terrain/splat/road.jpg");
 rock.setWrap(WrapMode.Repeat);
 matRock.setTexture("Tex3", rock);
 matRock.setFloat("Tex3Scale", 128f);
+
 ----
+
 We create the heightmap from the `heightMapImage`.
 
 
 [source,java]
+
 ----
+
 AbstractHeightMap heightmap = null;
 heightmap = new ImageBasedHeightMap(heightMapImage.getImage(), 1f);
 heightmap.load();
+
 ----
+
 Next we create the actual terrain.
 
 
@@ -199,7 +207,9 @@ Next we create the actual terrain.
 *  It uses the heightmap to generate the height values.
 
 [source,java]
+
 ----
+
 terrain = new TerrainQuad("terrain", 65, 513, heightmap.getHeightMap());
 terrain.setMaterial(matRock);
 terrain.setLocalScale(2f, 1f, 2f); // scale to make it less steep
@@ -208,11 +218,16 @@ cameras.add(getCamera());
 TerrainLodControl control = new TerrainLodControl(terrain, cameras);
 terrain.addControl(control);
 rootNode.attachChild(terrain);
+
 ----
+
 PS: As an alternative to an image-based height map, you can also generate a Hill hightmap:
 
 
 [source,java]
+
 ----
+
 heightmap = new HillHeightMap(1025, 1000, 50, 100, (byte) 3);
-----
+
+----

+ 20 - 4
src/docs/asciidoc/jme3/advanced/terrain_collision.adoc

@@ -9,7 +9,9 @@ This tutorial expands the HelloTerrain tutorial and makes the terrain solid. You
 == Sample Code
 
 [source,java]
-----package jme3test.helloworld;
+
+----
+package jme3test.helloworld;
 
 import com.jme3.app.SimpleApplication;
 import com.jme3.bullet.BulletAppState;
@@ -197,7 +199,9 @@ public class HelloTerrainCollision extends SimpleApplication
     player.setWalkDirection(walkDirection);
     cam.setLocation(player.getPhysicsLocation());
   }
-}----
+}
+----
+
 To try this code, create a New Project → JME3 → BasicGame using the default settings. Paste the sample code over the pregenerated Main.java class. Chnage the package to “mygame if necessary. Open the Project Properties, Libraries, and add the `jme3-test-data` library to make certain you have all the files. 
 
 
@@ -228,7 +232,11 @@ Read <<jme3/beginner/hello_collision#,Hello Collision>> for details of the follo
 .  The custom `setUpKeys()` method loads your reconfigured input handlers. They now don't just walk blindly, but calculate the `walkDirection` vector that we need for collision detection.
 .  `simpleUpdate()` uses the `walkDirection` vector and makes the character walk, while taking obstacles and solid walls/floor into account. 
 [source,java]
-----player.setWalkDirection(walkDirection);----
+
+----
+player.setWalkDirection(walkDirection);
+----
+
 .  The RigidBodyControl `landscape` is the CollisionShape of the terrain.
 .  The physical first-person player is a CapsuleCollisionShape with a CharacterControl.
 
@@ -242,18 +250,26 @@ Here are the changed parts to combine the two:
 .  Add the control to the `terrain` to make it physical.
 
 [source,java]
-----/** 6. Add physics: */ 
+
+----
+/** 6. Add physics: */ 
     terrain.addControl(new RigidBodyControl(0));  
+
 ----
+
 You attach the `terrain` and the first-person `player` to the rootNode, and to the physics space, to make them appear in the game world.
 
 
 [source,java]
+
 ----
+
     bulletAppState.getPhysicsSpace().add(terrain);
     bulletAppState.getPhysicsSpace().add(player);
+
 ----
 
+
 == Conclusion
 
 You see that you can combine snippets of sample code (such as HelloTerrain and HelloCollision), and create a new application from it that combines two features into soemthing new.

+ 8 - 1
src/docs/asciidoc/jme3/advanced/texture_atlas.adoc

@@ -95,18 +95,24 @@ Use `makeAtlasBatch` to turn several geometries that are loaded from a j3o file
 
 
 [source,java]
+
 ----
+
  // scene contains many geometries ared attached to one node:
  Node scene = assetManager.loadModel("Scenes/MyScene.j3o");
  // geom is one geometry containing all of these geometries together
  Geometry geom = TextureAtlas.makeAtlasBatch(scene);
  rootNode.attachChild(geom);
+
 ----
+
 Create a texture atlas and change the texture coordinates of one geometry:
 
 
 [source,java]
+
 ----
+
  Node scene = assetManager.loadModel("Scenes/MyScene.j3o");
 
  // Either auto-create texture Atlas from an existing node that has geometries...
@@ -128,4 +134,5 @@ Create a texture atlas and change the texture coordinates of one geometry:
  // of this geometry to the atlas, and replace the material.
  Geometry geom = scene.getChild("MyGeometry");
  atlas.applyCoords(geom);
- geom.setMaterial(mat);----
+ geom.setMaterial(mat);
+----

+ 4 - 0
src/docs/asciidoc/jme3/advanced/traverse_scenegraph.adoc

@@ -33,7 +33,9 @@ For each search, you create a `com.jme3.scene.SceneGraphVisitorAdapter` that def
 
 
 [source,java]
+
 ----
+
 SceneGraphVisitor visitor = new SceneGraphVisitor() {
 
   @Override
@@ -53,7 +55,9 @@ SceneGraphVisitor visitor = new SceneGraphVisitor() {
 rootNode.depthFirstTraversal(visitor);
 // ... or scan it breadth first.
 rootNode.breadthFirstTraversal(visitor);
+
 ----
+
 Which of the two methods is faster depends on how you designed the scengraph, and what tree element you are looking for. If you are searching for one single Geometry that is a “leaf of the tree, and then stop searching, depth-first may be faster. If you search for a high-level grouping Node, breadth-first may be faster. 
 
 

+ 66 - 10
src/docs/asciidoc/jme3/advanced/vehicles.adoc

@@ -61,43 +61,67 @@ Every physical object must have a collision shape, that we prepare first. For th
 
 
 [source,java]
+
 ----
+
 CompoundCollisionShape compoundShape = new CompoundCollisionShape();
 BoxCollisionShape box = new BoxCollisionShape(new Vector3f(1.2f, 0.5f, 2.4f));
+
 ----
+
 *Best Practice:* We attach the BoxCollisionShape (the vehicle body) to the CompoundCollisionShape at a Vector of (0,1,0): This shifts the effective center of mass of the BoxCollisionShape downwards to 0,-1,0 and makes a moving vehicle more stable! 
 
 
 [source,java]
-----compoundShape.addChildShape(box, new Vector3f(0, 1, 0));----
+
+----
+compoundShape.addChildShape(box, new Vector3f(0, 1, 0));
+----
+
 Any kind of geometry can make up the visible part of the vehicle, here we use a wireframe box. We create a node that we use to group the geometry. 
 
 
 [source,java]
-----Node vehicleNode=new Node("vehicleNode");
+
+----
+Node vehicleNode=new Node("vehicleNode");
 vehicle = new VehicleControl(compoundShape, 400);
-vehicleNode.addControl(vehicle);----
+vehicleNode.addControl(vehicle);
+----
+
 We initialize the Vehicle Control with the compound shape, and set its mass to a heavy value, 400f. The Vehicle Control represents the car's physical behaviour.
 
 
 [source,java]
-----vehicle = new VehicleControl(compoundShape, 400);----
+
+----
+vehicle = new VehicleControl(compoundShape, 400);
+----
+
 Finally we add the behaviour (VehicleControl) to the visible Geometry (node).
 
 
 [source,java]
-----vehicleNode.addControl(vehicle);----
+
+----
+vehicleNode.addControl(vehicle);
+----
+
 We configure the physical properties of the vehicle's suspension: Compresion, Damping, Stiffness, and MaxSuspenionForce. Picking workable values for the wheel suspension can be tricky – for background info have a look at these link:https://docs.google.com/Doc?docid=0AXVUZ5xw6XpKZGNuZG56a3FfMzU0Z2NyZnF4Zmo&hl=en[Suspension Settings Tips]. For now, let's work with the following values:
 
 
 [source,java]
-----float stiffness = 60.0f;//200=f1 car
+
+----
+float stiffness = 60.0f;//200=f1 car
 float compValue = .3f; //(should be lower than damp)
 float dampValue = .4f;
 vehicle.setSuspensionCompression(compValue * 2.0f * FastMath.sqrt(stiffness));
 vehicle.setSuspensionDamping(dampValue * 2.0f * FastMath.sqrt(stiffness));
 vehicle.setSuspensionStiffness(stiffness);
-vehicle.setMaxSuspensionForce(10000.0f);----
+vehicle.setMaxSuspensionForce(10000.0f);
+----
+
 We now have a node `vehicleNode` with a visible “car geometry, which acts like a vehicle. One thing that's missing are wheels.
 
 
@@ -122,7 +146,9 @@ We initialize a few variables that we will reuse when we add the four wheels. yO
 
 
 [source,java]
+
 ----
+
 Vector3f wheelDirection = new Vector3f(0, -1, 0);
 Vector3f wheelAxle = new Vector3f(-1, 0, 0);
 float radius = 0.5f;
@@ -130,17 +156,25 @@ float restLength = 0.3f;
 float yOff = 0.5f;
 float xOff = 1f;
 float zOff = 2f;
+
 ----
+
 We create a Cylinder mesh shape that we use to create the four visible wheel geometries.
 
 
 [source,java]
-----Cylinder wheelMesh = new Cylinder(16, 16, radius, radius * 0.6f, true);----
+
+----
+Cylinder wheelMesh = new Cylinder(16, 16, radius, radius * 0.6f, true);
+----
+
 For each wheel, we create a Node and a Geometry. We attach the Cylinder Geometry to the Node. We rotate the wheel by 90° around the Y axis. We set a material to make it visible. Finally we add the wheel (plus its properties) to the vehicle.
 
 
 [source,java]
+
 ----
+
 Node node1 = new Node("wheel 1 node");
 Geometry wheels1 = new Geometry("wheel 1", wheelMesh);
 node1.attachChild(wheels1);
@@ -149,12 +183,16 @@ wheels1.setMaterial(mat);
 
 vehicle.addWheel(node1, new Vector3f(-xOff, yOff, zOff),
     wheelDirection, wheelAxle, restLength, radius, true);
+
 ----
+
 The three next wheels are created in the same fashion, only the offsets are different. Remember to set the Boolean parameter correctly to indicate whether it's a front wheel.
 
 
 [source,java]
+
 ----
+
 ...
 vehicle.addWheel(node2, new Vector3f(xOff, yOff, zOff),
   wheelDirection, wheelAxle, restLength, radius, true);
@@ -164,25 +202,35 @@ vehicle.addWheel(node3, new Vector3f(-xOff, yOff, -zOff),
 ...
 vehicle.addWheel(node4, new Vector3f(xOff, yOff, -zOff),
   wheelDirection, wheelAxle, restLength, radius, false);
+
 ----
+
 Attach the wheel Nodes to the vehicle Node to group them, so they move together.
 
 
 [source,java]
+
 ----
+
 vehicleNode.attachChild(node1);
 vehicleNode.attachChild(node2);
 vehicleNode.attachChild(node3);
 vehicleNode.attachChild(node4);
+
 ----
+
 As always, attach the vehicle Node to the rootNode to make it visible, and add the Vehicle Control to the PhysicsSpace to make the car physical.
 
 
 [source,java]
+
 ----
+
 rootNode.attachChild(vehicleNode);
 getPhysicsSpace().add(vehicle);
+
 ----
+
 Not shown here is that we also created a Material `mat`.
 
 
@@ -205,7 +253,9 @@ In the ActionListener, we implement the actions that control the vehicle's direc
 `vehicle.applyImpulse(jumpForce, Vector3f.ZERO);`
 
 [source,java]
-----public void onAction(String binding, boolean value, float tpf) {
+
+----
+public void onAction(String binding, boolean value, float tpf) {
   if (binding.equals("Lefts")) {
       if (value) { steeringValue += .5f; } else { steeringValue += -.5f; }
       vehicle.steer(steeringValue);
@@ -236,18 +286,24 @@ In the ActionListener, we implement the actions that control the vehicle's direc
       } else {
     }
   }
-}----
+}
+----
+
 For your reference, this is how we initialized the constants for this example:
 
 
 [source,java]
+
 ----
+
 private final float accelerationForce = 1000.0f;
 private final float brakeForce = 100.0f;
 private float steeringValue = 0;
 private float accelerationValue = 0;
 private Vector3f jumpForce = new Vector3f(0, 3000, 0);
+
 ----
+
 Remember, the standard input listener code that maps the actions to keys can be found in the code samples.
 
 

+ 26 - 3
src/docs/asciidoc/jme3/advanced/video.adoc

@@ -36,18 +36,28 @@ You create either a file inputstream to load the video from your hard drive:
 
 
 [source,java]
-----FileInputStream  fis = new FileInputStream("E:\\my_bunny.ogg");----
+
+----
+FileInputStream  fis = new FileInputStream("E:\\my_bunny.ogg");
+----
+
 Or you stream the video live from a web location:
 
 
 [source,java]
-----InputStream fis = new URL("http://server/my_video.ogg").openStream();----
+
+----
+InputStream fis = new URL("http://server/my_video.ogg").openStream();
+----
+
 Setting the queued frames to a value value higher than 5 (`videoQueue = new VQueue(5);`) will make web streamed playback smoother at the cost of memory.
 Here is an example of video streaming in context:
 
 
 [source,java]
+
 ----
+
     private void createVideo(){
         try {
             InputStream fis = new URL("http://mirrorblender.top-ix.org/peach/"+
@@ -62,12 +72,16 @@ Here is an example of video streaming in context:
             ex.printStackTrace();
         }
     }
+
 ----
+
 Use the simpleUpdate() method to play the audio:
 
 
 [source,java]
+
 ----
+
     @Override
     public void simpleUpdate(float tpf){
         if (source == null){
@@ -140,12 +154,16 @@ Use the simpleUpdate() method to play the audio:
             }
         }
     }
+
 ----
+
 Helper Methods:
 
 
 [source,java]
+
 ----
+
     private void drawFrame(VFrame frame){
         Image image = frame.getImage();
         frame.setImage(image);
@@ -158,9 +176,13 @@ Helper Methods:
         videoQueue.returnFrame(frame);
         lastFrameTime = frame.getTime();
     }
+
 ----
+
 [source,java]
+
 ----
+
     private void waitNanos(long time){
         long millis = (long) (time / Clock.MILLIS_TO_NANOS);
         int nanos   = (int) (time - (millis * Clock.MILLIS_TO_NANOS));
@@ -172,4 +194,5 @@ Helper Methods:
             return;
         }
     }
-----
+
+----

+ 61 - 1
src/docs/asciidoc/jme3/advanced/walking_character.adoc

@@ -37,7 +37,9 @@ This code sample creates a simple upright Character:
 
 
 [source,java]
+
 ----
+
 // Load any model
 Node myCharacter = (Node) assetManager.loadModel("Models/myCharacterModel.mesh.xml");
 rootNode.attachChild(myCharacter);
@@ -47,12 +49,16 @@ CharacterControl myCharacter_phys = new CharacterControl(capsuleShape, 0.01f);
 // Attach physical properties to model and PhysicsSpace
 myCharacter.addControl(myCharacter_phys);
 bulletAppState.getPhysicsSpace().add(myCharacter_phys);
+
 ----
+
 To use the BetterCharacterControl, you may load your character like this:
 
 
 [source,java]
+
 ----
+
 // Load any model
 Spatial playerSpatial = assetManager.loadModel("Models/Oto/Oto.mesh.xml");
 player =  (Node)playerSpatial; // You can set the model directly to the player. (We just wanted to explicitly show that it's a spatial.)
@@ -75,7 +81,9 @@ playerControl.warp(new Vector3f(0,10,10)); // warp character into landscape at p
         bulletAppState.getPhysicsSpace().add(playerControl); 
         bulletAppState.getPhysicsSpace().addAll(playerNode); 
 rootNode.attachChild(playerNode); // add wrapper to root
+
 ----
+
 “<<physics_listeners#,collision listener>>
 
 
@@ -119,7 +127,9 @@ For best practices on how to use `setWalkDirection()`, see the Navigation Inputs
 === Code Skeleton
 
 [source,java]
-----public class WalkingCharacterDemo extends SimpleApplication
+
+----
+public class WalkingCharacterDemo extends SimpleApplication
         implements ActionListener, AnimEventListener {
 
   public static void main(String[] args) {
@@ -136,8 +146,10 @@ For best practices on how to use `setWalkDirection()`, see the Navigation Inputs
   public void onAnimCycleDone(AnimControl control, AnimChannel channel, String animName) { }
 
   public void onAnimChange(AnimControl control, AnimChannel channel, String animName) { }
+
 ----
 
+
 === Overview
 
 To create a walking character:
@@ -157,7 +169,9 @@ To create a walking character:
 === Activate Physics
 
 [source,java]
+
 ----
+
 private BulletAppState bulletAppState;
 ...
 public void simpleInitApp() {
@@ -166,26 +180,34 @@ public void simpleInitApp() {
     stateManager.attach(bulletAppState);
     ...
 }
+
 ----
 
+
 === Initialize the Scene
 
 In the simpleInitApp() method you initialize the scene and give it a MeshCollisionShape. The sample in the jme3 sources uses a custom helper class that simply creates a flat floor and drops some cubes and spheres on it:
 
 
 [source,java]
+
 ----
+
 public void simpleInitApp() {
   ...
   PhysicsTestHelper.createPhysicsTestWorld(rootNode,
       assetManager, bulletAppState.getPhysicsSpace());
   ...
+
 ----
+
 In a real game, you would load a scene model here instead of a test world. You can load a model from a local or remote zip file, and scale and position it:
 
 
 [source,java]
+
 ----
+
 private Node gameLevel;
 ..
 public void simpleInitApp() {
@@ -203,17 +225,23 @@ public void simpleInitApp() {
   rootNode.attachChild(gameLevel);
   bulletAppState.getPhysicsSpace().addAll(gameLevel);
   ...
+
 ----
+
 Also, add a light source to be able to see the scene.
 
 
 [source,java]
+
 ----
+
   AmbientLight light = new AmbientLight();
   light.setColor(ColorRGBA.White.mult(2));
   rootNode.addLight(light);
+
 ----
 
+
 === Create the Animated Character
 
 You create an animated model, such as Oto.mesh.xml.
@@ -227,7 +255,9 @@ You create an animated model, such as Oto.mesh.xml.
 .  Attach the visible model to the rootNode.
 
 [source,java]
+
 ----
+
 private CharacterControl character;
 private Node model;
 ...
@@ -241,7 +271,9 @@ public void simpleInitApp() {
   bulletAppState.getPhysicsSpace().add(character);
   rootNode.attachChild(model);
   ...
+
 ----
+
 *Did you know?*
 
 
@@ -252,7 +284,9 @@ Create several AnimChannels, one for each animation that can happen simultaneous
 
 
 [source,java]
+
 ----
+
 private AnimChannel animationChannel;
 private AnimChannel attackChannel;
 private AnimControl animationControl;
@@ -267,7 +301,9 @@ public void simpleInitApp() {
   attackChannel.addBone(animationControl.getSkeleton().getBone("arm.right"));
   attackChannel.addBone(animationControl.getSkeleton().getBone("hand.right"));
   ...
+
 ----
+
 The attackChannel only controls one arm, while the walking channels controls the whole character.
 
 
@@ -275,7 +311,9 @@ The attackChannel only controls one arm, while the walking channels controls the
 === Add ChaseCam / CameraNode
 
 [source,java]
+
 ----
+
 private ChaseCamera chaseCam;
 
 ...
@@ -285,15 +323,19 @@ public void simpleInitApp() {
   flyCam.setEnabled(false);
   chaseCam = new ChaseCamera(cam, model, inputManager);
   ...
+
 ----
 
+
 === Handle Navigation
 
 Configure custom key bindings for WASD keys that you will use to make the character walk. Then calculate the vector where the user wants the character to move. Note the use of the special `setWalkDirection()` method below.
 
 
 [source,java]
+
 ----
+
 // track directional input, so we can walk left-forward etc
 private boolean left = false, right = false, up = false, down = false;
 ...
@@ -312,12 +354,16 @@ public void simpleInitApp() {
   inputManager.addListener(this, "CharJump", "CharAttack");
   ...
 }
+
 ----
+
 Respond to the key bindings by setting variables that track in which direction you will go. This allows us to steer the character forwards and to the left at the same time. *Note that no actual walking happens here yet!* We just track the input.
 
 
 [source,java]
+
 ----
+
 @Override
 public void onAction(String binding, boolean value, float tpf) {
   if (binding.equals("CharLeft")) {
@@ -337,17 +383,23 @@ public void onAction(String binding, boolean value, float tpf) {
   if (binding.equals("CharAttack"))
     attack();
 }
+
 ----
+
 The player can attack and walk at the same time. `Attack()` is a custom method that triggers an attack animation in the arms. Here you should also add custom code to play an effect and sound, and to determine whether the hit was successful.
 
 
 [source,java]
+
 ----
+
 private void attack() {
     attackChannel.setAnim("Dodge", 0.1f);
     attackChannel.setLoopMode(LoopMode.DontLoop);
 }
+
 ----
+
 Finally, the update loop looks at the directional variables and moves the character accordingly. Since this is a special kinematic CharacterControl, we use the `setWalkDirection()` method. 
 
 
@@ -355,7 +407,9 @@ The variable `airTime` tracks how long the character is off the ground (e.g. whe
 
 
 [source,java]
+
 ----
+
 private Vector3f walkDirection = new Vector3f(0,0,0); // stop
 
 private float airTime = 0;
@@ -398,19 +452,25 @@ public void simpleUpdate(float tpf) {
   walkDirection.multLocal(25f).multLocal(tpf);// The use of the first multLocal here is to control the rate of movement multiplier for character walk speed. The second one is to make sure the character walks the same speed no matter what the frame rate is.
   character.setWalkDirection(walkDirection); // THIS IS WHERE THE WALKING HAPPENS
 }
+
 ----
+
 This method resets the walk animation.
 
 
 [source,java]
+
 ----
+
 public void onAnimCycleDone(AnimControl control, AnimChannel channel, String animName) {
         if (channel == attackChannel) channel.setAnim("stand");
 }
 
 public void onAnimChange(AnimControl control, AnimChannel channel, String animName) { }
+
 ----
 
+
 == See also
 
 *  link:http://hub.jmonkeyengine.org/forum/topic/bettercharactercontrol-in-the-works/[http://hub.jmonkeyengine.org/forum/topic/bettercharactercontrol-in-the-works/]

+ 34 - 6
src/docs/asciidoc/jme3/advanced/water.adoc

@@ -81,7 +81,9 @@ Here is the most important part of the code:
 
 
 [source,java]
+
 ----
+
 // we create a water processor
 SimpleWaterProcessor waterProcessor = new SimpleWaterProcessor(assetManager);
 waterProcessor.setReflectionScene(mainScene);
@@ -107,42 +109,68 @@ water.setLocalTranslation(-200, -6, 250);
 water.setShadowMode(ShadowMode.Receive);
 water.setMaterial(waterProcessor.getMaterial());
 rootNode.attachChild(water);
+
 ----
 
+
 == Settings
 
 You can lower the render size to gain higher performance:
 
 
 [source,java]
-----waterProcessor.setRenderSize(128,128);----
+
+----
+waterProcessor.setRenderSize(128,128);
+----
+
 The deeper the water, the more transparent. (?) 
 
 
 [source,java]
-----waterProcessor.setWaterDepth(40);----
+
+----
+waterProcessor.setWaterDepth(40);
+----
+
 A higher distortion scale makes bigger waves.
 
 
 [source,java]
-----waterProcessor.setDistortionScale(0.05f);----
+
+----
+waterProcessor.setDistortionScale(0.05f);
+----
+
 A lower wave speed makes calmer water.
 
 
 [source,java]
-----waterProcessor.setWaveSpeed(0.05f);----
+
+----
+waterProcessor.setWaveSpeed(0.05f);
+----
+
 If your scene does not have a lightsource, you can set the light direction for the water:
 
 
 [source,java]
-----waterProcessor.setLightDirection( new Vector3f(0.55f, -0.82f, 0.15f));----
+
+----
+waterProcessor.setLightDirection( new Vector3f(0.55f, -0.82f, 0.15f));
+----
+
 Instead of creating a quad and specifying a plane, you can get a default waterplane from the processor:
 
 
 [source,java]
-----Geometry waterPlane = waterProcessor.createWaterGeometry(10, 10);
+
+----
+Geometry waterPlane = waterProcessor.createWaterGeometry(10, 10);
 waterPlane.setLocalTranslation(-5, 0, 5);
 waterPlane.setMaterial(waterProcessor.getMaterial());
+
 ----
+
 You can offer a switch to set the water Material to a static texture – for users with slow PCs.
 

+ 8 - 0
src/docs/asciidoc/jme3/atomixtuts/cardsgame/ai.adoc

@@ -235,7 +235,9 @@ The first try to implement the AI
 
 
 [source,java]
+
 ----
+
 package magiccard.gameplay.ai
 
 import magiccard.*
@@ -363,12 +365,16 @@ public class CardPlayerAI {
     }
 
 }
+
 ----
+
 And the way to call it … CardGamePlay 
 
 
 [source,java]
+
 ----
+
             case MainPhase:
                 if (!currentTurn.player.aiPlayer){
                     if (isPlayerChangePhase(MainPhase)){
@@ -381,7 +387,9 @@ And the way to call it … CardGamePlay
                     currentTurn.player.ai.think();
                     currentTurn.player.ai.act();
                 }
+
 ----
+
 The fun things here are we delayed Action we want the AI and save to Actions list made from Closure. In the main loop, we wait till ai.act is called then execute all the delayed action. The power of Groovy once again shown! By this technique we can easily introduce paralel computing with an cool ulitities of Groovy named <<gpars#,GPars>>. But we don’t use it right now though ! 
 
 

+ 8 - 0
src/docs/asciidoc/jme3/atomixtuts/cardsgame/assets.adoc

@@ -41,7 +41,9 @@ image::http///farm9.staticflickr.com/8521/8616051519_7c8c32ee1a_c.jpg[8616051519
 ==== CardMat.j3md
 
 [source,glsl]
+
 ----
+
 MaterialDef Card {
 
     MaterialParameters {
@@ -66,12 +68,16 @@ MaterialDef Card {
     }
 
 }
+
 ----
 
+
 ==== SimpleCard.frag
 
 [source,glsl]
+
 ----
+
 varying vec2 texCoord;
 
 uniform sampler2D m_ColorMap;
@@ -115,7 +121,9 @@ void main() {
 
     gl_FragColor = color;
 }
+
 ----
+
 This GLSL code can be obviously explain like this:
 
 

+ 52 - 0
src/docs/asciidoc/jme3/atomixtuts/cardsgame/programming.adoc

@@ -112,7 +112,9 @@ Information relate to the orginal Magic card game:
 
 
 [source,java]
+
 ----
+
 String cardId=”"
 String name = “”
 String picture = “”
@@ -122,7 +124,9 @@ int defend = -1
 String cardType = “”
 
 String attribute = “”
+
 ----
+
 […full in the source code.The meanings are obvious.] 
 
 
@@ -134,7 +138,9 @@ This hold a link to the orginal Card in the CardLibrary, which keeps information
 
 
 [source,java]
+
 ----
+
 package magiccard.gameplay
  
 import com.jme3.scene.Spatial
@@ -185,8 +191,10 @@ public class Card  extends SpatialEntity{
         this.longDesc = orgCard.longDesc
     }
 }
+
 ----
 
+
 ==== Show the card
 
 According to the Atom framework, the representation part of a Card should be provided by a EntityFactory. In this implementation, I just ask the GameLevel – The CardTable, to made it up, cause it’s really simple.
@@ -199,7 +207,9 @@ This is a part of the CardTable class which create and “attach” the Card spa
 
 
 [source,java]
+
 ----
+
     public void createCardOrg(){
         cardOrg = ((Node) ((Node) assetManager.loadModel(“Models/Cards/Template/card1.j3o”)).getChild(“Card”)).getChild(“Cube1″);
     }
@@ -221,8 +231,10 @@ This is a part of the CardTable class which create and “attach” the Card spa
         newCard.addControl(new CardSelectControl(worldManager,gamePlayManager));
         return newCard;
     }
+
 ----
 
+
 ==== Card movement
 
 ....
@@ -243,7 +255,9 @@ These 3 basic movement types are already enough to compose quite fascinated effe
 
 
 [source,java]
+
 ----
+
 package magiccard.gameplay
 
 import com.jme3.scene.control.AbstractControl
@@ -337,8 +351,10 @@ public class CardSpatialControl extends SpatialEntityControl{
         spatial.setLocalTranslation(oldPos.add(x,y,z));
     }
 }
+
 ----
 
+
 ==== More
 
 
@@ -382,7 +398,9 @@ This part
 *  load card models with texture (cover) and attach a CardControl to handle the Movement and highlight
 
 [source,java]
+
 ----
+
 package magiccard.gameplay
 
 import com.jme3.asset.AssetManager
@@ -536,7 +554,9 @@ return newCard;
 CardSpatialControl getCardControl(Spatial spatial){
 return spatial.getControl(CardSpatialControl.class)
 }
+
 ----
+
 These pieces help to find the exact location of card in each situation:
 
 
@@ -549,7 +569,9 @@ These pieces help to find the exact location of card in each situation:
 *  MagicPos
 
 [source,java]
+
 ----
+
 public void arrangeDeck(CardPlayer player){
 int numOfCards = player.currentDeck.cardList.size()
 
@@ -704,12 +726,16 @@ public Vector3f getCamPos(){
 return center.add(0f,-8f,20f)
 }
 
+
 ----
+
 This is the update hook of the Level. We update it by clean up and execute delayed actions!!!
 
 
 [source,java]
+
 ----
+
 public void simpleUpdate(float tpf){
 // see if anything queued
 for (Iterator it=actions.iterator(); it.hasNext(); ) {
@@ -722,12 +748,16 @@ it.remove();
 }
 }
 }
+
 ----
+
 Make a cool explosion effect by calling the Atom's ParticleFactory, play it when a card destroyed
 
 
 [source,java]
+
 ----
+
 void destroy(CardPlayer player,Card card){
 addExplosion(card.spatial.localTranslation)
 CardSpatialControl cc=getCardControl(card.spatial)
@@ -767,12 +797,16 @@ spark.setLocalTranslation(new Vector3f(0,0,-5f));
 explosionPrefab = pf.createExplosionNode();
 explosionPrefab.getControl(ExplosionNodeControl.class).setMaxTime(2f)
 }
+
 ----
+
 Load the card character 3d model for a specific card
 
 
 [source,java]
+
 ----
+
 public void loadCharacters(){
 
 Quaternion rot= new Quaternion().fromAngleAxis(FastMath.HALF_PI,Vector3f.UNIT_X)
@@ -801,8 +835,10 @@ lamp.setColor(ColorRGBA.White);
 levelNode.addLight(lamp);
 }
 }
+
 ----
 
+
 === Select
 
 For a card game, select is a very important game mechanic, in fact, you are nearly ask to select/choose somethings almost everytime. In Atom, I introduce a generic way to hook your select function into your code game mechanic. 
@@ -822,21 +858,31 @@ For this card game, we will implement a few things in this designed mechanic:
 ==== Select function:
 
 [source,java]
+
 ----
 
+
+
 ----
 
+
 ==== Select condition:
 
 [source,java]
+
 ----
 
+
+
 ----
 
+
 ==== Select Control:
 
 [source,java]
+
 ----
+
 package magiccard.stage;
 
 import com.jme3.math.Vector3f;
@@ -991,8 +1037,10 @@ isHighlight = false;
 }
 }
 }
+
 ----
 
+
 ==== Cached conditions – Rules:
 
 We use a Groovy Map cardSelectRules to save all rule in form of Closure that determine if a Card is selected or not. More about rules in the scripting part <<jme3/atomixtuts/cardsgame/scripting#,scripting>>
@@ -1002,7 +1050,9 @@ We use a Groovy Map cardSelectRules to save all rule in form of Closure that det
 
 
 [source,java]
+
 ----
+
 public Map cardSelectRules=[:];
 void createSelectConditions(){
 // RULE : The card is in hand
@@ -1068,8 +1118,10 @@ return false;
 cardSelectRules["noneSelect"] =new ClosureSelectCondition(noneSelect);
 
 }
+
 ----
 
+
 === States
 
 

+ 45 - 1
src/docs/asciidoc/jme3/beginner/hello_animation.adoc

@@ -21,7 +21,9 @@ image::jme3/beginner/beginner-animation.png[beginner-animation.png,with="",heigh
 == Sample Code
 
 [source,java]
+
 ----
+
 package jme3test.helloworld;
 
 import com.jme3.animation.AnimChannel;
@@ -93,8 +95,10 @@ public class HelloAnimation extends SimpleApplication
     }
   };
 }
+
 ----
 
+
 == Creating and Loading Animated Models
 
 You create animated models with a tool such as Blender. Take some time and learn how to create your own models in these link:http://www.blender.org/education-help/tutorials/animation/[Blender Animation Tutorials]. For now, download and use a free model, such as the one included here as an example (link:http://jmonkeyengine.googlecode.com/svn/trunk/engine/test-data/Models/Oto/[Oto Golem], and link:http://jmonkeyengine.googlecode.com/svn/trunk/engine/test-data/Models/Ninja/[Ninja]).
@@ -104,7 +108,9 @@ Loading an animated model is pretty straight-forward, just as you have learned i
 
 
 [source,java]
+
 ----
+
   public void simpleInitApp() {
     /* Displaying the model requires a light source */
     DirectionalLight dl = new DirectionalLight();
@@ -116,7 +122,9 @@ Loading an animated model is pretty straight-forward, just as you have learned i
     rootNode.attachChild(player);
     ...
     }
+
 ----
+
 Don't forget to add a light source to make the material visible.
 
 
@@ -131,7 +139,9 @@ After you load the animated model, you register it to the Animation Controller.
 *  To run several sequences, you create several channels, and set them each to their animation.
 
 [source,java]
+
 ----
+
   private AnimChannel channel;
   private AnimControl control;
 
@@ -144,7 +154,9 @@ After you load the animated model, you register it to the Animation Controller.
     channel = control.createChannel();
     channel.setAnim("stand");
     ...
+
 ----
+
 *Nehon on the jME forum link:http://jmonkeyengine.org/groups/general-2/forum/topic/helloanimation-animations-seem-to-be-clashing/#post-180994[wrote],*
 
 
@@ -165,27 +177,37 @@ After you load the animated model, you register it to the Animation Controller.
 
 
 [source]
+
 ----
+
 control = player.getControl(AnimControl.class);
+
 ----
+
 
 
 [source]
+
 ----
+
 player.getChild("Subnode").getControl(AnimControl.class);
+
 ----
 
 
 
 
+
 == Responding to Animation Events
 
 Add `implements AnimEventListener` to the class declaration. This interface gives you access to events that notify you when a sequence is done, or when you change from one sequence to another, so you can respond to it. In this example, you reset the character to a standing position after a `Walk` cycle is done.
 
 
 [source,java]
+
 ----
+
 public class HelloAnimation extends SimpleApplication
                          implements AnimEventListener {
   ...
@@ -201,8 +223,10 @@ public class HelloAnimation extends SimpleApplication
   public void onAnimChange(AnimControl control, AnimChannel channel, String animName) {
     // unused
   }
+
 ----
 
+
 == Trigger Animations After User Input
 
 There are ambient animations like animals or trees that you may want to trigger in the main event loop. In other cases, animations are triggered by user interaction, such as key input. You want to play the Walk animation when the player presses a certain key (here the spacebar), at the same time as the avatar performs the walk action and changes its location.
@@ -217,12 +241,16 @@ There are ambient animations like animals or trees that you may want to trigger
 .  Add an input listener for the `Walk` action.
 
 [source,java]
+
 ----
+
   private void initKeys() {
     inputManager.addMapping("Walk", new KeyTrigger(KeyInput.KEY_SPACE));
     inputManager.addListener(actionListener, "Walk");
   }
+
 ----
+
 To use the input controller, you need to implement the actionListener by testing for each action by name, then set the channel to the corresponding animation to run.
 
 
@@ -232,7 +260,9 @@ To use the input controller, you need to implement the actionListener by testing
 *  Optionally, use channel.setTime() to Fast-forward or rewind to a certain moment in time of this animation.
 
 [source,java]
+
 ----
+
   private ActionListener actionListener = new ActionListener() {
     public void onAction(String name, boolean keyPressed, float tpf) {
         if (name.equals("Walk") && !keyPressed) {
@@ -243,8 +273,10 @@ To use the input controller, you need to implement the actionListener by testing
         }
     }
   };
+
 ----
 
+
 == Exercises
 
 
@@ -257,7 +289,11 @@ Make a mouse click trigger another animation sequence!
 ..  Create a new key trigger mapping and action (see: <<hello_input_system#,Hello Input>>)
 ..  Tip: Do you want to find out what animation sequences are available in the model? Use: 
 [source,java]
-----for (String anim : control.getAnimationNames()) { System.out.println(anim); }----
+
+----
+for (String anim : control.getAnimationNames()) { System.out.println(anim); }
+----
+
 
 
 ==== Exercise 2: Revealing the Skeleton (1)
@@ -276,15 +312,21 @@ Add the following import statements for the SkeletonDebugger and Material classe
 
 
 [source,java]
+
 ----
+
      import com.jme3.scene.debug.SkeletonDebugger;
      import com.jme3.material.Material;
+
 ----
+
 Add the following code snippet to `simpleInitApp()` to make the bones (that you just read about) visible!
 
 
 [source,java]
+
 ----
+
      SkeletonDebugger skeletonDebug = 
          new SkeletonDebugger("skeleton", control.getSkeleton());
      Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
@@ -292,7 +334,9 @@ Add the following code snippet to `simpleInitApp()` to make the bones (that you
      mat.getAdditionalRenderState().setDepthTest(false);
      skeletonDebug.setMaterial(mat);
      player.attachChild(skeletonDebug);
+
 ----
+
 Can you identify individual bones in the skeleton?
 
 

+ 93 - 21
src/docs/asciidoc/jme3/beginner/hello_asset.adoc

@@ -21,7 +21,9 @@ image::beginner-assets-models.png[beginner-assets-models.png,with="320",height="
 == Code Sample
 
 [source,java]
+
 ----
+
 package jme3test.helloworld;
 
 import com.jme3.app.SimpleApplication;
@@ -83,7 +85,9 @@ public class HelloAssets extends SimpleApplication {
         rootNode.addLight(sun);
 
     }
-}----
+}
+----
+
 Build and run the code sample. You should see a green Ninja with a colorful teapot standing behind a wall. The text on the screen should say “Hello World.
 
 
@@ -102,7 +106,9 @@ The following is the recommended directory structure for storing assets in your
 
 
 [source]
+
 ----
+
 MyGame/assets/               
 MyGame/assets/Interface/
 MyGame/assets/MatDefs/
@@ -115,7 +121,9 @@ MyGame/assets/Textures/     <-- your textures go here
 MyGame/build.xml            <-- Default Ant build script
 MyGame/src/...              <-- your Java sources go here
 MyGame/...
+
 ----
+
 This is just a suggested best practice, and it's what you get by default when creating a new Java project in the jMokeyEngine <<sdk#,SDK>>. You can create an `assets` directory and technically name the subdirectories whatever you like.
 
 
@@ -126,7 +134,9 @@ Place your textures in a subdirectory of `assets/Textures/`. Load the texture in
 
 
 [source,java]
+
 ----
+
 // Create a wall with a simple texture from test_data
 Box box = new Box(2.5f,2.5f,1.0f);
 Spatial wall = new Geometry("Box", box );
@@ -137,7 +147,9 @@ mat_brick.setTexture("ColorMap",
 wall.setMaterial(mat_brick);
 wall.setLocalTranslation(2.0f,-2.5f,0.0f);
 rootNode.attachChild(wall);
+
 ----
+
 In this case, you <<hello_material#,create your own Material>> and apply it to a Geometry. You base Materials on default material descriptions (such as “Unshaded.j3md), as shown in this example. 
 
 
@@ -149,7 +161,9 @@ The following code sample goes into the `simpleInitApp()` method.
 
 
 [source,java]
-----// Display a line of text with a default font
+
+----
+// Display a line of text with a default font
 guiNode.detachAllChildren();
 guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
 BitmapText helloText = new BitmapText(guiFont, false);
@@ -157,7 +171,9 @@ helloText.setSize(guiFont.getCharSet().getRenderedSize());
 helloText.setText("Hello World");
 helloText.setLocalTranslation(300, helloText.getLineHeight(), 0);
 guiNode.attachChild(helloText);
+
 ----
+
 *Tip:* Clear existing text in the guiNode by detaching all its children.
 
 
@@ -168,7 +184,9 @@ Export your 3D model in OgreXML format (.mesh.xml, .scene, .material, .skeleton.
 
 
 [source,java]
+
 ----
+
 // Load a model from test_data (OgreXML + material + texture)
 Spatial ninja = assetManager.loadModel("Models/Ninja/Ninja.mesh.xml");
 ninja.scale(0.05f, 0.05f, 0.05f);
@@ -179,7 +197,9 @@ rootNode.attachChild(ninja);
 DirectionalLight sun = new DirectionalLight();
 sun.setDirection(new Vector3f(-0.1f, -0.7f, -1.0f).normalizeLocal());
 rootNode.addLight(sun);
+
 ----
+
 Note that you do not need to create a Material if you exported the model with a material. Remember to add a light source, as shown, otherwise the material (and the whole model) is not visible!
 
 
@@ -193,22 +213,30 @@ Here is a usage example of a ZipLocator that is registered to a file `town.zip`
 
 
 [source,java]
+
 ----
+
     assetManager.registerLocator("town.zip", ZipLocator.class);
     Spatial scene = assetManager.loadModel("main.scene");
     rootNode.attachChild(scene);
+
 ----
+
 Here is a HttpZipLocator that can download zipped models and load them:
 
 
 [source,java]
+
 ----
+
     assetManager.registerLocator(
       "http://jmonkeyengine.googlecode.com/files/wildhouse.zip", 
       HttpZipLocator.class);
     Spatial scene = assetManager.loadModel("main.scene");
     rootNode.attachChild(scene);
+
 ----
+
 JME3 offers ClasspathLocator, ZipLocator, FileLocator, HttpZipLocator, and UrlLocator (see `com.jme3.asset.plugins`). 
 
 
@@ -250,12 +278,16 @@ The `loadModel()` method loads these original file formats when you run your cod
 
 
 [source]
-----com.jme3.asset.DesktopAssetManager loadAsset
+
+----
+com.jme3.asset.DesktopAssetManager loadAsset
 WARNING: Cannot locate resource: Models/Ninja/Ninja.mesh.xml
 com.jme3.app.Application handleError
 SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
 java.lang.NullPointerException
+
 ----
+
 You see that loading the *XML/OBJ/Blend files* directly is only acceptable during the development phase in the SDK. For example, every time your graphic designer pushes updated files to the asset directory, you can quickly review the latest version in your development environment.
 
 
@@ -269,7 +301,11 @@ Open your JME3 Project in the jMonkeyEngine SDK.
 .  The .j3o file appears next to the .mesh.xml file and has the same name. 
 .  Update all your `loadModel()` lines accordingly. For example: 
 [source,java]
-----Spatial ninja = assetManager.loadModel("Models/Ninja/Ninja.j3o");----
+
+----
+Spatial ninja = assetManager.loadModel("Models/Ninja/Ninja.j3o");
+----
+
 
 
@@ -285,28 +321,48 @@ a| Solution!
 a| Load a model with materials 
 a| Use the asset manager's `loadModel()` method and attach the Spatial to the rootNode. 
 [source,java]
-----Spatial elephant = assetManager.loadModel("Models/Elephant/Elephant.mesh.xml");
-rootNode.attachChild(elephant);----
+
+----
+Spatial elephant = assetManager.loadModel("Models/Elephant/Elephant.mesh.xml");
+rootNode.attachChild(elephant);
+----
+
 [source,java]
-----Spatial elephant = assetManager.loadModel("Models/Elephant/Elephant.j3o");
-rootNode.attachChild(elephant);----
+
+----
+Spatial elephant = assetManager.loadModel("Models/Elephant/Elephant.j3o");
+rootNode.attachChild(elephant);
+----
+
 
 a| Load a model without materials 
 a| If you have a model without materials, you have to give it a material to make it visible. 
 [source,java]
-----Spatial teapot = assetManager.loadModel("Models/Teapot/Teapot.j3o");
+
+----
+Spatial teapot = assetManager.loadModel("Models/Teapot/Teapot.j3o");
 Material mat = new Material(assetManager, "Common/MatDefs/Misc/ShowNormals.j3md"); // default material
 teapot.setMaterial(mat);
-rootNode.attachChild(teapot);----
+rootNode.attachChild(teapot);
+----
+
 
 a| Load a scene 
 a| You load scenes just like you load models: 
 [source,java]
-----Spatial scene = assetManager.loadModel("Scenes/town/main.scene");
-rootNode.attachChild(scene);----
+
+----
+Spatial scene = assetManager.loadModel("Scenes/town/main.scene");
+rootNode.attachChild(scene);
+----
+
 [source,java]
-----Spatial scene = assetManager.loadModel("Scenes/town/main.j3o");
-rootNode.attachChild(scene);----
+
+----
+Spatial scene = assetManager.loadModel("Scenes/town/main.j3o");
+rootNode.attachChild(scene);
+----
+
 
 |===
 
@@ -320,24 +376,32 @@ As an exercise, let's try different ways of loading a scene. You will learn how
 .  (Optional:) Unzip the town.zip to see the structure of the contained Ogre dotScene: You'll get a directory named `town`. It contains XML and texture files, and file called main.scene. (This is just for your information, you do not need to do anything with it.)
 .  Place the town.zip file in the top level directory of your JME3 project, like so: 
 [source]
-----jMonkeyProjects/MyGameProject/assets/
+
+----
+jMonkeyProjects/MyGameProject/assets/
 jMonkeyProjects/MyGameProject/build.xml
 jMonkeyProjects/MyGameProject/src/
 jMonkeyProjects/MyGameProject/town.zip
 ...
+
 ----
 
+
 Use the following method to load models from a zip file:
 
 
 .  Verify `town.zip` is in the project directory.
 .  Register a zip file locator to the project directory: Add the following code under `simpleInitApp() {`
 [source,java]
-----    assetManager.registerLocator("town.zip", ZipLocator.class);
+
+----
+    assetManager.registerLocator("town.zip", ZipLocator.class);
     Spatial gameLevel = assetManager.loadModel("main.scene");
     gameLevel.setLocalTranslation(0, -5.2f, 0);
     gameLevel.setLocalScale(2);
-    rootNode.attachChild(gameLevel);----
+    rootNode.attachChild(gameLevel);
+----
+
 The loadModel() method now searches this zip directly for the files to load. +
 (This means, do not write `loadModel(town.zip/main.scene)` or similar!)
 
@@ -355,10 +419,14 @@ Earlier in this tutorial, you loaded scenes and models from the asset directory.
 .  Move the unzipped `town/` directory into the `assets/Scenes/` directory of your project.
 .  Add the following code under `simpleInitApp() {` 
 [source,java]
-----    Spatial gameLevel = assetManager.loadModel("Scenes/town/main.scene");
+
+----
+    Spatial gameLevel = assetManager.loadModel("Scenes/town/main.scene");
     gameLevel.setLocalTranslation(0, -5.2f, 0);
     gameLevel.setLocalScale(2);
-    rootNode.attachChild(gameLevel);----
+    rootNode.attachChild(gameLevel);
+----
+
  Note that the path is relative to the `assets/…` directory.
 
 
@@ -373,10 +441,14 @@ Here is a third method you must know, loading a scene/model from a .j3o file:
 .  Right-click the `main.scene` and convert the scene to binary: The jMonkeyPlatform generates a main.j3o file.
 .  Add the following code under `simpleInitApp() {`
 [source,java]
-----    Spatial gameLevel = assetManager.loadModel("Scenes/town/main.j3o");
+
+----
+    Spatial gameLevel = assetManager.loadModel("Scenes/town/main.j3o");
     gameLevel.setLocalTranslation(0, -5.2f, 0);
     gameLevel.setLocalScale(2);
-    rootNode.attachChild(gameLevel);----
+    rootNode.attachChild(gameLevel);
+----
+
  Again, note that the path is relative to the `assets/…` directory.
 
 

+ 93 - 21
src/docs/asciidoc/jme3/beginner/hello_asset_pt.adoc

@@ -21,7 +21,9 @@ image::beginner-assets-models.png[beginner-assets-models.png,with="320",height="
 == Amostra de Código
 
 [source,java]
+
 ----
+
 package jme3test.helloworld;
 
 import com.jme3.app.SimpleApplication;
@@ -83,7 +85,9 @@ public class HelloAssets extends SimpleApplication {
         rootNode.addLight(sun);
 
     }
-}----
+}
+----
+
 Compile e execute a amostra de código. Você deveria ver um ninja verde com um bule colorido permanecendo atrás de uma parede. O texto na tela deveria dizer “Hello World.
 
 
@@ -102,7 +106,9 @@ O seguinte é a estrutura de diretório recomendada em seu diretório de projeto
 
 
 [source]
+
 ----
+
 MyGame/assets/Interface/
 MyGame/assets/MatDefs/
 MyGame/assets/Materials/
@@ -114,7 +120,9 @@ MyGame/assets/Textures/
 MyGame/build.xml            <-- Ant build script
 MyGame/src/...              <-- Java sources go here
 MyGame/...
+
 ----
+
 Isto é apenas um melhor prática sugerida, e é o que você consegue por padrão quando criando um novo projeto Java no <<sdk#,SDK>> da jMokeyEngine. Você pode criar um diretório de ativos e tecnicamente nomear os subdiretórios da maneira que você gostar.
 
 
@@ -125,7 +133,9 @@ Coloque suas texturas em um subdiretório de `assets/Textures/`. Carregue a text
 
 
 [source,java]
+
 ----
+
 // Create a wall with a simple texture from test_data
 Box box = new Box(Vector3f.ZERO, 2.5f,2.5f,1.0f);
 Spatial wall = new Geometry("Box", box );
@@ -136,7 +146,9 @@ mat_brick.setTexture("ColorMap",
 wall.setMaterial(mat_brick);
 wall.setLocalTranslation(2.0f,-2.5f,0.0f);
 rootNode.attachChild(wall);
+
 ----
+
 Neste caso, você <<hello_material#,cria seu próprio Material>> e aplica ele para a geometria (Geometry). Você baseia Materiais nas descrições de material padrão (por exemplo, “Unshaded.j3md), como mostrado neste exemplo.
 
 
@@ -148,7 +160,9 @@ A seguinte amostra de código vai no método `simpleInitApp()`.
 
 
 [source,java]
-----// Display a line of text with a default font
+
+----
+// Display a line of text with a default font
 guiNode.detachAllChildren();
 guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
 BitmapText helloText = new BitmapText(guiFont, false);
@@ -156,7 +170,9 @@ helloText.setSize(guiFont.getCharSet().getRenderedSize());
 helloText.setText("Hello World");
 helloText.setLocalTranslation(300, helloText.getLineHeight(), 0);
 guiNode.attachChild(helloText);
+
 ----
+
 *Dica:* Limpe o texto existente no nó da +++<abbr title="Graphical User Interface">GUI</abbr>+++ (guiNode) por retirar todas as suas crianças.
 
 
@@ -167,7 +183,9 @@ Exporte seu modelo 3D no formato OgreXML (.mesh.xml, .scene, .material, .skeleto
 
 
 [source,java]
+
 ----
+
 // Load a model from test_data (OgreXML + material + texture)
 Spatial ninja = assetManager.loadModel("Models/Ninja/Ninja.mesh.xml");
 ninja.scale(0.05f, 0.05f, 0.05f);
@@ -178,7 +196,9 @@ rootNode.attachChild(ninja);
 DirectionalLight sun = new DirectionalLight();
 sun.setDirection(new Vector3f(-0.1f, -0.7f, -1.0f).normalizeLocal());
 rootNode.addLight(sun);
+
 ----
+
 Note que você precisa criar um Material se você exportou o modelo com um material. Lembre-se de adicionar uma fonte de luz, como mostrado, de outra maneira o material (e o modelo inteiro) não estará visível!
 
 
@@ -192,22 +212,30 @@ Aqui está um exemplo de uso de um ZipLocator que está registrado para um arqui
 
 
 [source,java]
+
 ----
+
     assetManager.registerLocator("town.zip", ZipLocator.class);
     Spatial scene = assetManager.loadModel("main.scene");
     rootNode.attachChild(scene);
+
 ----
+
  Aque está um HttpZipLocator que pode baixar modelos zipados e carregá-los: 
 
 
 [source,java]
+
 ----
+
     assetManager.registerLocator(
       "http://jmonkeyengine.googlecode.com/files/wildhouse.zip", 
       HttpZipLocator.class);
     Spatial scene = assetManager.loadModel("main.scene");
     rootNode.attachChild(scene);
+
 ----
+
 JME3 oferece ClasspathLocator, ZipLocator, FileLocator, HttpZipLocator, e UrlLocator (Veja `com.jme3.asset.plugins`). 
 
 
@@ -245,12 +273,16 @@ Se você construir os executáveis usando o scrit de construção padrão, entã
 
 
 [source]
-----com.jme3.asset.DesktopAssetManager loadAsset
+
+----
+com.jme3.asset.DesktopAssetManager loadAsset
 WARNING: Cannot locate resource: Models/Ninja/Ninja.mesh.xml
 com.jme3.app.Application handleError
 SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
 java.lang.NullPointerException
+
 ----
+
 Carregando os arquivos XML/OBJ diretamente é somente aceitável durante a fase de desenvolvimento. Se seus projetista gráfico coloca arquivos atualizados para o diretório de ativos, você pode rapidamente revisar a versão mais recente em seu ambiente de desenvolvimento.
 
 
@@ -264,7 +296,11 @@ Abra seu Projeto JME3 no SDK da jMonkeyEngine.
 .  O arquivo .j3o aparece próximo ao arquivo .mesh.xml file e tem o mesmo nome.
 .  Mude todas as linhas do seu loadModel() de acordo. Por exemplo: 
 [source,java]
-----Spatial ninja = assetManager.loadModel("Models/Ninja/Ninja.j3o");----
+
+----
+Spatial ninja = assetManager.loadModel("Models/Ninja/Ninja.j3o");
+----
+
 
 Se seu executável dá uma exceção em tempo de execução, tenha certeza de que você converteu todos os modelos para .j3o!
 
@@ -280,28 +316,48 @@ a| Solução!
 a| Carregar um modelo com materiais 
 a| Use o método `loadModel()` do gerenciador de ativo (asset manager) e anexe o Spatial para o nó raiz (rootNode). 
 [source,java]
-----Spatial elephant = assetManager.loadModel("Models/Elephant/Elephant.mesh.xml");
-rootNode.attachChild(elephant);----
+
+----
+Spatial elephant = assetManager.loadModel("Models/Elephant/Elephant.mesh.xml");
+rootNode.attachChild(elephant);
+----
+
 [source,java]
-----Spatial elephant = assetManager.loadModel("Models/Elephant/Elephant.j3o");
-rootNode.attachChild(elephant);----
+
+----
+Spatial elephant = assetManager.loadModel("Models/Elephant/Elephant.j3o");
+rootNode.attachChild(elephant);
+----
+
 
 a| carregar um modelo sem materiais 
 a| Se você tiver um modelo sem materiais, você tem de dár a ele um material para fazê-lo visível. 
 [source,java]
-----Spatial teapot = assetManager.loadModel("Models/Teapot/Teapot.j3o");
+
+----
+Spatial teapot = assetManager.loadModel("Models/Teapot/Teapot.j3o");
 Material mat = new Material(assetManager, "Common/MatDefs/Misc/ShowNormals.j3md"); // default material
 teapot.setMaterial(mat);
-rootNode.attachChild(teapot);----
+rootNode.attachChild(teapot);
+----
+
 
 a| Carregar uma cena 
 a| Você carrega cenas da mesma forma que você carrega modelos: 
 [source,java]
-----Spatial scene = assetManager.loadModel("Scenes/town/main.scene");
-rootNode.attachChild(scene);----
+
+----
+Spatial scene = assetManager.loadModel("Scenes/town/main.scene");
+rootNode.attachChild(scene);
+----
+
 [source,java]
-----Spatial scene = assetManager.loadModel("Scenes/town/main.j3o");
-rootNode.attachChild(scene);----
+
+----
+Spatial scene = assetManager.loadModel("Scenes/town/main.j3o");
+rootNode.attachChild(scene);
+----
+
 
 |===
 
@@ -315,24 +371,32 @@ Como um exercício, vamos tentar diferentes maneiras de carregar uma cena. Você
 .  (Opcional:) Dezipe o arquivo town.zip para ver a estrutura da Ogre dotScene contida: Você terá um diretório chamado `town`. Ele contém arquivos XML e textura, e o arquivo chamado main.scene. (Isto é apenas para sua informação, você não precisa fazer nada com ele.)
 .  Coloque o arquivo town.zip no diretório topo de nível de seu projeto JME3, assim:
 [source]
-----jMonkeyProjects/MyGameProject/assets/
+
+----
+jMonkeyProjects/MyGameProject/assets/
 jMonkeyProjects/MyGameProject/build.xml
 jMonkeyProjects/MyGameProject/src/
 jMonkeyProjects/MyGameProject/town.zip
 ...
+
 ----
 
+
 Use o seguinte método para carregar modelos de um arquivo zip:
 
 
 .  Verifique se `town.zip` está no diretório do projeto.
 .  Registre um localizador de arquivo zip para o diretório do projeto: Adicione o seguinte código sobre `simpleInitApp(){`
 [source,java]
-----    assetManager.registerLocator("town.zip", ZipLocator.class);
+
+----
+    assetManager.registerLocator("town.zip", ZipLocator.class);
     Spatial gameLevel = assetManager.loadModel("main.scene");
     gameLevel.setLocalTranslation(0, -5.2f, 0);
     gameLevel.setLocalScale(2);
-    rootNode.attachChild(gameLevel);----
+    rootNode.attachChild(gameLevel);
+----
+
 O método loadModel() agora pesquisa pelo arquivo zip diretamente para carregar os arquivos (isto significa, não escreva `loadModel(town.zip/main.scene)` ou similar!) 
 
 
@@ -349,10 +413,14 @@ Anteriormente neste tutorial, você carregou cenas e modelos do diretório de at
 .  Mova o diretório dezipado `town/` no diretório `assets/Scenes/` de seu projeto.
 .  Adicione o seguinte código sobre `simpleInitApp() {` 
 [source,java]
-----    Spatial gameLevel = assetManager.loadModel("Scenes/town/main.scene");
+
+----
+    Spatial gameLevel = assetManager.loadModel("Scenes/town/main.scene");
     gameLevel.setLocalTranslation(0, -5.2f, 0);
     gameLevel.setLocalScale(2);
-    rootNode.attachChild(gameLevel);----
+    rootNode.attachChild(gameLevel);
+----
+
  Note que o caminho é relativo ao diretório `assets/…`.
 
 
@@ -367,10 +435,14 @@ Aqui está um terceiro método que você deve conhecer, carregando uma cena/mode
 .  Dê um clique com o botão direito em `main.scene` e converta a cena para binário: A jMonkeyPlatform gera um arquivo main.j3o.
 .  Adicione o seguinte código em `simpleInitApp() {`
 [source,java]
-----    Spatial gameLevel = assetManager.loadModel("Scenes/town/main.j3o");
+
+----
+    Spatial gameLevel = assetManager.loadModel("Scenes/town/main.j3o");
     gameLevel.setLocalTranslation(0, -5.2f, 0);
     gameLevel.setLocalScale(2);
-    rootNode.attachChild(gameLevel);----
+    rootNode.attachChild(gameLevel);
+----
+
  Novamente, note que o caminho é relativo ao diretório `assets/…` directory.
 
 

+ 55 - 7
src/docs/asciidoc/jme3/beginner/hello_audio.adoc

@@ -15,7 +15,9 @@ This tutorial explains how to add 3D sound to a game, and how to make sounds pla
 == Sample Code
 
 [source,java]
-----package jme3test.helloworld;
+
+----
+package jme3test.helloworld;
 
 import com.jme3.app.SimpleApplication;
 import com.jme3.audio.AudioNode;
@@ -98,7 +100,9 @@ public class HelloAudio extends SimpleApplication {
   }
 
 }
+
 ----
+
 When you run the sample, you should see a blue cube. You should hear a nature-like ambient sound. When you click, you hear a loud shot.
 
 
@@ -121,19 +125,27 @@ For each sound, you create an AudioNode. You can use an AudioNode like any node
 
 
 [source,java]
+
 ----
+
   private AudioNode audio_gun;
   private AudioNode audio_nature;
+
 ----
+
 Look at the custom `initAudio()` method: Here you initialize the sound objects and set their parameters.
 
 
 [source,Java]
+
 ----
+
 audio_gun = new AudioNode(assetManager, "Sound/Effects/Gun.wav", false);
     ...
 audio_nature = new AudioNode(assetManager, "Sound/Environment/Nature.ogg", false);
+
 ----
+
 These two lines create new sound nodes from the given audio files in the AssetManager. The `false` flag means that you want to buffer these sounds before playing. (If you set this flag to true, the sound will be streamed, which makes sense for really long sounds.)
 
 
@@ -141,36 +153,48 @@ You want the gunshot sound to play _once_ (you don't want it to loop). You also
 
 
 [source,java]
+
 ----
+
     audio_gun.setPositional(false);
     audio_gun.setLooping(false);
     audio_gun.setVolume(2);
     rootNode.attachChild(audio_gun);
+
 ----
 
 
 
+
 The nature sound is different: You want it to loop _continuously_ as background sound. This is why you set looping to true, and immediately call the play() method on the node. You also choose to set its volume to 3.
 
 
 [source,java]
+
 ----
+
     audio_nature.setLooping(true); // activate continuous playing
     ...
     audio_nature.setVolume(3);
     rootNode.attachChild(audio_nature);
     audio_nature.play(); // play continuously!
-  }----
+  }
+----
+
 Here you make audio_nature a positional sound that comes from a certain place. For that you give the node an explicit translation, in this example, you choose Vector3f.ZERO (which stands for the coordinates `0.0f,0.0f,0.0f`, the center of the scene.) Since jME supports 3D audio, you are now able to hear this sound coming from this particular location. Making the sound positional is optional. If you don't use these lines, the ambient sound comes from every direction.
 
 
 [source,java]
+
 ----
+
     ...
     audio_nature.setPositional(true);
     audio_nature.setLocalTranslation(Vector3f.ZERO.clone());
     ...
+
 ----
+
 *Tip:* Attach AudioNodes into the scene graph like all nodes, to make certain moving nodes stay up-to-date. If you don't attach them, they are still audible and you don't get an error message but 3D sound will not work as expected. AudioNodes can be attached directly to the root node or they can be attached inside a node that is moving through the scene and both the AudioNode and the 3d position of the sound it is generating will move accordingly.
 
 
@@ -184,18 +208,24 @@ Let's have a closer look at `initKeys()`: As you learned in previous tutorials,
 
 
 [source,java]
+
 ----
+
   /** Declaring "Shoot" action, mapping it to a trigger (mouse left click). */
   private void initKeys() {
     inputManager.addMapping("Shoot", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
     inputManager.addListener(actionListener, "Shoot");
   }
+
 ----
+
 Setting up the ActionListener should also be familiar from previous tutorials. You declare that, when the trigger (the mouse button) is pressed and released, you want to play a gun sound.
 
 
 [source,java]
+
 ----
+
   /** Defining the "Shoot" action: Play a gun sound. */
   private ActionListener actionListener = new ActionListener() {
     @Override
@@ -204,7 +234,9 @@ Setting up the ActionListener should also be familiar from previous tutorials. Y
         audio_gun.playInstance(); // play each instance once!
       }
     }
-  };----
+  };
+----
+
 Since you want to be able to shoot fast repeatedly, so you do not want to wait for the previous gunshot sound to end before the next one can start. This is why you play this sound using the `playInstance()` method. This means that every click starts a new instance of the sound, so two instances can overlap. You set this sound not to loop, so each instance only plays once. As you would expect it of a gunshot.
 
 
@@ -229,11 +261,17 @@ Apart from the looping boolean, another difference is where `play().playInstance
 
 *  You start playing the background nature sound right after you have created it, in the initAudio() method.
 [source,java]
-----    audio_nature.play(); // play continuously!
+
+----
+    audio_nature.play(); // play continuously!
+
 ----
+
 *  The gunshot sound, however, is triggered situationally, once, only as part of the `Shoot` input action that you defined in the ActionListener.
 [source,java]
+
 ----
+
   /** Defining the "Shoot" action: Play a gun sound. */
   private ActionListener actionListener = new ActionListener() {
     @Override
@@ -242,7 +280,9 @@ Apart from the looping boolean, another difference is where `play().playInstance
         audio_gun.playInstance(); // play each instance once!
       }
     }
-  };----
+  };
+----
+
 
 
 == Buffered or Streaming?
@@ -251,9 +291,13 @@ The Boolean in the AudioNode constructor defines whether the audio is buffered (
 
 
 [source,java]
-----audio_gunshot = new AudioNode(assetManager, "Sound/Effects/Gun.wav", false); // buffered
+
+----
+audio_gunshot = new AudioNode(assetManager, "Sound/Effects/Gun.wav", false); // buffered
 ...
-audio_nature = new AudioNode(assetManager, "Sound/Environment/Nature.ogg", true); // streamed ----
+audio_nature = new AudioNode(assetManager, "Sound/Environment/Nature.ogg", true); // streamed 
+----
+
 Typically, you stream long sounds, and buffer short sounds.
 
 
@@ -289,12 +333,16 @@ In order to make the most of the 3D audio effect, you must use the `simpleUpdate
 
 
 [source,java]
+
 ----
+
   public void simpleUpdate(float tpf) {
     listener.setLocation(cam.getLocation());
     listener.setRotation(cam.getRotation());
   }
+
 ----
+
 If you don't do that, the results of 3D audio will be quite random.
 
 

+ 86 - 10
src/docs/asciidoc/jme3/beginner/hello_collision.adoc

@@ -23,16 +23,22 @@ If you don't have it yet, link:http://jmonkeyengine.googlecode.com/svn/trunk/eng
 
 
 [source]
-----jMonkeyProjects$ ls -1 BasicGame
+
+----
+jMonkeyProjects$ ls -1 BasicGame
 assets/
 build.xml
 town.zip
-src/----
+src/
+----
+
 Place town.zip in the root directory of your JME3 project. Here is the code:
 
 
 [source,java]
+
 ----
+
 package jme3test.helloworld;
 
 import com.jme3.app.SimpleApplication;
@@ -192,7 +198,9 @@ public class HelloCollision extends SimpleApplication
         cam.setLocation(player.getPhysicsLocation());
     }
 }
+
 ----
+
 Run the sample. You should see a town square with houses and a monument. Use the WASD keys and the mouse to navigate around with a first-person perspective. Run forward and jump by pressing W and Space. Note how you step over the sidewalk, and up the steps to the monument. You can walk in the alleys between the houses, but the walls are solid. Don't walk over the edge of the world! emoji:smiley
 
 
@@ -203,13 +211,19 @@ Let's start with the class declaration:
 
 
 [source,java]
-----public class HelloCollision extends SimpleApplication
-        implements ActionListener { ... }----
+
+----
+public class HelloCollision extends SimpleApplication
+        implements ActionListener { ... }
+----
+
 You already know that SimpleApplication is the base class for all jME3 games. You make this class implement the `ActionListener` interface because you want to customize the navigational inputs later.
 
 
 [source,java]
+
 ----
+
   private Spatial sceneModel;
   private BulletAppState bulletAppState;
   private RigidBodyControl landscape;
@@ -221,7 +235,9 @@ You already know that SimpleApplication is the base class for all jME3 games. Yo
   //They here to avoid instanciating new vectors on each frame
   private Vector3f camDir = new Vector3f();
   private Vector3f camLeft = new Vector3f();
+
 ----
+
 You initialize a few private fields:
 
 
@@ -242,12 +258,16 @@ As usual, you initialize the game in the `simpleInitApp()` method.
 
 
 [source,java]
+
 ----
+
     viewPort.setBackgroundColor(new ColorRGBA(0.7f,0.8f,1f,1f));
     flyCam.setMoveSpeed(100);
     setUpKeys();
     setUpLight();
+
 ----
+
 .  You set the background color to light blue, since this is a scene with a sky.
 .  You repurpose the default camera control “flyCam as first-person camera and set its speed.
 .  The auxiliary method `setUpLights()` adds your light sources.
@@ -260,30 +280,42 @@ The first thing you do in every physics game is create a BulletAppState object.
 
 
 [source,java]
+
 ----
+
     bulletAppState = new BulletAppState();
     stateManager.attach(bulletAppState);
+
 ----
+
 For the scene, you load the `sceneModel` from a zip file, and adjust the size.
 
 
 [source,java]
+
 ----
+
     assetManager.registerLocator("town.zip", ZipLocator.class);
     sceneModel = assetManager.loadModel("main.scene");
     sceneModel.setLocalScale(2f);
+
 ----
+
 The file `town.zip` is included as a sample model in the JME3 sources – you can link:http://jmonkeyengine.googlecode.com/svn/trunk/engine/town.zip[download it here]. (Optionally, use any OgreXML scene of your own.) For this sample, place the zip file in the application's top level directory (that is, next to src/, assets/, build.xml).
 
 
 [source,java]
+
 ----
+
     CollisionShape sceneShape =
       CollisionShapeFactory.createMeshShape((Node) sceneModel);
     landscape = new RigidBodyControl(sceneShape, 0);
     sceneModel.addControl(landscape);
     rootNode.attachChild(sceneModel);
+
 ----
+
 To use collision detection, you add a RigidBodyControl to the `sceneModel` Spatial. The RigidBodyControl for a complex model takes two arguments: A Collision Shape, and the object's mass.
 
 
@@ -305,9 +337,13 @@ So let's set up collision detection for the first-person player.
 
 
 [source,java]
+
 ----
+
     CapsuleCollisionShape capsuleShape = new CapsuleCollisionShape(1.5f, 6f, 1);
+
 ----
+
 Again, you create a CollisionShape: This time you choose a CapsuleCollisionShape, a cylinder with a rounded top and bottom. This shape is optimal for a person: It's tall and the roundness helps to get stuck less often on obstacles.
 
 
@@ -315,14 +351,22 @@ Again, you create a CollisionShape: This time you choose a CapsuleCollisionShape
 *  The final integer argument specifies the orientation of the cylinder: 1 is the Y-axis, which fits an upright person. For animals which are longer than high you would use 0 or 2 (depending on how it is rotated).
 
 [source,java]
+
 ----
+
     player = new CharacterControl(capsuleShape, 0.05f);
+
 ----
+
 
 
 [source,java]
-----bulletAppState.getPhysicsSpace().enableDebug(assetManager);----
+
+----
+bulletAppState.getPhysicsSpace().enableDebug(assetManager);
+----
+
 
 
 
@@ -330,18 +374,26 @@ Now you use the CollisionShape to create a `CharacterControl` that represents th
 
 
 [source,java]
+
 ----
+
     player.setJumpSpeed(20);
     player.setFallSpeed(30);
     player.setGravity(30);
+
 ----
+
 Apart from step height and character size, the `CharacterControl` lets you configure jumping, falling, and gravity speeds. Adjust the values to fit your game situation.
 
 
 [source,java]
+
 ----
+
     player.setPhysicsLocation(new Vector3f(0, 10, 0));
+
 ----
+
 Finally we put the player in its starting position and update its state – remember to use `setPhysicsLocation()` instead of `setLocalTranslation()` now, since you are dealing with a physical object. 
 
 
@@ -352,10 +404,14 @@ Remember, in physical games, you must register all solid objects (usually the ch
 
 
 [source,java]
+
 ----
+
     bulletAppState.getPhysicsSpace().add(landscape);
     bulletAppState.getPhysicsSpace().add(player);
+
 ----
+
 The invisible body of the character just sits there on the physical floor. It cannot walk yet – you will deal with that next.
 
 
@@ -378,7 +434,9 @@ In the `simpleInitApp()` method, you re-configure the familiar WASD inputs for w
 
 
 [source,java]
-----private void setUpKeys() {
+
+----
+private void setUpKeys() {
     inputManager.addMapping("Left", new KeyTrigger(KeyInput.KEY_A));
     inputManager.addMapping("Right", new KeyTrigger(KeyInput.KEY_D));
     inputManager.addMapping("Up", new KeyTrigger(KeyInput.KEY_W));
@@ -390,7 +448,9 @@ In the `simpleInitApp()` method, you re-configure the familiar WASD inputs for w
     inputManager.addListener(this, "Down");
     inputManager.addListener(this, "Jump");
 }
+
 ----
+
 You can move this block of code into an auxiliary method `setupKeys()` and call this method from `simpleInitApp()`– to keep the code more readable.
 
 
@@ -401,7 +461,9 @@ Remember that this class implements the `ActionListener` interface, so you can c
 
 
 [source,java]
+
 ----
+
   public void onAction(String binding, boolean value, float tpf) {
     if (binding.equals("Left")) {
       if (value) { left = true; } else { left = false; }
@@ -414,7 +476,9 @@ Remember that this class implements the `ActionListener` interface, so you can c
     } else if (binding.equals("Jump")) {
       player.jump();
     }
-  }----
+  }
+----
+
 The only movement that you do not have to implement yourself is the jumping action. The call `player.jump()` is a special method that handles a correct jumping motion for your `PhysicsCharacterNode`.
 
 
@@ -431,7 +495,9 @@ This last and most important code snippet goes into the `simpleUpdate()` method.
 
 
 [source,java]
+
 ----
+
  public void simpleUpdate(float tpf) {
         camDir.set(cam.getDirection()).multLocal(0.6f);
         camLeft.set(cam.getLeft()).multLocal(0.4f);
@@ -450,7 +516,9 @@ This last and most important code snippet goes into the `simpleUpdate()` method.
         }
         player.setWalkDirection(walkDirection);
         cam.setLocation(player.getPhysicsLocation());
-    }----
+    }
+----
+
 This is how the walking is triggered:
 
 
@@ -458,13 +526,21 @@ This is how the walking is triggered:
 ..  Add to `walkDirection` the recent motion vectors that you polled from the camera. This way it is posible for a character to move forward and to the left simultaneously, for example! 
 ..  This one last line does the “walking magic: 
 [source,java]
-----player.setWalkDirection(walkDirection);----
+
+----
+player.setWalkDirection(walkDirection);
+----
+
  Always use `setWalkDirection()` to make a physics-controlled object move continuously, and the physics engine handles collision detection for you.
 
 
 ..  Make the first-person camera object follow along with the physics-controlled player:
 [source,java]
-----cam.setLocation(player.getPhysicsLocation());----
+
+----
+cam.setLocation(player.getPhysicsLocation());
+----
+
 
 *Important:* Again, do not use `setLocalTranslation()` to walk the player around. You will get it stuck by overlapping with another physical object. You can put the player in a start position with `setPhysicalLocation()` if you make sure to place it a bit above the floor and away from obstacles.
 

+ 20 - 4
src/docs/asciidoc/jme3/beginner/hello_effects.adoc

@@ -37,7 +37,9 @@ Particle effects can be animated (e.g. sparks, drops) and static (strands of gra
 == Sample Code
 
 [source,java]
-----package jme3test.helloworld;
+
+----
+package jme3test.helloworld;
 
 import com.jme3.app.SimpleApplication;
 import com.jme3.effect.ParticleEmitter;
@@ -95,7 +97,9 @@ public class HelloEffects extends SimpleApplication {
     rootNode.attachChild(debris);
     debris.emitAllParticles();
   }
-}----
+}
+----
+
 You should see an explosion that sends debris flying, and a fire.
 link:https://github.com/jMonkeyEngine/jmonkeyengine/tree/master/jme3-examples/src/main/java/jme3test/effect[More example code is here.]
 
@@ -115,7 +119,9 @@ Setting emitter textures works just as you have already learned in previous chap
 
 
 [source,java]
+
 ----
+
     ParticleEmitter debris = 
             new ParticleEmitter("Debris", ParticleMesh.Type.Triangle, 10);
     Material debris_mat = new Material(assetManager, 
@@ -127,7 +133,9 @@ Setting emitter textures works just as you have already learned in previous chap
     debris.setImagesY(3); // 3x3 texture animation
     debris.setSelectRandomImage(true);
         ...
+
 ----
+
 .  Create a material and load the texture.
 .  Tell the Emitter into how many animation steps (x*y) the texture is divided. +
 The debris texture has 3x3 frames.
@@ -184,7 +192,9 @@ For your game, you will likely create custom particle textures. Look at the fire
 
 
 [source,java]
+
 ----
+
     ParticleEmitter fire = 
             new ParticleEmitter("Emitter", ParticleMesh.Type.Triangle, 30);
     Material mat_red = new Material(assetManager, 
@@ -196,7 +206,9 @@ For your game, you will likely create custom particle textures. Look at the fire
     fire.setImagesY(2); // 2x2 texture animation
     fire.setEndColor(  new ColorRGBA(1f, 0f, 0f, 1f));   // red
     fire.setStartColor(new ColorRGBA(1f, 1f, 0f, 0.5f)); // yellow
-    ----
+    
+----
+
 
 image::http///jmonkeyengine.googlecode.com/svn/trunk/engine/test-data/Effects/Explosion/flame.png[flame.png,with="96",height="96",align="right"]
 
@@ -231,7 +243,11 @@ Example:
 
 
 [source,java]
-----emitter.setShape(new EmitterPointShape(Vector3f.ZERO));----
+
+----
+emitter.setShape(new EmitterPointShape(Vector3f.ZERO));
+----
+
 You create different effects by changing the emitter parameters: 
 
 [cols="4", options="header"]

+ 33 - 5
src/docs/asciidoc/jme3/beginner/hello_input_system-pt.adoc

@@ -16,7 +16,9 @@ Every game has its custom keybindings, and this tutorial explains how you define
 == Sample Code
 
 [source,java]
+
 ----
+
 package jme3test.helloworld;
 
 import com.jme3.app.SimpleApplication;
@@ -95,7 +97,9 @@ public class HelloInput extends SimpleApplication {
     }
   };
 }
+
 ----
+
 Build and run the example.
 
 
@@ -126,14 +130,18 @@ Have a look at the code:
 .  You map the `Pause`, `Left`, `Right` mappings to the P, J, K keys, respectively. 
 
 [source,java]
+
 ----
+
     // You can map one or several inputs to one named action
     inputManager.addMapping("Pause",  new KeyTrigger(KeyInput.KEY_P));
     inputManager.addMapping("Left",   new KeyTrigger(KeyInput.KEY_J));
     inputManager.addMapping("Right",  new KeyTrigger(KeyInput.KEY_K));
     inputManager.addMapping("Rotate", new KeyTrigger(KeyInput.KEY_SPACE),
                                       new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
+
 ----
+
 Now you need to register your trigger mappings.
 
 
@@ -141,11 +149,15 @@ Now you need to register your trigger mappings.
 .  You register the movement actions to the AnalogListener, because they are gradual actions.
 
 [source,java]
+
 ----
+
     // Add the names to the action listener.
     inputManager.addListener(actionListener, new String[]{"Pause"});
     inputManager.addListener(analogListener, new String[]{"Left", "Right", "Rotate"});
+
 ----
+
 This code goes into the `simpleInitApp()` method. But since we will likely add many keybindings, we extract these lines and wrap them in an auxiliary method, `initKeys()`. The `initKeys()` method is not part of the Input Controls interface – you can name it whatever you like. Just don't forget to call your method from the `initSimpleApp()` method.
 
 
@@ -167,7 +179,9 @@ In this example, we trigger the following actions:
 .  We also want to check the boolean `isRunning` before any action (other than unpausing) is executed.
 
 [source,java]
+
 ----
+
   private ActionListener actionListener = new ActionListener() {
     public void onAction(String name, boolean keyPressed, float tpf) {
       if (name.equals("Pause") && !keyPressed) {
@@ -194,12 +208,16 @@ In this example, we trigger the following actions:
         System.out.println("Press P to unpause.");
       }
     }
-  };----
+  };
+----
+
 You can also combine both listeners into one, the engine will send the appropriate events to each method (onAction or onAnalog). For example:
 
 
 [source,java]
+
 ----
+
   private MyCombinedListener combinedListener = new MyCombinedListener();
 
   private static class MyCombinedListener implements AnalogListener, ActionListener {
@@ -229,7 +247,9 @@ You can also combine both listeners into one, the engine will send the appropria
   }
 // ...
 inputManager.addListener(combinedListener, new String[]{"Pause", "Left", "Right", "Rotate"});
-  ----
+  
+----
+
 It's okay to use only one of the two Listeners, and not implement the other one, if you are not using this type of interaction. In the following, we have a closer look how to decide which of the two listeners is best suited for which situation.
 
 
@@ -265,9 +285,13 @@ Mappings registered to the *ActionListener* are digital either-or actions – 
 
 
 [source,java]
-----      if (name.equals("Pause") && !keyPressed) {
+
+----
+      if (name.equals("Pause") && !keyPressed) {
         isRunning = !isRunning;
-      }----
+      }
+----
+
 
 == Table of Triggers
 
@@ -315,11 +339,15 @@ KeyTrigger(KeyInput.KEY_LEFT), KeyTrigger(KeyInput.KEY_RIGHT)
 
 .  In which situation would it be better to use variables instead of literals for the MouseInput/KeyInput definitions? 
 [source,java]
-----int usersPauseKey = KeyInput.KEY_P; 
+
+----
+int usersPauseKey = KeyInput.KEY_P; 
 ...
 inputManager.addMapping("Pause",  new KeyTrigger(usersPauseKey));
+
 ----
 
+
 link:http://jmonkeyengine.org/wiki/doku.php/jm3:solutions[http://jmonkeyengine.org/wiki/doku.php/jm3:solutions]
 +++<u>Be sure to try to solve them for yourself first!</u>+++
 

+ 33 - 5
src/docs/asciidoc/jme3/beginner/hello_input_system.adoc

@@ -16,7 +16,9 @@ Every game has its custom keybindings, and this tutorial explains how you define
 == Sample Code
 
 [source,java]
+
 ----
+
 package jme3test.helloworld;
 
 import com.jme3.app.SimpleApplication;
@@ -95,7 +97,9 @@ public class HelloInput extends SimpleApplication {
     }
   };
 }
+
 ----
+
 Build and run the example.
 
 
@@ -126,14 +130,18 @@ Have a look at the code:
 .  You map the `Pause`, `Left`, `Right` mappings to the P, J, K keys, respectively. 
 
 [source,java]
+
 ----
+
     // You can map one or several inputs to one named action
     inputManager.addMapping("Pause",  new KeyTrigger(KeyInput.KEY_P));
     inputManager.addMapping("Left",   new KeyTrigger(KeyInput.KEY_J));
     inputManager.addMapping("Right",  new KeyTrigger(KeyInput.KEY_K));
     inputManager.addMapping("Rotate", new KeyTrigger(KeyInput.KEY_SPACE),
                                       new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
+
 ----
+
 Now you need to register your trigger mappings.
 
 
@@ -141,11 +149,15 @@ Now you need to register your trigger mappings.
 .  You register the movement actions to the AnalogListener, because they are gradual actions.
 
 [source,java]
+
 ----
+
     // Add the names to the action listener.
     inputManager.addListener(actionListener,"Pause");
     inputManager.addListener(analogListener,"Left", "Right", "Rotate");
+
 ----
+
 This code goes into the `simpleInitApp()` method. But since we will likely add many keybindings, we extract these lines and wrap them in an auxiliary method, `initKeys()`. The `initKeys()` method is not part of the Input Controls interface – you can name it whatever you like. Just don't forget to call your method from the `initSimpleApp()` method.
 
 
@@ -167,7 +179,9 @@ In this example, we trigger the following actions:
 .  We also want to check the boolean `isRunning` before any action (other than unpausing) is executed.
 
 [source,java]
+
 ----
+
   private ActionListener actionListener = new ActionListener() {
     public void onAction(String name, boolean keyPressed, float tpf) {
       if (name.equals("Pause") && !keyPressed) {
@@ -194,12 +208,16 @@ In this example, we trigger the following actions:
         System.out.println("Press P to unpause.");
       }
     }
-  };----
+  };
+----
+
 You can also combine both listeners into one, the engine will send the appropriate events to each method (onAction or onAnalog). For example:
 
 
 [source,java]
+
 ----
+
   private MyCombinedListener combinedListener = new MyCombinedListener();
 
   private static class MyCombinedListener implements AnalogListener, ActionListener {
@@ -229,7 +247,9 @@ You can also combine both listeners into one, the engine will send the appropria
   }
 // ...
 inputManager.addListener(combinedListener, new String[]{"Pause", "Left", "Right", "Rotate"});
-  ----
+  
+----
+
 It's okay to use only one of the two Listeners, and not implement the other one, if you are not using this type of interaction. In the following, we have a closer look how to decide which of the two listeners is best suited for which situation.
 
 
@@ -265,9 +285,13 @@ Mappings registered to the *ActionListener* are digital either-or actions – 
 
 
 [source,java]
-----      if (name.equals("Pause") && !keyPressed) {
+
+----
+      if (name.equals("Pause") && !keyPressed) {
         isRunning = !isRunning;
-      }----
+      }
+----
+
 
 == Table of Triggers
 
@@ -318,11 +342,15 @@ KeyTrigger(KeyInput.KEY_LEFT), KeyTrigger(KeyInput.KEY_RIGHT)
 
 .  In which situation would it be better to use variables instead of literals for the MouseInput/KeyInput definitions? 
 [source,java]
-----int usersPauseKey = KeyInput.KEY_P; 
+
+----
+int usersPauseKey = KeyInput.KEY_P; 
 ...
 inputManager.addMapping("Pause",  new KeyTrigger(usersPauseKey));
+
 ----
 
+
 link:http://jmonkeyengine.org/wiki/doku.php/jm3:solutions[http://jmonkeyengine.org/wiki/doku.php/jm3:solutions]
 +++<u>Be sure to try to solve them for yourself first!</u>+++
 

+ 5 - 2
src/docs/asciidoc/jme3/beginner/hello_input_system/timekeypressed.adoc

@@ -9,7 +9,9 @@ Here is a sample of a program where the camera accelerates if the key is kept pr
 
 
 [source,java]
-----import com.jme3.app.SimpleApplication;
+
+----
+import com.jme3.app.SimpleApplication;
 import com.jme3.bounding.BoundingBox;
 import com.jme3.font.BitmapText;
 import com.jme3.input.KeyInput;
@@ -232,4 +234,5 @@ public class Accelerate extends SimpleApplication implements ActionListener {
     }
 }
 
-----
+
+----

+ 5 - 1
src/docs/asciidoc/jme3/beginner/hello_main_event_loop.adoc

@@ -13,7 +13,9 @@ Now that you know how to load assets, such as 3D models, you want to implement s
 == Code Sample
 
 [source,java]
+
 ----
+
 package jme3test.helloworld;
 
 import com.jme3.app.SimpleApplication;
@@ -52,7 +54,9 @@ public class HelloLoop extends SimpleApplication {
         // make the player rotate:
         player.rotate(0, 2*tpf, 0); 
     }
-}----
+}
+----
+
 Build and run the file: You see a constantly rotating cube. 
 
 

+ 5 - 1
src/docs/asciidoc/jme3/beginner/hello_main_event_loop_pt.adoc

@@ -13,7 +13,9 @@ Agora que você sabe como carregar ativos, como modelos 3D, você quer implement
 == Amostra de Código
 
 [source,java]
+
 ----
+
 package jme3test.helloworld;
 
 import com.jme3.app.SimpleApplication;
@@ -52,7 +54,9 @@ public class HelloLoop extends SimpleApplication {
         // make the player rotate
         player.rotate(0, 2*tpf, 0); 
     }
-}----
+}
+----
+
 Compile e execute o arquivo: Você vê um cubo rotacionando constantemente.
 
 

+ 67 - 11
src/docs/asciidoc/jme3/beginner/hello_material.adoc

@@ -19,7 +19,9 @@ image::beginner-materials.png[beginner-materials.png,with="320",height="240",ali
 == Sample Code
 
 [source,java]
-----package jme3test.helloworld;
+
+----
+package jme3test.helloworld;
 
 import com.jme3.app.SimpleApplication;
 import com.jme3.light.DirectionalLight;
@@ -98,7 +100,9 @@ public class HelloMaterial extends SimpleApplication {
 
   }
 }
+
 ----
+
 You should see
 
 
@@ -115,7 +119,9 @@ Typically you want to give objects in your scene textures: It can be rock, grass
 
 
 [source,java]
+
 ----
+
     /** A simple textured cube -- in good MIP map quality. */
     Box cube1Mesh = new Box( 1f,1f,1f);
     Geometry cube1Geo = new Geometry("My Textured Box", cube1Mesh);
@@ -127,7 +133,9 @@ Typically you want to give objects in your scene textures: It can be rock, grass
     cube1Mat.setTexture("ColorMap", cube1Tex);
     cube1Geo.setMaterial(cube1Mat);
     rootNode.attachChild(cube1Geo);
+
 ----
+
 Here is what we did: to create a textured box:
 
 
@@ -152,7 +160,9 @@ For a partially translucent/transparent texture, you need:
 This bucket ensures that the transparent object is drawn on top of objects behind it, and they show up correctly under the transparent parts. 
 
 [source,java]
+
 ----
+
     /** A translucent/transparent texture, similar to a window frame. */
     Box cube2Mesh = new Box( 1f,1f,0.01f);
     Geometry cube2Geo = new Geometry("window frame", cube2Mesh);
@@ -164,7 +174,9 @@ This bucket ensures that the transparent object is drawn on top of objects behin
     cube2Geo.setQueueBucket(Bucket.Transparent);                        // !
     cube2Geo.setMaterial(cube2Mat);
     rootNode.attachChild(cube2Geo);
+
 ----
+
 For non-transparent objects, the drawing order is not so important, because the z-buffer already keeps track of whether a pixel is behind something else or not, and the color of an opaque pixel doesn't depend on the pixels under it, this is why opaque Geometries can be drawn in any order.
 
 
@@ -196,57 +208,93 @@ Let's have a look at the part of the code example where you create the shiny bum
 
 .  Create a Geometry from a Sphere shape. Note that this shape is a normal smooth sphere mesh. 
 [source,java]
+
 ----
+
     Sphere sphereMesh = new Sphere(32,32, 2f);
-    Geometry sphereGeo = new Geometry("Shiny rock", sphereMesh);----
+    Geometry sphereGeo = new Geometry("Shiny rock", sphereMesh);
+----
+
 ..  (Only for Spheres) Change the sphere's TextureMode to make the square texture project better onto the sphere.
 [source,java]
+
+----
+
+    sphereMesh.setTextureMode(Sphere.TextureMode.Projected);
 ----
-    sphereMesh.setTextureMode(Sphere.TextureMode.Projected);----
+
 ..  You must generate TangentBinormals for the mesh so you can use the NormalMap layer of the texture.
 [source,java]
+
+----
+
+    TangentBinormalGenerator.generate(sphereMesh);
 ----
-    TangentBinormalGenerator.generate(sphereMesh);----
+
 
 .  Create a material based on the `Lighting.j3md` default material.
 [source,java]
+
 ----
+
     Material sphereMat = new Material(assetManager, 
-        "Common/MatDefs/Light/Lighting.j3md");----
+        "Common/MatDefs/Light/Lighting.j3md");
+----
+
 ..  Set a standard rocky texture in the `DiffuseMap` layer. +
 
 image::http///jmonkeyengine.googlecode.com/svn/trunk/engine/test-data/Textures/Terrain/Pond/Pond.jpg[Pond.jpg,with="64",height="64",align="right"]
 
 [source,java]
+
 ----
+
     sphereMat.setTexture("DiffuseMap", 
         assetManager.loadTexture("Textures/Terrain/Pond/Pond.jpg"));
+
 ----
+
 ..  Set the `NormalMap` layer that contains the bumpiness. The NormalMap was generated for this particular DiffuseMap with a special tool (e.g. Blender). 
 image::http///jmonkeyengine.googlecode.com/svn/trunk/engine/test-data/Textures/Terrain/Pond/Pond_normal.png[Pond_normal.png,with="64",height="64",align="right"]
  
 [source,java]
+
 ----
+
     sphereMat.setTexture("NormalMap", 
-        assetManager.loadTexture("Textures/Terrain/Pond/Pond_normal.png"));----
+        assetManager.loadTexture("Textures/Terrain/Pond/Pond_normal.png"));
+----
+
 ..  Set the Material's Shininess to a value between 1 and 128. For a rock, a low fuzzy shininess is appropriate. Use material colors to define the shiny Specular color. 
 [source,java]
+
 ----
+
     sphereMat.setBoolean("UseMaterialColors",true);    
     sphereMat.setColor("Diffuse",ColorRGBA.White);  // minimum material color
     sphereMat.setColor("Specular",ColorRGBA.White); // for shininess
-    sphereMat.setFloat("Shininess", 64f); // [1,128] for shininess----
+    sphereMat.setFloat("Shininess", 64f); // [1,128] for shininess
+----
+
 
 .  Assign your newly created material to the Geometry.
 [source,java]
+
+----
+
+    sphereGeo.setMaterial(sphereMat);
 ----
-    sphereGeo.setMaterial(sphereMat);----
+
 .  Let's move and rotate the geometry a bit to position it better. 
 [source,java]
+
 ----
+
     sphereGeo.setLocalTranslation(0,2,-2); // Move it a bit
     sphereGeo.rotate(1.6f, 0, 0);          // Rotate it a bit
-    rootNode.attachChild(sphereGeo);----
+    rootNode.attachChild(sphereGeo);
+----
+
 
 Remember that any Lighting.j3md-based material requires a light source, as shown in the full code sample above.
 
@@ -306,7 +354,9 @@ You create a j3m file as follows:
 
 .  Create a plain text file `assets/Materials/MyCustomMaterial.j3m` in your project directory, with the following content:
 [source]
-----Material My shiny custom material : Common/MatDefs/Light/Lighting.j3md {
+
+----
+Material My shiny custom material : Common/MatDefs/Light/Lighting.j3md {
      MaterialParameters {
         DiffuseMap : Textures/Terrain/Pond/Pond.jpg
         NormalMap : Textures/Terrain/Pond/Pond_normal.png
@@ -316,7 +366,9 @@ You create a j3m file as follows:
         Shininess : 64.0
      }
 }
+
 ----
+
 **  Note that `Material` is a fixed keyword.
 **  Note that `My shiny custom material` is a String that you can choose to describe the material.
 **  Note how the code sets all the same properties as before! 
@@ -324,9 +376,13 @@ You create a j3m file as follows:
 .  In the code sample, comment out the eight lines that have `sphereMat` in them.
 .  Below this line, add the following line: 
 [source,java]
-----sphereGeo.setMaterial((Material) assetManager.loadMaterial( 
+
+----
+sphereGeo.setMaterial((Material) assetManager.loadMaterial( 
     "Materials/MyCustomMaterial.j3m"));
+
 ----
+
 .  Run the app. The result is the same.
 
 Using this new custom material `MyCustomMaterial.j3m` only takes one line. You have replaced the eight lines of an on-the-fly material definition with one line that loads a custom material from a file. Using .j3m files is very handy if you use the same material often. 

+ 103 - 23
src/docs/asciidoc/jme3/beginner/hello_node.adoc

@@ -26,7 +26,9 @@ You will learn that the scene graph represents the 3D world, and why the rootNod
 == Code Sample
 
 [source,java]
-----package jme3test.helloworld;
+
+----
+package jme3test.helloworld;
 
 import com.jme3.app.SimpleApplication;
 import com.jme3.material.Material;
@@ -77,7 +79,9 @@ public class HelloNode extends SimpleApplication {
         /** Rotate the pivot node: Note that both boxes have rotated! */
         pivot.rotate(.4f,.4f,0f);
     }
-}----
+}
+----
+
 Build and run the code sample. You should see two colored boxes tilted at the same angle.
 
 
@@ -149,13 +153,17 @@ What happens in the code snippet? You use the `simpleInitApp()` method that was
 **  Create a blue material. 
 **  Apply the blue material to the Box Geometry. 
 [source,java]
+
 ----
+
     Box box1 = new Box(1,1,1);
     Geometry blue = new Geometry("Box", box1);
     blue.setLocalTranslation(new Vector3f(1,-1,1));
     Material mat1 = new Material(assetManager,"Common/MatDefs/Misc/Unshaded.j3md");
     mat1.setColor("Color", ColorRGBA.Blue);
-    blue.setMaterial(mat1);----
+    blue.setMaterial(mat1);
+----
+
 
 .  You create a second box Geometry.
 **  Create a second Box shape with the same size.
@@ -164,14 +172,18 @@ What happens in the code snippet? You use the `simpleInitApp()` method that was
 **  Create a red material. 
 **  Apply the red material to the Box Geometry. 
 [source,java]
+
 ----
+
     Box box2 = new Box(1,1,1);
     Geometry red = new Geometry("Box", box2);
     red.setLocalTranslation(new Vector3f(1,3,1));
     Material mat2 = new Material(assetManager,
       "Common/MatDefs/Misc/Unshaded.j3md");
     mat2.setColor("Color", ColorRGBA.Red);
-    red.setMaterial(mat2);----
+    red.setMaterial(mat2);
+----
+
 
 .  You create a pivot Node. 
 **  Name the Node “pivot.
@@ -179,24 +191,36 @@ What happens in the code snippet? You use the `simpleInitApp()` method that was
 **  Attach the Node to the rootNode.
 **  The Node has no visible appearance in the scene. 
 [source,java]
+
 ----
+
     Node pivot = new Node("pivot");
-    rootNode.attachChild(pivot);----
+    rootNode.attachChild(pivot);
+----
+
 If you run the application with only the code up to here, the scene appears empty. This is because a Node is invisible, and you have not yet attached any visible Geometries to the rootNode. 
 
 
 
 .  Attach the two boxes to the pivot node. 
 [source,java]
+
 ----
+
         pivot.attachChild(blue);
-        pivot.attachChild(red);----
+        pivot.attachChild(red);
+----
+
 If you run the app with only the code up to here, you see two cubes: A red cube straight above a blue cube.
 
 
 .  Rotate the pivot node.
 [source,java]
-----        pivot.rotate( 0.4f , 0.4f , 0.0f );----
+
+----
+        pivot.rotate( 0.4f , 0.4f , 0.0f );
+----
+
  If you run the app now, you see two boxes on top of each other – both tilted at the same angle.
 
 
@@ -223,32 +247,60 @@ a| Solution!
 a| Create a Spatial 
 a| Create a Mesh shape, wrap it into a Geometry, and give it a Material. For example: 
 [source,java]
-----Box mesh = new Box(Vector3f.ZERO, 1, 1, 1); // a cuboid default mesh
+
+----
+Box mesh = new Box(Vector3f.ZERO, 1, 1, 1); // a cuboid default mesh
 Geometry thing = new Geometry("thing", mesh); 
 Material mat = new Material(assetManager,
    "Common/MatDefs/Misc/ShowNormals.j3md");
-thing.setMaterial(mat);----
+thing.setMaterial(mat);
+----
+
 
 a| Make an object appear in the scene 
 a| Attach the Spatial to the `rootNode`, or to any node that is attached to the rootNode. 
 [source,java]
-----rootNode.attachChild(thing);----
+
+----
+rootNode.attachChild(thing);
+----
+
 
 a| Remove objects from the scene 
 a| Detach the Spatial from the `rootNode`, and from any node that is attached to the rootNode. 
 [source,java]
-----rootNode.detachChild(thing);----
+
+----
+rootNode.detachChild(thing);
+----
+
 [source,java]
-----rootNode.detachAllChildren();----
+
+----
+rootNode.detachAllChildren();
+----
+
 
 a| Find a Spatial in the scene by the object's name, or ID, or by its position in the parent-child hierarchy. 
 a| Look at the node's children or parent: 
 [source,java]
-----Spatial thing = rootNode.getChild("thing");----
+
+----
+Spatial thing = rootNode.getChild("thing");
+----
+
 [source,java]
-----Spatial twentyThird = rootNode.getChild(22);----
+
+----
+Spatial twentyThird = rootNode.getChild(22);
+----
+
 [source,java]
-----Spatial parent = myNode.getParent();----
+
+----
+Spatial parent = myNode.getParent();
+----
+
 
 a| Specify what should be loaded at the start 
 a| Everything you initialize and attach to the `rootNode` in the `simpleInitApp()` method is part of the scene at the start of the game. 
@@ -271,12 +323,20 @@ a| Z-axis
 a| Specify the new location in three dimensions: How far away is it from the origin going right-up-forward? +
 To move a Spatial _to_ specific coordinates, such as (0,40.2f,-2), use: 
 [source,java]
-----thing.setLocalTranslation( new Vector3f( 0.0f, 40.2f, -2.0f ) );----
+
+----
+thing.setLocalTranslation( new Vector3f( 0.0f, 40.2f, -2.0f ) );
+----
+
  To move a Spatial _by_ a certain amount, e.g. higher up (y=40.2f) and further back (z=-2.0f): 
 
 
 [source,java]
-----thing.move( 0.0f, 40.2f, -2.0f );----
+
+----
+thing.move( 0.0f, 40.2f, -2.0f );
+----
+
 a|+right -left
 a|+up -down
 a|+forward -backward
@@ -295,7 +355,11 @@ A value between 0.0f and 1.0f shrinks the Spatial; bigger than 1.0f stretches it
 Using the same value for each dimension scales proportionally, different values stretch it. +
 To scale a Spatial 10 times longer, one tenth the height, and keep the same width: 
 [source,java]
-----thing.scale( 10.0f, 0.1f, 1.0f );----
+
+----
+thing.scale( 10.0f, 0.1f, 1.0f );
+----
+
 a|length
 a|height
 a|width
@@ -312,13 +376,21 @@ a| Z-axis
 a|3-D rotation is a bit tricky (<<jme3/rotate#,learn details here>>). In short: You can rotate around three axes: Pitch, yaw, and roll. You can specify angles in degrees by multiplying the degrees value with `FastMath.DEG_TO_RAD`. +
 To roll an object 180° around the z axis: 
 [source,java]
-----thing.rotate( 0f , 0f , 180*FastMath.DEG_TO_RAD );----
+
+----
+thing.rotate( 0f , 0f , 180*FastMath.DEG_TO_RAD );
+----
+
  Tip: If your game idea calls for a serious amount of rotations, it is worth looking into <<jme3/quaternion#,quaternion>>s, a data structure that can combine and store rotations efficiently. 
 
 
 [source,java]
-----thing.setLocalRotation( 
-  new Quaternion().fromAngleAxis(180*FastMath.DEG_TO_RAD, new Vector3f(1,0,0)));----
+
+----
+thing.setLocalRotation( 
+  new Quaternion().fromAngleAxis(180*FastMath.DEG_TO_RAD, new Vector3f(1,0,0)));
+----
+
 a|pitch = nodding your head
 a|yaw = shaking your head
 a|roll = cocking your head
@@ -368,12 +440,20 @@ For example, to add a custom id number to a node, you would use:
 
 
 [source,java]
-----pivot.setUserData( "pivot id", 42 );----
+
+----
+pivot.setUserData( "pivot id", 42 );
+----
+
 To read this Node's id number elsewhere, you would use:
 
 
 [source,java]
-----int id = pivot.getUserData( "pivot id" ); ----
+
+----
+int id = pivot.getUserData( "pivot id" ); 
+----
+
 By using different Strings keys (here the key is `pivot id`), you can get and set several values for whatever data the Spatial needs to carry. When you start writing your game, you might add a fuel value to a car node, speed value to an airplane node, or number of gold coins to a player node, and much more. However, one should note that only custom objects that implements Savable can be passed.
 
 

+ 96 - 20
src/docs/asciidoc/jme3/beginner/hello_node_pl.adoc

@@ -16,7 +16,9 @@ W tym tutorialu rzucimy okiem na prostą scenę trójwymiarową.  3D world is re
 == Kod źródłowy
 
 [source,java]
+
 ----
+
 package jme3test.helloworld;
 import com.jme3.app.SimpleApplication;
 import com.jme3.material.Material;
@@ -56,7 +58,9 @@ public class HelloNode extends SimpleApplication {
         // rotate pivot node: Both boxes have rotated!
         pivot.rotate( 0.4f , 0.4f , 0.0f );
     }
-}----
+}
+----
+
 Build and run the code sample. You should see two colored boxes tilted at the same angle.
 
 
@@ -86,33 +90,45 @@ So what exactly happens in this code snippet? Note that we are using the `simple
 **  We place the box at (1,-1,1)
 **  We give it a solid blue material. 
 [source,java]
+
 ----
+
         Box box1 = new Box( new Vector3f(1,-1,1), 1,1,1);
         Geometry blue = new Geometry("Box", box1);
         Material mat1 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
         mat1.setColor("Color", ColorRGBA.Blue);
-        blue.setMaterial(mat1);----
+        blue.setMaterial(mat1);
+----
+
 
 .  We create a second box Geometry.
 **  This box Geometry is also 2x2x2 world units big.
 **  We place the second box at (1,3,1). This is straight above the blue box, with a gap of 2 world units inbetween.
 **  We give it a solid red material
 [source,java]
+
 ----
+
         Box box2 = new Box( new Vector3f(1,3,1), 1,1,1);
         Geometry red = new Geometry("Box", box2);
         Material mat2 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
         mat2.setColor("Color", ColorRGBA.Red);
-        red.setMaterial(mat2);----
+        red.setMaterial(mat2);
+----
+
 
 .  We create a Node.
 **  By default the Node is placed at (0,0,0).
 **  We attach the Node to the rootNode.
 **  An attached Node has no visible appearance in the scene. 
 [source,java]
+
 ----
+
         Node pivot = new Node("pivot");
-        rootNode.attachChild(pivot);----
+        rootNode.attachChild(pivot);
+----
+
 
 .  Note that we have not attached the two boxes to anything yet!
 **  _If we ran the application now, the scenegraph would appear empty._
@@ -120,15 +136,23 @@ So what exactly happens in this code snippet? Note that we are using the `simple
 .  We attach the two boxes to the node.
 **  _If we ran the app now, we would see two boxes: one straight above the other._ 
 [source,java]
+
 ----
+
         pivot.attachChild(blue);
-        pivot.attachChild(red); ----
+        pivot.attachChild(red); 
+----
+
 
 .  Now, we rotate the node.
 **  _When we run the application now, we see two boxes on top of each other – but both are tilted at the same angle._ 
 [source,java]
+
+----
+
+        pivot.rotate( 0.4f , 0.4f , 0.0f );
 ----
-        pivot.rotate( 0.4f , 0.4f , 0.0f );----
+
 
 
 What has happened? We have attached two box Geometries to a Node. Then we used the Node as a handle to grab the two boxes and transform (rotate) both, in one step. This is a common task and you will use this method a lot in your games when you move game characters around.
@@ -171,29 +195,53 @@ a| Solution!
 a| Create a Spatial 
 a| Create a shape and give it a Material. For instance a box shape: 
 [source,java]
-----Box mesh = new Box(Vector3f.ZERO, 1, 1, 1);
+
+----
+Box mesh = new Box(Vector3f.ZERO, 1, 1, 1);
 Geometry thing = new Geometry("thing", mesh);
 Material mat = new Material(assetManager, "Common/MatDefs/Misc/ShowNormals.j3md");
-thing.setMaterial(mat);----
+thing.setMaterial(mat);
+----
+
 
 a| Make an object appear in the scene 
 a| Attach the Spatial to the `rootNode`, or to any node that is attached to the rootNode. 
 [source,java]
-----rootNode.attachChild(thing);----
+
+----
+rootNode.attachChild(thing);
+----
+
 
 a| Remove objects from the scene 
 a| Detach the Spatial from the `rootNode`, and from any node that is attached to the rootNode. 
 [source,java]
-----rootNode.detachChild(thing);----
+
+----
+rootNode.detachChild(thing);
+----
+
 [source,java]
-----rootNode.detachAllChildren();----
+
+----
+rootNode.detachAllChildren();
+----
+
 
 a| Find a Spatial in the scene by the object's name or ID 
 a| Look at the node's children. 
 [source,java]
-----Spatial thing = rootNode.getChild("thing");----
+
+----
+Spatial thing = rootNode.getChild("thing");
+----
+
 [source,java]
-----Spatial twentyThird = rootNode.getChild(22);----
+
+----
+Spatial twentyThird = rootNode.getChild(22);
+----
+
 
 a| Specify what should be loaded at the start 
 a| Everything you initialize and attach to the `rootNode` in the `simpleInitApp()` method is part of the scene at the start of the game. 
@@ -218,13 +266,21 @@ a| Position and move objects
 a| *Translation:* Specify the new location in three dimensions: right/left, up/down, forward/backward. +
 Example 1. To move an object _to_ specific coordinates, such as (0,40.2f,-2), use: 
 [source,java]
-----thing.setLocalTranslation( new Vector3f( 0.0f, 40.2f, -2.0f ) );----
+
+----
+thing.setLocalTranslation( new Vector3f( 0.0f, 40.2f, -2.0f ) );
+----
+
  +
 Example 2: To move an object _by_ a certain amount, e.g. higher up (y=40.2f) and further back (z=-2.0f): 
 
 
 [source,java]
-----thing.move( 0.0f, 40.2f, -2.0f );----
+
+----
+thing.move( 0.0f, 40.2f, -2.0f );
+----
+
 a|right/left
 a|up/down
 a|forward/ backward
@@ -233,9 +289,17 @@ a| Resize objects
 a| *Scaling:* To resize a Spatial, specify the scale factor in each dimension: length, height, width. A value between 0.0f and 1.0f will shrink the object; a value bigger than 1.0f will make it grow; and 1.0f will keep this dimension the same. Using the same value for each dimension scales an object proportionally, using different values stretches it. +
 Example: Make it 10 times longer, one tenth of the height, same width: 
 [source,java]
-----thing.setLocalScale( 10.0f, 0.1f, 1.0f  );----
+
+----
+thing.setLocalScale( 10.0f, 0.1f, 1.0f  );
+----
+
 [source,java]
-----thing.scale( 10.0f, 0.1f, 1.0f );----
+
+----
+thing.scale( 10.0f, 0.1f, 1.0f );
+----
+
 a|length
 a|height
 a|width
@@ -245,18 +309,30 @@ a| *Rotation:* 3-D rotation is a bit tricky (<<jme2/rotate#,learn details here>>
 Important: *You do not specify the rotation in degrees from 0° to 360°, but in radians from 0.0f to 6.28f (FastMath.PI*2) !* +
 Example: To roll an object 180° around the z axis: 
 [source,java]
-----thing.rotate( 0f , 0f , FastMath.PI );----
+
+----
+thing.rotate( 0f , 0f , FastMath.PI );
+----
+
  If you do want to specify angles in degrees then multiply your degrees value with FastMath.DEG_TO_RAD +
 Example: 
 
 
 [source,java]
-----thing.rotate( 0f , 0f , 180*FastMath.DEG_TO_RAD );----
+
+----
+thing.rotate( 0f , 0f , 180*FastMath.DEG_TO_RAD );
+----
+
   Tip: If your game idea calls for a serious amount of rotations, it is worth looking into <<jme2/quaternion#,quaternion>>s, a data structure that can combine and store rotations efficiently. 
 
 
 [source,java]
-----thing.setLocalRotation( new Quaternion(). fromAngleAxis(FastMath.PI/2, new Vector3f(1,0,0)));----
+
+----
+thing.setLocalRotation( new Quaternion(). fromAngleAxis(FastMath.PI/2, new Vector3f(1,0,0)));
+----
+
 a|pitch
 a|yaw
 a|roll

+ 103 - 23
src/docs/asciidoc/jme3/beginner/hello_node_pt.adoc

@@ -26,7 +26,9 @@ Você aprendera que o grafo de cena representa o mundo 3D, e porque o nó raiz (
 == Amostra de código
 
 [source,java]
-----package jme3test.helloworld;
+
+----
+package jme3test.helloworld;
 
 import com.jme3.app.SimpleApplication;
 import com.jme3.material.Material;
@@ -78,7 +80,9 @@ public class HelloNode extends SimpleApplication {
         /** Rotaciona o nó pivô: Veja que ambas as caixas rotacionaram! */
         pivot.rotate(.4f,.4f,0f);
     }
-}----
+}
+----
+
 Construa e execute a amostra de código. Você deveria ver duas caixas coloridas inclinadas no mesmo ângulo.
 
 
@@ -150,14 +154,18 @@ O que acontece no trecho de código? Você usa o método `simpleInitApp()` que f
 **  Crie um material azul
 **  Aplique o material azul para a geometria da caixa (Box Geometry). 
 [source,java]
+
 ----
+
     Box box1 = new Box( Vector3f.ZERO, 1,1,1);
     Geometry blue = new Geometry("Box", box1);
     Material mat1 = new Material(assetManager,
       "Common/MatDefs/Misc/Unshaded.j3md");
     mat1.setColor("Color", ColorRGBA.Blue);
     blue.setMaterial(mat1);
-    blue.move(1,-1,1);----
+    blue.move(1,-1,1);
+----
+
 
 .  Você cria uma segunda geometria (Geometry) de caixa.
 **  Crie uma segunda forma caixa (Box) com o mesmo tamanho.
@@ -166,14 +174,18 @@ O que acontece no trecho de código? Você usa o método `simpleInitApp()` que f
 **  Crie um material vermelho
 **  Aplique o material vermelho para a geometria caixa (Box Geometry). 
 [source,java]
+
 ----
+
     Box box2 = new Box( Vector3f.ZERO, 1,1,1);
     Geometry red = new Geometry("Box", box2);
     Material mat2 = new Material(assetManager,
       "Common/MatDefs/Misc/Unshaded.j3md");
     mat2.setColor("Color", ColorRGBA.Red);
     red.setMaterial(mat2);
-    red.move(1,3,1);----
+    red.move(1,3,1);
+----
+
 
 .  Você cria um nó (Node) pivô. 
 **  Nomeie o nó “pivot.
@@ -181,24 +193,36 @@ O que acontece no trecho de código? Você usa o método `simpleInitApp()` que f
 **  Anexe o nó (Node) ao nó raiz (rootNode).
 **  O nó (Node) não tem aparência visível na cena. 
 [source,java]
+
 ----
+
     Node pivot = new Node("pivot");
-    rootNode.attachChild(pivot);----
+    rootNode.attachChild(pivot);
+----
+
 Se você executar a aplicação somente com o código dado até aqui, a cena parece vazia. Isto é porque o nó (Node) está invisível, e você não tem ainda anexado quaisquer geometrias (Geometries) visíveis para o nó raiz (rootNode).. 
 
 
 
 .  Anexe as duas caixas para o nó pivô 
 [source,java]
+
 ----
+
         pivot.attachChild(blue);
-        pivot.attachChild(red);----
+        pivot.attachChild(red);
+----
+
 Se você executar o aplicativo com somente o código dado até aqui, você vê dois cubos: Um vermelho imediatamente acima de um azul.
 
 
 .  Rotacione o nó pivô.
 [source,java]
-----        pivot.rotate( 0.4f , 0.4f , 0.0f );----
+
+----
+        pivot.rotate( 0.4f , 0.4f , 0.0f );
+----
+
  Se você executar o aplicativo agora, você verá duas caixas uma no topo da outra - ambas inclinadas no mesmo ângulo.
 
 
@@ -228,32 +252,60 @@ a| Solução!
 a| Crie um espacial (Spatial) 
 a| Crie uma forma malha (Mesh), envolva ela em uma geometria (Geometry), e dê a ela um Material. Por exemplo: 
 [source,java]
-----Box mesh = new Box(Vector3f.ZERO, 1, 1, 1); // a cuboid default mesh
+
+----
+Box mesh = new Box(Vector3f.ZERO, 1, 1, 1); // a cuboid default mesh
 Geometry thing = new Geometry("thing", mesh); 
 Material mat = new Material(assetManager,
    "Common/MatDefs/Misc/ShowNormals.j3md");
-thing.setMaterial(mat);----
+thing.setMaterial(mat);
+----
+
 
 a| Faça um objeto aparecer na cena 
 a| Anexe o espacial (Spatial) para o `nó raiz (rootNode)`, ou para qualquer no que esteja anexado para o nó raiz (rootNode). 
 [source,java]
-----rootNode.attachChild(thing);----
+
+----
+rootNode.attachChild(thing);
+----
+
 
 a| Remova objetos da cena 
 a| Retire o nó espacial (Spatial) do `nó raiz (rootNode)`, e de qualquer nó que esteja vinculado ao nó raiz (rootNode). 
 [source,java]
-----rootNode.detachChild(thing);----
+
+----
+rootNode.detachChild(thing);
+----
+
 [source,java]
-----rootNode.detachAllChildren();----
+
+----
+rootNode.detachAllChildren();
+----
+
 
 a| Ache um nó espacial na cena pelo nome do objeto, ou ID, ou por sua posição na hierarquia pai-criança. 
 a| Olhe na criança ou pai do nó:  
 [source,java]
-----Spatial thing = rootNode.getChild("thing");----
+
+----
+Spatial thing = rootNode.getChild("thing");
+----
+
 [source,java]
-----Spatial twentyThird = rootNode.getChild(22);----
+
+----
+Spatial twentyThird = rootNode.getChild(22);
+----
+
 [source,java]
-----Spatial parent = myNode.getParent();----
+
+----
+Spatial parent = myNode.getParent();
+----
+
 
 a| Especifique o que deveria ser carregado no início 
 a| Tudo que você inicializa e anexa ao `nó raiz (rootNode)` no método `simpleInitApp()` é parte da cena no início do jogo. 
@@ -284,12 +336,20 @@ Para mover um espacial (Spatial) para coordenadas específicas, tais como (0,40.
 
 
 [source,java]
-----thing.setLocalTranslation( new Vector3f( 0.0f, 40.2f, -2.0f ) );----
+
+----
+thing.setLocalTranslation( new Vector3f( 0.0f, 40.2f, -2.0f ) );
+----
+
  Para mover um espacial (Spatial) por uma certa quantia, e.g. mais acima (y=40.2f) e mais atrás (z=-2.0f): 
 
 
 [source,java]
-----thing.move( 0.0f, 40.2f, -2.0f );----
+
+----
+thing.move( 0.0f, 40.2f, -2.0f );
+----
+
  |+right -left|+up -down|+forward -backward|
 
 [cols="4", options="header"]
@@ -305,7 +365,11 @@ a|Especifique o fator de escalonamento em cada dimensão: tamanho, altura, compr
  Usando o mesmo valor para cada dimensão escalona proporcionalmente, valor diferentes esticam ele. +
  Para escalonar um espacial (Spatial) 10 vezes mais longo, um décimo da altura, e manter o mesmo comprimento:  
 [source,java]
-----thing.scale( 10.0f, 0.1f, 1.0f );----
+
+----
+thing.scale( 10.0f, 0.1f, 1.0f );
+----
+
 a|length
 a|height
 a|width
@@ -322,13 +386,21 @@ a| eixo Z
 a|Rotação 3-D é um pouco complicado (<<jme3/rotate#,aprenda os detalhes aqui>>)). em breve: Você pode rotacionar ao redor de três eixos: Pitch (X), yaw (Y), e roll (Z). Você pode especificar ângulos em graus por multiplicar o valor de graus com `FastMath.DEG_TO_RAD`. +
  Para rolar um objeto 180° ao redor do z axis: : 
 [source,java]
-----thing.rotate( 0f , 0f , 180*FastMath.DEG_TO_RAD );----
+
+----
+thing.rotate( 0f , 0f , 180*FastMath.DEG_TO_RAD );
+----
+
  Tip: Dica: Se sua idéia de jogo pede uma quantidade séria de rotações, é merecedor dar uma olhada em <<jme3/quaternion#,quaternion>>s, uma estrutura de dado que pode combinar e armazenar rotações eficientemente. 
 
 
 [source,java]
-----thing.setLocalRotation( 
-  new Quaternion().fromAngleAxis(180*FastMath.DEG_TO_RAD, new Vector3f(1,0,0)));----
+
+----
+thing.setLocalRotation( 
+  new Quaternion().fromAngleAxis(180*FastMath.DEG_TO_RAD, new Vector3f(1,0,0)));
+----
+
 a|pitch = fazer um sinal de sim com sua cabeça
 a|yaw = agitar sua cabeça
 a|roll = inclinar sua cabeça
@@ -380,12 +452,20 @@ Por exemplo, para adicionar um número de id customizado para um nó, você usar
 
 
 [source,java]
-----pivot.setUserData( "pivot id", 42 );----
+
+----
+pivot.setUserData( "pivot id", 42 );
+----
+
 Para ler o id do nó (Node) em outro lugar, você usaria:
 
 
 [source,java]
-----int id = pivot.getUserData( "pivot id" ); ----
+
+----
+int id = pivot.getUserData( "pivot id" ); 
+----
+
 Por usar diferentes chaves de Strings (aqui a chave é o `id do pivô`), você pode recuperar e configurar vários valores para quaisquer dados que o espacial (Spatial) precisa carregar. Quando você iniciar a escrever seu jogo, você talvez adicione um valor de combustível para um nó carro, valor de velocidade para um nó avião, ou número de moedas douradas para um nó jogador, e muito mais. Entretanto, deve-se notar que somente objetos customizados que implementam Savable podem ser passados.
 
 

+ 103 - 23
src/docs/asciidoc/jme3/beginner/hello_node_zh.adoc

@@ -29,7 +29,9 @@
 == 例子
 
 [source,java]
-----package jme3test.helloworld;
+
+----
+package jme3test.helloworld;
 
 import com.jme3.app.SimpleApplication;
 import com.jme3.material.Material;
@@ -80,7 +82,9 @@ public class HelloNode extends SimpleApplication {
         /** 转 pivot:那两个立方体会跟他转*/
         pivot.rotate(.4f,.4f,0f);
     }
-}----
+}
+----
+
 开始 Hello Node 后,你会看到两个一样斜的立方体。
 
 
@@ -152,14 +156,18 @@ What happens in the code snippet? You use the `simpleInitApp()` method that was
 **  Create a blue material. 
 **  Apply the blue material to the Box Geometry. 
 [source,java]
+
 ----
+
     Box box1 = new Box( Vector3f.ZERO, 1,1,1);
     Geometry blue = new Geometry("Box", box1);
     Material mat1 = new Material(assetManager,
       "Common/MatDefs/Misc/Unshaded.j3md");
     mat1.setColor("Color", ColorRGBA.Blue);
     blue.setMaterial(mat1);
-    blue.move(1,-1,1);----
+    blue.move(1,-1,1);
+----
+
 
 .  You create a second box Geometry.
 **  Create a second Box shape with the same size.
@@ -168,14 +176,18 @@ What happens in the code snippet? You use the `simpleInitApp()` method that was
 **  Create a red material. 
 **  Apply the red material to the Box Geometry. 
 [source,java]
+
 ----
+
     Box box2 = new Box( Vector3f.ZERO, 1,1,1);
     Geometry red = new Geometry("Box", box2);
     Material mat2 = new Material(assetManager,
       "Common/MatDefs/Misc/Unshaded.j3md");
     mat2.setColor("Color", ColorRGBA.Red);
     red.setMaterial(mat2);
-    red.move(1,3,1);----
+    red.move(1,3,1);
+----
+
 
 .  You create a pivot Node. 
 **  Name the Node “pivot.
@@ -183,24 +195,36 @@ What happens in the code snippet? You use the `simpleInitApp()` method that was
 **  Attach the Node to the rootNode.
 **  The Node has no visible appearance in the scene. 
 [source,java]
+
 ----
+
     Node pivot = new Node("pivot");
-    rootNode.attachChild(pivot);----
+    rootNode.attachChild(pivot);
+----
+
 If you run the application with only the code up to here, the scene appears empty. This is because a Node is invisible, and you have not yet attached any visible Geometries to the rootNode. 
 
 
 
 .  Attach the two boxes to the pivot node. 
 [source,java]
+
 ----
+
         pivot.attachChild(blue);
-        pivot.attachChild(red);----
+        pivot.attachChild(red);
+----
+
 If you run the app with only the code up to here, you see two cubes: A red cube straight above a blue cube.
 
 
 .  Rotate the pivot node.
 [source,java]
-----        pivot.rotate( 0.4f , 0.4f , 0.0f );----
+
+----
+        pivot.rotate( 0.4f , 0.4f , 0.0f );
+----
+
  If you run the app now, you see two boxes on top of each other – both tilted at the same angle.
 
 
@@ -227,32 +251,60 @@ a| Solution!
 a| Create a Spatial 
 a| Create a Mesh shape, wrap it into a Geometry, and give it a Material. For example: 
 [source,java]
-----Box mesh = new Box(Vector3f.ZERO, 1, 1, 1); // a cuboid default mesh
+
+----
+Box mesh = new Box(Vector3f.ZERO, 1, 1, 1); // a cuboid default mesh
 Geometry thing = new Geometry("thing", mesh); 
 Material mat = new Material(assetManager,
    "Common/MatDefs/Misc/ShowNormals.j3md");
-thing.setMaterial(mat);----
+thing.setMaterial(mat);
+----
+
 
 a| Make an object appear in the scene 
 a| Attach the Spatial to the `rootNode`, or to any node that is attached to the rootNode. 
 [source,java]
-----rootNode.attachChild(thing);----
+
+----
+rootNode.attachChild(thing);
+----
+
 
 a| Remove objects from the scene 
 a| Detach the Spatial from the `rootNode`, and from any node that is attached to the rootNode. 
 [source,java]
-----rootNode.detachChild(thing);----
+
+----
+rootNode.detachChild(thing);
+----
+
 [source,java]
-----rootNode.detachAllChildren();----
+
+----
+rootNode.detachAllChildren();
+----
+
 
 a| Find a Spatial in the scene by the object's name, or ID, or by its position in the parent-child hierarchy. 
 a| Look at the node's children or parent: 
 [source,java]
-----Spatial thing = rootNode.getChild("thing");----
+
+----
+Spatial thing = rootNode.getChild("thing");
+----
+
 [source,java]
-----Spatial twentyThird = rootNode.getChild(22);----
+
+----
+Spatial twentyThird = rootNode.getChild(22);
+----
+
 [source,java]
-----Spatial parent = myNode.getParent();----
+
+----
+Spatial parent = myNode.getParent();
+----
+
 
 a| Specify what should be loaded at the start 
 a| Everything you initialize and attach to the `rootNode` in the `simpleInitApp()` method is part of the scene at the start of the game. 
@@ -275,12 +327,20 @@ a| Z-axis
 a| Specify the new location in three dimensions: How far away is it from the origin going right-up-forward? +
 To move a Spatial _to_ specific coordinates, such as (0,40.2f,-2), use: 
 [source,java]
-----thing.setLocalTranslation( new Vector3f( 0.0f, 40.2f, -2.0f ) );----
+
+----
+thing.setLocalTranslation( new Vector3f( 0.0f, 40.2f, -2.0f ) );
+----
+
  To move a Spatial _by_ a certain amount, e.g. higher up (y=40.2f) and further back (z=-2.0f): 
 
 
 [source,java]
-----thing.move( 0.0f, 40.2f, -2.0f );----
+
+----
+thing.move( 0.0f, 40.2f, -2.0f );
+----
+
 a|+right -left
 a|+up -down
 a|+forward -backward
@@ -299,7 +359,11 @@ A value between 0.0f and 1.0f shrinks the Spatial; bigger than 1.0f stretches it
 Using the same value for each dimension scales proportionally, different values stretch it. +
 To scale a Spatial 10 times longer, one tenth the height, and keep the same width: 
 [source,java]
-----thing.scale( 10.0f, 0.1f, 1.0f );----
+
+----
+thing.scale( 10.0f, 0.1f, 1.0f );
+----
+
 a|length
 a|height
 a|width
@@ -316,13 +380,21 @@ a| Z-axis
 a|3-D rotation is a bit tricky (<<jme3/rotate#,learn details here>>). In short: You can rotate around three axes: Pitch, yaw, and roll. You can specify angles in degrees by multiplying the degrees value with `FastMath.DEG_TO_RAD`. +
 To roll an object 180° around the z axis: 
 [source,java]
-----thing.rotate( 0f , 0f , 180*FastMath.DEG_TO_RAD );----
+
+----
+thing.rotate( 0f , 0f , 180*FastMath.DEG_TO_RAD );
+----
+
  Tip: If your game idea calls for a serious amount of rotations, it is worth looking into <<jme3/quaternion#,quaternion>>s, a data structure that can combine and store rotations efficiently. 
 
 
 [source,java]
-----thing.setLocalRotation( 
-  new Quaternion().fromAngleAxis(180*FastMath.DEG_TO_RAD, new Vector3f(1,0,0)));----
+
+----
+thing.setLocalRotation( 
+  new Quaternion().fromAngleAxis(180*FastMath.DEG_TO_RAD, new Vector3f(1,0,0)));
+----
+
 a|pitch = nodding your head
 a|yaw = shaking your head
 a|roll = cocking your head
@@ -372,12 +444,20 @@ For example, to add a custom id number to a node, you would use:
 
 
 [source,java]
-----pivot.setUserData( "pivot id", 42 );----
+
+----
+pivot.setUserData( "pivot id", 42 );
+----
+
 To read this Node's id number elsewhere, you would use:
 
 
 [source,java]
-----int id = pivot.getUserData( "pivot id" ); ----
+
+----
+int id = pivot.getUserData( "pivot id" ); 
+----
+
 By using different Strings keys (here the key is `pivot id`), you can get and set several values for whatever data the Spatial needs to carry. When you start writing your game, you might add a fuel value to a car node, speed value to an airplane node, or number of gold coins to a player node, and much more. 
 
 

+ 49 - 9
src/docs/asciidoc/jme3/beginner/hello_physics.adoc

@@ -37,7 +37,9 @@ Thanks to double1984 for contributing this fun sample!
 
 
 [source,java]
-----package jme3test.helloworld;
+
+----
+package jme3test.helloworld;
 
 import com.jme3.app.SimpleApplication;
 import com.jme3.asset.TextureKey;
@@ -230,7 +232,9 @@ public class HelloPhysics extends SimpleApplication {
     guiNode.attachChild(ch);
   }
 }
+
 ----
+
 You should see a brick wall. Click to shoot cannon balls. Watch the bricks fall and bounce off one another!
 
 
@@ -244,7 +248,9 @@ As always, start with a standard com.jme3.app.SimpleApplication. To activate phy
 
 
 [source,java]
+
 ----
+
 public class HelloPhysics extends SimpleApplication {
   private BulletAppState bulletAppState;
   
@@ -254,7 +260,9 @@ public class HelloPhysics extends SimpleApplication {
     ...
   }
   ...
-}----
+}
+----
+
 The BulletAppState gives the game access to a PhysicsSpace. The PhysicsSpace lets you use com.jme3.bullet.control.PhysicsControls that add physical properties to Nodes.
 
 
@@ -268,7 +276,9 @@ In this “shoot at the wall example, you use Geometries such as cannon balls an
 
 
 [source,java]
+
 ----
+
   /** Prepare geometries and physical nodes for bricks and cannon balls. */
   private static final Box    box;
   private static final Sphere sphere;
@@ -287,7 +297,9 @@ In this “shoot at the wall example, you use Geometries such as cannon balls an
     /** Initialize the floor geometry */
     floor = new Box(10f, 0.1f, 5f);
     floor.scaleTextureCoordinates(new Vector2f(3, 6));
-  }----
+  }
+----
+
 
 === RigidBodyControl: Brick
 
@@ -295,9 +307,13 @@ We want to create brick Geometries from those boxes. For each Geometry with phys
 
 
 [source,java]
+
 ----
+
   private RigidBodyControl brick_phy;
+
 ----
+
 The custom `makeBrick(loc)` methods creates individual bricks at the location `loc`. A brick has the following properties:
 
 
@@ -305,7 +321,9 @@ The custom `makeBrick(loc)` methods creates individual bricks at the location `l
 *  It has physical properties `brick_phy` (RigidBodyControl)
 
 [source,java]
+
 ----
+
   public void makeBrick(Vector3f loc) {
     /** Create a brick geometry and attach to scene graph. */
     Geometry brick_geo = new Geometry("brick", box);
@@ -318,7 +336,9 @@ The custom `makeBrick(loc)` methods creates individual bricks at the location `l
     /** Add physical brick to physics space. */
     brick_geo.addControl(brick_phy);
     bulletAppState.getPhysicsSpace().add(brick_phy);
-  }----
+  }
+----
+
 This code sample does the following:
 
 
@@ -344,7 +364,9 @@ You notice that the cannon ball is created in the same way, using the custom `ma
 *  It has physical properties `ball_phy` (RigidBodyControl)
 
 [source,java]
+
 ----
+
     /** Create a cannon ball geometry and attach to scene graph. */
     Geometry ball_geo = new Geometry("cannon ball", sphere);
     ball_geo.setMaterial(stone_mat);
@@ -358,7 +380,9 @@ You notice that the cannon ball is created in the same way, using the custom `ma
     bulletAppState.getPhysicsSpace().add(ball_phy);
     /** Accelerate the physcial ball to shoot it. */
     ball_phy.setLinearVelocity(cam.getDirection().mult(25));
-    ----
+    
+----
+
 This code sample does the following:
 
 
@@ -388,7 +412,9 @@ As before, you write a custom `initFloor()` method that creates a flat box with
 *  It has physical properties `floor_phy` (RigidBodyControl)
 
 [source,java]
+
 ----
+
   public void initFloor() {
     Geometry floor_geo = new Geometry("Floor", floor);
     floor_geo.setMaterial(floor_mat);
@@ -398,7 +424,9 @@ As before, you write a custom `initFloor()` method that creates a flat box with
     floor_phy = new RigidBodyControl(0.0f);
     floor_geo.addControl(floor_phy);
     bulletAppState.getPhysicsSpace().add(floor_phy);
-  }----
+  }
+----
+
 This code sample does the following:
 
 
@@ -435,24 +463,32 @@ In the `initInputs()` method, you add an input mapping that triggers a shoot act
 
 
 [source,java]
+
 ----
+
   private void initInputs() {
     inputManager.addMapping("shoot", 
             new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
     inputManager.addListener(actionListener, "shoot");
-  }----
+  }
+----
+
 You define the actual action of shooting a new cannon ball as follows:
 
 
 [source,java]
+
 ----
+
     private ActionListener actionListener = new ActionListener() {
         public void onAction(String name, boolean keyPressed, float tpf) {
             if (name.equals("shoot") && !keyPressed) {
                 makeCannonBall();
             }
         }
-    };----
+    };
+----
+
 In the moment the cannonball appears in the scene, it flies off with the velocity (and in the direction) that you specified using `setLinearVelocity()` inside `makeCannonBall()`. The newly created cannon ball flies off, hits the wall, and exerts a _physical force_ that impacts individual bricks.
 
 
@@ -482,7 +518,11 @@ Add the following line after the bulletAppState initialization.
 
 
 [source,java]
-----bulletAppState.getPhysicsSpace().enableDebug(assetManager);----
+
+----
+bulletAppState.getPhysicsSpace().enableDebug(assetManager);
+----
+
 Now you see the collisionShapes of the bricks and spheres, and the floor highlighted. 
 
 

+ 27 - 7
src/docs/asciidoc/jme3/beginner/hello_picking.adoc

@@ -24,7 +24,9 @@ image::beginner-picking.png[beginner-picking.png,with="",height="",align="center
 == Sample Code
 
 [source,java]
-----package jme3test.helloworld;
+
+----
+package jme3test.helloworld;
 
 import com.jme3.app.SimpleApplication;
 import com.jme3.collision.CollisionResult;
@@ -172,7 +174,9 @@ public class HelloPicking extends SimpleApplication {
     golem.addLight(sun);
     return golem;
   }
-}----
+}
+----
+
 You should see four colored cubes floating over a gray floor, and cross-hairs. Aim the cross-hairs and click, or press the spacebar to shoot. The hit spot is marked with a red dot.
 
 
@@ -225,7 +229,9 @@ First initialize some shootable nodes and attach them to the scene. You will use
 
 
 [source,java]
+
 ----
+
   Node shootables;
   Geometry mark;
   
@@ -242,7 +248,9 @@ First initialize some shootable nodes and attach them to the scene. You will use
     shootables.attachChild(makeCube("the Sheriff",  0f, 1f,-2f));
     shootables.attachChild(makeCube("the Deputy",   1f, 0f, -4));
     shootables.attachChild(makeFloor());
-  }----
+  }
+----
+
 
 === Setting Up the Input Listener
 
@@ -250,7 +258,9 @@ Next you declare the shooting action. It can be triggered either by clicking, or
 
 
 [source,java]
+
 ----
+
   /** Declaring the "Shoot" action and its triggers. */
   private void initKeys() {
     inputManager.addMapping("Shoot",      // Declare...
@@ -258,8 +268,10 @@ Next you declare the shooting action. It can be triggered either by clicking, or
       new MouseButtonTrigger(MouseInput.BUTTON_LEFT));         // trigger 2: left-button click
     inputManager.addListener(actionListener, "Shoot"); // ... and add.
   }
+
 ----
 
+
 === Picking Action Using Crosshairs
 
 Next we implement the ActionListener that responds to the Shoot trigger with an action. The action follows the ray casting algorithm described above:
@@ -275,7 +287,9 @@ Note how it prints a lot of output to show you which hits were registered.
 
 
 [source,java]
-----  /** Defining the "Shoot" action: Determine what was hit and how to respond. */
+
+----
+  /** Defining the "Shoot" action: Determine what was hit and how to respond. */
   private ActionListener actionListener = new ActionListener() {
     @Override
     public void onAction(String name, boolean keyPressed, float tpf) {
@@ -309,7 +323,9 @@ Note how it prints a lot of output to show you which hits were registered.
         }
       }
     }
-  };----
+  };
+----
+
 *Tip:* Notice how you use the provided method `results.getClosestCollision().getContactPoint()` to determine the _closest_ hit's location. If your game includes a “weapon or “spell that can hit multiple targets, you could also loop over the list of results, and interact with each of them.
 
 
@@ -326,7 +342,9 @@ The above example assumes that the player is aiming crosshairs (attached to the
 .  Collect intersections between ray and all nodes into a results list.
 
 [source,java]
-----...
+
+----
+...
 CollisionResults results = new CollisionResults();
 Vector2f click2d = inputManager.getCursorPosition();
 Vector3f click3d = cam.getWorldCoordinates(
@@ -335,7 +353,9 @@ Vector3f dir = cam.getWorldCoordinates(
     new Vector2f(click2d.x, click2d.y), 1f).subtractLocal(click3d).normalizeLocal();
 Ray ray = new Ray(click3d, dir);
 shootables.collideWith(ray, results);
-...----
+...
+----
+
 Use this together with `inputManager.setCursorVisible(true)` to make certain the cursor is visible. 
 
 

Неке датотеке нису приказане због велике количине промена