diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/asset_manager.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/asset_manager.html index e582301d3..66b80977e 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/asset_manager.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/asset_manager.html @@ -126,7 +126,7 @@ Loading a model: Loading a scene from an Ogre3D dotScene file stored inside a zip:

-
assetManager.registerLocator("town.zip", ZipLocator.class.getName());
+
assetManager.registerLocator("town.zip", ZipLocator.class);
 Spatial scene = assetManager.loadModel("main.scene");
 rootNode.attachChild(scene);
@@ -134,7 +134,7 @@ rootNode.attachChild(scene);
Alternatively to ZipLocator, there is also a HttpZipLocator that can stream models from a zip file online:

assetManager.registerLocator("http://jmonkeyengine.googlecode.com/files/wildhouse.zip", 
-                             HttpZipLocator.class.getName());
+                             HttpZipLocator.class);
 Spatial scene = assetManager.loadModel("main.scene");
 rootNode.attachChild(scene);
@@ -175,7 +175,7 @@ rootNode.attachChild(scene); - +

NullPointerException: Cannot locate resource?

diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/bullet_multithreading.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/bullet_multithreading.html index 816718000..f8430e99d 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/bullet_multithreading.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/bullet_multithreading.html @@ -8,8 +8,8 @@

-Since bullet is not (yet) multithreaded or GPU accelerated the jME3 implementation allows to run each physics space on a separate thread that is executed in parallel to rendering. +Since bullet is not (yet) multithreaded or GPU accelerated, the jME3 implementation allows to run each physics space on a separate thread that is executed in parallel to rendering.

@@ -18,24 +18,41 @@ Since bullet is not (yet) multithreaded or GPU accelerated the jME3 implementati

+ A SimpleApplication with a BulletAppState allows setting the threading type via

setThreadingType(ThreadingType type);

- where ThreadingType can be either SEQUENTIAL or PARALLEL. + where ThreadingType can be either SEQUENTIAL or PARALLEL. By default, it's SEQUENTIAL.

-In the simpleInitApp() method: - +You can activate PARALLEL threading in the simpleInitApp() method:

bulletAppState = new BulletAppState();
 bulletAppState.setThreadingType(BulletAppState.ThreadingType.PARALLEL);
 stateManager.attach(bulletAppState);

-The physics update happens in parallel to rendering, after the users changes have been made in the update() call. This way the loop logic is still maintained: the user can set and change values in physics and scenegraph objects before render() and physicsUpdate() are called in parallel. More physics spaces can simply be added by using multiple bulletAppStates. +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. +

+
+ + + + + + + + + +
PARALLELSEQUENTIAL
1. update(), 2. render() and physics update().1. update(), 2. render(), 3. physics update().
Physics Debug View is rendered inaccurately (out of sync)Physics Debug View is rendered accurately.
+ +

+ +

You can add more physics spaces by using multiple PARALLEL bulletAppStates. You would do that if you have sets physical objects that never collide (for example, underground bolders and flying cannon balls above ground), so you put those into separate physics spaces, which improves performances (less collisions to check!). +

documentation, diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/custom_controls.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/custom_controls.html index b5cca9015..869d7e9ac 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/custom_controls.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/custom_controls.html @@ -62,6 +62,8 @@ Use C
  • A Control only has access to and control over the Spatial it is attached to.
  • +
  • Controls can be saved as .j3o file together with a Spatial.
    +
  • @@ -218,7 +220,7 @@ See also:

    -

    If you want to create a Control that also extends another existing class (rare, but possible), then create a custom extension of the Control Interface. You custom Control implements your custom interface. +

    In the less common case that you want to create a Control that also extends another class, create a custom interface that extends jME3's Control interface. Your class can become a Control by implement the Control interface, and at the same time extend another class.

    diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/hud.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/hud.html index e0679cfae..e8ec15a4d 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/hud.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/hud.html @@ -35,7 +35,7 @@ You have two options how to create HUDs. OptionProsCons - Attach elements to default guiNode:Easy to learn. jMonkeyEngine built-in API for attaching images and bitmap text.Only basic features.
    + Attach elements to default guiNode:Easy to learn. jMonkeyEngine built-in API for attaching plain images and bitmap text.Only basic features.
    You will have to write custom controls / buttons / effects if you need them. @@ -44,7 +44,12 @@ Includes buttons, effects, controls.
    Supports XML and Java layouts.Steeper learning curve.
    - + +

    + +Using the GUI Node is the default approach in jme3 to create simple HUDs. If you just quickly want to display a line of text, or a simple icon on the screen, use the no-frills GUI Node, it's easier. +

    +

    Simple HUD: GUI Node

    @@ -52,18 +57,14 @@ Supports XML and Java layo

    -Using the GUI Node is the default approach in jme3 to create simple HUDs. If you just quickly want to display a line of text, or a simple icon on the screen, use this no-frills method. -

    - -

    -Next to the rootNode for the 3-dimensional scene graph, jME3 also offers a 2-dimension (orthogonal) node, the guiNode. +You already know the rootNode that holds the 3-dimensional scene graph. jME3 also offers a 2-dimension (orthogonal) node, the guiNode.

    This is how you use the guiNode for HUDs:

    @@ -128,22 +130,12 @@ hudText = new BitmapText(myFont, false); -

    Displaying Geometries in the HUD

    -
    - -

    - -It is technically possible to attach Quads and 3D Geometries to the HUD. They show up as flat, static GUI elements. Note that if you use a lit Material, you must add a light to the guiNode. Also remember that size units are pixels in the HUD (a 2-wu cube is displayed tiny 2 pixels wide!). -

    - -
    -

    Positioning HUD Elements

    +

    Displaying Geometries in the HUD

    +
    + +

    + +It is technically possible to attach Quads and 3D Geometries to the HUD. They show up as flat, static GUI elements. The size unit for the guiNode is pixels, not world units. If you attach a Geometry that uses a lit Material, you must add a light to the guiNode. +

    + +

    +

    If you don't see an attached object in the GUI, check it's position and material (add a light to guiNode). Also verify whether it is not too tiny to be seen. For comparison: A 1 world-unit wide cube is only 1 pixel wide when attached to the guiNode! You may need to scale it bigger. +

    +

    + +
    +

    Keeping the HUD Up-To-Date

    diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/physics.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/physics.html index 5176682d1..b0db7082c 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/physics.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/physics.html @@ -357,18 +357,19 @@ The PhysicsSpace is an object in BulletAppState that is like a rootNode for Phys

    -

    You can register the PhysicsControl to the PhysicsSpace, or register the Geometry to the PhysicsSpace after you added the PhysicsControl to it. +

    You can either add the PhysicsControl to the PhysicsSpace, or add the PhysicsControl to the Geometry and then add the Geometry to the PhysicsSpace. jME3 understands both and the outcome is the same.

    @@ -434,7 +435,7 @@ This setting has an impact on performance, so use it sparingly. Brick: Rubber ball: 1.0f
    - +

    On a RigidBodyControl, you can apply the following physical forces: @@ -458,7 +459,7 @@ On a RigidBodyControl, you can apply the following physical forces: (See detailed explanation below.)

    - +

    Kinematic vs Dynamic vs Static

    @@ -510,7 +511,7 @@ setKinematic(true);setMass(1f);
    setKinematic(false); - +

    When Do I Use Kinematic Objects?

    @@ -571,7 +572,7 @@ Use the following methods to move dynamic physical objects. clearForces()Cancels out all forces (force, torque) etc and stops the motion. - +

    It is technically possible to position PhysicsControls using setLocalTranslation(), e.g. to place them in their start position in the scene. However you must be very careful not to cause an "impossible state" where one physical object overlaps with another! Within the game, you typically use the setters shown here exclusively. @@ -611,7 +612,13 @@ removeCollideWithGroup(COLLISION_GROUP_01)Collision Groups are integer setCcdSweptSphereRadius(.5f)Bullet does not use the full collision shape for continuous collision detection, insteadit uses a "swept sphere" shape to approximate a motion. Only relevant for fast moving dynamic bodies. (?)
    - + +

    + +

    You can setApplyPhysicsLocal(true) for an object to make it move relatively to its local physics space. You would do that if you need a physics space that moves with a node (e.g. a spaceship with artificial gravity surrounded by zero-g space). By default, it's set to false, and all movement is relative to the world. +

    +

    +

    Best Practices

    diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/spatial.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/spatial.html index 0dadea53d..7789f0b26 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/spatial.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/spatial.html @@ -8,7 +8,11 @@ This is an introduction to the concept of Spatials, the elements of the 3D scene

    -The rootNode is the central element of the scene graph. Even if the scenegraph is empty, it always has at least its rootNode. All other Spatials are attached to the rootNode in a parent-child relationship. If you think you need to understand the scene graph concept better, please read Scenegraph for dummies first. +The rootNode is the central element of the scene graph. Even if the scene graph is empty, it always contains at least the rootNode. We attach Spatials to the rootNode. Attached Spatials are always in a parent-child relationship. Every time you attach a Spatial to something, it is implicitly detached from its previous parent. A Spatial can have only one parent. A Spatial can have several children. +

    + +

    +If you think you need to understand the scene graph concept better, please read Scenegraph for dummies first.

    @@ -18,7 +22,7 @@ The rootNode is the central element of the scene graph. Even if the scenegraph i

    -In your Java code, a Spatial is either a com.jme3.scene.Node or a com.jme3.scene.Geometry. You use the two for different purposes: +In your Java code, a Spatial is either a com.jme3.scene.Node or a com.jme3.scene.Geometry. You use the two for different purposes:

    @@ -30,17 +34,18 @@ In your Java code, a Spatial is either a com.jme3.scene.Node or a com.jme3.scene com.jme3.scene.Spatial - Purpose: A Spatial is an abstract data structure that stores transformations (translation, rotation, scale) of elements of the scene graph. Spatials can be saved and loaded using the AssetManager. + Purpose: A Spatial is an abstract data structure that stores transformations (translation, rotation, scale) of elements of the 3D scene graph. Spatials can be saved and loaded using the Asset Manager. com.jme3.scene.Geometry com.jme3.scene.Node - Visibility: A Geometry represents a visible 3-D object in the scene graph. A Node is an invisible "handle" for a group of objects in the scene graph. + Visibility: A Geometry represents a visible 3D object in the scene graph. A Node is an invisible "handle" for a group of Spatials in the scene graph. - Purpose: Use Geometries to represent an object's looks: Every Geometry contains a polygon mesh and a material, specifying its shape, color, texture, and opacity/transparency.
    -You can attach a Geometry to a Node. Use Nodes to structure and group Geometries and other Nodes. Every Node is attached to one parent node, and each node can have zero or more children attached to itself. When you transform a parent node, all its children are transformed as well. + Purpose: Use Geometries to represent an object's looks: Every Geometry contains a polygon mesh and a material, specifying its shape, color, texture, and opacity/transparency.
    +You can attach a Geometry to a Node. Use Nodes to structure and group Geometries and other Nodes. Every Node is attached to one parent node, and each node can have zero or more children attached to itself.
    +When you transform (move, rotate, etc) a parent node, all its children are transformed (moved, rotated, etc). Content: Transformations; custom user data;
    @@ -48,13 +53,13 @@ mesh, material; Transformations; custom user data;
    no mesh, no material. - Examples: Box, sphere, player, building, terrain, vehicle, missiles, NPCs, etc… The rootNode, the guiNode, an audio node, a custom grouping node, etc… + Examples: Box, sphere, player, building, terrain, vehicle, missiles, NPCs, etc… rootNode, guiNode, audioNode, a custom vehicleNode or shipNode with passengers attached, etc. - +

    -

    You never create a Spatial with Spatial s = new Spatial();! A Spatial is an abstract concept, like a mammal (there is no actual creature called "mammal" walking around here). You create a Node, or load a Geometry object. Some methods however require a Spatial argument: This is because they are able to accept both Nodes and Geometries as arguments. In this case, you must cast a Node or Geometry to Spatial. +

    You never create a Spatial with Spatial s = new Spatial();! A Spatial is an abstract concept, like a mammal (there is no actual creature called "mammal" walking around here). You either create a Node or a Geometry object. Some methods however require a Spatial argument: This is because they are able to accept both Nodes and Geometries as arguments. In this case, you must cast a Node or Geometry to Spatial.

    @@ -84,51 +89,57 @@ The polygon Mesh i

    -You can include custom Java objects in Nodes and Geometries. This is useful for maintaining information about a game element, such as health, budget, ammunition, inventory, equipment, etc for players, or landmark locations for terrains, and much more. +You can include custom user data –that is, custom Java objects and methods– in Nodes and Geometries. This is very useful for maintaining information about a game element, such as health, budget, ammunition, inventory, equipment, etc for players, or landmark locations for terrains, and much more.

    -You do not need to create a custom class that extends Node or Geometry to be able to add custom fields to a spatial – use the setUserData() method instead. Neither do you need to create a custom class that extends Node to be able to add custom accessor methods to this spatial – use a Control instead. Where ever the spatial is accessible, you can also access the object's game data and accessors. +

    Neither do you need to ever extend Node to be able to add custom accessor methods to a spatial – use Custom Controls instead. There is no need to create a custom class that extends Node or Geometry to be able to add custom fields – use the provided setUserData() method instead. Where ever the Spatial is accessible, you can easily access the object's game data and accessors this way. +

    -For example when you initialize your custom PlayerControl class: +The following example adds an integer field named health to the Spatil player_node, and initializes it to 100.

    -
    // init custom data fields in this Control's Spatial (Node or Geometry)
    -spatial.setUserData("Health", 100); 
    +
    player_node.setUserData("health", 100);

    +To be able to add accessors to the player, you create a custom PlayerControl class and add it to the Spatial. -In your PlayerControl, you offer accessors that manipulate and get this custom data: +

    +
    player_node.addControl(PlayerControl.class);
    +

    +In PlayerControl you define methods that set and get your users data in the spatial object.

    public int getHealth() {
    -  return (Integer)spatial.getUserData("Health");
    +  return (Integer)spatial.getUserData("health");
     }
     public void setHealth(int h) {
    -  spatial.setUserData("Health",h);
    +  spatial.setUserData("health",h);
     }

    - -Elsewhere in your code, you can access this data wherever you have access to the spatial. - +Elsewhere in your code, you can access this data wherever you have access to the Spatial player_node.

    health = player_node.getControl(PlayerControl.class).getHealth();
     ...
     player_node.getControl(PlayerControl.class).setHealth(99);
    - -

    -You can add as many data objects (including Strings, Integers, Floats, Arrays,) to a Spatial as you need. Just make sure to label them with different Strings (health, inventory, equipment, etc). The saved data can also be custom Java objects if you make the Java class implement the Savable interface. When you save a Spatial as a j3o file, the custom data is saved too, and it will be restored the next time you load the j3o! -

    +

    -You can list all data keys that are already defined for one Spatial: +This is how you list all data keys that are already defined for one Spatial:

    for(String key : spatial.getUserDataKeys()){
    -      System.out.println(spatial.getName()+"'s keys: "+key);
    +    System.out.println(spatial.getName()+"'s keys: "+key);
     }
    diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/walking_character.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/walking_character.html index 4f9140c42..676329a44 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/walking_character.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/walking_character.html @@ -199,10 +199,10 @@ In a real game, you would load a scene model here instead of a test world. You c .. public void simpleInitApp() { ... - //assetManager.registerLocator("quake3level.zip", ZipLocator.class.getName()); + //assetManager.registerLocator("quake3level.zip", ZipLocator.class); assetManager.registerLocator( "http://jmonkeyengine.googlecode.com/files/quake3level.zip", - HttpZipLocator.class.getName()); + HttpZipLocator.class); MaterialList matList = (MaterialList) assetManager.loadAsset("Scene.material"); OgreMeshKey key = new OgreMeshKey("main.meshxml", matList); gameLevel = (Node) assetManager.loadAsset(key); diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_asset.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_asset.html index 6d67ed4fb..b01c2761d 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_asset.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_asset.html @@ -215,7 +215,7 @@ What if your game relies on user supplied model files, that are not included in

    Here is a usage example of a ZipLocator that is registered to a file town.zip in the top level of your project directory:

    -
        assetManager.registerLocator("town.zip", ZipLocator.class.getName());
    +
        assetManager.registerLocator("town.zip", ZipLocator.class);
         Spatial scene = assetManager.loadModel("main.scene");
         rootNode.attachChild(scene);
    @@ -224,7 +224,7 @@ Here is a HttpZipLocator that can download zipped models and load them:

        assetManager.registerLocator(
           "http://jmonkeyengine.googlecode.com/files/wildhouse.zip", 
    -      HttpZipLocator.class.getName());
    +      HttpZipLocator.class);
         Spatial scene = assetManager.loadModel("main.scene");
         rootNode.attachChild(scene);
    @@ -346,7 +346,7 @@ rootNode.attachChild(scene);
    - +

    Excercise - How to Load Assets

    @@ -378,7 +378,7 @@ Use the following method to load models from a zip file:
    1. Verify town.zip is in the project directory.
    2. -
    3. Register a zip file locator to the project directory: Add the following code under simpleInitApp() {
          assetManager.registerLocator("town.zip", ZipLocator.class.getName());
      +
    4. Register a zip file locator to the project directory: Add the following code under simpleInitApp() {
          assetManager.registerLocator("town.zip", ZipLocator.class);
           Spatial gameLevel = assetManager.loadModel("main.scene");
           gameLevel.setLocalTranslation(0, -5.2f, 0);
           gameLevel.setLocalScale(2);
      @@ -472,11 +472,7 @@ Let's add some action to the scene and continue with the  ()
      -
    5. -
    6. -
    7. -
    8. +
    9. diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_collision.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_collision.html index cd8acdc6b..97fbb4dc3 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_collision.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_collision.html @@ -88,7 +88,7 @@ public class HelloCollision extends SimpleApplication setUpLight();   // We load the scene from the zip file and adjust its size. - assetManager.registerLocator("town.zip", ZipLocator.class.getName()); + assetManager.registerLocator("town.zip", ZipLocator.class); sceneModel = assetManager.loadModel("main.scene"); sceneModel.setLocalScale(2f);   @@ -268,7 +268,7 @@ The first thing you do in every physics game is create a BulletAppState object.

      For the scene, you load the sceneModel from a zip file, and adjust the size.

      -
          assetManager.registerLocator("town.zip", ZipLocator.class.getName());
      +
          assetManager.registerLocator("town.zip", ZipLocator.class);
           sceneModel = assetManager.loadModel("main.scene");
           sceneModel.setLocalScale(2f);
      diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/external/blender.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/external/blender.html new file mode 100644 index 000000000..f68c8aab7 --- /dev/null +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/external/blender.html @@ -0,0 +1,91 @@ + +

      Creating jME3 models in Blender3D

      +
      + +

      +This section discusses how to create and import models from Blender3D (2.62+, see bottom of page for Blender 2.49 and before) to jME3. +

      + +
      + +

      Asset Management

      +
      + +

      +For the managing of assets in general, be sure to read the Asset Pipeline Documentation. It contains vital information on how to manage your asset files. +

      + +
      + +

      Creation Process

      +
      + +

      +To export an animated model in Blender make sure the following conditions are met: + +

      +
        +
      1. Apply Location, Rotation and Scate to the mesh on Blender: On 3D View editor on Blender, select the mesh in Object Mode and go to the 3D View Editor’s header → Object Menu → Apply → Location / Rotation / Location.
        +
      2. +
      3. Apply Location, Rotation and Scate to the armature on Blender: On 3D View editor on Blender, select the armature in Object Mode and go to the 3D View Editor’s header → Object Menu → Apply → Location / Rotation / Location.
        +
      4. +
      5. Set the mesh’s origin point in the bottom of the mesh (see the images bellow).
        +
      6. +
      7. Set the armature’s origin point in the bottom of the armature (see the images bellow).
        +
      8. +
      9. Armature’s origin point and mesh’s origin point must be in the same location(see the images bellow).
        +
      10. +
      11. Use a root bone located in the armature’s origin. This root bone must be in vertical position (see the images bellow) and it is the root bone of the armature. If you rotate the root bone, the the entire armature might be rotate when you import the model into jMonkey (I’m just mentioning the result, I don’t know where is the problem (jmonkey importer or blender’s ogre exporter plugin)).
        +
      12. +
      13. Uncheck “Bone Envelopes” checkbox on the Armature modifier for the mesh (see the images bellow).
        +
      14. +
      15. Uncheck “Envelopes” checkbox on the armature (see the images bellow).
        +
      16. +
      17. Use SkeletonDebugger to show the skeleton on your game in order to check if the mesh and the skeleton are loaded correctly:
        +
      18. +
      +
          final Material soldier2Mat = assetManager.loadMaterial("Materials/soldier2/soldier2.j3m");
      +    final Spatial soldier2 = assetManager.loadModel("Models/soldier2/soldier2.j3o");
      +    TangentBinormalGenerator.generate(soldier2);
      +    soldier2.setMaterial(soldier2Mat);
      + 
      +    final Node soldier2Node = new Node("Soldier2 Node");
      + 
      +    soldier2Node.attachChild(soldier2);
      +    rootNode.attachChild(soldier2Node);
      + 
      +    final AnimControl control = soldier2.getControl(AnimControl.class);
      +    control.addListener(this);
      +    final AnimChanel channel = control.createChannel();
      + 
      +    final SkeletonDebugger skeletonDebug = new SkeletonDebugger("skeleton", control.getSkeleton());
      +    final Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
      +    mat.setColor("Color", ColorRGBA.Green);
      +    mat.getAdditionalRenderState().setDepthTest(false);
      +    skeletonDebug.setMaterial(mat);
      +    soldier2Node.attachChild(skeletonDebug);
      + +

      + + + + + + +

      + +

      +Also check out these videos and resources: + +

      +
        +
      • ()
        +
      • +
      • +
      • +
      • +
      • +
      + +
      +

      view online version

      \ No newline at end of file diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/external/blender_apply_bones.png b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/external/blender_apply_bones.png new file mode 100644 index 000000000..617454726 Binary files /dev/null and b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/external/blender_apply_bones.png differ diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/external/blender_apply_mesh.png b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/external/blender_apply_mesh.png new file mode 100644 index 000000000..c063a8d1b Binary files /dev/null and b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/external/blender_apply_mesh.png differ diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/external/blender_envelopes.png b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/external/blender_envelopes.png new file mode 100644 index 000000000..eee1b7aaf Binary files /dev/null and b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/external/blender_envelopes.png differ diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/external/blender_finished.png b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/external/blender_finished.png new file mode 100644 index 000000000..006f4cb21 Binary files /dev/null and b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/external/blender_finished.png differ diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/external/blender_rootbone.png b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/external/blender_rootbone.png new file mode 100644 index 000000000..9bb251d2a Binary files /dev/null and b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/external/blender_rootbone.png differ diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/faq.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/faq.html index 343c9bbff..bb0403100 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/faq.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/faq.html @@ -146,7 +146,7 @@ If you are not using the default assets directory, verify that you

      this.assetManager.registerLocator("assets/", FileLocator.class); // default
       this.assetManager.registerLocator("c:/jme3User/JMEisSoCool/myAwesomeFolder/", FileLocator.class);
      -this.assetManager.registerLocator("town.zip", ZipLocator.class.getName());
      +this.assetManager.registerLocator("town.zip", ZipLocator.class);

      @@ -556,7 +556,10 @@ Use a PhysicsControl's hinges and joints.

      -At the bottom left of every default SimpleGame, you see the StatsView and the FPS (frames per seconds) view. It provides you with extra information during the development phase. For example, if the object count is increasing and the FPS slows down, then you now that your code attaches too many and does not detach enough objects. +At the bottom left of every default SimpleGame, you see the StatsView and the FPS (frames per seconds) view. These views provide you with extra information during the development phase. For example, if you notice the object count is increasing and the FPS is decreasing, then you know that your code attaches too many objects and does not detach enough of them again (maybe a loop gone wild?). +
      +Learn more: StatsView +

      @@ -571,6 +574,13 @@ In the application's simpleInitApp() method, call:
      setDisplayFps(false); // to hide the FPS
       setDisplayStatView(false); // to hide the statistics 
      +

      + +
      +Learn more: StatsView + +

      +

      How do I display score, health, mini-maps, status icons?

      diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/headlessserver.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/headlessserver.html index 9411ee126..c6c1f649f 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/headlessserver.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/headlessserver.html @@ -12,7 +12,7 @@ - + @@ -33,10 +33,10 @@ - + @@ -168,7 +168,7 @@ var NS='jme3:intermediate';var JSINFO = {"id":"jme3:intermediate:headlessserver" - + @@ -325,7 +325,7 @@ You've followed a link to a topic that doesn't exist yet. If permissio
      -
        +
       
      @@ -368,7 +368,7 @@ You've followed a link to a topic that doesn't exist yet. If permissio - +
      diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/multi-media_asset_pipeline.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/multi-media_asset_pipeline.html new file mode 100644 index 000000000..5965345e8 --- /dev/null +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/multi-media_asset_pipeline.html @@ -0,0 +1,235 @@ + +

      Multi-Media Asset Pipeline

      +
      + +

      + +Assets are files that are not code. Your multi-media assets includes, for example, your textures (image files), models (mesh files), and sounds (audio files). + +

      +
        +
      • You create textures in a graphic editor, for example Gimp, and export them as PNG or JPG.
        +
      • +
      • You create models in a 3D mesh editor, for example Blender, and export it in Ogre Mesh XML or Wavefront OBJ format.
        +
      • +
      • You create sounds in an audio editor, for example Audacity, and export them as WAVE or OGG.
        +
      • +
      +
      + + + + + + + + + + + + + + + + + + + + + +
      DODON'T
      Save original models plus textures into assets/Textures. Don't leave textures or models in a folder outside your JME project: The game cannot load or reference them from there.
      Save sounds into assets/Sounds. Don't leave audio files in a folder outside your JME project: The game cannot load or reference them from there.
      Create simple, low-polygon models. Don't create high-polygon models, they render too slow to be useful in games.
      Only use Diffuse Map, Normal Map, Glow Map, Specular Map in your models. Don't use unsupported material properties that are not listed in the Materials Overview.
      Use UV texture / texture atlases / baking for each texture map. Don't create models based on multiple separate textures, it will break the model into separate meshes.
      Convert original models to .j3o format. Move .j3o files into assets/Models. Don't reference original Blender/Ogre/OBJ files in your load() code, because these unoptimized files are not packaged into the final JAR.
      + +

      + +Read on for details. +

      + +
      + +

      Use The Assets Folder

      +
      + +

      + +Store your assets in subfolders of your project's assets directory. The assets directory is the default path where a JME game's Asset Manager looks for files to load. +

      +
      jMonkeyProjects/MyGame/assets/Interface/ # .font, .jpg, .png, .xml
      +jMonkeyProjects/MyGame/assets/MatDefs/   # .j3md
      +jMonkeyProjects/MyGame/assets/Materials/ # .j3m
      +jMonkeyProjects/MyGame/assets/Models/    # .j3o
      +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, 
      + +

      +Prepare the asset folder structure for your individual project: + +

      +
        +
      1. Agree on a directory structure with the graphic designers.
        +
      2. +
      3. Create subfolders of assets in any way that suits your project (see example above). Stick with one system.
        +
          +
        • If different assets belong together, create a parallel subdirectory structure for them.
          +Example: For car models, create Textures/vehicles/car1/, Materials/vehicles/car1/, Models/vehicles/car1/, , Sounds/vehicles/car1/ (etc) directories now.
          +
        • +
        +
      4. +
      5. Agree on a file naming and numbering scheme with the graphic designers.
        +
          +
        • Are some assets used interchangeably? Systematic naming and numbering lets developers easily swap out assets by swapping out parts of the path String.
          +
        • +
        • Decide on naming standards for naming interactive parts (arms/legs) of animated models.
          +
        • +
        +
      6. +
      + +

      + + +

      + +

      +See also: +

      +
        +
      • More details on Asset Manager, including tips how to work with assets when using other IDEs.
        +
      • +
      • Use Asset Packs to bundle, share, and manage assets!
        +
      • +
      + +
      + +

      Create Textures and Materials

      +
      + +

      + +Install a graphic editor such as Gimp or Photoshop. Consult the graphic editor's documentation for specific details how to do the following tasks. + +

      +
        +
      1. Create textures in a graphic editor.
        +
          +
        • Save all textures to your prepared subfolders in the assets/Textures directory.
          +
        • +
        +
      2. +
      3. (Optional) If you plan to use JME materials that you set programmatically from the code, create .j3m materials in the SDK.
        +
          +
        • Save these .j3m files into the assets/Materials directory.
          +
        • +
        +
      4. +
      + +

      + +

      Storing the textures inside your project directory is necessary for the paths in JME's binary model files (.j3o) to work. Treat the paths of your assets like class names of java classes, they define a specific asset. When you later generate .j3o files, compile class files, and distribute the project, paths and files need to be available in their final absolute form. It is imperative to keep the same directory structure from beginning to end. If you ever change the assets directory structure, you have to re-export all affected models, regenerate all affected .j3o files, and manually update all affected paths in your code. +

      +

      + +
      + +

      Create 3D Models

      +
      + +

      + +Install a mesh editor such as Blender or 3D Studio MAX. Reuse textures and materials as much as possible. Consult the mesh editor's documentation for specific details how to do the following tasks. + +

      +
        +
      1. Create 3D models in a mesh editor.
        +
          +
        1. Create simple low-polygon models. High-polygon models slow down the game.
          +
        2. +
        3. Unwrap the model and generate a UV texture (i.e. one texture file that contains all the pieces of one model from different angles).
          +Don't use multiple separate texture files with one model, it will break the model into several meshes.
          +
        4. +
        5. Create textures for the model: Only use Diffuse Map (minimum), Normal Map, Glow Map, and Specular Map.
          +Everything not listed in the Materials Overview is ignored by JME.
          +
        6. +
        +
      2. +
      3. Export the model mesh in one of the following formats: .blend, Wavefront .OBJ/.MTL, Ogre .mesh/.material/.scene.
        +
          +
        1. Bake each texture into one file when exporting. (Create a Texture Atlas.)
          +
        2. +
        3. Save exported models to subfolders of the assets/Textures directory, together with their Textures. (for now)
          +
        4. +
        +
      4. +
      + +

      + +See also: +

      + +

      +

      When I load the model in JME, why does it look different than in the 3D editor?
      +3D models will never look identical in a game engine and in a mesh editor. Mesh editors are optimized for high-quality offline rendering, and many of the material and texture options simply do not work in a live rendering context. Also, the shaders that render the materials in JME are different than in your mesh editor's renderer. Remind your graphic designers to only focus on features that game engines support. +

      +

      + +
      + +

      Convert 3D Models to .j3o Format

      +
      + +

      + +Convert all models and scenes to jME3's binary .j3o format to load() them. You use the jMonkeyEngine SDK to do the conversion. + +

      +
        +
      1. Confirm that you exported the model into the assets/Textures directory (or subdirectories) together with all its textures.
        +
      2. +
      3. In the SDK, right-click the model and choose "Convert to j3o Binary".
        +The paths in the j3o now reference files with an absolute assets/Textures/… path.
        +
      4. +
      5. Now, move the .j3o into the corresponding assets/Models/ or assets/Scenes/ directory.
        +
      6. +
      7. Use the AssetManager to load() the .j3o files.
        +
      8. +
      + +

      + +This process ensures that the texture paths are correct, and it also keeps your assets/Models folder free from textures. You can reuse your set of textures for many models. +

      + +

      +Must I convert to .j3o? – Yes! +

      +
        +
      • .j3o is an optimized format to store parts of a jME3 scene graph. A .j3o file can contain one shape, one model, or a whole scene.
        +
      • +
      • Only .j3o files can store all of jme3's material and other options, other formats can only be considered meshes with UV mapping data and always need to be worked on.
        +
      • +
      • .j3o files work seamlessly across platforms and can also be automatically adapted for certain platforms on distribution.
        +
      • +
      • (Optional) You can store the model's physical properties, materials, lights, particle emitters, and audio nodes, in the .j3o file.
        +Use the jMonkeyEngine SceneComposer to add these properties.
        +
      • +
      • The default Ant build script copies .j3o / .j3m files, sounds, and textures, into the distributable JAR automatically.
        +
      • +
      + +

      + +

      Important: Unoptimized external model files (.mesh.xml, .material, .obj, .mat, etc) are not bundled when you build your application! If you try to run the JAR with code referring to non-j3o models, you get a Runtime Error because the resource is not found. The final application code should only reference .j3o files. +

      +

      + +

      +See also: Model Loader and Viewer + +

      + +
      +

      view online version

      \ No newline at end of file diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/optimization.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/optimization.html index 2e92e09eb..bca916249 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/optimization.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/optimization.html @@ -21,7 +21,8 @@ The reason for this is, that for every object a render command must be done, her Possible optimization techniques

        -
      • Use GeometryBatchFactory.optimize(node) to merge the meshes of the geometries contained in the given node into fewer batches (based on common Material used). You can do this using the SceneComposer in the SDK as well, just right-click a node and select "Optimize Geometry"
        +
      • Use GeometryBatchFactory.optimize(node) to merge the meshes of the geometries contained in the given node into fewer batches, each based on common Materials used.
        +You can optimize nodes using the SceneComposer in the SDK as well: Right-click a node and select "Optimize Geometry".
      @@ -29,7 +30,7 @@ The reason for this is, that for every object a render command must be done, her Side-effects

        -
      • Using GeometryBatchFactory merges individual Geometries into a single mesh. Thereby it becomes hard to apply specific Materials or to remove a single Geometry. Therefore it should be used for static Geometry only that does not require frequent changes or individual materials/texturing.
        +
      • Using GeometryBatchFactory merges individual Geometries into a single mesh. Thereby it becomes hard to apply specific Materials or to remove a single Geometry. Therefore it should be used for static Geometry only that does not require frequent changes or individual materials/texturing.
      • Using Texture atlases might be a way to provide a limited individual texturing.
      • @@ -93,11 +94,12 @@ Genereally jME3 is well optimized and optimizes these things correctly. The norm
      • If the (M) values are much higher than the (F) values, that means a lot more GL objects are in memory than are actually used. This can happen in rare cases, such as extremely large scenes (> 2000 wu). In this case, you should can optimize performance by identifying spatials to cull or detach.
      • -
      • The Object Count (Batch Count) is a very important value that indicates how many geometries were rendered in the last frame. In general, try to keep the object count around 100-200 to keep your game fast and responsive. If the count is permanently higher, optimize your scene via GeometryBatchFactory or other means.
        +
      • The Object Count (Batch Count) is a very important value that indicates how many geometries were rendered in the last frame. In general, try to keep the object count around 100-200 to keep your game fast and responsive. If the count is permanently higher, hand-code rules that detach remote objects, or optimize a complex multi-material scene using:
        GeometryBatchFactory.optimize(complexNode, true);
        +
      • -
      • Same for Triangle Counts. If your game runs sluggishly and triangle count is high, then you are rendering too many too detailed meshes.
        +
      • Same for Triangle Counts. If your game runs sluggishly and triangle (polygon) count is high, then you are rendering too many too detailed meshes. Tell your graphic designers to create models with lower polygon counts.
      • -
      • FrameBuffers: If you don't use any post-processing effects (FilterPostProcessor), this count should be zero. The more effects you use, the more FrameBuffers are in use.
        +
      • FrameBuffers: If you don't use any post-processing effects (FilterPostProcessor), this count should be zero. The more effects you use, the more FrameBuffers are in use. If this value is high while others are normal, you can speed up the application by using fewer post-processing effects.
      diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/troubleshooting.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/troubleshooting.html index b87ec4a1c..7ad2758f5 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/troubleshooting.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/troubleshooting.html @@ -99,6 +99,15 @@ Compiz on Linux might cause issues, if you set its rendering quality to "me
      +

      Updating problems

      +
      + +

      +If you have problems updating the SDK, try deleting all files from jmonkeyplatform/update/download or [settings folder]/update/download depending on your system (look above for the settings folder location). +

      + +
      +

      Known Issues

      diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/wiki-map.xml b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/wiki-map.xml index fd2b25599..ad3be72bd 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/wiki-map.xml +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/wiki-map.xml @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file