From ef9ade64e8c13ca622608232c9acd52442489e21 Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Tue, 2 Oct 2012 13:37:01 +0000 Subject: [PATCH] SDK: - update manual git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9796 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../jme3/advanced/application_states.html | 26 ++- .../advanced/collision_and_intersection.html | 45 +++-- .../docs/jme3/advanced/custom_controls.html | 8 +- .../docs/jme3/advanced/custom_meshes.html | 26 ++- .../docs/jme3/advanced/effects_overview.html | 167 ++++++++++++------ .../docs/jme3/advanced/loading_screen.html | 8 + .../jme3/advanced/materials_overview.html | 16 +- .../gde/core/docs/jme3/advanced/mesh.html | 9 +- .../docs/jme3/advanced/multithreading.html | 23 ++- .../core/docs/jme3/advanced/networking.html | 50 +++--- .../jme3/advanced/post-processor_water.html | 4 +- .../docs/jme3/advanced/save_and_load.html | 10 +- .../gde/core/docs/jme3/advanced/shape.html | 7 + .../gde/core/docs/jme3/advanced/spatial.html | 38 ++-- .../gde/core/docs/jme3/advanced/terrain.html | 36 ++-- .../com/jme3/gde/core/docs/jme3/android.html | 10 +- .../core/docs/jme3/beginner/hello_audio.html | 24 ++- .../jme3/beginner/hello_input_system.html | 15 +- .../core/docs/jme3/beginner/hello_node.html | 71 ++++---- .../docs/jme3/beginner/hello_terrain.html | 26 +-- .../gde/core/docs/jme3/external/blender.html | 2 +- .../com/jme3/gde/core/docs/jme3/faq.html | 134 +++++++------- .../jme3/intermediate/best_practices.html | 42 ++--- .../intermediate/how_to_use_materials.html | 16 +- .../gde/core/docs/jme3/intermediate/math.html | 31 +--- .../multi-media_asset_pipeline.html | 53 ++++-- .../com/jme3/gde/core/docs/jme3/math.html | 159 +++++++++-------- .../gde/core/docs/jme3/the_scene_graph.html | 10 +- .../sdk/development/extension_library.html | 2 +- 29 files changed, 615 insertions(+), 453 deletions(-) diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/application_states.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/application_states.html index d97b4765c..cf9f5e50c 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/application_states.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/application_states.html @@ -236,22 +236,18 @@ Definition: } }   + // Note that update is only called while the state is both attached and enabled. @Override public void update(float tpf) { - if(isEnabled()){ - // do the following while game is RUNNING - this.app.getRootNode().getChild("blah").scale(tpf); // modify scene graph... - x.setUserData(...); // call some methods... - } else { - // do the following while game is PAUSED, e.g. play an idle animation. - ... - } + // do the following while game is RUNNING + this.app.getRootNode().getChild("blah").scale(tpf); // modify scene graph... + x.setUserData(...); // call some methods... }   } - +

Pausing and Unpausing

@@ -261,7 +257,7 @@ You define what an AppState does when Paused or Unpaused, in the setEnable

- +

AppStateManager

@@ -281,19 +277,19 @@ The com.jme3.app.state.AppStateManager holds the list of AppStates for an applic getState(MyAppState.class)Returns the first attached state that is an instance of a subclass of MyAppState.class.
- +

The AppStateManager's render(), postRender(), cleanUp() methods are internal, ignore them, users never call them directly.

- +

Best Practices

- +

Communication Among AppStates

@@ -309,7 +305,7 @@ You can use custom accessors to get data from AppStates, to set data in AppState
this.app.getStateManager().getState(MyAppState.class).doSomeCustomStuffInThisState();
- +

Initialize Familiar Class Fields

@@ -337,5 +333,5 @@ public void initialize(AppStateManager stateManager, Application app) &# }
- +

view online version

\ No newline at end of file diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/collision_and_intersection.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/collision_and_intersection.html index 5652d5bf0..231c925c1 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/collision_and_intersection.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/collision_and_intersection.html @@ -72,12 +72,12 @@ A CollisionResult object contains information about the second party of the coll getTriangle(t)Binds t to the triangle t on the second party's mesh that was hit. - getTriangleIndex()Returns the index of the triangle on the second party's mesh that was hit. (?) + getTriangleIndex()Returns the index of the triangle on the second party's mesh that was hit. - + - +

Code Sample

@@ -132,13 +132,17 @@ Knowing the distance of the collisions is useful for example when you intersect

- +

Bounding Volumes

-A com.jme3.bounding.BoundingVolume is an interface for dealing with containment of a collection of points. All BoundingVolumes are Collidable and are used as optimization to calculate non-physical collisions more quickly: It's always faster to calculate an intersection between simple shapes like spheres and boxes than between complex shapes like models. +A com.jme3.bounding.BoundingVolume is an interface for dealing with containment of a collection of points. All BoundingVolumes are Collidable and are used as optimization to calculate non-physical collisions more quickly: It's always faster to calculate an intersection between simple shapes like spheres and boxes than between complex shapes like models. +

+ +

+jME3 computes bounding volumes for all objects. These bounding volumes are later used for frustum culling, which is making sure only objects visible on-screen are actually sent for rendering.

@@ -150,24 +154,25 @@ Supported types:

    -
  • Type.Sphere: com.jme3.bounding.BoundingSphere is a sphere used as a container for a group of vertices of a piece of geometry. A BoundingSphere has a center and a radius.
    +
  • Type.AABB = Axis-aligned bounding box, that means it doesn't rotate, which makes it less precise. A com.jme3.bounding.BoundingBox is an axis-aligned cuboid used as a container for a group of vertices of a piece of geometry. A BoundingBox has a center and extents from that center along the x, y and z axis. This is the default bounding volume, since it is fairly fast to generate and gives better accuracy than the bounding sphere.
  • -
  • Type.AABB = Axis-aligned bounding box, that means it doesn't rotatewhich makes it less precise. A com.jme3.bounding.BoundingBox is an axis-aligned cuboid used as a container for a group of vertices of a piece of geometry. A BoundingBox has a center and extents from that center along the x, y and z axis.
    +
  • Type.Sphere: com.jme3.bounding.BoundingSphere is a sphere used as a container for a group of vertices of a piece of geometry. A BoundingSphere has a center and a radius.
  • Type.OBB = Oriented bounding box. This bounding box is more precise because it can rotate with its content, but is computationally more expensive. (Currently not supported.)
  • -
  • Type.Capsule = Cylinder with rounded ends, also called "swept sphere". Typically used for mobile characters.
    +
  • Type.Capsule = Cylinder with rounded ends, also called "swept sphere". Typically used for mobile characters. (Currently not supported.)

-

Note: If you are looking for BoundingVolumes for physical objects, use CollisionShapes. +

Note: If you are looking for bounding volumes for physical objects, use CollisionShapes.

+

- +

Usage

@@ -180,13 +185,23 @@ For example you can use Bounding Volumes on custom meshes, or complex non-physic mesh.updateBound();
- + +

Mesh and Scene Graph Collision

+
+ +

+ +One of the supported Collidables are meshes and scene graph objects. To execute a collision detection query against a scene graph, use Spatial.collideWith(). This will traverse the scene graph and return any mesh collisions that were detected. Note that the first collision against a particular scene graph may take a long time, this is because a special data structure called needs to be generated for the meshes. At a later point, the mesh could change and the BIH tree would become out of date, in that case, call on the changed mesh to update the BIH tree. +

+ +
+

Intersection

-A com.jme3.math.Ray is an infinite line with a beginning, a direction, and no end; whereas a com.jme3.math.Line is an infinite line with only a direction (no beginning, no end). +A com.jme3.math.Ray is an infinite line with a beginning, a direction, and no end; whereas a com.jme3.math.Line is an infinite line with only a direction (no beginning, no end).

@@ -214,14 +229,12 @@ Learn the details of how to implement +

view online version

\ No newline at end of file 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 da5541501..a22a75511 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 @@ -145,7 +145,7 @@ For example, you disable your IdleBehaviourControl when you enable your Defensiv Usage: Your custom subclass implements the three methods controlUpdate(), controlRender(), setSpatial(), and cloneForSpatial() as shown here:

public class MyControl extends AbstractControl implements Savable, Cloneable {
-  privat int index; // can have custom fields -- example 
+  private int index; // can have custom fields -- example 
  
   public MyControl(){} // empty serialization constructor
  
@@ -214,7 +214,7 @@ See also:
 
 
 
- +

The Control Interface

@@ -321,7 +321,7 @@ Usage example: }
- +

Best Practices

@@ -387,5 +387,5 @@ vehicleSpatial.addControl(new ManualVehicleControl()); c.steerX(steerX);
- +

view online version

\ No newline at end of file diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/custom_meshes.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/custom_meshes.html index 6fa671e9a..b946c2298 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/custom_meshes.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/custom_meshes.html @@ -154,6 +154,15 @@ Ta-daa!
+

Dynamic Meshes

+
+ +

+If modifying a mesh dynamically in a way which would change the model's bounds then you need to call updateModelBound() on the Geometry object containing the mesh after calling updateBounds() on the mesh object. There is a warning on updateModelBounds about not usually needing to use it but that can be ignored in this special case. +

+ +
+

Optional Mesh Features

@@ -163,7 +172,7 @@ There are more vertex buffers in a Mesh than the three shown above. For an overv

- +

Example: Vertex Colors

@@ -229,7 +238,7 @@ Now you see a gradient color extending from each vertex.

- +

Example: Shaded Mesh with Normals

@@ -247,7 +256,7 @@ You need as many normals as the polygon has vertices. For a flat quad, they poin

- +

Example: Point Mode

@@ -273,7 +282,7 @@ This will result in a 10 px dot being rendered for each of the four vertices. Th

- +

Tip: Front and Back Faces

@@ -290,7 +299,14 @@ In case that your use case requires the backfaces to be visible, you have two op int[] indexes = { 2,0,1, 1,3,2, 2,3,1, 1,0,2 };
+
+ spatial, + node, + mesh, + geometry, + scenegraph +
- +

view online version

\ No newline at end of file diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/effects_overview.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/effects_overview.html index 76a1ea779..b2cd3b14c 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/effects_overview.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/effects_overview.html @@ -1,46 +1,89 @@ -

jME3 Post-Processor Filters and Effects -- Overview

+

jME3 Special Effects Overview

-jME3 supports two types of effects, post-rendering filters and particle emitters. This list contains screenshots and links to sample code that demonstrates how to add the effect to a scene. +jME3 supports several types of special effects: Post-Processor Filters, SceneProcessors, and Particle Emitters (also known as particle systems). This list contains screenshots and links to sample code that demonstrates how to add the effect to a scene.

-

-For example, post-processor filter effects are typically activated after the following pattern: -

+
+ +

Sample Code

+
+
    +
  • There is one com.jme3.effect.ParticleEmitter class for all Particle Systems.
    +
  • +
  • There is one com.jme3.post.FilterPostProcessor class and several com.jme3.post.filters.* classes (all Filters have *Filter in their names).
    +
  • +
  • There are several SceneProcessor classes in various packages, including e.g. com.jme3.shadow.* and com.jme3.water.* (SceneProcessor have *Processor or *Renderer in their names).
    +
  • +
+ +
+ +

Particle Emitter

+
public class MyGame extends SimpleApplication {
-    private FilterPostProcessor fpp;
-    private SomeFilter sf;
+  public void simpleInitApp() {
+    ParticleEmitter pm = new ParticleEmitter("my particle effect", Type.Triangle, 60);
+    Material pmMat = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
+    pmMat.setTexture("Texture", assetManager.loadTexture("Effects/spark.png"));
+    pm.setMaterial(pmMat);
+    pm.setImagesX(1);
+    pm.setImagesY(1);
+    rootNode.attachChild(pm); // attach one or more emitters to any node
+  }
+}
+ +
+ +

Scene Processor

+
+
public class MyGame extends SimpleApplication {
+    private BasicShadowRenderer bsr;
+ 
+    public void simpleInitApp() {
+        bsr = new BasicShadowRenderer(assetManager, 1024);
+        bsr.setDirection(new Vector3f(.3f, -0.5f, -0.5f));
+        viewPort.addProcessor(bsr); // add one or more sceneprocessor to viewport
+    }
+ +
+ +

Post-Processor Filter

+
+
public class MyGame extends SimpleApplication {
+    private FilterPostProcessor fpp; // one FilterPostProcessor per app
+    private SomeFilter sf;           // one or more Filters per app
  
     public void simpleInitApp() {
-        ...
         fpp = new FilterPostProcessor(assetManager);
+        viewPort.addProcessor(fpp); // add one FilterPostProcessor to viewPort
+ 
         sf = new SomeFilter();
-        fpp.addFilter(sf);
-        viewPort.addProcessor(fpp);
-        ...
+        fpp.addFilter(sf);  // add one or more Filters to FilterPostProcessor
     }
- +

Water

-The jMonkeyEngine features "SeaMonkey" water effect including cool underwater caustics. +The jMonkeyEngine's "SeaMonkey" WaterFilter simulates ocean waves, foam, including cool underwater caustics. +Use the SimpleWaterProcessor (SceneProcessor) for small, limited bodies of water, such as puddles, drinking troughs, pools, fountains.

See also the announcement with video.

    -
  • +
  • – SimpleWaterProcessor (SceneProcessor)
  • -
  • +
  • – SimpleWaterProcessor (SceneProcessor)
@@ -48,19 +91,19 @@ See also the

    -
  • +
  • – WaterFilter
  • -
  • +
  • – WaterFilter
- +

Environment Effects

- +

Depth of Field Blur

@@ -69,30 +112,30 @@ See also the

    -
  • +
  • – DepthOfFieldFilter
- +

Fog

    -
  • +
  • – FogFilter
- +

Light Scattering

    -
  • +
  • – LightScatteringFilter
- +

Vegetation

    @@ -103,7 +146,7 @@ See also the +

    Light and Shadows

    @@ -112,26 +155,26 @@ See also the +

    Bloom and Glow

    - +

    Light

      -
    • +
    • – DirectionalLight, PointLight
    • -
    • +
    • – DirectionalLight, PointLight
    • -
    • +
    • – .j3o scene
    • More details: Light and Shadow
    • @@ -143,24 +186,24 @@ See also the +

      Shadow

        -
      • – Simple Shadows
        +
      • – BasicShadowRenderer (SceneProcessor)
      • -
      • – Parallel-Split Shadow Mapping (PSSM)
        +
      • – PssmShadowRenderer (SceneProcessor), also known as Parallel-Split Shadow Mapping (PSSM).
      • -
      • , – Screen-Space Ambient Occlusion shadows
        +
      • , – SSAOFilter, also known as Screen-Space Ambient Occlusion shadows (SSOA).
      • -
      • – Screen-Space Ambient Occlusion shadows plus transparancy
        +
      • – SSAOFilter, also known as Screen-Space Ambient Occlusion shadows (SSOA), plus transparancy
      • More details: Light and Shadow
      - +

      Special: Glass, Metal, Dissolve, Toon

      @@ -171,27 +214,27 @@ See also the +

      Toon Effect

        -
      • +
      • – CartoonEdgeFilter
      • -
      • +
      • – CartoonEdgeFilter
      - +

      Fade in / Fade out

      - +

      User Contributed

      @@ -204,19 +247,29 @@ See also the

        -
      • LightBlow Shader
        +
      • LightBlow Shader – blend material texture maps
        +
      • +
      • FakeParticleBlow Shader – jet, fire effect
        +
      • +
      • ToonBlow Shader – Toon Shading, toon edges
        +
      • +
      • Dissolve Shader – Scifi teleportation/dissolve effect
        +
      • +
      • MatCap Shader – Gold, metals, glass, toons…!
        +
      • +
      • Glass Shader – Glass
      • -
      • FakeParticleBlow Shader
        +
      • Force Shield Shader – Scifi impact-on-force-field effect
      • -
      • ToonBlow Shader
        +
      • SimpleSprite Shader – Animated textures
      • -
      • Dissolve Shader
        +
      • SimpleSpriteParticle Shader – Sprite library
      • -
      • MatCap Shader for glass, gold, metals, toons…
        +
      • MovingTexture Shader – Animated cloud/mist texture
      • -
      • Glass Shader
        +
      • SoftParticles Shader – Fire, clouds, smoke etc
      • -
      • Force Shield Shader
        +
      • Displace Shader – Deformation effect: Ripple, wave, pulse, swell!
      @@ -226,21 +279,21 @@ Thanks for your awesome contributions! Keep them coming!

      - -

      Particles: Explosions, Fire, Smoke

      + +

      Particle Emitters: Explosions, Fire, Smoke

      -Particle emitter effects can have any texture, e.g. fog, smoke, leaves, meteors, snowflakes, mosquitos, fire, sparks… +Particle emitter effects are highly configurable and can have any texture. They can simulate smoke, dust, leaves, meteors, snowflakes, mosquitos, fire, explosions, clusters, embers, sparks…

      • – debris, flame, flash, shockwave, smoke, sparks
      • -
      • +
      • – cluster of points
      • -
      • +
      • – dust, smoke

      @@ -264,5 +317,5 @@ See also:
      - +

      view online version

      \ No newline at end of file diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/loading_screen.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/loading_screen.html index a1715e0d2..f5c9c0828 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/loading_screen.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/loading_screen.html @@ -552,6 +552,14 @@ public class TestLoadingScreen1 extends SimpleApplication implements ScreenContr   public void onFocus(boolean getFocus) { } +  +  + @Override + public void stop() { + super.stop(); + //the pool executor needs to be shut down so the application properly exits. + exec.shutdown(); + } } diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/materials_overview.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/materials_overview.html index 92c700e12..e452648a5 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/materials_overview.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/materials_overview.html @@ -340,21 +340,21 @@ Later, put the Geometry (not the Material!) in the appropriate render queue Material OptionUsageExample - getAdditionalRenderState().setFaceCullMode(FaceCullMode.Back); Activate back-face culling. Mesh faces that are not facing the camera are not rendered, which saves time. Backface culling is activated by default as a major optimization.The backside of mesh polygons (and the inside of models) is invisible. + getAdditionalRenderState().setFaceCullMode(FaceCullMode.Back); Activates back-face culling. Mesh faces that are facing away from the camera are not rendered, which saves time. *Backface culling is activated by default as a major optimization.* The invisible backsides and insides of models are not calculated. - getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off); Nothing is culled. Both mesh faces are rendered, even if they face away from the camera. Slow.Sometimes used to debug custom meshes if you messed up some of the polygon sides, or for special shadow effects. + getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off); No meshes are culled. Both mesh faces are rendered, even if they face away from the camera. Slow.Sometimes used to debug custom meshes if you messed up some of the polygon sides, or for special shadow effects. - getAdditionalRenderState().setFaceCullMode(FaceCullMode.Front); Activate front-face culling. Mesh faces facing the camera are not rendered.Typically not used because you wouldn't see anything. + getAdditionalRenderState().setFaceCullMode(FaceCullMode.Front); Activates front-face culling. Mesh faces facing the camera are not rendered.No example – Typically not used because you wouldn't see anything meaningful. - getAdditionalRenderState().setFaceCullMode(FaceCullMode.FrontAndBack)Cull both backfaces and frontfaces.Use this as an efficient way to make an object temporarily invisible, while keeping all its other in-game properties (node attachment, collision shapes, interactions, etc) active. + getAdditionalRenderState().setFaceCullMode(FaceCullMode.FrontAndBack)Culls both backfaces and frontfaces.Use this as an efficient way to make an object temporarily invisible, while keeping all its other in-game properties (such as node attachment, collision shapes, interactions, etc) active. - + - +

      Miscellaneous

      @@ -368,7 +368,7 @@ Later, put the Geometry (not the Material!) in the appropriate render queue
      getAdditionalRenderState().setPolyOffset();Enable polygon offset.Use this when you have meshes that have triangles really close to each over (e.g. ), it will shift the depth values to prevent .
      - +

      Related Links @@ -389,7 +389,7 @@ Later, put the Geometry (not the Material!) in the appropriate render queue

      -
      +
      1) UseAlpha specifies whether DiffuseMap uses the alpha channel
      2) diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/mesh.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/mesh.html index 749d72ceb..bf0be94a9 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/mesh.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/mesh.html @@ -158,7 +158,14 @@ The VertexBuffer contains a particular type of geometry data used by Meshes. Eve Mesh.Mode.Hybrid?
      - + +

      view online version

      \ No newline at end of file diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/multithreading.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/multithreading.html index 45e192a2a..4ca1a2750 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/multithreading.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/multithreading.html @@ -72,8 +72,19 @@ 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.

      +

      +!!! Executor needs to be shut down when the application ends, in order to make the process die properly +In your simple application you can override the stop method and shutdown the executor : + +

      +
          @Override
      +    public void stop() {
      +        super.stop();
      +        executor.shutdown();
      +    }
      +
      - +

      Control Class Fields

      @@ -93,7 +104,7 @@ Here we also created the Future variable to track the state of this task.

      - +

      Control Update() Method

      @@ -141,7 +152,7 @@ Remember not to mess with the class fields after starting the thread, because th

      - +

      The Callable

      @@ -193,7 +204,7 @@ private Callable<MyWayList> findWay = new Callable<MyWayList>(&# };
      - +

      The jME3 Threading Model

      @@ -220,7 +231,7 @@ If the processing thread needs to wait or needs the return value then get(

      - +

      Conclusion

      @@ -239,5 +250,5 @@ The cool thing about this approach is that every entity creates one self-contain
      - +

      view online version

      \ No newline at end of file diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/networking.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/networking.html index 4e93b1c92..614473f94 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/networking.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/networking.html @@ -69,7 +69,7 @@ You can register several types of listeners to be notified of changes. The game server is a "headless" com.jme3.app.SimpleApplication:

      -
      public class MyGameServer extends SimpleApplication {
      +
      public class ServerMain extends SimpleApplication {
         public static void main(String[] args) {
           ServerMain app = new ServerMain();
           app.start(JmeContext.Type.Headless); // headless type for servers!
      @@ -96,7 +96,7 @@ When you run this app on a host, the server is ready to accept clients. Let'
       

      - +

      Creating a Client

      @@ -104,7 +104,7 @@ When you run this app on a host, the server is ready to accept clients. Let' A game client is a standard com.jme3.app.SimpleApplication.

      -
      public class MyGameClient extends SimpleApplication {
      +
      public class ClientMain extends SimpleApplication {
         public static void main(String[] args) {
           ClientMain app = new ClientMain();
           app.start(JmeContext.Type.Display); // standard display type
      @@ -135,7 +135,7 @@ When you run this client, it connects to the server.
       

      - +

      Getting Info About a Client

      @@ -158,7 +158,7 @@ The server refers to a connected client as com.jme3.network.HostedConnection obj myServer.getConnection(0)Server gets the first (0), second (1), etc, connected HostedConnection object (one client).
      - +

      Your game can define its own game data based on whatever criteria you want, typically these include player ID and state. If the server needs to look up player/client-specific information, you can store this information directly on the HostedConnection object. The following examples read and write a custom Java object MyState in the HostedConnection object conn: @@ -175,14 +175,14 @@ Your game can define its own game data based on whatever criteria you want, typi MyState state = conn.getAttribute("MyState") Server can read an attribute of the HostedConnection. - + - +

      Messaging

      - +

      Creating Message Types

      @@ -203,7 +203,7 @@ You must register each message type to the com.jme3.network.serializing.Serializ
      Serializer.registerClass(HelloMessage.class);
      - +

      Responding to Messages

      @@ -260,7 +260,7 @@ For each message type, register a server listener to the server:
      myServer.addMessageListener(new ServerListener(), HelloMessage.class);
      - +

      Creating and Sending Messages

      @@ -297,7 +297,7 @@ The last two broadcasting methods use com.jme3.network.Filters to select a subse

      - +

      Identification and Rejection

      @@ -328,7 +328,7 @@ A server has a game version and game name property. Each client expects to commu myClient.getVersion() Client queries the version of the server it is connected to.
      - +

      Typically, your networked game defines its own attributes (such as player ID) based on whatever criteria you want. If you want to look up player/client-specific information beyond the game version, you can set this information directly on the Client/HostedConnection object (see Getting Info About a Client). @@ -336,12 +336,12 @@ A server has a game version and game name property. Each client expects to commu

      - +

      Closing Clients and Server Cleanly

      - +

      Closing a Client

      @@ -357,7 +357,7 @@ You must override the client's destroy() method to close the connection cle }
      - +

      Closing a Server

      @@ -373,7 +373,7 @@ You must override the server's destroy() method to close the connection whe }
      - +

      Kicking a Client

      @@ -384,7 +384,7 @@ The server can kick a HostedConnection to make it disconnect. You should provide
      conn.close("We kick cheaters.");
      - +

      Listening to Connection Notification

      @@ -394,7 +394,7 @@ The server and clients are notified about connection changes.

      - +

      ClientStateListener

      @@ -414,7 +414,7 @@ The com.jme3.network.ClientStateListener notifies the Client when the Client has public void clientDisconnected(Client c, DisconnectInfo info){} Implement here what happens after the server kicks this client. For example, display the DisconnectInfo to the user.
      - +

      First implement the ClientStateListener interface in the Client class. Then register it to myClient in MyGameClient's simpleInitApp() method: @@ -422,7 +422,7 @@ First implement the ClientStateListener interface in the Client class. Then regi

      myClient.addClientStateListener(this);
      - +

      ConnectionListener

      @@ -442,7 +442,7 @@ The com.jme3.network.ConnectionListener notifies the Server whenever new HostedC public void connectionRemoved(Server s, HostedConnection c){} Implement here what happens after a HostedConnection has left. E.g. a player has quit the game and the server removes his character.
      - +

      First implement the ConnectionListener interface in the Server class. Then register it to myServer in MyGameServer's simpleInitApp() method. @@ -451,7 +451,7 @@ First implement the ConnectionListener interface in the Server class. Then regis

      myServer.addConnectionListener(this);
      - +

      UDP versus TCP

      @@ -469,7 +469,7 @@ message2.setReliable(false); // UDP
      - +

      Important: Use Multi-Threading

      @@ -493,7 +493,7 @@ For general advice, see the articles +

      Troubleshooting

      @@ -508,5 +508,5 @@ If you have set up a server in your home network, and the game clients cannot re
      - +

      view online version

      \ No newline at end of file diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/post-processor_water.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/post-processor_water.html index 8c7cdf654..5240f87a3 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/post-processor_water.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/post-processor_water.html @@ -12,7 +12,7 @@ The awesome SeaMonkey WaterFilter is highly configurable. It can render any type

      -

      The SeaMonkey WaterFilter is ideal for oceans and lakes, and expecially for under-water scenes. If you only need a small simple water surface, such as a water trough or a shallow fountain, the SimpleWaterProcessor may already be all you need. +

      The SeaMonkey WaterFilter is ideal for oceans and lakes, and especially for under-water scenes. If you only need a small simple water surface, such as a water trough or a shallow fountain, the SimpleWaterProcessor may already be all you need.

      @@ -286,7 +286,7 @@ See also: diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/save_and_load.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/save_and_load.html index 02153ea17..11a57b759 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/save_and_load.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/save_and_load.html @@ -101,7 +101,7 @@ Example: You used something like mySpatial.setUserData("inventory&quo

      -If your custom classes (the user data or the Controls) do not implement Savable, then the BinaryImporter/BinaryExporter cannot save the Spatial! +If your custom classes (the user data or the Controls) do not implement Savable, then the BinaryImporter/BinaryExporter cannot save the Spatial!

      @@ -179,7 +179,13 @@ To make a custom class savable: documentation, serialization, import, - export + export, + spatial, + node, + mesh, + geometry, + scenegraph, + sdk

      diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/shape.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/shape.html index 1fb7ba1cf..b97f88c63 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/shape.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/shape.html @@ -186,6 +186,13 @@ rootNode.attachChild(geom); // attach geometry to a n * Optimization – The GeometryBatchFactory class combines several of your shapes with the same texture into one mesh with one texture.

      + 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 dd202740f..89921c046 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 @@ -22,7 +22,7 @@ If you think you need to understand the scene graph concept better, please read

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

      @@ -34,7 +34,7 @@ In your Java code, a Spatial is either a com.jme3.scene.Node or a < com.jme3.scene.Spatial - 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. + Purpose: A Spatial is an abstract data structure that stores user data and 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 @@ -56,15 +56,15 @@ no mesh, no material. Examples: Box, sphere, player, building, terrain, vehicle, missiles, NPCs, etc… rootNode, guiNode, audioNode, a custom grouping node such as 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 either a com.jme3.scene.Node, or a com.jme3.scene.Geometry object. Some methods, however, require a spatial as argument: This is because they are able to accept both Nodes and Geometries as arguments. In this case, you simply 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 create either a com.jme3.scene.Node or com.jme3.scene.Geometry instance. Some methods, however, require a Spatial type as argument: This is because they are able to accept both Nodes and Geometries as arguments. In this case, you simply cast a Node or Geometry to Spatial.

      - +

      Mesh

      @@ -83,7 +83,7 @@ The polygon Mesh i
      - +

      What is a Clone?

      @@ -112,7 +112,7 @@ Usually there is no need to manually use any of the clone() methods

      - +

      How to Add Fields and Methods to a Spatial

      @@ -171,7 +171,7 @@ This is how you list all data keys that are already defined for one Spatial: }
      - +

      How to Access a Named Sub-Mesh

      @@ -196,15 +196,23 @@ In the following example, the Node house is the loaded model. The s
      Geometry submesh = (Geometry) houseScene.getChild("door 12");
      - +

      See also

      - -

      - -* Optimization – The GeometryBatchFactory class batches several Geometries into meshes with each their own texture. -

      +
        +
      • Optimization – The GeometryBatchFactory class batches several Geometries into meshes with each their own texture.
        +
      • +
      • Traverse SceneGraph – Find any Node or Geometry in the scenegraph.
        +
      • +
      +
      - +

      view online version

      \ No newline at end of file diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/terrain.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/terrain.html index ab20721e3..84487f420 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/terrain.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/advanced/terrain.html @@ -163,9 +163,9 @@ Here are the names of TerrainLighting.j3md's material properties:
    • DiffuseMap_4, DiffuseMap_4_scale, NormalMap_4
    • -
    • DiffuseMap_5, DiffuseMap_5_scale, NormalMap_5
      +
    • -
    • DiffuseMap_6, DiffuseMap_6_scale, …, DiffuseMap_11
      +
    • DiffuseMap_11, DiffuseMap_11_scale, NormalMap_11
    • @@ -193,11 +193,11 @@ Adhere to the following constraints:

        -
      • 1-12 Diffuse Maps (one Diffuse Map is the minimum)
        +
      • 1-12 Diffuse Maps. One Diffuse Map is the minimum!
      • -
      • 1-3 Alpha Maps (for each 4 Diffuse Maps, you need 1 more Alpha Map!)
        +
      • 1-3 Alpha Maps. For each 4 Diffuse Maps, you need 1 more Alpha Map!
      • -
      • 0-6 Normal Maps (Diffuse Maps & Normal Maps come in pairs!)
        +
      • 0-6 Normal Maps. Diffuse Maps & Normal Maps always come in pairs!
      • 0 or 1 Glow Map
      • @@ -213,11 +213,11 @@ Here are some common examples what this means:

          -
        • 3 Alpha + 12 Diffuse + 1 Normal.
          +
        • 3 Alpha + 11 Diffuse + 1 Normal.
        • -
        • 3 Alpha + 12 Diffuse + 1 Glow.
          +
        • 3 Alpha + 11 Diffuse + 1 Glow.
        • -
        • 3 Alpha + 12 Diffuse + 1 Specular.
          +
        • 3 Alpha + 11 Diffuse + 1 Specular.
        • 3 Alpha + 10 Diffuse + 3 Normal.
        • @@ -237,7 +237,7 @@ You can hand-paint Alpha, Diffuse, Glow, and Specular maps in a drawing program,

          - +

          Code Sample: Terrain.j3md

          @@ -252,24 +252,24 @@ First, we load our textures and the heightmap texture for the terrain
          // Create material from Terrain Material Definition
           matRock = new Material(assetManager, "Common/MatDefs/Terrain/Terrain.j3md");
           // Load alpha map (for splat textures)
          -matRock.setTexture("m_Alpha", assetManager.loadTexture("Textures/Terrain/splat/alphamap.png"));
          +matRock.setTexture("Alpha", assetManager.loadTexture("Textures/Terrain/splat/alphamap.png"));
           // load heightmap image (for the terrain heightmap)
           Texture heightMapImage = assetManager.loadTexture("Textures/Terrain/splat/mountains512.png");
           // load grass texture
           Texture grass = assetManager.loadTexture("Textures/Terrain/splat/grass.jpg");
           grass.setWrap(WrapMode.Repeat);
          -matRock.setTexture("m_Tex1", grass);
          -matRock.setFloat("m_Tex1Scale", 64f);
          +matRock.setTexture("Tex1", grass);
          +matRock.setFloat("Tex1Scale", 64f);
           // load dirt texture
           Texture dirt = assetManager.loadTexture("Textures/Terrain/splat/dirt.jpg");
           dirt.setWrap(WrapMode.Repeat);
          -matRock.setTexture("m_Tex2", dirt);
          -matRock.setFloat("m_Tex2Scale", 32f);
          +matRock.setTexture("Tex2", dirt);
          +matRock.setFloat("Tex2Scale", 32f);
           // load rock texture
           Texture rock = assetManager.loadTexture("Textures/Terrain/splat/road.jpg");
           rock.setWrap(WrapMode.Repeat);
          -matRock.setTexture("m_Tex3", rock);
          -matRock.setFloat("m_Tex3Scale", 128f);
          +matRock.setTexture("Tex3", rock); +matRock.setFloat("Tex3Scale", 128f);

          We create the heightmap from the heightMapImage. @@ -291,8 +291,6 @@ Next we create the actual terrain.

        terrain = new TerrainQuad("terrain", 65, 513, heightmap.getHeightMap());
         terrain.setMaterial(matRock);
        -terrain.setModelBound(new BoundingBox());
        -terrain.updateModelBound();
         terrain.setLocalScale(2f, 1f, 2f); // scale to make it less steep
         List<Camera> cameras = new ArrayList<Camera>();
         cameras.add(getCamera());
        @@ -306,5 +304,5 @@ PS: As an alternative to an image-based height map, you can also generate a Hill
         
        heightmap = new HillHeightMap(1025, 1000, 50, 100, (byte) 3);
        - +

        view online version

        \ No newline at end of file diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/android.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/android.html index 514e776e9..4211b00d1 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/android.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/android.html @@ -226,10 +226,12 @@ Activating the nbandroid plugin in the jMonkeyEngine SDK Rev. 20 you need to copy and paste mobile/AndroidManifest.xml to mobile/MANIFEST.MF () +
      - +

      Android Considerations

      @@ -253,7 +255,7 @@ You can use the jMonkeyEngine SDK
      - +

      Using Android specific functions

      @@ -275,7 +277,7 @@ Note that you have to build the whole project once to make (new) classes in the

      - +

      More Info

      @@ -299,5 +301,5 @@ The SDK will later provide t
      - +

      view online version

      \ No newline at end of file diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_audio.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_audio.html index f18bf9511..4f2b8c37f 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_audio.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_audio.html @@ -119,16 +119,12 @@ When you run the sample, you should see a blue cube. You should hear a nature-li In the initSimpleApp() method, you create a simple blue cube geometry called player and attach it to the scene – this just arbitrary sample content, so you see something when running the audio sample.

      -

      -From initSampleApp(), you initialize the game by calling the two custom methods initKeys() and initAudio(). You could call the lines of code in these two methods directly from initSampleApp(); they merely are in extra methods to keep the code more readable. -

      -

      Let's have a closer look at initAudio() to learn how to use AudioNodes.

      - +

      AudioNodes

      @@ -184,7 +180,7 @@ Here you make audio_nature a positional sound that comes from a certain place. F

      - +

      Triggering Sound

      @@ -216,7 +212,7 @@ Since you want to be able to shoot fast repeatedly, so you do not want to wait f

      - +

      Ambient or Situational?

      @@ -265,7 +261,7 @@ Apart from the looping boolean, another difference is where play().playIns
      - +

      Buffered or Streaming?

      @@ -288,7 +284,7 @@ Note that streamed sounds can not loop (i.e. setLooping will not work as you exp

      - +

      Play() or PlayInstance()?

      @@ -305,9 +301,9 @@ Note that streamed sounds can not loop (i.e. setLooping will not work as you exp
      The same sound cannot play twice at the same time.The same sounds can play multiple times and overlap.
      - +
      - +

      Your Ear in the Scene

      @@ -329,7 +325,7 @@ If you don't do that, the results of 3D audio will be quite random.

      - +

      Global, Directional, Positional?

      @@ -356,7 +352,7 @@ In short, you must choose in every situation whether it makes sense for a sound

      - +

      Conclusion

      @@ -391,5 +387,5 @@ See also:
      - +

      view online version

      \ No newline at end of file diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_input_system.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_input_system.html index aec5c578c..65dc18e69 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_input_system.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_input_system.html @@ -259,15 +259,16 @@ You can also combine both listeners into one, the engine will send the appropria } } // ... -inputManager.addListener(analogListener, new String[]{"Pause", "Left", "Right", "Rotate"}); +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. +

      - +

      Analog, Pressed, or Released?

      @@ -324,7 +325,7 @@ Mappings registered to the ActionListener are digital either-or }
      - +

      Table of Triggers

      @@ -360,14 +361,14 @@ You can find the list of input constants in the files src/core/com/jme3/in KeyTrigger(KeyInput.KEY_LEFT), KeyTrigger(KeyInput.KEY_RIGHT)
      - +

      Tip: If you don't recall an input constant during development, you benefit from an IDE's code completion functionality: Place the caret after e.g. KeyInput.| and trigger code completion to select possible input identifiers.

      - +

      Exercises

        @@ -395,7 +396,7 @@ inputManager.addMapping("Pause", new KeyTrigger(usersPauseKey

      - +

      Conclusion

      @@ -417,5 +418,5 @@ Now you can already write a little interactive game! But wouldn't it be coo
      - +

      view online version

      \ No newline at end of file diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_node.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_node.html index a95fd8af3..8822a7ae0 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_node.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_node.html @@ -65,20 +65,22 @@ public class HelloNode extends SimpleApplication { public void simpleInitApp() {   /** create a blue box at coordinates (1,-1,1) */ - Box box1 = new Box( new Vector3f(1,-1,1), 1,1,1); + 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);   /** create a red box straight above the blue one at (1,3,1) */ - Box box2 = new Box( new Vector3f(1,3,1), 1,1,1); + 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);   /** Create a pivot node at (0,0,0) and attach it to the root node */ Node pivot = new Node("pivot"); @@ -97,7 +99,7 @@ Build and run the code sample. You should see two colored boxes tilted at the sa

      - +

      Understanding the Terminology

      @@ -123,10 +125,10 @@ In this tutorial, you learn some new terms: Make an object disappear from the sceneDetach the Spatial from the rootNode - Position/move, turn, or resize an objectTranslate, rotate, scale an object. Transform an object. + Position/move, turn, or resize an objectTranslate, or rotate, or scale an object = transform an object.
      - +

      Every JME3 application has a rootNode: Your game automatically inherits the rootNode object from SimpleApplication. Everything attached to the rootNode is part of the scene graph. The elements of the scene graph are Spatials. @@ -153,9 +155,9 @@ Every JME3 application has a rootNode: Your game automatically inherits the Examples: A box, a sphere, a player, a building, a piece of terrain, a vehicle, missiles, NPCs, etc… The rootNode, a floor node grouping several terrains, a custom vehicle-with-passengers node, a player-with-weapon node, an audio node, etc… - + - +

      Understanding the Code

      @@ -169,18 +171,19 @@ What happens in the code snippet? You use the simpleInitApp() metho
      • Create a Box shape with a radius of (1,1,1), that makes the box 2x2x2 world units big.
      • -
      • Position the box at (1,-1,1).
        +
      • Position the box at (1,-1,1) using the move() method. (Don't change the Vector3f.ZERO unless you want to change the center of rotation)
      • Wrap the Box shape into a Geometry.
      • Create a blue material.
      • -
      • Apply the blue material to the Box Geometry.
            Box box1 = new Box( new Vector3f(1,-1,1), 1,1,1);
        +
      • Apply the blue material to the Box Geometry.
            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.setMaterial(mat1); + blue.move(1,-1,1);
      @@ -195,12 +198,13 @@ What happens in the code snippet? You use the simpleInitApp() metho
    • Create a red material.
    • -
    • Apply the red material to the Box Geometry.
          Box box2 = new Box( new Vector3f(1,3,1), 1,1,1);
      +
    • Apply the red material to the Box Geometry.
          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.setMaterial(mat2); + red.move(1,3,1);
    • @@ -241,7 +245,7 @@ If you run the app with only the code up to here, you see two cubes: A red cube
      - +

      What is a Pivot Node?

      @@ -260,7 +264,7 @@ You can transform (e.g. rotate) Geometries around their own center, or around a
      - +

      How do I Populate the Scenegraph?

      @@ -268,8 +272,8 @@ You can transform (e.g. rotate) Geometries around their own center, or around a -
      Task…? Solution!
      Create a Spatial Create a shape, wrap it into a Geometry, and give it a Material. For example:
      Box mesh = new Box(Vector3f.ZERO, 1, 1, 1);
      -Geometry thing = new Geometry("thing", mesh);
      +		
      Create a Spatial Create a Mesh shape, wrap it into a Geometry, and give it a Material. For example:
      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);
      @@ -294,9 +298,9 @@ thing.setMaterial(mat);
      Specify what should be loaded at the start Everything you initialize and attach to the rootNode in the simpleInitApp() method is part of the scene at the start of the game.
      - +
      - +

      How do I Transform Spatials?

      @@ -320,7 +324,7 @@ To move a Spatial to specific coordinates, such as (0,40.2f,-2), use: < +right -left+up -down+forward -backward
      -
      +
      @@ -332,25 +336,25 @@ To scale a Spatial 10 times longer, one tenth the height, and keep the same widt
      Scaling resizes Spatials X-axis Y-axis Z-axis
      lengthheightwidth
      -
      +
      -
      Rotation turns Spatials X-axis Y-axis Z-axis
      3-D rotation is a bit tricky (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.
      +
      3-D rotation is a bit tricky (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:
      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 quaternions, a data structure that can combine and store rotations efficiently. + Tip: If your game idea calls for a serious amount of rotations, it is worth looking into quaternions, a data structure that can combine and store rotations efficiently.

      thing.setLocalRotation( 
         new Quaternion().fromAngleAxis(180*FastMath.DEG_TO_RAD, new Vector3f(1,0,0)));
      pitch = nodding your headyaw = shaking your headroll = cocking your head
      - + - +

      How do I Troubleshoot Spatials?

      @@ -371,17 +375,18 @@ Is it to tiny or too gigantic to see?
      Is it too far from the camera? (Try (111111f); to see further) - A Spatial rotates in unexpected ways. Did you use radian values, and not degrees? (If you used degrees, multiply them with FastMath.DEG_TO_RAD to convert them to radians)
      -Did you rotate around the intended pivot node or something else?
      + A Spatial rotates in unexpected ways. Did you use radian values, and not degrees? (If you used degrees, multiply them with FastMath.DEG_TO_RAD to convert them to radians)
      +Did you create the Spatial at the origin (Vector.ZERO) before moving it?
      +Did you rotate around the intended pivot node or around something else?
      Did you rotate around the right axis? A Geometry has an unexpected Color or Material. Did you reuse a Material from another Geometry and have inadvertently changed its properties? (If so, consider cloning it: mat2 = mat.clone(); )
      - + - +

      How do I Add Custom Data to Spatials?

      @@ -414,7 +419,7 @@ By using different Strings keys (here the key is pivot id), you can

      - +

      Conclusion

      @@ -432,9 +437,13 @@ Since standard shapes like spheres and boxes get old fast, continue with the nex node, intro, documentation, - color + color, + spatial, + geometry, + scenegraph, + mesh
      - +

      view online version

      \ No newline at end of file diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_terrain.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_terrain.html index 7c6a26cf3..ca28951e1 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_terrain.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/beginner/hello_terrain.html @@ -263,11 +263,11 @@ Before you can start painting, you have to make a few decisions:
    • You "paint" three texture layers by using three colors: Red, blue and, green. You arbitrarily decide that…
        -
      1. … everything red will be grass – red goes into layer Tex1
        +
      2. Red is grass – red is layer Tex1, so put the grass texture into Tex1.
      3. -
      4. … everything green will be dirt – green goes into layer Tex2
        +
      5. Green is dirt – green is layer Tex2, so put the dirt texture into Tex2.
      6. -
      7. … everything blue will be roads – blue goes into layer Tex3
        +
      8. Blue is roads – blue is layer Tex3, so put the roads texture into Tex3.
    • @@ -301,7 +301,7 @@ Now you start painting the texture:

      - +

      Looking at the Texturing Code

      @@ -357,7 +357,7 @@ Use setWrap(WrapMode.Repeat) to make the small texture fill the wid

      - +

      What is a Terrain?

      @@ -395,7 +395,7 @@ Create a TerrainQuad with the following arguments:
      - +

      Looking at the Terrain Code

      @@ -430,7 +430,7 @@ You have created the terrain object.

      - +

      What is LOD (Level of Detail)?

      @@ -446,12 +446,12 @@ Close parts of the terrain are rendered in full detail. Terrain parts that are f

      - +

      Exercises

      - +

      Exercise 1: Texture Layers

      @@ -470,7 +470,7 @@ You see it's easier to swap layers in the code, than to change the colors i

      - +

      Exercise 2: Randomized Terrains

      @@ -531,7 +531,7 @@ You see the variety of hilly landscapes that can be generated using this method.

      - +

      Exercise 3: Solid Terrains

      @@ -541,7 +541,7 @@ Can you combine what you learned here and in +

      Conclusion

      @@ -572,5 +572,5 @@ See also:
      - +

      view online version

      \ No newline at end of file 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 index 2e0488d6d..4f6487255 100644 --- 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 @@ -59,7 +59,7 @@ To export an animated model in Blender make sure the following conditions are me

        -
      1. The animation bas to be a bone animation
        +
      2. The animation has to be a bone animation
      3. 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 / Scale.
      4. 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 2c5df4dd7..1882f8e59 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 @@ -99,11 +99,23 @@ Make sure to only load() models converted to .j3o binary format, not the origina +

        What is java.lang.LinkageError: Version mismatch?

        +
        + +

        +This rare exception shows a message similar to the following: Exception in thread "LWJGL Renderer Thread" java.lang.LinkageError: Version mismatch: jar version is (number), native library version is (another number). jME3 needs native libraries (.dll, .jnilib, lib*.so files) to run LWJGL and jBullet. The correct versions of these libraries are included when you install the SDK or download the binaries. However there are circumstances where jME3 cannot determine which copy of the native library it should use:
        +If you install another application that needs a different version of a native library, and this app globally installs its version over jME3's; or if an old copy of a native library is in your project directory, your home directory, or Java library path, or in the classpath; or if you permanently linked an old copy in your IDE's settings; then Java assumes you prefer these native libraries over the bundled ones, and your jME3 application ends up running with the wrong version.
        +To fix this, search for .dll (Windows), .jnilib (Mac), and .so (Linux) files for jBullet and LWJGL on your harddrive and in your path and IDE settings, and verify they don't interfere. (If you have other jME versions installed and linked somehow, the outdated natives may also be in a lwjgl.jar or jbullet.jar file!) + +

        + +
        +

        I want to load my scene

        - +

        How do I make objects appear / disappear in the 3D scene?

        @@ -128,7 +140,7 @@ Optionally, you can control whether the engine culls an object always or never.

        - +

        Why do I get AssetNotFoundException when loading X ?

        @@ -154,7 +166,7 @@ this.assetManager.registerLocator("town.zip", ZipLocator.class)

        - +

        How do I Create 3-D models, textures, sounds?

        @@ -162,7 +174,7 @@ this.assetManager.registerLocator("town.zip", ZipLocator.class) Follow our best practices for the multi-media asset pipeline.
        You create 3-D models in a 3-D mesh editor, for example Blender, and export it in Ogre Mesh XML (animated objects, scenes) or Wavefront OBJ format (static objects, scenes). -You create textures in a graphic editor, for exmaple Gimp, and export them as PNG or JPG. +You create textures in a graphic editor, for example Gimp, and export them as PNG or JPG. You create sounds in an audio editor, for example, Audacity, and export them as WAVE or OGG.
        Learn more: 3D Models, Multi-Media Asset Pipeline, JME3's blend-to-j3o importer;
        @@ -170,7 +182,7 @@ You create sounds in an audio editor, for example, Audacity, and export them as

        - +

        How do I load a 3-D model into the scene?

        @@ -190,7 +202,7 @@ Spatial ninja = assetManager.loadModel("Models/Ninja/Ninja.j3o"

        - +

        How do initialize the scene?

        @@ -201,12 +213,12 @@ Use the simpleInitApp() method in SimpleApplication (or initApp() in Application

        - +

        I want to transform objects in the scene

        - +

        How do I move or turn or resize a spatial?

        @@ -222,7 +234,7 @@ To move or turn or resize a spatial you use transformations. You can concatenate

        - +

        How do I make a spatial move by itself?

        @@ -235,7 +247,7 @@ Change the geometry's translation (position) live in the update loop using

        - +

        How do I access a named sub-mesh in Model?

        Geometry result = spatial.getName().startsWith(name);
        @@ -246,7 +258,7 @@ Change the geometry's translation (position) live in the update loop using

        - +

        How do I make procedural or custom shapes?

        @@ -257,12 +269,12 @@ You can programmatically create com.jme3.scene.Mesh'es.

        - +

        I want to change the surface of objects in the scene

        - +

        Why is my UV wrapping / texture appearance all wrong?

        @@ -280,7 +292,7 @@ You can set the boolean value in the constructor of TextureKey to flipped or not
          material.setTexture("ColorMap", this.assetManager.loadTexture(new TextureKey("myTexture.jpg", false)));
        - +

        How do I scale, mirror, or wrap a texture?

        @@ -298,7 +310,7 @@ You can choose among various com.jme3.texture.Texture.WrapModes for
        material.getTextureParam("DiffuseMap").getTextureValue().setWrap(WrapMode.Repeat);
        - +

        How do I change color or shininess of an material?

        @@ -311,7 +323,7 @@ Use the AssetManager to load Materials, and change material settings.

        - +

        How do I make a surface wood, stone, metal, etc?

        @@ -324,7 +336,7 @@ Create Textures as image files. Use the AssetManager to load a Material and use

        - +

        Why are materials too bright, too dark, or flickering?

        @@ -333,7 +345,7 @@ If you use a lit material (based on Lighting.j3md) then you must attach a light

        - +

        How do I make geometries cast a shadow?

        @@ -346,7 +358,7 @@ Use com.jme3.shadow.BasicShadowRenderer together with com.jme3.light.Directional

        - +

        How do I make materials transparent?

        @@ -362,7 +374,7 @@ Assign a texture with an alpha channel to a Material and set the Material's

        - +

        How do I force or disable backface culling?

        @@ -373,7 +385,7 @@ You can switch the com.jme3.material.RenderState.FaceCullMode to Back, Front, Fr
        material.getAdditionalRenderState().setFaceCullMode(FaceCullMode.FrontAndBack);
        - +

        Can I draw only an outline of the scene?

        @@ -389,12 +401,12 @@ Create a material and switch its renders state to wireframe.

        - +

        I want to control the camera

        - +

        How do I switch between third-person and first-person view ?

        @@ -416,18 +428,18 @@ chaseCam = new ChaseCamera(cam, spatial, inputManager);
        - +

        How do I increase camera speed?

        flyCam.setMoveSpeed(50f);
        - +

        Actions, Interactions, Physics

        - +

        How do I implement game logic / game mechanics?

        @@ -438,7 +450,7 @@ Use Controls to define the behaviour of types of Spatials. Use Application State

        - +

        How do I let players interact via keyboard?

        @@ -449,7 +461,7 @@ Use com.jme3.input.KeyInput and a Input Listener.

        - +

        How do I let players interact by clicking?

        @@ -462,7 +474,7 @@ Players typically click the mouse to pick up objects, to open doors, to shoot a

        - +

        How do I animate characters?

        @@ -475,7 +487,7 @@ Create an animated OgreMesh model with bones in a 3-D mesh editor (e.g. Blender)

        - +

        How do I keep players from falling through walls and floors?

        @@ -486,7 +498,7 @@ Use collision detection. The most common solution is to use jme's physics i

        - +

        How do I make balls/wheels/etc bounce and roll?

        @@ -499,7 +511,7 @@ Add physics controls to Spatials and give them spherical or cylindrical bounding

        - +

        How do I debug weird Physics behaviour?

        @@ -509,7 +521,7 @@ Maybe your collision shapes overlap – or they are not where you think they are
        bulletAppState.getPhysicsSpace().enableDebug(assetManager);
        - +

        How do I make a walking character?

        @@ -522,7 +534,7 @@ Code samples: +

        How do I steer vehicles?

        @@ -535,7 +547,7 @@ Code samples: +

        Can objects swing like a pendulums, chains, ropebridges?

        @@ -547,12 +559,12 @@ Use a PhysicsControl's hinges and joints.

        - +

        Default GUI Display

        - +

        What are these FPS/Objects/Vertices/Triangles statistics?

        @@ -564,7 +576,7 @@ At the bottom left of every default SimpleGame, you see the +

        How do I get rid of the FPS/Objects statistics?

        @@ -583,7 +595,7 @@ setDisplayStatView(false); // to hide the statistics

        - +

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

        @@ -596,7 +608,7 @@ Attach text and pictures to the orthogonal guiNode to create a head

        - +

        How do I display buttons and UI controls?

        @@ -609,7 +621,7 @@ Sample Code: +

        How do i display a loading screen?

        @@ -620,12 +632,12 @@ Instead of having a frozen frame while your games loads, you can have a loading

        - +

        Nifty GUI

        - +

        I get NoSuchElementException when adding controls (buttons etc)!

        @@ -636,7 +648,7 @@ Verify that you include a controls definition file link in your +

        Where can I find example code of Nifty GUI's XML and Java classes?

        @@ -645,7 +657,7 @@ Verify that you include a controls definition file link in your +

        Is there Java Doc for Nifty GUI?

        @@ -654,12 +666,12 @@ Verify that you include a controls definition file link in your +

        I want to create an environment with sounds, effects, and landscapes

        - +

        How do I play sounds and noises?

        @@ -672,7 +684,7 @@ Use AudioRenderer, Listener, and AudioNode from com.jme3.audio.*.

        - +

        How do I make fire, smoke, explosions, swarms, magic spells?

        @@ -685,7 +697,7 @@ For swarm like effects you use particle emitters.

        - +

        How do I make water, waves, reflections?

        @@ -698,7 +710,7 @@ Use a special post-processor renderer from com.jme3.water.*.

        - +

        How do I make fog, bloom, blur, light scrattering?

        @@ -709,7 +721,7 @@ Use special post-processor renderers from com.jme3.post.*.

        - +

        How do I generate a terrain?

        @@ -722,7 +734,7 @@ Use com.jme3.terrain.*. The JMonkeyEngine also provides you with a Terrain Edito

        - +

        How do I make a sky?

        @@ -740,12 +752,12 @@ skyGeo.setQueueBucket(Bucket.Sky)

        - +

        I want to access to back-end properties

        - +

        How do I read out graphic card capabilities?

        @@ -802,7 +814,7 @@ FloatColorBuffer, FloatDepthBuffer, PackedFloatTexture, SharedExponentTexture, P TextureCompressionLATC, NonPowerOfTwoTextures, MeshInstancing]
        - +

        How do I optimize the heck out of the Scene Graph?

        @@ -819,7 +831,7 @@ Batching means that all Geometries with the same Material are combined into one

        - +

        How do I prevent users from unzipping my JAR?

        @@ -829,12 +841,12 @@ Add an - +

        I want to do maths

        - +

        What does addLocal() / multLocal() etc mean?

        @@ -887,7 +899,7 @@ Many maths functions (mult(), add(), subtract(), etc) come as local and a non-lo
        - +

        What is the difference between World and Local coordinates?

        @@ -897,7 +909,7 @@ World coordinates of a Spatial are its absolute coordinates in the 3D scene (thi

        - +

        How do I convert Degrees to Radians?

        @@ -911,5 +923,5 @@ Multiply degree value by FastMath.DEG_TO_RAD to convert it to radians.
        - +

        view online version

        \ No newline at end of file diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/best_practices.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/best_practices.html index f374c36f3..81b3996cb 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/best_practices.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/best_practices.html @@ -35,7 +35,7 @@ As a quick overview, answer yourself the following questions:
        • Sum up your game idea in one sentence. If you can't, it's too complicated.
        • -
        • Who's the target group? Why would they choose your game over the million others that exist?
          +
        • Who's the target group? Are you making it for yourself or are you trying to attract the masses?
        @@ -51,7 +51,7 @@ As a quick overview, answer yourself the following questions:
      5. Gameplay
          -
        • What is the start state, what is the end state?
          +
        • What is the start state, what is the end state (if any)?
        • What resources does the player manage? How are resources gained, transformed, spent?
          E.g. speed, gold, health, "points".
          @@ -82,7 +82,7 @@ E.g. models, terrains; materials, textures; noises, music, voices; video, cutsce
        - +

        Planning Development Milestones

        @@ -144,7 +144,7 @@ How you name or number these stages is fully up to your team. Development teams

        - +

        Use File Version Control

        @@ -163,7 +163,7 @@ If you don't know which to choose, Subversion is a good choice for starters
        - +

        Multi-Media Asset Pipeline

        @@ -189,14 +189,14 @@ If you don't know which to choose, Subversion is a good choice for starters
        Convert Models to j3o format. Move j3o files into assets/Models. Don't reference Blender/Ogre/OBJ files in your load() code, because these unoptimized files are not packaged into the JAR.
        - +

        Learn details about the Multi-Media Asset Pipeline here.

        - +

        Development Phase

        @@ -208,7 +208,7 @@ Even for large experienced game producers, the creation of such a complex game i

        - +

        Extend SimpleApplication

        @@ -227,7 +227,7 @@ For your future game releases, you will want to rely on your own base framework:

        - +

        Where to Start?

        @@ -255,7 +255,7 @@ You have a list of features that you want in game, but which one do you implemen

        - +

        The Smart Way to Add Custom Methods and Fields

        @@ -279,7 +279,7 @@ Game entities (Nodes and Geometrys) often carry custom
        - +

        The Smart Way to Access Game Features

        @@ -297,7 +297,7 @@ An AppState has access to all game features in the SimpleApplication via the
        - +

        The Smart Way to Implement Game Logic

        @@ -359,7 +359,7 @@ Read all about +

        Optimize Application Performance

          @@ -372,7 +372,7 @@ Read all about +

          Don't Mess With Geometric State

          @@ -390,7 +390,7 @@ Read all about +

          Maintain Internal Documentation

          @@ -413,7 +413,7 @@ Treat javadoc as messages to your future self. "genNextVal() generates the

          - +

          Debugging and Test Phase

          @@ -439,12 +439,12 @@ Treat javadoc as messages to your future self. "genNextVal() generates the

          - +

          Release Phase

          - +

          Pre-Release To-Do List

            @@ -469,7 +469,7 @@ Treat javadoc as messages to your future self. "genNextVal() generates the
          - +

          Distributing the Executables

          @@ -507,7 +507,7 @@ Decide whether you want to release your game as WebStart, desktop JAR, mobile AP (.APK)Game runs on Android devices.Android devices do not support post-procesor effects.
          - +

          Which ever method you choose, a Java-Application works on the main operating systems: Windows, Mac OS, Linux, Android. @@ -519,5 +519,5 @@ The distribution appears in a newly generated dist directory inside

          - +

          view online version

          \ No newline at end of file diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/how_to_use_materials.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/how_to_use_materials.html index 2cd9a979e..d67a1f069 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/how_to_use_materials.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/how_to_use_materials.html @@ -193,7 +193,7 @@ Shininess is a float value between 1 (rough surface with blurry shininess) and 1
      6. Specify the Specular and Diffuse colors of the shiny spot.
        -The ColorRGBA value of the light source, often RGBA.White.
        mat.setColor("Specular",ColorRGBA.White);
        +Typically you set Specular to the ColorRGBA value of the light source, often RGBA.White.
        mat.setColor("Specular",ColorRGBA.White);
         mat.setColor("Diffuse",ColorRGBA.White);
      7. @@ -208,13 +208,13 @@ You optionally hand-draw this grayscale texture to outline in detail where the s To deactivate shininess

          -
        • Set the Specular color to ColorRGBA.Black. Do not just set Shininess to 0.
          mat.setFloat("Shininess", 0f);
          +
        • Set the Specular color to ColorRGBA.Black. Do not just set Shininess to 0.
          mat.setColor("Specular",ColorRGBA.Black);
        - +

        (Optional) Glow

        @@ -255,7 +255,7 @@ Learn more about +

        (Optional) Transparent

        @@ -326,7 +326,7 @@ getAdditionalRenderState().setAlphaFallOff(0.5f);Enables Alpha Testing Deactivate Alpha Testing for gradually translucent objects, such as colored glass, smoked glass, ghosts.
        - +

        It is possible to load a DiffuseMap texture that has an Alpha channel, and combine it with an underlying Material Color. @@ -339,7 +339,7 @@ Deactivate Alpha Testing for gradually translucent objects, suc

        - +

        (Optional) Wireframe

        @@ -356,7 +356,7 @@ Additionally to the above settings, you can switch off and on a wireframe render getAdditionalRenderState().setWireframe(true);Switch to showing the (textured) Material in wireframe mode. The wireframe optionally uses the Material's Color value.Use wireframes to debug meshes, or for a "matrix" or "holodeck" effect.
        -
        +
        material, texture, effect, @@ -366,5 +366,5 @@ Additionally to the above settings, you can switch off and on a wireframe render
        - +

        view online version

        \ No newline at end of file diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/math.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/math.html index 1c90d9e77..c2c4a9666 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/math.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/intermediate/math.html @@ -2,13 +2,8 @@

        Math Cheat Sheet

        -

        -Just some math notes to myself… - -

        -
        - +

        Formulas

        @@ -57,7 +52,7 @@ new Quaternion qQuaternion q = new Quaternion();
        q.lookAt(v,up)
        -
        +
        @@ -105,28 +100,20 @@ x and z coordinates
        I have…I want…Formula
        float x = FastMath.cos(phi)*r;
        float z = FastMath.sin(phi)*r;
        - +
        - +

        Local vs Non-local methods?

        - -

        -v2 = v.mult(); v2 = v.add(); v2 = v.subtract(); etc -

          -
        • Creates new object as return value, v is unchanged.
          +
        • Non-local method creates new object as return value, v remains unchanged.
          +v2 = v.mult(); v2 = v.add(); v2 = v.subtract(); etc
        • -
        - -

        -v.multLocal(); v.addLocal(); v.subtractLocal(); etc -

        -
          -
        • Changes v.
          +
        • Local method changes v directly!
          +v.multLocal(); v.addLocal(); v.subtractLocal(); etc
        - +

        view online version

        \ No newline at end of file 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 index d195bde7f..fec41c259 100644 --- 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 @@ -26,26 +26,26 @@ Assets are files that are not code. Your multi-media assets includes, for exampl 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. + Create 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. + Only use Diffuse Map, Normal Map, Glow Map, Specular Map in your models' materials. 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. + Convert original models to JME3's .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 automatically packaged into the final JAR. - +

        Read on for details.

        - +

        Use The Assets Folder

        @@ -102,7 +102,7 @@ See also:
        - +

        Create Textures and Materials

        @@ -128,12 +128,13 @@ Install a graphic editor such as Gimp or Photoshop. Consult the graphic

        -

        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. +

        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 will have to do manual refactoring (just as for Java package name changes): You will need to re-export all affected models, regenerate all affected .j3o files, and manually update all affected paths in your code.

        - +

        Create 3D Models

        -
      8. 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.
        +
      9. Unwrap the model in the 3D editor 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.
      10. @@ -177,7 +178,7 @@ See also:

        - +

        Convert 3D Models to .j3o Format

        @@ -226,11 +227,25 @@ Use the jMonkeyEngine SceneComposer to add these properties.

        -

        -See also: Model Loader and Viewer - -

        + + +

        See Also

        + - +

        view online version

        \ No newline at end of file diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/math.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/math.html index a4fab26dd..e6dd3e7fd 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/math.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/math.html @@ -4,7 +4,7 @@

        -It's a fact of life, math is hard. Unfortunately, 3D graphics require a fair bit of knowledge about the subject. Fortunately, jME is able to hide the majority of the details away from the user. Vectors are the fundamental type in the 3D environment, and it is used extensively. Matrices are also a basic necessity of 3D for representing linear systems. Quaternions are perhaps the most complicated of the basic types and are used for rotation in jME. +It's a fact of life, math is hard. Unfortunately, 3D graphics require a fair bit of knowledge about the subject. Fortunately, jME is able to hide the majority of the details away from the user. Vectors are the fundamental type in the 3D environment, and it is used extensively. Matrices are also a basic necessity of 3D for representing linear systems. Quaternions are perhaps the most powerful and complicated of the basic types and are used for rotation in jME.

        @@ -16,12 +16,12 @@ To get a visual introduction to math in jME3 for the absolute beginner, check ou

        - +

        Coordinate System

        - +

        Definition

        @@ -43,7 +43,7 @@ The definition of a coordinate system is defined in jME by the properties sent t

        - +

        Transformations

        @@ -53,7 +53,7 @@ Transformations define an operation that converts points from one coordinate sys

        - +

        Visibility Determination

        @@ -63,17 +63,17 @@ Visibility Determination concerns itself with minimizing the amount of data that

        - +

        Fundamental Types

        - +

        ColorRGBA

        - +

        Definition

        @@ -87,7 +87,7 @@ ColorRGBA defines a color value in the jME library. The color value is made of t

        - +

        jME Class

        @@ -109,25 +109,25 @@ ColorRGBA will also handle interpolation between two colors. Given a second colo

        - +

        Matrix

        -See
        +See
        -and +and

        - +

        Definition

        -A Matrix is typically used as a linear transformation to map vectors to vectors. That is: Y = MX where X is a Vector and M is a Matrix applying any or all transformations (scale, rotate, translate). +A Matrix is typically used as a linear transformation to map vectors to vectors. That is: Y = MX where X is a Vector and M is a Matrix applying any or all transformations (scale, rotate, translate).

        @@ -148,7 +148,7 @@ There are a few special matrices: 000

        - +

        The Identity Matrix is the matrix with 1 on the diagonal entries and 0 for all other entries. @@ -164,7 +164,7 @@ The Identity Matrix is the matrix with 1 on the diagonal entries and 0 001 - +

        A Matrix is invertible if there is a matrix M-1 where MM-1 = M-1M = I. @@ -185,7 +185,7 @@ The transpose of a matrix M = [mij] is MT< 333 123 - +

        A Matrix is symmetric if M = MT. @@ -201,7 +201,7 @@ A Matrix is symmetric if M = MT. BCX - +

        Where X, A, B, and C equal numbers

        @@ -211,7 +211,7 @@ jME includes two types of Matrix classes: Matrix3f and Matrix4f. Matrix3f is a 3

        - +

        Transformations

        @@ -251,7 +251,7 @@ A rotation matrix requires that the transpose and inverse are the same u1-u00
        - +

        Translation

        @@ -270,14 +270,14 @@ Translation requires a 4x4 matrix, where the vector (x,y,z) is mapped to (x,y,z, ST1 - +

        where M is the 3x3 matrix (containing any rotation/scale information), T is the translation vector and ST is the transpose Vector of T. 1 is just a constant.

        - +

        jME Class

        @@ -291,19 +291,19 @@ Most methods are straight forward, and I will leave documentation to the Javadoc

        - +

        Vector

        -See
        +See
        -and +and

        - +

        Definition

        @@ -321,7 +321,7 @@ We have two Vectors (2f and 3f) meaning we have tuples of 2 float values or 3 fl

        - +

        Operations

        @@ -411,17 +411,17 @@ Vector3f and Vector2f store their values (x, y, z) and (x, y) respectively as fl

        - +

        Quaternion

        -See +See

        - +

        Definition

        @@ -431,11 +431,11 @@ Quaternions define a subset of a hypercomplex number system. Quaternions are def

        -Additional benefits of the Quaternion is reducing the chance of Gimbal Lock and allowing for easily interpolation between two rotations (spherical linear interpolation or slerp). +Additional benefits of the Quaternion is reducing the chance of and allowing for easily interpolation between two rotations (spherical linear interpolation or slerp).

        -While Quaternions are quite difficult to fully understand, there are an exceeding number of convenience methods to allow you to use them without having to understand the math behind it. Basically, these methods involve nothing more than setting the Quaternion's x,y,z,w values using other means of representing rotations. The Quaternion is then contained in Spatial as its local rotation component. +While Quaternions are quite difficult to fully understand, there are an exceeding number of convenience methods to allow you to use them without having to understand the math behind it. Basically, these methods involve nothing more than setting the Quaternion's x,y,z,w values using other means of representing rotations. The Quaternion is then contained in the Spatial as its local rotation component.

        @@ -485,13 +485,13 @@ These basic operations allow us to convert various rotation representations to Q

        - +

        Angle Axis

        -You might wish to represent your rotations as Angle Axis pairs. That is, you define a axis of rotation and the angle with which to rotate about this axis. Quaternion defines a method fromAngleAxis (and fromAngleNormalAxis) to create a Quaternion from this pair. This is acutally used quite a bit in jME demos to continually rotate objects. You can also obtain a Angle Axis rotation from an existing Quaternion using toAngleAxis. +You might wish to represent your rotations as Angle Axis pairs. That is, you define a axis of rotation and the angle with which to rotate about this axis. Quaternion defines a method fromAngleAxis (and fromAngleNormalAxis) to create a Quaternion from this pair. This is acutally used quite a bit in jME demos to continually rotate objects. You can also obtain a Angle Axis rotation from an existing Quaternion using toAngleAxis.

        @@ -505,7 +505,7 @@ float angle = 3.14f; s.getLocalRotation().fromAngleAxis(angle, axis); - +

        Three Angles

        @@ -523,13 +523,13 @@ float[] angles = {1, 3, 0}; s.getLocalRotation().fromAngles(angles);
        - +

        Three Axes

        -If you have three axes that define your rotation, where the axes define the left axis, up axis and directional axis respectively) you can make use of fromAxes to generate the Quaternion. It should be noted that this will generate a new Matrix object that is then garbage collected, thus, this method should not be used if it will be called many times. Again, toAxes will populate a Vector3f array. +If you have three axes that define your rotation, where the axes define the left axis, up axis and directional axis respectively) you can make use of fromAxes to generate the Quaternion. It should be noted that this will generate a new Matrix object that is then garbage collected, thus, this method should not be used if it will be called many times. Again, toAxes will populate a Vector3f array.

        @@ -545,7 +545,7 @@ axes[2] = new Vector3f(0, 0.5f, 0.5f); //dir s.getLocalRotation().fromAxes(axes); - +

        Rotation Matrix

        @@ -570,7 +570,7 @@ As you can see there are many ways to build a Quaternion. This allows you to wor

        - +

        Slerp

        @@ -590,7 +590,7 @@ Quaternion q2; Quaternion q3 = q1.slerp(q2, 0.5f);
        - +

        Multiplication

        @@ -608,7 +608,7 @@ Vector3f myVector = new Vector3f(0,0,-1); myRotation.multLocal(myVector);
        - +

        Utility Classes

        @@ -618,17 +618,17 @@ Along with the base Math classes, jME provides a number of Math classes to make

        - +

        Fast Math

        -See +See

        - +

        Definition

        @@ -638,7 +638,7 @@ FastMath provides a number of convience methods, and where possible faster versi

        - +

        Usage

        @@ -729,17 +729,17 @@ There are five major categories of functions that FastMath provides.
        - +

        Line

        -See +See

        - +

        Definition

        @@ -749,7 +749,7 @@ A line is a straight one-dimensional figure having no thickness and extending in

        - +

        Usage

        @@ -763,24 +763,24 @@ jME defines a Line class that is defined by an origin and direction. In reality,

        - +

        Example 1 - Find a Random Point on a Line

        Line l = new Line(new Vector3f(0,1,0), new Vector3f(3,2,1));
         Vector3f randomPoint = l.random();
        - +

        Plane

        -See +See

        - +

        Definition

        @@ -814,7 +814,7 @@ This gives us the general equation: (ax + by + cz + d = 0)

        - +

        Usage in jME

        @@ -846,7 +846,7 @@ These values are returned on a call to whichSide.

        - +

        Example 1 - Determining if a Point is On the Positive Side of a Plane

        Vector3f normal = new Vector3f(0,1,0);
        @@ -860,7 +860,7 @@ if(side == Plane.NO_SIDE) {
         }
        - +

        Example 2 - For the Layperson

        @@ -932,17 +932,17 @@ public class TestPlanes }
        - +

        Ray

        -See +See

        - +

        Definition

        @@ -956,23 +956,23 @@ This Ray is used extensively in jME for +

        Example 1 - Create a Ray That Represents Where the Camera is Looking

        Ray ray = new Ray(cam.getLocation(), cam.getDirection());
        - +

        Rectangle

        -See +See

        - +

        Definition

        @@ -982,7 +982,7 @@ Rectangle defines a finite plane within three dimensional space that is specifie

        - +

        jME Usage

        @@ -992,7 +992,7 @@ Rectangle is a straight forward data class that simply maintains values that def

        - +

        Example 1 : Define a Rectangle and Get a Point From It

        Vector3f v1 = new Vector3f(1,0,0);
        @@ -1002,17 +1002,17 @@ Rectangle r = new Rectangle(v1, v2, v3);
         Vector3f point = r.random();
        - +

        Triangle

        -See +See

        - +

        Definition

        @@ -1022,7 +1022,7 @@ A triangle is a 3-sided polygon. Every triangle has three sides and three angles

        - +

        Usage

        @@ -1032,7 +1032,7 @@ jME's Triangle class is a simple data class. It contains three +

        Example 1 - Creating a Triangle

        //the three points that make up the triangle
        @@ -1042,12 +1042,12 @@ Vector3f p3 = new Vector3f(0,1,1);
         Triangle t = new Triangle(p1, p2, p3);
        - +

        Tips and Tricks

        - +

        How do I get height/width of a spatial?

        @@ -1062,11 +1062,22 @@ float y = ( (BoundingBox)spatial.getWorldBound()).getYEx float z = ( (BoundingBox)spatial.getWorldBound()).getZExtent();
        - +

        How do I position the center of a Geomtry?

        geo.center().move(pos);
        - + +

        See Also

        +
        + + +
        +

        view online version

        \ No newline at end of file diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/the_scene_graph.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/the_scene_graph.html index 079177fe6..18f2c45a3 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/the_scene_graph.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/jme3/the_scene_graph.html @@ -124,9 +124,15 @@ Before you start creating your game, you should have completed the intermediate and advanced documentation gives you more details on how to put all the parts together to create an awesome Java 3D game! - +The intermediate and advanced documentation gives you more details on how to put all the parts together to create an awesome 3D game in Java!

        +
        diff --git a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/development/extension_library.html b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/development/extension_library.html index 71310b2d2..ea4a72f32 100644 --- a/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/development/extension_library.html +++ b/sdk/jme3-core/javahelp/com/jme3/gde/core/docs/sdk/development/extension_library.html @@ -69,7 +69,7 @@ You will notice a new file "MyLibrary.xml" is created in the plugins b

        -After you are done, you can contribute the plugin in the jMonkeyEngine SDK contribution update center. +After you are done, you can contribute the plugin in the jMonkeyEngine SDK contribution update center.