diff --git a/common.gradle b/common.gradle index 91d4ab204..eee3320ba 100644 --- a/common.gradle +++ b/common.gradle @@ -5,9 +5,6 @@ apply plugin: 'java' apply plugin: 'maven' -//String jmeVersion = '3.0.10' -//String jmeVersion = rootProject.version; - String mavenGroupId = 'com.jme3' String mavenVersion = jmeVersion + '-' + jmeVersionTag //'-SNAPSHOT' @@ -19,9 +16,6 @@ repositories { maven{ url "http://nifty-gui.sourceforge.net/nifty-maven-repo" } - // You may define additional repositories, or even remove "mavenCentral()". - // Read more about repositories here: - // http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:repositories } dependencies { @@ -34,21 +28,17 @@ String mavenArtifactId = name group = mavenGroupId version = mavenVersion -//jar.doFirst{ -// manifest { -// attributes('Manifest-Version' : '1.0', -// 'Created-By' : vendor, -// 'Specification-Title' : appName, -// 'Specification-Version' : version, -// 'Specification-Vendor' : vendor, -// 'Implementation-Title' : appName, -// 'Implementation-Version' : version, -// 'Implementation-Vendor' : vendor, -// 'Main-Class' : getProperty('mainClass'), -// 'Class-Path' : configurations.compile.collect { 'lib/' + it.getName() }.join(' ') -// ) -// } -//} +javadoc { + failOnError = false + options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED + options.docTitle = "jMonkeyEngine ${jmeMainVersion} ${project.name} Javadoc" + options.windowTitle = "jMonkeyEngine ${jmeMainVersion} ${project.name} Javadoc" + options.header = "jMonkeyEngine ${jmeMainVersion} ${project.name}" + options.author = "true" + options.use = "true" + //disable doclint for JDK8, more quiet output + options.addStringOption('Xdoclint:none', '-quiet') +} task sourcesJar(type: Jar, dependsOn: classes, description: 'Creates a jar from the source files.') { classifier = 'sources' @@ -63,7 +53,9 @@ task javadocJar(type: Jar, dependsOn: javadoc, description: 'Creates a jar from artifacts { archives jar archives sourcesJar -// archives javadocJar + if(buildJavaDoc == "true"){ + archives javadocJar + } } configure(install.repositories.mavenInstaller) { diff --git a/gradle.properties b/gradle.properties index 80d3274f4..4d8b56aa7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,6 +5,9 @@ jmeMainVersion = 3.1 # Version addition pre-alpha-svn, Stable, Beta jmeVersionTag = snapshot-github +# specify if JavaDoc should be built +buildJavaDoc = true + # specify if SDK and Native libraries get built buildSdkProject = true buildNativeProjects = false diff --git a/jme3-bullet/src/common/java/com/jme3/bullet/control/CharacterControl.java b/jme3-bullet/src/common/java/com/jme3/bullet/control/CharacterControl.java index becdc7914..d521dbec7 100644 --- a/jme3-bullet/src/common/java/com/jme3/bullet/control/CharacterControl.java +++ b/jme3-bullet/src/common/java/com/jme3/bullet/control/CharacterControl.java @@ -47,10 +47,9 @@ import com.jme3.scene.control.Control; import java.io.IOException; /** - * @deprecated in favor of BetterCharacterControl + * You might want to try BetterCharacterControl as well. * @author normenhansen */ -@Deprecated public class CharacterControl extends PhysicsCharacter implements PhysicsControl { protected Spatial spatial; diff --git a/sdk/ant-jme/src/com/jme/ant/FixWikiLinks.java b/sdk/ant-jme/src/com/jme/ant/FixWikiLinks.java index 24b7e55c7..a2de023ef 100644 --- a/sdk/ant-jme/src/com/jme/ant/FixWikiLinks.java +++ b/sdk/ant-jme/src/com/jme/ant/FixWikiLinks.java @@ -31,16 +31,16 @@ public class FixWikiLinks extends Task { String line = rdr.readLine(); while (line != null) { //internal links - line = line.replaceAll("wiki/doku\\.php/([^>]*):([^>]*):([^>]*):([^>]*)\\?do=export_xhtmlbody", helpPath + "$1/$2/$3/$4.html"); - line = line.replaceAll("wiki/doku\\.php/([^>]*):([^>]*):([^>]*)\\?do=export_xhtmlbody", helpPath + "$1/$2/$3.html"); - line = line.replaceAll("wiki/doku\\.php/([^>]*):([^>]*)\\?do=export_xhtmlbody", helpPath + "$1/$2.html"); - line = line.replaceAll("wiki/doku\\.php/([^>]*)\\?do=export_xhtmlbody", helpPath + "$1.html"); + line = line.replaceAll("doku\\.php/([^>]*):([^>]*):([^>]*):([^>]*)\\?do=export_xhtmlbody", helpPath + "$1/$2/$3/$4.html"); + line = line.replaceAll("doku\\.php/([^>]*):([^>]*):([^>]*)\\?do=export_xhtmlbody", helpPath + "$1/$2/$3.html"); + line = line.replaceAll("doku\\.php/([^>]*):([^>]*)\\?do=export_xhtmlbody", helpPath + "$1/$2.html"); + line = line.replaceAll("doku\\.php/([^>]*)\\?do=export_xhtmlbody", helpPath + "$1.html"); //images - line = line.replaceAll("/wiki/lib/exe/fetch\\.php/([^>]*):([^>]*):([^>]*):([^>]*)\"", "nbdocs:/" + helpPath + "$1/$2/$3/$4\""); - line = line.replaceAll("/wiki/lib/exe/fetch\\.php/([^>]*):([^>]*):([^>]*)\"", "nbdocs:/" + helpPath + "$1/$2/$3\""); - line = line.replaceAll("/wiki/lib/exe/fetch\\.php/([^>]*):([^>]*)\"", "nbdocs:/" + helpPath + "$1/$2\""); - line = line.replaceAll("/wiki/lib/exe/fetch\\.php/([^>]*)\"", "nbdocs:/" + helpPath + "$1\""); -// line = line.replaceAll("/wiki/lib/exe/fetch\\.php?([^>]*)\"", "nbdocs:/" + helpPath + "external/$1\"").replaceAll("[_[^\\w\\däüö:ÄÜÖ\\/\\+\\-\\. ]]", "_"); + line = line.replaceAll("/lib/exe/fetch\\.php/([^>]*):([^>]*):([^>]*):([^>]*)\"", "nbdocs:/" + helpPath + "$1/$2/$3/$4\""); + line = line.replaceAll("/lib/exe/fetch\\.php/([^>]*):([^>]*):([^>]*)\"", "nbdocs:/" + helpPath + "$1/$2/$3\""); + line = line.replaceAll("/lib/exe/fetch\\.php/([^>]*):([^>]*)\"", "nbdocs:/" + helpPath + "$1/$2\""); + line = line.replaceAll("/lib/exe/fetch\\.php/([^>]*)\"", "nbdocs:/" + helpPath + "$1\""); +// line = line.replaceAll("/lib/exe/fetch\\.php?([^>]*)\"", "nbdocs:/" + helpPath + "external/$1\"").replaceAll("[_[^\\w\\däüö:ÄÜÖ\\/\\+\\-\\. ]]", "_"); line = line.replaceAll("]*)>]*)>", ""); line = line.replaceAll("]*)\\?([^>]*)\">", ""); diff --git a/sdk/ant-jme/src/com/jme/ant/LoadWikiImages.java b/sdk/ant-jme/src/com/jme/ant/LoadWikiImages.java index 834d2205e..12f824bbc 100644 --- a/sdk/ant-jme/src/com/jme/ant/LoadWikiImages.java +++ b/sdk/ant-jme/src/com/jme/ant/LoadWikiImages.java @@ -37,11 +37,12 @@ public class LoadWikiImages extends Task { int endIdx = line.indexOf("\"", idx + 10); if (endIdx >= 0) { String link = line.substring(idx + 10, endIdx); - int wikidx = link.indexOf("/wiki/lib/exe/fetch.php/"); - //int extidx = link.indexOf("/wiki/lib/exe/fetch.php?"); + link = link.replace("&", "&"); + int wikidx = link.indexOf("/lib/exe/fetch.php/"); + //int extidx = link.indexOf("/lib/exe/fetch.php?"); int extidx = -1; if (wikidx >= 0) { - String name = link.replaceAll("/wiki/lib/exe/fetch\\.php/", ""); + String name = link.replaceAll("/lib/exe/fetch\\.php/", ""); int markIdx = name.indexOf("?"); if (markIdx >= 0) { name = name.substring(0, markIdx); @@ -75,7 +76,7 @@ public class LoadWikiImages extends Task { } } } else if (extidx >= 0) { - String name = link.replaceAll("/wiki/lib/exe/fetch\\.php\\?([^>]*);media=([^>]*)\"", ""); + String name = link.replaceAll("/lib/exe/fetch\\.php\\?([^>]*);media=([^>]*)\"", ""); int markIdx = name.indexOf("?"); if (markIdx >= 0) { name = name.substring(0, markIdx); diff --git a/sdk/ant-lib/ant-jme.jar b/sdk/ant-lib/ant-jme.jar index 449997c07..9998d4a78 100644 Binary files a/sdk/ant-lib/ant-jme.jar and b/sdk/ant-lib/ant-jme.jar differ diff --git a/sdk/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties b/sdk/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties index 4941aef18..af4bb4fac 100644 --- a/sdk/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties +++ b/sdk/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties @@ -4,6 +4,6 @@ currentVersion=jMonkeyEngine SDK 3.1-snapshot-github LBL_splash_window_title=Starting jMonkeyEngine SDK SPLASH_HEIGHT=350 SPLASH_WIDTH=500 -SplashProgressBarBounds=0,344,500,6 -SplashRunningTextBounds=3,330,497,12 -SplashRunningTextFontSize=12 +SplashProgressBarBounds=0,347,500,6 +SplashRunningTextBounds=3,335,497,12 +SplashRunningTextFontSize=10 diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserFolder.java b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserFolder.java index 6c33d362e..aafd77fc6 100644 --- a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserFolder.java +++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserFolder.java @@ -19,7 +19,7 @@ import org.w3c.dom.Element; */ public class AssetPackBrowserFolder extends AbstractNode { - Image icon = ImageUtilities.loadImage("/com/jme3/gde/assetpack/icons/assets.gif"); + Image icon = ImageUtilities.loadImage("com/jme3/gde/assetpack/icons/assets.gif"); Project proj; public AssetPackBrowserFolder(Element[] elem, Project lib, String[] categories, String[] tags) { diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserItem.java b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserItem.java index 7aa0a4e89..12f2b8d08 100644 --- a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserItem.java +++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserItem.java @@ -63,7 +63,7 @@ public class AssetPackBrowserItem extends AbstractNode { private void setImage() { try { String add = item.getAttribute("type"); - icon = ImageUtilities.loadImage("/com/jme3/gde/assetpack/icons/" + add + ".gif"); + icon = ImageUtilities.loadImage("com/jme3/gde/assetpack/icons/" + add + ".gif"); } catch (Exception e) { } } diff --git a/sdk/jme3-core/src/com/jme3/gde/core/assets/nodes/AssetNode.java b/sdk/jme3-core/src/com/jme3/gde/core/assets/nodes/AssetNode.java index a8d007530..795fc8b1f 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/assets/nodes/AssetNode.java +++ b/sdk/jme3-core/src/com/jme3/gde/core/assets/nodes/AssetNode.java @@ -48,12 +48,21 @@ public class AssetNode extends FilterNode { private Node node; public AssetNode(ProjectAssetManager manager, Node node) { - super(node, new AssetChildren(manager, node), createLookupProxy(manager, node)); + super(node, isFile(node) ? Children.LEAF : new AssetChildren(manager, node), createLookupProxy(manager, node)); this.node = node; enableDelegation(DELEGATE_GET_ACTIONS); enableDelegation(DELEGATE_GET_CONTEXT_ACTIONS); } + public static boolean isFile(Node node) { + DataObject obj = null; + obj = node.getLookup().lookup(DataObject.class); + if (obj != null) { + return !obj.getPrimaryFile().isFolder(); + } + return false; + } + public static Lookup createLookupProxy(ProjectAssetManager manager, Node node) { //TODO: This is causing the most silly exception for the most silly problem // due to the most silly warning in netbeans platform diff --git a/sdk/jme3-core/src/com/jme3/gde/core/codeless/CodelessProjectWizardAction.java b/sdk/jme3-core/src/com/jme3/gde/core/codeless/CodelessProjectWizardAction.java index 14de215e8..5f8d64936 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/codeless/CodelessProjectWizardAction.java +++ b/sdk/jme3-core/src/com/jme3/gde/core/codeless/CodelessProjectWizardAction.java @@ -47,6 +47,9 @@ import org.netbeans.api.project.ProjectManager; import org.netbeans.api.project.ui.OpenProjects; import org.openide.DialogDisplayer; import org.openide.WizardDescriptor; +import org.openide.awt.ActionID; +import org.openide.awt.ActionReference; +import org.openide.awt.ActionRegistration; import org.openide.filesystems.FileLock; import org.openide.filesystems.FileObject; import org.openide.filesystems.FileUtil; @@ -54,9 +57,13 @@ import org.openide.util.Exceptions; import org.openide.util.HelpCtx; import org.openide.util.actions.CallableSystemAction; -// An example action demonstrating how the wizard could be called from within -// your code. You can copy-paste the code below wherever you need. @SuppressWarnings({"unchecked", "rawtypes"}) +@ActionID(id = "com.jme3.gde.core.codeless.CodelessProjectWizardAction", category = "CodelessProjects") +@ActionRegistration(iconBase = "com/jme3/gde/core/assets/actions/jme-logo.png", + displayName = "#CTL_Codeless_Project", + lazy = false, + iconInMenu = true) +@ActionReference(path = "Menu/File/Import", name = "CodelessProject", position = 0) public final class CodelessProjectWizardAction extends CallableSystemAction { private static final Logger logger = Logger.getLogger(CodelessProjectWizardAction.class.getName()); diff --git a/sdk/jme3-core/src/com/jme3/gde/core/errorreport/RendererInfoAction.java b/sdk/jme3-core/src/com/jme3/gde/core/errorreport/RendererInfoAction.java index 8868da619..bf0925e11 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/errorreport/RendererInfoAction.java +++ b/sdk/jme3-core/src/com/jme3/gde/core/errorreport/RendererInfoAction.java @@ -34,7 +34,13 @@ package com.jme3.gde.core.errorreport; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JFrame; +import org.openide.awt.ActionID; +import org.openide.awt.ActionReference; +import org.openide.awt.ActionRegistration; +@ActionID(id = "com.jme3.gde.core.errorreport.RendererInfoAction", category = "jMonkeyPlatform") +@ActionRegistration(displayName = "#CTL_RendererInfoAction", iconInMenu = true) +@ActionReference(path = "Menu/Help", position = 1225) public final class RendererInfoAction implements ActionListener { RendererInfo info; diff --git a/sdk/jme3-core/src/com/jme3/gde/core/filters/FilterExplorerTopComponent.java b/sdk/jme3-core/src/com/jme3/gde/core/filters/FilterExplorerTopComponent.java index 28310a151..3fc09fa8b 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/filters/FilterExplorerTopComponent.java +++ b/sdk/jme3-core/src/com/jme3/gde/core/filters/FilterExplorerTopComponent.java @@ -51,6 +51,7 @@ import org.openide.explorer.view.BeanTreeView; import org.openide.nodes.Node; import org.openide.util.HelpCtx; import org.openide.util.NbBundle; +import org.openide.util.actions.SystemAction; import org.openide.windows.TopComponent; import org.openide.windows.WindowManager; @@ -84,8 +85,8 @@ public final class FilterExplorerTopComponent extends TopComponent implements Ex setToolTipText(NbBundle.getMessage(FilterExplorerTopComponent.class, "HINT_FilterExplorerTopComponent")); ActionMap map = getActionMap(); map.put("delete", ExplorerUtils.actionDelete(explorerManager, true)); - map.put("moveup", new MoveUpAction()); - map.put("movedown", new MoveDownAction()); + map.put("moveup", SystemAction.get(MoveUpAction.class)); + map.put("movedown", SystemAction.get(MoveDownAction.class)); associateLookup(ExplorerUtils.createLookup(explorerManager, map)); } diff --git a/sdk/jme3-core/src/com/jme3/gde/core/layer.xml b/sdk/jme3-core/src/com/jme3/gde/core/layer.xml index 3a9b7b143..35e537791 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/layer.xml +++ b/sdk/jme3-core/src/com/jme3/gde/core/layer.xml @@ -2,26 +2,6 @@ - - - - - - - - - - - - - - - - - - - - @@ -43,12 +23,6 @@ - - - - - - @@ -76,24 +50,16 @@ - - - - + + - - - - - - @@ -181,14 +147,6 @@ - - - - - - - - diff --git a/sdk/jme3-documentation/build.xml b/sdk/jme3-documentation/build.xml index ed032b03b..ec5e665e2 100644 --- a/sdk/jme3-documentation/build.xml +++ b/sdk/jme3-documentation/build.xml @@ -45,7 +45,7 @@ + host="http://wiki.jmonkeyengine.org"/> diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/1.jpg b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/1.jpg index 7979ddcb4..12be4ce31 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/1.jpg and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/1.jpg differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/2.jpg b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/2.jpg index 9e079194e..1faee4b87 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/2.jpg and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/2.jpg differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/220px-trefoil_knot_arb.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/220px-trefoil_knot_arb.png index cda20c661..ae0aaad11 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/220px-trefoil_knot_arb.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/220px-trefoil_knot_arb.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/3.jpg b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/3.jpg index 4161ce13b..d41d5043d 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/3.jpg and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/3.jpg differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/3d_models.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/3d_models.html index 150ba0bc7..e3a20ebbb 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/3d_models.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/3d_models.html @@ -1,23 +1,21 @@ -

Models and Scenes

+

Models and Scenes

- Like Shapes, 3D models are also made up of Meshes, but models are more complex than Shapes. While Shapes are built into jME3, you typically create models in external 3D Mesh Editors.

-

Using Models and Scenes with jME3

+

Using Models and Scenes with jME3

- To use 3D models in a jME3 application:

    -
  1. Export the 3D model in Ogre XML or Wavefront OBJ format. Export Scenes as Ogre DotScene format.
    +
  2. Export the 3D model in Ogre XML or Wavefront OBJ format. Export Scenes as Ogre DotScene format.
  3. Save the files into a subdirectory of your jME3 project's assets directory.
  4. @@ -25,17 +23,16 @@ To use 3D models in a jME3 application: "Models/MonkeyHead/MonkeyHead.mesh.xml" );
-
  • (For the release build:) Use the jMonkeyEngine SDK to convert models to .j3o format. You don't need this step as long you still develop and test the aplication within the jMonkeyEngine SDK.
    +
  • (For the release build:) Use the jMonkeyEngine SDK to convert models to .j3o format. You don't need this step as long you still develop and test the aplication within the jMonkeyEngine SDK.
  • -

    Creating Models and Scenes

    +

    Creating Models and Scenes

    - To create 3D models and scenes, you need a 3D Mesh Editor such as , with an OgreXML Exporter plugin.

    @@ -45,7 +42,6 @@ To create 3D models and scenes, you need a 3D Mesh Editor such as 3D model editors are third-party products, so please consult their documentation for instructions how to use them. Here is an example workflow for Blender users: -

    • @@ -53,13 +49,12 @@ To create 3D models and scenes, you need a 3D Mesh Editor such as

      - -To export your models as Ogre XML meshes with materials: +To export your models as Ogre XML meshes with materials:

      1. Open the menu File > Export > OgreXML Exporter to open the exporter dialog.
      2. -
      3. In the Export Materials field: Give the material the same name as the model. For example, the model something.mesh.xml goes with something.material, plus (optionally) something.skeleton.xml, and some JPG files.
        +
      4. In the Export Materials field: Give the material the same name as the model. For example, the model something.mesh.xml goes with something.material, plus (optionally) something.skeleton.xml, and some JPG files.
      5. In the Export Meshes field: Select a target subdirectory of your assets/Models/ directory. E.g. assets/Models/something/.
      6. @@ -82,10 +77,9 @@ To export your models as Ogre XML

        - You can now use the jMonkeyEngine SDK to load and view models. You can create scenes from them and write code that loads them into your application.

        -

        view online version

        \ No newline at end of file +

        view online version

        \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/4.jpg b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/4.jpg index bec6cde94..f0e4931a0 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/4.jpg and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/4.jpg differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/5.jpg b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/5.jpg index f46cb4e58..66df7276c 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/5.jpg and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/5.jpg differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/6.jpg b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/6.jpg index 3955f21be..dc66e7c17 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/6.jpg and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/6.jpg differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/animation.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/animation.html index 59074ae89..92c72735e 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/animation.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/animation.html @@ -1,24 +1,22 @@ -

        Animation in jME3

        +

        Animation in jME3

        - In 3D games, you do not only load static 3D models, you also want to be able to trigger animations in the model from the Java code.

        -

        Requirements

        +

        Requirements

        - JME3 only loads and plays animated models, it does not create them.

        -What is required for an animated model? (See also: Animation terminology) +What is required for an animated model? (See also: Animation terminology)

        1. For each model, you have to segment the model into a skeleton (bone rigging).
          @@ -32,7 +30,6 @@ What is required for an animated model? ( -

          Code Samples

          +

          Code Samples

          • @@ -82,16 +78,15 @@ What is required in your JME3-based Java class?
          -

          Controlling Animations

          +

          Controlling Animations

          -

          The Animation Control

          +

          The Animation Control

          - Create one com.jme3.animation.AnimControl object in your JME3 application for each animated model that you want to control. You have to register each animated model to one of these Animation Controls. The control object gives you access to the available animation sequences in the model.

            AnimControl playerControl; // you need one Control per model
          @@ -101,16 +96,15 @@ Create one com.jme3.animation.AnimControl object in your JME3 appli
           
           
          -

          Animation Channels

          +

          Animation Channels

          - An Animation Control has several Animation Channels (com.jme3.animation.AnimChannel). Each channel can play one animation sequence at a time.

          -There often are situations where you want to run several animation sequences at the same time, e.g. "shooting while walking" or "boxing while jumping". In this case, you create several channels, assign an animation to each, and play them in parallel. +There often are situations where you want to run several animation sequences at the same time, e.g. “shooting while walking” or “boxing while jumping”. In this case, you create several channels, assign an animation to each, and play them in parallel.

            AnimChannel channel_walk = playerControl.createChannel();
             AnimChannel channel_jump = playerControl.createChannel();
          @@ -122,18 +116,18 @@ To reset a Control, call control.clearChannels();
           
           
          -

          Animation Control Properties

          +

          Animation Control Properties

          - The following information is available for an AnimControl. -

          + + @@ -153,9 +147,11 @@ clearListeners()
          AnimControl PropertyUsage
          createChannel()Returns a new channel, controlling all bones by default.
          Adds or removes listeners to receive animation related
          + + @@ -167,16 +163,18 @@ removeAnim(boneAnim)getAnimationNames() - + - +
          AnimControl PropertyUsage
          setAnimations(aniHashMap)Sets the animations that this AnimControl is capable of playing. The animations must be compatible with the skeleton given in the constructor.
          Adds or removes an animation from this Control.A String Collection of names of all animations that this Control can play for this model.
          getAnim("anim")Retrieve an animation from the list of animations.getAnim(“anim”)Retrieve an animation from the list of animations.
          getAnimationLength("anim")Returns the length of the given named animation in secondsgetAnimationLength(“anim”)Returns the length of the given named animation in seconds
          + + @@ -184,24 +182,24 @@ removeAnim(boneAnim)getTargets() - +
          AnimControl PropertyUsage
          getSkeleton()The Skeleton object controlled by this Control.
          Adds or removes an animation from this Control.The Skin objects controlled by this Control, as Mesh array.
          getAttachmentsNode("bone")Returns the attachment node of a bone. Attach models and effects to this node to make them follow this bone's motions.getAttachmentsNode(“bone”)Returns the attachment node of a bone. Attach models and effects to this node to make them follow this bone's motions.
          -

          Animation Channel Properties

          +

          Animation Channel Properties

          - The following properties are set per AnimChannel. -

          + + @@ -220,14 +218,14 @@ The following properties are set per AnimChannel.
          AnimChannel PropertyUsage
          setLoopMode(LoopMode.Loop); From now on, the animation on this channel will repeat from the beginning when it ends.

          - The following information is available for a channel. -

          + + @@ -246,64 +244,62 @@ The following information is available for a channel.
          AnimChannel PropertyUsage
          getAnimationName()The name of the animation playing on this channel. Returns null when no animation is playing.

          - Use the following methods to add or remove individual bones to an AnimChannel. This is useful when you play two animations in parallel on two channels, and each controls a subset of the bones (e.g. one the arms, and the other the legs). -

          + + - - -
          AnimChannel MethodsUsage
          addAllBones()Add all the bones of the model's skeleton to be influenced by this animation channel. (default)
          addBone("bone1")
          +
          addBone(“bone1”)
          addBone(bone1)
          Add a single bone to be influenced by this animation channel.
          addToRootBone("bone1")
          +
          addToRootBone(“bone1”)
          addToRootBone(bone1)
          Add a series of bones to be influenced by this animation channel: Add all bones, starting from the given bone, to the root bone.
          addFromRootBone("bone1")
          +
          addFromRootBone(“bone1”)
          addFromRootBone(bone1)
          Add a series of bones to be influenced by this animation channel: Add all bones, starting from the given root bone, going towards the children bones.
          -

          Playing Animations

          +

          Playing Animations

          - Animations are played by channel. Note: Whether the animation channel plays continuously or only once, depends on the Loop properties you have set. -

          + + -
          Channel MethodUsage
          channel_walk.setAnim("Walk",0.50f); Start the animation named "Walk" on channel channel_walk.
          +
          channel_walk.setAnim(“Walk”,0.50f); Start the animation named “Walk” on channel channel_walk.
          The float value specifies the time how long the animation should overlap with the previous one on this channel. If set to 0f, then no blending will occur and the new animation will be applied instantly.

          - Tip: Use the AnimEventLister below to react at the end or start of an animation cycle.

          -

          Usage Example

          +

          Usage Example

          - -In this short example, we define the space key to trigger playing the "Walk" animation on channel2. +In this short example, we define the space key to trigger playing the “Walk” animation on channel2.

            public void simpleInitApp() {
               ...
          @@ -312,7 +308,7 @@ In this short example, we define the space key to trigger playing the "Walk
               ...
             }
            
          -  private ActionListener actionListener = new ActionListener() {
          +  private ActionListener() {
               public void onAction(String name, boolean keyPressed, float tpf) {
                 if (name.equals("Walk") && !keyPressed) {
                   if (!channel2.getAnimationName().equals("Walk")) {
          @@ -325,11 +321,10 @@ In this short example, we define the space key to trigger playing the "Walk
           
           
          -

          Animation Event Listener

          +

          Animation Event Listener

          - A jME3 application that contains animations can implement the com.jme3.animation.AnimEventListener interface.

          public class HelloAnimation extends SimpleApplication
          @@ -341,11 +336,10 @@ This optional Listener enables you to respond to animation start and end events,
           
           
          -

          Responding to Animation End

          +

          Responding to Animation End

          - The onAnimCycleDone() event is invoked when an animation cycle has ended. For non-looping animations, this event is invoked when the animation is finished playing. For looping animations, this event is invoked each time the animation loop is restarted.

          @@ -370,11 +364,10 @@ You have access to the following objects:
          -

          Responding to Animation Start

          +

          Responding to Animation Start

          - The onAnimChange() event is invoked every time before an animation is set by the user to be played on a given channel (channel.setAnim()).

          @@ -399,4 +392,4 @@ You have access to the following objects
          -

          view online version

          \ No newline at end of file +

          view online version

          \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/application_states.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/application_states.html index 37c1b9cf9..70d1541a4 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/application_states.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/application_states.html @@ -1,24 +1,22 @@ -

          Application States

          +

          Application States

          - The com.jme3.app.state.AppState class is a customizable jME3 interface that allows you to control the global game logic, the overall game mechanics. (To control the behaviour of a Spatial, see Custom Controls instead. Controls and AppStates can be used together.)

          -

          Overview

          +

          Overview

          -

          Use Case Examples

          +

          Use Case Examples

          - There are situations during your game development where you think:

            @@ -26,22 +24,21 @@ There are situations during your game development where you think:
          • I have the in-game scene, and a character editor, and a Captain's Quarters screen. Can I group a set of nodes and behaviours, and swap them in and out in one step?
          • -
          • When I pause the game, I want the character's "idle" animation to continue, but all other loops and game events should stop. How do I define what happens when the game is paused/unpaused?
            +
          • When I pause the game, I want the character's “idle” animation to continue, but all other loops and game events should stop. How do I define what happens when the game is paused/unpaused?
          • I have a conditional block that takes up a lot of space in my simpleUpdate() loop. Can I wrap up this block of code, and switch it on and off in one step?
          • -
          • Can I package everything that belongs in-game, and everything that belongs to the menu screen, and switch between these two "big states" in one step?
            +
          • Can I package everything that belongs in-game, and everything that belongs to the menu screen, and switch between these two “big states” in one step?

          - You can! This is what AppStates are there for. An AppState class is subset of (or an extension to) your application. Every AppState class has access to all fields in your main application (AssetManager, ViewPort, StateManager, InputManager, RootNode, GuiNode, etc) and hooks into the main update loop. An AppState can contain:

          • a subset of class fields, functions, methods (game state data and accessors),
          • -
          • a subset of GUI elements and their listeners,
            +
          • a subset of GUI elements and their listeners,
          • a subset of input handlers and mappings,
          • @@ -51,17 +48,16 @@ You can! This is what AppStates are there for. An AppState class is subset of (o
          • a subset of other AppStates and Controls
          • -
          • ??? or combinations thereof.
            +
          • … or combinations thereof.
          -

          Supported Features

          +

          Supported Features

          - Each AppState lets you define what happens to it in the following situations:

            @@ -73,25 +69,23 @@ The AppState executes its own simpleInitApp() method when it is attached, so to
          • While the AppState is running/paused: You can poll isEnabled() to define paused and unpaused game behaviour in the update() loop. In update(), you poll and modify the game state, modify the scene graph, and trigger events. Test if !isEnabled(), and write code that skips the running sections of this AppState's update() loop.
            Each AppState has its own update loop, which hooks into the main simpleUpdate() loop (callback).
          • -
          • The AppState has been disabled (paused): This toggles a boolean isEnabled() to false. Here you switch all objects to their specific "paused" behaviour.
            +
          • The AppState has been disabled (paused): This toggles a boolean isEnabled() to false. Here you switch all objects to their specific “paused” behaviour.
          • The AppState is cleaned up: Here you decide what happens when the AppState is detached. Save this AppState's game state, unregister Controls and InputHandlers, detach related AppStates, detach nodes from the rootNode, etc.

          - -

          Tip: AppStates are extremely handy to swap out, or pause/unpause whole sets of other AppStates. For example, an InGameState (loads in-game GUI, activates click-to-shoot input mappings, inits game content, starts game loop) versus MainScreenState (stops game loop, saves and detaches game content, switches to menu screen GUI, switches to click-to-select input mappings). +

          Tip: AppStates are extremely handy to swap out, or pause/unpause whole sets of other AppStates. For example, an InGameState (loads in-game GUI, activates click-to-shoot input mappings, inits game content, starts game loop) versus MainScreenState (stops game loop, saves and detaches game content, switches to menu screen GUI, switches to click-to-select input mappings).

          -

          Usage

          +

          Usage

          - To implement game logic:

            @@ -114,17 +108,15 @@ To implement game logic:

          - When you add several AppStates to one Application and activate them, their initialize() methods and update() loops are executed in the order in which the AppStates were added to the AppStateManager.

          -

          Code Samples

          +

          Code Samples

          - JME3 comes with a BulletAppState that implements Physical behaviour (using the jBullet library). You, for example, could write an Artificial Intelligence AppState to control all your enemy units. Existing examples in the code base include:

            @@ -140,18 +132,18 @@ JME3 comes with a BulletAppState that implements Physical behaviour (using the j
          -

          AppState

          +

          AppState

          - The AppState interface lets you initialize sets of objects, and hook a set of continously executing code into the main loop. -

          + +
          AppState MethodUsage
          initialize(asm,app)When this AppState is added to the game, the RenderThread initializes the AppState and then calls this method. You can modify the scene graph from here (e.g. attach nodes). To get access to the main app, call:
          super.initialize(stateManager, app);
           this.app = (SimpleApplication) app;
          @@ -187,17 +179,15 @@ stateDetached(asm)
          The AppState knows when it is attached to, or detache -

          AbstractAppState

          +

          AbstractAppState

          - The AbstractAppState class already implements some common methods (isInitialized(), setActive(), isActive()) and makes creation of custom AppStates a bit easier. We recommend you extend AbstractAppState and override the remaining AppState methods: initialize(), setEnabled(), cleanup().

          Definition: -

          public class MyAppState extends AbstractAppState {
            
          @@ -250,28 +240,27 @@ Definition:
           
           
          -

          Pausing and Unpausing

          +

          Pausing and Unpausing

          - You define what an AppState does when Paused or Unpaused, in the setEnabled() and update() methods. Call myState.setEnabled(false) on all states that you want to pause. Call myState.setEnabled(true) on all states that you want to unpause.

          -

          AppStateManager

          +

          AppStateManager

          - The com.jme3.app.state.AppStateManager holds the list of AppStates for an application. AppStateManager ensures that active AppStates can modify the scene graph, and that the update() loops of active AppStates is executed. There is one AppStateManager per application. You typically attach several AppStates to one AppStateManager, but the same state can only be attached once. -

          + + @@ -281,9 +270,7 @@ The com.jme3.app.state.AppStateManager holds the list of AppStates for an applic
          AppStateManager MethodUsage
          hasState(myState)Is AppState object 'myState' attached?

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

          • If a detached AppState is attached then initialize() will be called on the following render pass.
            @@ -300,32 +287,29 @@ The AppStateManager's render(), postRender(), cleanup() method
          -

          Best Practices

          +

          Best Practices

          -

          Communication Among AppStates

          +

          Communication Among AppStates

          - You can only access other AppStates (read from and write to them) from certain places: From a Control's update() method, from an AppState's update() method, and from the SimpleApplication's simpleUpdate() loop. Don't mess with the AppState from other places, because from other methods you have no control over the order of modifications; the game can go out of sync because you can't know when (during which half-finished step of another state change) your modification will be performed.

          You can use custom accessors to get data from AppStates, to set data in AppStates, or to trigger methods in AppStates. -

          this.app.getStateManager().getState(MyAppState.class).doSomeCustomStuffInThisState();
          -

          Initialize Familiar Class Fields

          +

          Initialize Familiar Class Fields

          - To access class fields of the SimpleApplication the way you are used to, initialize them to local variables, as shown in the following AppState template:

          private SimpleApplication app;
          @@ -352,4 +336,4 @@ public class MyAppState extends AbstractAppState {
           
           
          -

          view online version

          \ No newline at end of file +

          view online version

          \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/appstatesdemo.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/appstatesdemo.html index 2ba7692cd..284e0f01a 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/appstatesdemo.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/appstatesdemo.html @@ -1,19 +1,17 @@ -

          Simple AppStates Demo

          +

          Simple AppStates Demo

          -

          THIS DEMO IS OUT OF DATE AND NEEDS CORRECTING

          -

          -

          THIS DEMO IS OUT OF DATE AND NEEDS CORRECTING FOR NOW PLEASE SEE

          +

          THIS DEMO IS OUT OF DATE AND NEEDS CORRECTING FOR NOW PLEASE SEE

          @@ -21,7 +19,7 @@ THIS DEMO IS OUT OF DATE AND NEEDS CORRECTING

          -Note: this tutorial needs to be fixed and is currently not correct. One should almost never override stateDetached and stateAttached??? and should certainly never do anything scene related in them. +Note: this tutorial needs to be fixed and is currently not correct. One should almost never override stateDetached and stateAttached… and should certainly never do anything scene related in them.

          @@ -30,12 +28,11 @@ This demo is a simple example of how you use AppStates to toggle between a Start

          There are four files, Main.java, GameRunningState.java, StartScreenState.java, SettingsScreenState.java. -

          -

          Main.java

          +

          Main.java

          package chapter04.appstatedemo;
            
          @@ -94,7 +91,7 @@ public class Main extends SimpleApplication {
               inputManager.addListener(actionListener, new String[]{"Toggle Settings"});
             }
            
          -  private ActionListener actionListener = new ActionListener() {
          +  private ActionListener() {
               public void onAction(String name, boolean isPressed, float tpf) {
                 System.out.println("key" + name);
                 if (name.equals("Game Pause Unpause") && !isPressed) {
          @@ -131,7 +128,7 @@ public class Main extends SimpleApplication {
           
           
          -

          GameRunningState.java

          +

          GameRunningState.java

          package chapter04.appstatedemo;
            
          @@ -178,7 +175,7 @@ public class GameRunningState extends AbstractAppState {
               /** Load this scene */
               viewPort.setBackgroundColor(backgroundColor);
            
          -    Box mesh = new Box(Vector3f.ZERO, 1, 1, 1);
          +    Box(Vector3f.ZERO, 1, 1, 1);
               Geometry geom = new Geometry("Box", mesh);
               Material mat = new Material(assetManager,
                       "Common/MatDefs/Misc/Unshaded.j3md");
          @@ -223,7 +220,7 @@ public class GameRunningState extends AbstractAppState {
           
           
          -

          SettingsScreenState.java

          +

          SettingsScreenState.java

          package chapter04.appstatedemo;
            
          @@ -270,7 +267,7 @@ public class SettingsScreenState extends AbstractAppState {
               /** Load this scene */
               viewPort.setBackgroundColor(backgroundColor);
            
          -    Box mesh = new Box(new Vector3f(-1, -1, 0), .5f, .5f, .5f);
          +    Box(new Vector3f(-1, -1, 0), .5f, .5f, .5f);
               Geometry geom = new Geometry("Box", mesh);
               Material mat = new Material(assetManager,
                       "Common/MatDefs/Misc/Unshaded.j3md");
          @@ -312,7 +309,7 @@ public class SettingsScreenState extends AbstractAppState {
           
           
          -

          StartScreenState.java

          +

          StartScreenState.java

          package chapter04.appstatedemo;
            
          @@ -359,7 +356,7 @@ public StartScreenState(SimpleApplication app){
               /** Init this scene */
               viewPort.setBackgroundColor(backgroundColor);
            
          -    Box mesh = new Box(new Vector3f(-1,1,0), .5f,.5f,.5f);
          +    Box(new Vector3f(-1,1,0), .5f,.5f,.5f);
               Geometry geom = new Geometry("Box", mesh);
               Material mat = new Material(assetManager,
                       "Common/MatDefs/Misc/Unshaded.j3md");
          @@ -401,4 +398,4 @@ public StartScreenState(SimpleApplication app){
           
           
          -

          view online version

          \ No newline at end of file +

          view online version

          \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/asset_manager.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/asset_manager.html index 2f5b04d82..f8597bb0e 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/asset_manager.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/asset_manager.html @@ -1,9 +1,8 @@ -

          AssetManager

          +

          AssetManager

          - By assets we mean multi-media files, such as 3D models, materials, textures, scenes, custom shaders, music and sound files, and custom fonts. JME3 has an integrated asset manager that helps you keep your project assets organized. Think of the asset manager as the filesystem of your game, independent of the actual deployment platform. By default, store your assets in the MyGame/assets/ directory of your project.

          @@ -21,13 +20,12 @@ For example, the same textures are not uploaded to the graphics card multiple ti

          - Advanced users can write a custom build and packaging script, and can register custom paths to the AssetManager, but this is up to you then.

          -

          Context

          +

          Context

          jMonkeyProjects/MyGame/assets/    # You store assets in subfolders here! <------
           jMonkeyProjects/MyGame/build/     # SDK generates built classes here (*)
          @@ -44,11 +42,10 @@ See also Best
           
           
          -

          Usage

          +

          Usage

          - The assetManager object is an com.jme3.asset.AssetManager instance that every com.jme3.app.Application can access. It maintains a root that also includes your project's classpath by default, so you can load any asset that's on the classpath, that is, the top level of your project directory.

          @@ -63,7 +60,7 @@ Here is an example how you load assets using the AssetManager. This lines loads new AssetKey("Common/Materials/RedColor.j3m"));

          -This Material is "somewhere" in the jME3 JAR; the default Asset Manager is configured to handle a Common/??? path correctly, so you don't have to specify the whole path when referring to built-in assets (such as default Materials). +This Material is “somewhere” in the jME3 JAR; the default Asset Manager is configured to handle a Common/… path correctly, so you don't have to specify the whole path when referring to built-in assets (such as default Materials).

          @@ -72,16 +69,15 @@ Additionally, you can configure the Asset Manager and add any path to its root.

          -

          Asset Directory

          +

          Asset Directory

          - By default, jME3 searches for models in a directory named assets.

          -

          In Java projects created with the jMonkeyEngine SDK, an assets folder is created by default in your project directory. If you are using any other IDE, or the command line, you simply create an assets directory manually (see the Codeless Project tip below). +

          In Java projects created with the jMonkeyEngine SDK, an assets folder is created by default in your project directory. If you are using any other IDE, or the command line, you simply create an assets directory manually (see the Codeless Project tip below).

          @@ -104,7 +100,7 @@ These subdirectories are just the most common examples.

          -

          You can rename/delete/add (sub)directories inside the assets directory in any way you like. Note however that there is no automatic refactoring for asset paths in the SDK, so if you modify them late in the development process, you have to refactor all paths manually. +

          You can rename/delete/add (sub)directories inside the assets directory in any way you like. Note however that there is no automatic refactoring for asset paths in the SDK, so if you modify them late in the development process, you have to refactor all paths manually.

          @@ -120,39 +116,33 @@ After the conversion, you move the .j3o file into the assets/Models/ -

          Example Code: Loading Assets

          +

          Example Code: Loading Assets

          - -Creating a material instance with the definition "Unshaded.j3md": - +Creating a material instance with the definition “Unshaded.j3md”:

          Material mat_brick = new Material( 
               assetManager, "Common/MatDefs/Misc/Unshaded.j3md");

          Applying a texture to the material: -

          mat_brick.setTexture("ColorMap", 
               assetManager.loadTexture("Textures/Terrain/BrickWall/BrickWall.jpg"));

          Loading a font: -

          guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");

          Loading a model: -

          Spatial ninja = assetManager.loadModel("Models/Ninja/Ninja.mesh.xml");

          Loading a scene from an Ogre3D dotScene file stored inside a zip: -

          assetManager.registerLocator("town.zip", ZipLocator.class);
           Spatial scene = assetManager.loadModel("main.scene");
          @@ -171,18 +161,20 @@ jME3 also offers a ClasspathLocator, ZipLocator, FileLocator, HttpZipLocator, an
           

          -

          The custom build script does not automatically include all ZIP files in the executable build. See "Cannot Locate Resource" solution below. +

          The custom build script does not automatically include all ZIP files in the executable build. See “Cannot Locate Resource” solution below.

          -

          Common AssetManager Tasks

          +

          Common AssetManager Tasks

          + +
          Task? Solution!
          Load a model with materials Use the asset manager's loadModel() method and attach the Spatial to the rootNode.
          Spatial elephant = assetManager.loadModel("Models/Elephant/Elephant.mesh.xml");
           rootNode.attachChild(elephant);
          @@ -206,16 +198,15 @@ rootNode.attachChild(scene); -

          NullPointerException: Cannot locate resource?

          +

          NullPointerException: Cannot locate resource?

          - Problem:

          -My game runs fine when I run it right from the jMonkeyEngine SDK. But when I run the stand-alone executables (.jar, .jnlp .exe, .app), a DesktopAssetManager error message occurs in the console, and it quits? +My game runs fine when I run it right from the jMonkeyEngine SDK. But when I run the stand-alone executables (.jar, .jnlp .exe, .app), a DesktopAssetManager error message occurs in the console, and it quits?

          com.jme3.asset.DesktopAssetManager loadAsset
           WARNING: Cannot locate resource: Scenes/town/main.scene
          @@ -228,7 +219,7 @@ java.lang.NullPointerException

          -If you use the default build script, original models and scenes (.mesh.xml, .obj, .blend, .zip), are excluded from the distribution automatically. A stand-alone executable includes converted .j3o files (models and scenes) only. The default build script makes sure to bundle existing .j3o files in the distribution, but you need to remember to convert the models (from mesh.xml???>.j3o, or .obj???>.j3o, etc) yourself. +If you use the default build script, original models and scenes (.mesh.xml, .obj, .blend, .zip), are excluded from the distribution automatically. A stand-alone executable includes converted .j3o files (models and scenes) only. The default build script makes sure to bundle existing .j3o files in the distribution, but you need to remember to convert the models (from mesh.xml–>.j3o, or .obj–>.j3o, etc) yourself.

          @@ -236,16 +227,16 @@ If you use the default build script, original models and scenes (.mesh.x

          -Before building the executable, you must use the jMonkeyEngine SDK's context menu action to convert 3D models to .j3o binary format. +Before building the executable, you must use the jMonkeyEngine SDK's context menu action to convert 3D models to .j3o binary format.

          1. Save your original models (.mesh.xml, .scene, .blend, or .obj files, plus textures) into assets/Textures/. (!)
          2. -
          3. Open the jME3 project in the jMonkeyEngine SDK.
            +
          4. Open the jME3 project in the jMonkeyEngine SDK.
          5. Browse to the assets directory in the Projects window.
          6. -
          7. Right-click an original model in assets/Textures/, and choose "Convert to JME3 binary".
            +
          8. Right-click an original model in assets/Textures/, and choose “Convert to JME3 binary”.
          9. The converted file appears in the same directory as the original file. It has the same name and a .j3o suffix.
          10. @@ -256,7 +247,6 @@ Before building the executable, you must use the jMonkeyEngine -

            Asset Handling For Other IDEs: Codeless Projects

            +

            Asset Handling For Other IDEs: Codeless Projects

            - Problem:

            -I use another IDE than jMonkeyEngine SDK for coding (Eclipse, IntelliJ, text editor). Where is my asset folder and .j3o converter? +I use another IDE than jMonkeyEngine SDK for coding (Eclipse, IntelliJ, text editor). Where is my asset folder and .j3o converter?

            @@ -284,8 +273,7 @@ I use another IDE than jMonkeyEngine S

            -You can code in any IDE, but you must create a so-called codeless project in the jMonkeyEngine SDK to maintain assets. A code-less jMonkeyEngine project does not meddle with your sources or custom build scripts. You merely use it to convert models to .j3o binaries. - +You can code in any IDE, but you must create a so-called codeless project in the jMonkeyEngine SDK to maintain assets. A code-less jMonkeyEngine project does not meddle with your sources or custom build scripts. You merely use it to convert models to .j3o binaries.

            1. Create your (Eclipse or whatever) project as you like.
              @@ -293,28 +281,27 @@ You can code in any IDE, but you must create a so-called codeless project in the
            2. Create a directory in your project folder and name it, for example, assets.
              Store your assets there as described above.
            3. -
            4. Download and install the jMonkeyEngine SDK.
              +
            5. Download and install the jMonkeyEngine SDK.
            6. -
            7. In the SDK, go to File ??? Import Projects ??? External Project Assets.
              +
            8. In the SDK, go to File → Import Projects → External Project Assets.
            9. Select your (Eclipse or whatever) project and your assets folder in the Import Wizard.
            10. -
            11. You can now open this (Eclipse or whatever) project in the jMonkeyEngine SDK.
              +
            12. You can now open this (Eclipse or whatever) project in the jMonkeyEngine SDK.
              Convert assets as described above.

            - -

            If you don't use the SDK for some reason, you can still convert models to j3o format: Load any model in Ogre3D or Wavefront format with the AssetManager.loadModel() as a spatial. Then save the spatial as j3o file using BinaryExporter. +

            If you don't use the SDK for some reason, you can still convert models to j3o format: Load any model in Ogre3D or Wavefront format with the AssetManager.loadModel() as a spatial. Then save the spatial as j3o file using BinaryExporter.

            -

            Use file version control and let team members check out the project. Your developers open the project in Eclipse (etc) as they are used to. Additionally to their graphic tools, ask your graphic designers to install the jMonkeyEngine SDK, and to check out the codeless project that you just prepared. This makes it easy for non-coding team member to browse and preview game assets, to arrange scenes, and to convert files. At the same time, non-coders don't accidentally mess with code, and developers don't accidentally mess with assets. :) +

            Use file version control and let team members check out the project. Your developers open the project in Eclipse (etc) as they are used to. Additionally to their graphic tools, ask your graphic designers to install the jMonkeyEngine SDK, and to check out the codeless project that you just prepared. This makes it easy for non-coding team member to browse and preview game assets, to arrange scenes, and to convert files. At the same time, non-coders don't accidentally mess with code, and developers don't accidentally mess with assets. :)

            -

            view online version

            \ No newline at end of file +

            view online version

            \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/audio.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/audio.html index 2cab347f4..e17b5765c 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/audio.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/audio.html @@ -1,15 +1,14 @@ -

            Audio in jME3

            +

            Audio in jME3

            - Place audio files in the assets/Sound/ directory of your project. jME3 supports Ogg Vorbis audio compression (.ogg) and uncompressed PCM Wave (.wav) formats. You can use for example to convert from other formats.

            -

            Audio Terminology

            +

            Audio Terminology

            • Streaming: There are two ways to load audio data: Short audio files are to be stored entirely in memory (prebuffered), while long audio files, such as music, are streamed from the hard drive as it is played.
              @@ -23,13 +22,11 @@ You cannot loop streamed sounds.
            -

            Creating Audio Nodes: Streamed or Buffered

            +

            Creating Audio Nodes: Streamed or Buffered

            - The main jME audio class to look at is com.jme3.audio.AudioNode. When creating a new audio node you need to declare whether how you want to load this sound: -

            • Buffered: By default, a new audio node is buffered. This means jME3 loads the whole file into memory before playing. Use this for short sounds. You create a buffered sound by setting the boolean to false, or using no boolean at all:
              AudioNode boom = new AudioNode(assetManager, "Sound/boom.wav");
              @@ -43,12 +40,14 @@ AudioNode boom = new AudioNode(assetManager, "Sound/boom.wav", fal
               
               
              -

              Getting AudioNode Properties

              +

              Getting AudioNode Properties

              + + @@ -66,12 +65,14 @@ Note: There are other obvious getters to poll the status of all corresponding se -

              Setting AudioNode Properties

              +

              Setting AudioNode Properties

              AudioNode MethodUsage
              getStatus()Returns either AudioSource.Status.Playing, AudioSource.Status.Stopped, or AudioSource.Status.Paused.
              + + @@ -94,12 +95,14 @@ Note: There are other obvious getters to poll the status of all corresponding se -

              Looping & Ambient Sounds

              +

              Looping & Ambient Sounds

              AudioNode MethodUsage
              setTimeOffset(0.5f)Play the sound starting at a 0.5 second offset from the beginning. Default is 0.
              + + @@ -112,58 +115,59 @@ setDirectional(false)
              AudioNode MethodUsage
              setPositional(false)
              setDirectional(false)
              All 3D effects switched off. This sound is global and plays in headspace (it appears to come from everywhere). Good for environmental ambient sounds and background music.All 3D effects switched off. This sound is global -

              Positional 3D Sounds

              +

              Positional 3D Sounds

              + + +setLocalTranslation(…) - +
              AudioNode MethodUsage
              setPositional(true)
              -setLocalTranslation(???)
              Activates 3D audio: The sound appears to come from a certain position, where it is loudest. Position the AudioNode in the 3D scene, or move it with mobile players or NPCs.Activates 3D audio: The sound appears to come from a certain position, where it is loudest. Position the AudioNode in the 3D scene, or move it with mobile players or NPCs.
              setReverbEnabled(true)Reverb is a 3D echo effect that only makes sense with positional AudioNodes. Use Audio Environments to make scenes sound as if they were "outdoors", or "indoors" in a large or small room, etc. The reverb effect is defined by the com.jme3.audio.Environment that the audioRenderer is in. See "Setting Audio Environment Properties" below. setReverbEnabled(true)Reverb is a 3D echo effect that only makes sense with positional AudioNodes. Use Audio Environments to make scenes sound as if they were “outdoors”, or “indoors” in a large or small room, etc. The reverb effect is defined by the com.jme3.audio.Environment that the audioRenderer is in. See “Setting Audio Environment Properties” below.

              -

              Positional 3D sounds require an AudioListener object in the scene (representing the player's ears).

              -

              Directional 3D Sounds

              +

              Directional 3D Sounds

              + + +setDirection(…) +setOuterAngle()
              AudioNode MethodUsage
              setDirectional(true)
              -setDirection(???)
              Activates 3D audio: This sound can only be heard from a certain direction. Specify the direction and angle in the 3D scene if you have setDirectional() true. Use this to restrict noises that should not be heard, for example, through a wall.Activates 3D audio: This sound can only be heard from a certain direction. Specify the direction and angle in the 3D scene if you have setDirectional() true. Use this to restrict noises that should not be heard, for example, through a wall.
              setInnerAngle()
              -setOuterAngle()
              Set the angle in degrees for the directional audio. The angle is relative to the direction. Note: By default, both angles are 360?? and the sound can be heard from all directions!Set the angle in degrees for the directional audio. The angle is relative to the direction. Note: By default, both angles are 360° and the sound can be heard from all directions!

              -

              Directional 3D sounds require an AudioListener object in the scene (representing the player's ears).

              -

              Play, Pause, Stop

              +

              Play, Pause, Stop

              - You play, pause, and stop a node called myAudioNode by using the respective of the following three methods:

              myAudioNode.play();
              @@ -181,11 +185,10 @@ You can also start playing instances of an AudioNode. Use the playInstance
              -

              The Audio Listener

              +

              The Audio Listener

              - The default AudioListener object listener in SimpleApplication is the user's ear in the scene. If you use 3D audio (positional or directional sounds), you must move the AudioListener with the player: For example, for a first-person player, you move the listener with the camera. For a third-person player, you move the listener with the player avatar Geometry.

                @Override
              @@ -197,18 +200,18 @@ The default AudioListener object listener in SimpleApplicatio
               
               
              -

              Setting Audio Environment Properties

              +

              Setting Audio Environment Properties

              - -Optionally, You can choose from the following environmental presets from com.jme3.audio.Environment. This presets influence subtle echo effects (reverb) that evoke associations of different environments in your users. That is, it makes you scene sound "indoors" or "outdoors" etc. You use Audio Environments together with setReverbEnabled(true) on positional AudioNodes (see above). - +Optionally, You can choose from the following environmental presets from com.jme3.audio.Environment. This presets influence subtle echo effects (reverb) that evoke associations of different environments in your users. That is, it makes you scene sound “indoors” or “outdoors” etc. You use Audio Environments together with setReverbEnabled(true) on positional AudioNodes (see above).

              + + @@ -228,7 +231,7 @@ Optionally, You can choose from the following environmental presets from c
              1. Activate a Environment preset
                  -
                • Either use a default, e.g. make you scene sounds like a dungeon environment:
                  audioRenderer.setEnvironment(new Environment(Environment.Dungeon));
                  +
                • Either use a default, e.g. make you scene sounds like a dungeon environment:
                  audioRenderer.setEnvironment(new Environment.Dungeon));
                • Or activate custom environment settings in the Environment constructor:
                  audioRenderer.setEnvironment(
                  @@ -245,25 +248,23 @@ footstepsAudio.setReverbEnabled(true);

              - -

              A sound engineer can create a custom com.???jme3.???audio.Environment object and specify custom environment values such as density, diffusion, gain, decay, delay??? You can find many examples of custom audio environment presets here. +

              A sound engineer can create a custom com.​jme3.​audio.Environment object and specify custom environment values such as density, diffusion, gain, decay, delay… You can find many examples of custom audio environment presets here.

              -Advanced users find more info about OpenAL and its features here: . +Advanced users find more info about OpenAL and its features here: .

              It depends on the hardware whether audio effects are supported (if not, you get the message OpenAL EFX not available! Audio effects won't work.)

              - + +

              +tag_sound_documentation_environment +

              -

              view online version

              \ No newline at end of file +

              view online version

              \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/audio_environment_presets.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/audio_environment_presets.html index ee5d9224a..773a57bac 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/audio_environment_presets.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/audio_environment_presets.html @@ -1,17 +1,15 @@ -

              Audio Environment Presets

              +

              Audio Environment Presets

              - -Use these presets together with Audio Nodes to create different "moods" for sounds. Environment effects make your audio sound as if the listener were in various places that have different types of echoes. +Use these presets together with Audio Nodes to create different “moods” for sounds. Environment effects make your audio sound as if the listener were in various places that have different types of echoes.

              Usage: -

              -
              Environment Generic = new Environment(
              +
              Environment(
                   new float[]{ 0, 7.5f, 1f, -1000, -100, 0, 1.49f, 0.83f, 1f, -2602,
                                0.007f, 0f, 0f, 0f, 200, 0.011f, 0f, 0f, 0f, 0.250f,
                                0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
              @@ -19,7 +17,7 @@ audioRenderer.setEnvironment(myEnvironment);
              -

              Castle

              +

              Castle

              CastleSmallRoom    = new Environment ( new float[]{ 26, 8.3f, 0.890f, -1000, -800, -2000, 1.22f, 0.83f, 0.31f, -100, 0.022f, 0f, 0f, 0f, 600, 0.011f, 0f, 0f, 0f, 0.138f, 0.080f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20} );
               CastleShortPassage = new Environment ( new float[]{ 26, 8.3f, 0.890f, -1000, -1000, -2000, 2.32f, 0.83f, 0.31f, -100, 0.007f, 0f, 0f, 0f, 200, 0.023f, 0f, 0f, 0f, 0.138f, 0.080f, 0.250f, 0f, -5f, 5168.6f, 139.5f, 0f, 0x20} );
              @@ -33,7 +31,7 @@ CastleAlcove       = new Environment ( new float[]{ 26, 8.3f, 0
               
               
              -

              Warehouse, Factory

              +

              Warehouse, Factory

              FactoryAlcove       = new Environment ( new float[]{ 26, 1.8f, 0.590f, -1200, -200, -600, 3.14f, 0.65f, 1.31f, 300, 0.010f, 0f, 0f, 0f, 000, 0.038f, 0f, 0f, 0f, 0.114f, 0.100f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20} );
               FactoryShortpassage = new Environment ( new float[]{ 26, 1.8f, 0.640f, -1200, -200, -600, 2.53f, 0.65f, 1.31f, 0, 0.010f, 0f, 0f, 0f, 200, 0.038f, 0f, 0f, 0f, 0.135f, 0.230f, 0.250f, 0f, -5f, 3762.6f, 362.5f, 0f, 0x20} ) );
              @@ -47,7 +45,7 @@ FactorySmallroom    = new Environment ( new float[]{ 26, 1.8f,
               
               
              -

              Ice Palace

              +

              Ice Palace

              IcepalaceAlcove       = new Environment ( new float[]{ 26, 2.7f, 0.840f, -1000, -500, -1100, 2.76f, 1.46f, 0.28f, 100, 0.010f, 0f, 0f, 0f, -100, 0.030f, 0f, 0f, 0f, 0.161f, 0.090f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20} );
               IcepalaceShortpassage = new Environment ( new float[]{ 26, 2.7f, 0.750f, -1000, -500, -1100, 1.79f, 1.46f, 0.28f, -600, 0.010f, 0f, 0f, 0f, 100, 0.019f, 0f, 0f, 0f, 0.177f, 0.090f, 0.250f, 0f, -5f, 12428.5f, 99.6f, 0f, 0x20} ) );
              @@ -61,7 +59,7 @@ IcepalaceSmallroom    = new Environment ( new float[]{ 26, 2.7f
               
               
              -

              Space Station

              +

              Space Station

              SpacestationAlcove       = new Environment ( new float[]{ 26, 1.5f, 0.780f, -1000, -300, -100, 1.16f, 0.81f, 0.55f, 300, 0.007f, 0f, 0f, 0f, 000, 0.018f, 0f, 0f, 0f, 0.192f, 0.210f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20} );
               SpacestationMediumroom   = new Environment ( new float[]{ 26, 1.5f, 0.750f, -1000, -400, -100, 3.01f, 0.50f, 0.55f, -800, 0.034f, 0f, 0f, 0f, 100, 0.035f, 0f, 0f, 0f, 0.209f, 0.310f, 0.250f, 0f, -5f, 3316.1f, 458.2f, 0f, 0x20} );
              @@ -74,7 +72,7 @@ SpacestationSmallroom    = new Environment ( new float[]{ 26, 1
               
               
              -

              Wooden Hut or Ship

              +

              Wooden Hut or Ship

              WoodenAlcove           = new Environment ( new float[]{ 26, 7.5f, 1f, -1000, -1800, -1000, 1.22f, 0.62f, 0.91f, 100, 0.012f, 0f, 0f, 0f, -300, 0.024f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f} );
               WoodenShortpassage     = new Environment ( new float[]{ 26, 7.5f, 1f, -1000, -1800, -1000, 1.75f, 0.50f, 0.87f, -100, 0.012f, 0f, 0f, 0f, -400, 0.024f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 4705f, 99.6f, 0f, 0x3f} );
              @@ -88,7 +86,7 @@ WoodenCourtyard        = new Environment ( new float[]{ 26, 7.5
               
               
              -

              Sport

              +

              Sport

              SportEmptystadium      = new Environment ( new float[]{ 26, 7.2f, 1f, -1000, -700, -200, 6.26f, 0.51f, 1.10f, -2400, 0.183f, 0f, 0f, 0f, -800, 0.038f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x20} );
               SportSquashcourt       = new Environment ( new float[]{ 26, 7.5f, 0.750f, -1000, -1000, -200, 2.22f, 0.91f, 1.16f, -700, 0.007f, 0f, 0f, 0f, -200, 0.011f, 0f, 0f, 0f, 0.126f, 0.190f, 0.250f, 0f, -5f, 7176.9f, 211.2f, 0f, 0x20} );
              @@ -99,7 +97,7 @@ SportFullstadium       = new Environment ( new float[]{ 26, 7.2
               
               
              -

              Pipes

              +

              Pipes

              Sewerpipe    = new Environment ( new float[]{ 21, 1.7f, 0.800f, -1000, -1000, 0, 2.81f, 0.14f, 1f, 429, 0.014f, 0f, 0f, 0f, 1023, 0.021f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
               PipeSmall    = new Environment ( new float[]{ 26, 50.3f, 1f, -1000, -900, -1300, 5.04f, 0.10f, 0.10f, -600, 0.032f, 0f, 0f, 0f, 800, 0.015f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 2854.4f, 20f, 0f, 0x3f} );
              @@ -109,7 +107,7 @@ PipeResonant = new Environment ( new float[]{ 26, 1.3f, 0.910f,
               
               
              -

              Moods

              +

              Moods

              Heaven    = new Environment ( new float[]{ 26, 19.6f, 0.940f, -1000, -200, -700, 5.04f, 1.12f, 0.56f, -1230, 0.020f, 0f, 0f, 0f, 200, 0.029f, 0f, 0f, 0f, 0.250f, 0.080f, 2.742f, 0.050f, -2f, 5000f, 250f, 0f, 0x3f} );
               Hell      = new Environment ( new float[]{ 26, 100f, 0.570f, -1000, -900, -700, 3.57f, 0.49f, 2f, -10000, 0.020f, 0f, 0f, 0f, 300, 0.030f, 0f, 0f, 0f, 0.110f, 0.040f, 2.109f, 0.520f, -5f, 5000f, 139.5f, 0f, 0x40} );
              @@ -120,7 +118,7 @@ Psychotic = new Environment ( new float[]{ 25, 1f, 0.500f, -100
               
               
              -

              Car Racing

              +

              Car Racing

              DrivingCommentator    = new Environment ( new float[]{ 26, 3f, 0f, 1000, -500, -600, 2.42f, 0.88f, 0.68f, -1400, 0.093f, 0f, 0f, 0f, -1200, 0.017f, 0f, 0f, 0f, 0.250f, 1f, 0.250f, 0f, -10f, 5000f, 250f, 0f, 0x20} );
               DrivingPitgarage       = new Environment ( new float[]{ 26, 1.9f, 0.590f, -1000, -300, -500, 1.72f, 0.93f, 0.87f, -500, 0f, 0f, 0f, 0f, 200, 0.016f, 0f, 0f, 0f, 0.250f, 0.110f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x0} );
              @@ -133,7 +131,7 @@ DrivingTunnel          = new Environment ( new float[]{ 26, 3.1
               
               
              -

              City

              +

              City

              CityIndoors   = new Environment ( new float[]{ 16, 7.5f, 0.500f, -1000, -800, 0, 1.49f, 0.67f, 1f, -2273, 0.007f, 0f, 0f, 0f, -1691, 0.011f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
               CityStreets   = new Environment ( new float[]{ 26, 3f, 0.780f, -1000, -300, -100, 1.79f, 1.12f, 0.91f, -1100, 0.046f, 0f, 0f, 0f, -1400, 0.028f, 0f, 0f, 0f, 0.250f, 0.200f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x20} );
              @@ -145,7 +143,7 @@ CityAbandoned = new Environment ( new float[]{ 26, 3f, 0.690f,
               
               
              -

              Small Indoor Rooms

              +

              Small Indoor Rooms

              Room         = new Environment ( new float[]{ 2, 1.9f, 1f, -1000, -454, 0, 0.40f, 0.83f, 1f, -1646, 0.002f, 0f, 0f, 0f, 53, 0.003f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
               Bathroom     = new Environment ( new float[]{ 3, 1.4f, 1f, -1000, -1200, 0, 1.49f, 0.54f, 1f, -370, 0.007f, 0f, 0f, 0f, 1030, 0.011f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
              @@ -155,7 +153,7 @@ Stoneroom    = new Environment ( new float[]{ 5, 11.6f, 1f, -10
               
               
              -

              Medium-Sized Indoor Rooms

              +

              Medium-Sized Indoor Rooms

              Workshop     = new Environment ( new float[]{ 26, 1.9f, 1f, -1000, -1700, -800, 0.76f, 1f, 1f, 0, 0.012f, 0f, 0f, 0f, 100, 0.012f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x0} );
               Schoolroom   = new Environment ( new float[]{ 26, 1.86f, 0.690f, -1000, -400, -600, 0.98f, 0.45f, 0.18f, 300, 0.017f, 0f, 0f, 0f, 300, 0.015f, 0f, 0f, 0f, 0.095f, 0.140f, 0.250f, 0f, -5f, 7176.9f, 211.2f, 0f, 0x20} );
              @@ -167,7 +165,7 @@ Chapel       = new Environment ( new float[]{ 26, 19.6f, 0.840f
               
               
              -

              Large Indoor Rooms

              +

              Large Indoor Rooms

              Auditorium     = new Environment ( new float[]{ 6, 21.6f, 1f, -1000, -476, 0, 4.32f, 0.59f, 1f, -789, 0.020f, 0f, 0f, 0f, -289, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
               Concerthall    = new Environment ( new float[]{ 7, 19.6f, 1f, -1000, -500, 0, 3.92f, 0.70f, 1f, -1230, 0.020f, 0f, 0f, 0f, -02, 0.029f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
              @@ -179,7 +177,7 @@ DomeSaintPauls = new Environment ( new float[]{ 26, 50.3f, 0.87
               
               
              -

              Hallways, Alleys

              +

              Hallways, Alleys

              Carpettedhallway = new Environment ( new float[]{ 11, 1.9f, 1f, -1000, -4000, 0, 0.30f, 0.10f, 1f, -1831, 0.002f, 0f, 0f, 0f, -1630, 0.030f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
               Hallway          = new Environment ( new float[]{ 12, 1.8f, 1f, -1000, -300, 0, 1.49f, 0.59f, 1f, -1219, 0.007f, 0f, 0f, 0f, 441, 0.011f, 0f, 0f, 0f, 0.250f, 0f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
              @@ -188,7 +186,7 @@ Alley            = new Environment ( new float[]{ 14, 7.5f, 0.3
               
               
              -

              Outdoors

              +

              Outdoors

              Backyard      = new Environment ( new float[]{ 26, 80.3f, 0.450f, -1000, -1200, -600, 1.12f, 0.34f, 0.46f, -700, 0.069f, 0f, 0f, -0f, -300, 0.023f, 0f, 0f, 0f, 0.218f, 0.340f, 0.250f, 0f, -5f, 4399.1f, 242.9f, 0f, 0x0} );
               Plain         = new Environment ( new float[]{ 19, 42.5f, 0.210f, -1000, -2000, 0, 1.49f, 0.50f, 1f, -2466, 0.179f, 0f, 0f, 0f, -1926, 0.100f, 0f, 0f, 0f, 0.250f, 1f, 0.250f, 0f, -5f, 5000f, 250f, 0f, 0x3f} );
              @@ -203,11 +201,11 @@ Parkinglot    = new Environment ( new float[]{ 20, 8.3f, 1f, -1
               
               
              -

              Water

              +

              Water

              Underwater     = new Environment ( new float[]{ 22, 1.8f, 1f, -1000, -4000, 0, 1.49f, 0.10f, 1f, -449, 0.007f, 0f, 0f, 0f, 1700, 0.011f, 0f, 0f, 0f, 0.250f, 0f, 1.180f, 0.348f, -5f, 5000f, 250f, 0f, 0x3f} );
               Smallwaterroom = new Environment ( new float[]{ 26, 36.2f, 0.700f, -1000, -698, 0, 1.51f, 1.25f, 1.14f, -100, 0.020f, 0f, 0f, 0f, 300, 0.030f, 0f, 0f, 0f, 0.179f, 0.150f, 0.895f, 0.190f, -7f, 5000f, 250f, 0f, 0x0} );
              -

              view online version

              \ No newline at end of file +

              view online version

              \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/bloom_and_glow.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/bloom_and_glow.html index c3066a787..bbc96ca43 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/bloom_and_glow.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/bloom_and_glow.html @@ -1,9 +1,8 @@ -

              Bloom and Glow

              +

              Bloom and Glow

              - Bloom is a popular shader effect in 3D games industry. It usually consist in displaying a glowing halo around light sources or bright areas of a scene. In practice, the bright areas are extracted from the rendered scene, blurred and finally added up to the render.

              @@ -16,7 +15,7 @@ Those images gives an idea of what bloom does. The left image has no bloom effec
              -

              Bloom Usage

              +

              Bloom Usage

              1. Create a FilterPostProcessor
                @@ -34,12 +33,14 @@ Those images gives an idea of what bloom does. The left image has no bloom effec viewPort.addProcessor(fpp);

                -Here are the parameters that you can tweak : +Here are the parameters that you can tweak :

              EnvironmentdensitydiffusiongaingainHfdecayTimedecayHfreflGainreflDelaylateGainlateDelay
              Garage 1.00f1.0f1.0f1.00f0.90f0.5f0.751f0.0039f0.661f0.0137f
              + + @@ -53,30 +54,27 @@ Here are the parameters that you can tweak :
              Parameter Method Default Description
              blur scale setBlurScale(float) 1.5f the scale of the bloom effect, but be careful, high values does artifacts
              bloom intensity setBloomIntensity(float) 2.0f the resulting bloom value is multiplied by this intensity
              - +

              - You'll probably need to adjust those parameters depending on your scene.

              -

              Bloom with a glow map

              +

              Bloom with a glow map

              - Sometimes, you want to have more control over what glows and does not glow. The bloom filter supports a glow map or a glow color.

              -
              Creating a glow-map
              +
              Creating a glow-map

              - Let's take the hover tank example bundled with JME3 test data.
              Here you can see the diffuse map of the tank, and the associated glow map that only contains the parts of the texture that will glow and their glowing color:
              @@ -88,7 +86,6 @@ Here you can see the diffuse map of the tank, and the associated glow map that o

              Glow maps work with Lighting.j3md, Particles.j3md and SolidColor.j3md material definitions. The tank material looks like this : -

              Material My Material : Common/MatDefs/Light/Lighting.j3md {
                    MaterialParameters {
              @@ -105,13 +102,12 @@ The tank material looks like this :
               }

              - The glow map is defined here : GlowMap : Models/HoverTank/tank_glow_map_highres.png

              -
              Usage
              +
              Usage
              1. Create a FilterPostProcessor
                @@ -136,18 +132,17 @@ Here is the result :
              -

              Bloom with a glow color

              +

              Bloom with a glow color

              - Sometimes you need an entire object to glow, not just parts of it. In this case you'll need to use the glow color parameter.

              -
              Usage
              +
              Usage
              1. Create a material for your object and set the GlowColor parameter
                @@ -178,33 +173,30 @@ Here is the result on Oto's plasma ball (before and after) :
              -

              Hints and tricks

              +

              Hints and tricks

              -
              Increasing the blur range and reducing fps cost
              +
              Increasing the blur range and reducing fps cost

              - The glow render is sampled on a texture that has the same dimensions as the viewport. You can reduce the size of the bloom sampling just by using the setDownSamplingFactor method like this :
              -

               BloomFilter bloom=new BloomFilter();
                bloom.setDownSamplingFactor(2.0f); 

              - In this example the sampling size is divided by 4 (width/2,height/2), resulting in less work to blur the scene. The resulting texture is then up sampled to the screen size using hardware bilinear filtering. this results in a wider blur range.

              -
              Using classic bloom combined with a glow map
              +
              Using classic bloom combined with a glow map

              @@ -219,11 +211,10 @@ However, note that both effects will share the same values of attribute, and som

              -
              Making your home brewed material definition support Glow
              +
              Making your home brewed material definition support Glow

              - Let's say you have made a custom material on your own, and that you want it to support glow maps and glow color. In your material definition you need to add those lines in the MaterialParameters section :

              @@ -239,7 +230,6 @@ In your material definition you need to add those lines in the MaterialParameter

              Then add the following technique : -

                  Technique Glow {
               
              @@ -264,27 +254,23 @@ Then you can use this material with the BloomFilter
               
               
              -
              Make a glowing object stop to glow
              +
              Make a glowing object stop to glow

              - If you are using a glow map, remove the texture from the material. -

              material.clearTextureParam("GlowMap");

              If you are using a glow color, set it to black -

              material.setColor("GlowColor",ColorRGBA.Black);
              - + +

              +tag_documentation_effect_light +

              -

              view online version

              \ No newline at end of file +

              view online version

              \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/bullet_multithreading.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/bullet_multithreading.html index df6a5ea39..630c60fbb 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/bullet_multithreading.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/bullet_multithreading.html @@ -1,24 +1,22 @@ -

              Multithreading Bullet Physics in jme3

              +

              Multithreading Bullet Physics in jme3

              -

              Introduction

              +

              Introduction

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

              -

              How is it handled in jme3 and bullet?

              +

              How is it handled in jme3 and bullet?

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

              setThreadingType(ThreadingType type);
              @@ -38,9 +36,11 @@ stateManager.attach(bulletAppState); Now the physics update happens in parallel to render(), that is, after the user's changes in the update() call have been applied. During update() the physics update loop pauses. This way the loop logic is still maintained: the user can set and change values in physics and scenegraph objects before render() and physicsUpdate() are called in parallel. This allows you to use physics methods in update() as if it was single-threaded.

              + + @@ -50,16 +50,14 @@ Now the physics update happens in parallel to render(), that is, after the user&
              PARALLELSEQUENTIAL
              1. update(), 2. render() and physics update().1. update(), 2. render(), 3. physics update().

              -

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

              - + +

              +tag_documentation_physics_threading +

              -

              view online version

              \ No newline at end of file +

              view online version

              \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/butterfly-particle-emitter.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/butterfly-particle-emitter.png index 08cb7609d..8ec7be68d 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/butterfly-particle-emitter.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/butterfly-particle-emitter.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/camera.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/camera.html index 370b0a69a..f1a8d9e49 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/camera.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/camera.html @@ -1,19 +1,17 @@ -

              The jME3 Camera

              +

              The jME3 Camera

              - Note that by default, the mouse pointer is invisible, and the mouse is set up to control the camera rotation.

              -

              Default Camera

              +

              Default Camera

              - The default com.jme3.renderer.Camera object is cam in com.jme3.app.Application.

              @@ -25,7 +23,7 @@ The camera object is created with the following defaults:
            • Frustum Perspective:
                -
              • Frame of view angle of 45?? along the Y axis
                +
              • Frame of view angle of 45° along the Y axis
              • Aspect ratio of width divided by height
              • @@ -41,9 +39,11 @@ The camera object is created with the following defaults:
              + + @@ -94,20 +94,21 @@ The camera object is created with the following defaults: -

              FlyBy Camera

              +

              FlyBy Camera

              - -The flyCam class field gives you access to an AppState that extends the default camera in com.jme3.app.SimpleApplication with more features. The input manager of the com.jme3.input.FlyByCamera AppState is preconfigured to respond to the WASD keys for walking forwards and backwards, and strafing to the sides; move the mouse to rotate the camera ("Mouse Look"), scroll the mouse wheel for zooming in or out. The QZ keys raise or lower the camera vertically. +The flyCam class field gives you access to an AppState that extends the default camera in com.jme3.app.SimpleApplication with more features. The input manager of the com.jme3.input.FlyByCamera AppState is preconfigured to respond to the WASD keys for walking forwards and backwards, and strafing to the sides; move the mouse to rotate the camera (“Mouse Look”), scroll the mouse wheel for zooming in or out. The QZ keys raise or lower the camera vertically.

              Q  W             up   forw
               A  S  D    -->  left  back  right 
               Z               down  
              MethodUsage
              cam.getLocation(), setLocation()The camera position
              + + @@ -123,25 +124,25 @@ Z down
              MethodUsage
              flyCam.setEnabled(true);Activate the flyby cam

              - The FlyByCamera is active by default, but you can change all these defaults for your game.

            • -

              Chase Camera

              +

              Chase Camera

              - jME3 also supports an optional Chase Cam that can follow a moving target Spatial (com.jme3.input.ChaseCamera). When you use the chase cam, the player clicks and hold the mouse button to rotate the camera around the camera target. You can use a chase cam if you need the mouse pointer visible in your game.

              flyCam.setEnabled(false);
               ChaseCamera chaseCam = new ChaseCamera(cam, target, inputManager);
              + + @@ -176,11 +177,11 @@ ChaseCamera chaseCam = new ChaseCamera(cam, target, inputManager);
              MethodUsage
              chaseCam.setSmoothMotion(true);Interpolates a smoother acceleration/deceleration when the camera moves.
              chaseCam.setDefaultHorizontalRotation(-FastMath.PI/2);The default horizontal rotation angle of the camera around the target at the start of the application.
              - + +

              +tag_camera_documentation +

              -

              view online version

              \ No newline at end of file +

              view online version

              \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/capture_audio_video_to_a_file.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/capture_audio_video_to_a_file.html index 3b6e7638c..2212317a6 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/capture_audio_video_to_a_file.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/capture_audio_video_to_a_file.html @@ -1,9 +1,8 @@ -

              Capture Audio/Video to a File

              +

              Capture Audio/Video to a File

              - So you've made your cool new JMonkeyEngine3 game and you want to create a demo video to show off your hard work. Or maybe you want to make a cutscene for your game using the physics and characters in the @@ -22,11 +21,10 @@ feature to record high-quality game trailers!

              -

              Simple Way

              +

              Simple Way

              - First off, if all you need is to record video at 30fps with no sound, then look no further than jMonkeyEngine 3's built in VideoRecorderAppState class. @@ -55,15 +53,14 @@ That's all!

              -

              Advanced Way

              +

              Advanced Way

              -

              This way of A/V recording is still in development. It works for all of jMonkeyEngine's test cases. If you experience any problems or -if something isn't clear, please . ??? bortreb +if something isn't clear, please . – bortreb

              @@ -131,20 +128,20 @@ video frames to it will fail, and nothing will be written.

              -2.) If the filename ends in ".avi" then the frames will be encoded as +2.) If the filename ends in “.avi” then the frames will be encoded as a RAW stream inside an AVI 1.0 container. The resulting file will be quite large and you will probably want to re-encode it to your preferred container/codec format. Be advised that some video payers cannot process AVI with a RAW stream, and that AVI 1.0 files generated by this method that exceed 2.0GB are invalid -according to the AVI 1.0 spec (but many programs can still deal +according to the AVI 1.0 spec (but many programs can still deal with them.) Thanks to for his excellent work which made the AVI file writer option possible.

              -3.) Any non-directory file ending in anything other than ".avi" will +3.) Any non-directory file ending in anything other than “.avi” will be processed through Xuggle. Xuggle provides the option to use many codecs/containers, but you will have to install it on your system yourself in order to use this option. Please visit @@ -158,11 +155,10 @@ a file.

              -

              Basic Example

              +

              Basic Example

              - Here is a complete example showing how to capture both audio and video from one of jMonkeyEngine3's advanced demo applications.

              @@ -186,9 +182,9 @@ import com.jme3.app.SimpleApplication;   public class Basic {   - public static void main(String[] ignore) throws IOException{ - File video = File.createTempFile("JME-water-video", ".avi"); - File audio = File.createTempFile("JME-water-audio", ".wav"); + public static void main(IOException{ + File.createTempFile("JME-water-video", ".avi"); + File.createTempFile("JME-water-audio", ".wav");   SimpleApplication app = new TestPostWater(); app.setTimer(new IsoTimer(60)); @@ -206,11 +202,10 @@ public class Basic {
              -

              How it works

              +

              How it works

              - A standard JME3 application that extends SimpleApplication or Application tries as hard as it can to keep in sync with user-time. If a ball is rolling at 1 game-mile per game-hour in the @@ -247,11 +242,10 @@ would be useless.

              -

              Advanced Example

              +

              Advanced Example

              - The package from aurellem.com was made for AI research and can do more than just record a single stream of audio and video. You can use it to: @@ -584,49 +578,24 @@ public class Advanced extends SimpleApplication { }

              - - - - - - -The is needed to display this content. - - - +oCEfK0yhDrY?.swf

              -

              Using Advanced features to Record from more than one perspective at once

              +

              Using Advanced features to Record from more than one perspective at once

              - - - - - - -The is needed to display this content. - - - +WIJt9aRGusc?.swf

              -

              More Information

              +

              More Information

              - This is the old page showing the first version of this idea

              @@ -654,4 +623,4 @@ listeners can be found here.
              -

              view online version

              \ No newline at end of file +

              view online version

              \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/cinematics.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/cinematics.html index c709dd228..26464990d 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/cinematics.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/cinematics.html @@ -1,10 +1,9 @@ -

              JME3 Cinematics

              +

              JME3 Cinematics

              - -JME3 cinematics (com.jme.cinematic) allow you to remote control nodes and cameras in a 3D game: You can script and and play cinematic scenes. You can use cinematics to create and movies/trailers for your game. Another good use case is efficient "destruction physics": Playing back prerecorded flying pieces of debris for demolitions is much faster than calculating them with live physics. +JME3 cinematics (com.jme.cinematic) allow you to remote control nodes and cameras in a 3D game: You can script and and play cinematic scenes. You can use cinematics to create and movies/trailers for your game. Another good use case is efficient “destruction physics”: Playing back prerecorded flying pieces of debris for demolitions is much faster than calculating them with live physics.

              @@ -29,7 +28,7 @@ This Node can be the rootNode, or a Node that is attached to the rootNode.

              -

              Sample Code

              +

              Sample Code

              • @@ -38,11 +37,10 @@ This Node can be the rootNode, or a Node that is attached to the rootNode.
              -

              How to Use a Cinematic

              +

              How to Use a Cinematic

              - A Cinematic is like a movie script for a node.

              Cinematic cinematic = new Cinematic(sceneNode, duration);
              @@ -76,9 +74,11 @@ stateManager.attach(cinematic);
              + + @@ -92,22 +92,22 @@ stateManager.attach(cinematic); -

              Events(CinematicEvents)

              +

              Events(CinematicEvents)

              - Just like a movie script consists of lines with instructions to the actors, each Cinematic consists of a series of events.

              Here is the list of available CinematicEvents that you use as events. Each track remote-controls scene objects in a different way: -

              MethodUsage
              cinematic.play()Starts playing the cinematic from the start, or from where it was paused.
              + + @@ -115,7 +115,7 @@ Here is the list of available CinematicEvents that you use as events. Each track - + @@ -123,20 +123,16 @@ Here is the list of available CinematicEvents that you use as events. Each track
              Events(CinematicEvents)Description
              MotionEventUse a MotionEvent to move a Spatial non-linearly over time. A MotionEvent is based on a list of waypoints in a MotionPath. The curve goes through each waypoint, and you can adjust the tension of the curve to modify the roundedness of the path. This is the motion interpolation you are going to use in most cases.
              SoundEventUse a SoundEvent to play a sound at a given time for the given duration.
              GuiEventDisplays a Nifty GUI at a given time for the given duration. Use it to display subtitles or HUD elements. Bind the Nifty GUI XML to the cinematic using cinematic.bindUi("path/to/nifty/file.xml");GuiEventDisplays a Nifty GUI at a given time for the given duration. Use it to display subtitles or HUD elements. Bind the Nifty GUI XML to the cinematic using cinematic.bindUi(“path/to/nifty/file.xml”);
              AnimationEventUse this to start playing a model animation at a given time (a character walking animation for example)

              - -Of course one can make is own event implementation, by extending the AbstractCinematicEvent. - +You can add custom events by extending AbstractCinematicEvent.

              - -

              MotionEvent

              + +

              MotionEvent

              - A MotionEvent moves a Spatial along a complex path. -

              MotionEvent events= new MotionEvent (thingNode, path);
              @@ -151,7 +147,6 @@ Details of the constructor:

              - To create a MotionEvent, do the following:

                @@ -165,9 +160,11 @@ To create a MotionEvent, do the following:
              + + @@ -193,30 +190,26 @@ To create a MotionEvent, do the following:
              MotionEvent configuration methodUsage
              event.setLoopMode(LoopMode.Loop)Sets whether the animation along this path should loop (LoopMode.Loop) or play only once (LoopMode.DontLoop).
              event.setRotation(quaternion)Sets the rotation. Use together with MotionEvent.Direction.Rotation or MotionEvent.Direction.PathAndRotation.
              - +

              - Tip: Most likely you remote-control more than one object in your scene. Give the events and paths useful names such as dragonEvent, dragonPath, heroEvent, heroPath, etc.

              - -

              SoundEvent

              + +

              SoundEvent

              - A SoundEventplays a sound as part of the cinematic. -

              SoundEvent( audioPath, isStream, duration, loopMode )

              - Details of the constructor:

                -
              • audioPath is the path to an audio file as String, e.g. "Sounds/mySound.wav".
                +
              • audioPath is the path to an audio file as String, e.g. “Sounds/mySound.wav”.
              • isStream toggles between streaming and buffering. Set to true to stream long audio file, set to false to play short buffered sounds.
              • @@ -227,21 +220,17 @@ Details of the constructor:
              - -

              GuiEvent

              + +

              GuiEvent

              - A GuiEventshows or hide a NiftyGUI as part of a cinematic. -

              GuiEvent( screen, duration, loopMode )

              - -You must use this together with bindUI() to specify the Nifty GUI XML file that you want to load: - +You must use this together with bindUI() to specify the Nifty GUI XML file that you want to load:

              cinematic.bindUi("Interface/subtitle.xml");
              @@ -249,7 +238,7 @@ You must use this together with bindUI() to specify the Nifty GUI screen to load, as String.
              +
            • screen is the name of the Nifty GUI screen to load, as String.
            • duration is the time that it should take to play.
            • @@ -258,19 +247,16 @@ Details of the constructor: - -

              AnimationEvent

              + +

              AnimationEvent

              - An AnimationEvent triggers an animation as part of a cinematic. -

              AnimationEvent( thingNode, animationName, duration, loopMode )

              - Details of the constructor:

                @@ -285,26 +271,22 @@ Details of the constructor:
              - -

              Camera Management

              + +

              Camera Management

              - There is a built in system for camera switching in Cinematics. It based on CameraNode, and the cinematic just enable the given CameraNode control at a given time.

              First you have to bind a camera to the cinematic with a unique name. You'll be provided with a CameraNode -

               CameraNode camNode = cinematic.bindCamera("topView", cam);

              - then you can do whatever you want with this camera node : place it so that you have a the camera angle you'd like, attach it to a motion event to have some camera scrolling, attach control of your own that give it whatever behavior you'd like. In the above example, I want it to be a top view of the scene looking at the world origin. -

               //set its position
                camNode.setLocalTranslation(new Vector3f(0, 50, 0));
              @@ -313,32 +295,30 @@ In the above example, I want it to be a top view of the scene looking at the wor
               
               

              Then i just have to schedule its activation in the cinematic. I want it to get activated 3 seconds after the start of the cinematic so I just have to do -

              -
               cinematic.activateCamera(3,???topView???);
              +
               cinematic.activateCamera(3,”topView”);
              - -

              Customizations

              + +

              Customizations

              - You can extend individual CinematicEvents. The shows how to extend a GuiTrack to script subtitles. See how the subtitles are used in the .

              -You can also create new CinematicEvent by extending . An AbstractCinematicEvent implements the CinematicEvent interface and provides duration, time, speed, etc??? management. Look at the is to use this for a custom fadeIn/fadeOut effect in combination with a com.jme3.post.filters.FadeFilter. +You can also create new CinematicEvent by extending . An AbstractCinematicEvent implements the CinematicEvent interface and provides duration, time, speed, etc… management. Look at the is to use this for a custom fadeIn/fadeOut effect in combination with a com.jme3.post.filters.FadeFilter.

              - -

              Interacting with Cinematics

              + +

              Interacting with Cinematics

              - -

              CinematicEventListener

              + +

              CinematicEventListener

              CinematicEventListener cel = new CinematicEventListener() {
                 public void onPlay(CinematicEvent cinematic) {
              @@ -359,15 +339,14 @@ You can also create new CinematicEvent by extending 
              -

              Physics Interaction

              + +

              Physics Interaction

              - Upcoming.

              - -

              view online version

              \ No newline at end of file + +

              view online version

              \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/collision_and_intersection.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/collision_and_intersection.html index a9f78fa65..6611944a6 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/collision_and_intersection.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/collision_and_intersection.html @@ -1,9 +1,8 @@ -

              Collision and Intersection

              +

              Collision and Intersection

              - The term collision can be used to refer to physical interactions (where physical objects collide, push and bump off one another), and also to non-physical intersections in 3D space. This article is about the non-physical (mathematical) collisions.

              @@ -12,16 +11,15 @@ Non-physical collision detection is interesting because it uses less computing r

              -Example: One example for an optimization is a physical vehicle's wheels. You could make the wheels fully physical disks, and have jME calculate every tiny force ??? sounds very accurate? It's total overkill and too slow for a racing game. A more performant solution is to cast four invisible rays down from the vehicle and calculate the intersections with the floor. These non-physical wheels require (in the simplest case) only four calculations per tick to achieve an effect that players can hardly distinguish from the real thing. +Example: One example for an optimization is a physical vehicle's wheels. You could make the wheels fully physical disks, and have jME calculate every tiny force – sounds very accurate? It's total overkill and too slow for a racing game. A more performant solution is to cast four invisible rays down from the vehicle and calculate the intersections with the floor. These non-physical wheels require (in the simplest case) only four calculations per tick to achieve an effect that players can hardly distinguish from the real thing.

              -

              Collidable

              +

              Collidable

              - The interface com.jme3.collision.Collidable declares one method that returns how many collisions were found between two Collidables: collideWith(Collidable other, CollisionResults results).

                @@ -32,9 +30,11 @@ Note that jME counts all collisions, this means a ray intersecting a bo
              + + @@ -53,9 +53,11 @@ Note that jME counts all collisions, this means a ray intersecting a bo A CollisionResult object contains information about the second party of the collision event.

              CollisionResults MethodUsage
              size() Returns the number of CollisionResult objects.
              + + @@ -78,11 +80,10 @@ A CollisionResult object contains information about the second party of the coll -

              Code Sample

              +

              Code Sample

              - Assume you have two collidables a and b and want to detect collisions between them. The collision parties can be Geometries, Nodes with Geometries attached (including the rootNode), Planes, Quads, Lines, or Rays. An important restriction is that you can only collide geometry vs bounding volumes or rays. (This means for example that a must be of Type Node or Geometry and b respectively of Type BoundingBox, BoundingSphere or Ray.)

              @@ -129,16 +130,14 @@ You can also loop over all results and trigger different reactions depending on

              Knowing the distance of the collisions is useful for example when you intersect Lines and Rays with other objects. -

              -

              Bounding Volumes

              +

              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.

              @@ -147,12 +146,12 @@ jME3 computes bounding volumes for all objects. These bounding volumes are later

              -All fast-paced action and shooter games use BoundingVolumes as an optimization. Wrap all complex models into simpler shapes ??? in the end, you get equally useful collision detection results, but faster. +All fast-paced action and shooter games use BoundingVolumes as an optimization. Wrap all complex models into simpler shapes – in the end, you get equally useful collision detection results, but faster.

              Supported types: - +

              • 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.
                @@ -161,52 +160,46 @@ Supported types:
              • 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. (Currently not supported.)
                +
              • Type.Capsule = Cylinder with rounded ends, also called “swept sphere”. Typically used for mobile characters. (Currently not supported.)

              -

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

              -

              -

              Usage

              +

              Usage

              - For example you can use Bounding Volumes on custom meshes, or complex non-physical shapes. -

              mesh.setBound(new BoundingSphere());
               mesh.updateBound();
              -

              Mesh and Scene Graph Collision

              +

              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

              +

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

              -Rays are used to perform line-of-sight calculations. This means you can detect what users were "aiming at" when they clicked or pressed a key. You can also use this to detect whether game characters can see something (or someone) or not. +Rays are used to perform line-of-sight calculations. This means you can detect what users were “aiming at” when they clicked or pressed a key. You can also use this to detect whether game characters can see something (or someone) or not.

              • Click to select: You can determine what a user has clicked by casting a ray from the camera forward in the direction of the camera. Now identify the closest collision of the ray with the rootNode, and you have the clicked object.
                @@ -216,8 +209,7 @@ Rays are used to perform line-of-sight calculations. This means you can detect w

              - -

              These simple but powerful ray-surface intersection tests are called Ray Casting. As opposed to the more advanced Ray Tracing technique, Ray Casting does not follow the ray's reflection after the first hit ??? the ray just goes straight on. +

              These simple but powerful ray-surface intersection tests are called Ray Casting. As opposed to the more advanced Ray Tracing technique, Ray Casting does not follow the ray's reflection after the first hit – the ray just goes straight on.

              @@ -238,4 +230,4 @@ TODO:
              -

              view online version

              \ No newline at end of file +

              view online version

              \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/combo_moves.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/combo_moves.html index 5253884ab..ef290378f 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/combo_moves.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/combo_moves.html @@ -1,5 +1,5 @@ -

              Combo Moves

              +

              Combo Moves

              @@ -7,7 +7,7 @@ The ComboMoves class allows you to define combinations of inputs that trigger sp

              -Combos are usually a series of inputs, in a fixed order: For example a keyboard combo can look like: "press Down, then Down+Right together, then Right". +Combos are usually a series of inputs, in a fixed order: For example a keyboard combo can look like: “press Down, then Down+Right together, then Right”.

              @@ -25,30 +25,28 @@ Usage:

              - Copy the two classes ComboMoveExecution.java and ComboMove.java into your application and adjust them to your package paths.

              -

              Example Code

              +

              Example Code

              • -
              • ??? required
                +
              • ← required
              • -
              • ??? required
                +
              • ← required
              -

              Create Input Triggers

              +

              Create Input Triggers

              - First you define your game's inputs as you usually do: Implement the com.jme3.input.controls.ActionListener interface for your class, and add triggers mappings such as com.jme3.input.controls.KeyTrigger and com.jme3.input.KeyInput.

              @@ -65,16 +63,15 @@ inputManager.addListener(this, "Left", "Right", "Up
              -

              Define Combos

              +

              Define Combos

              - For each of your combo moves, you specify the series of inputs that will trigger it. The order in which you define them is the order the player has to press them for the step to be recorded. When all steps have been recorded, the combo is triggered.

              -The following example shows how a fireball combo move is triggered by pressing the navigation keys for "down, down+right, right", in this order. +The following example shows how a fireball combo move is triggered by pressing the navigation keys for “down, down+right, right”, in this order.

              ComboMove fireball = new ComboMove("Fireball");
               fireball.press("Down").notPress("Right").done();
              @@ -90,37 +87,37 @@ Also create a ComboMoveExecution object for each ComboMove. You need it later to
               
               
              -

              ComboMove Class Methods

              +

              ComboMove Class Methods

              - Use the following ComboMove methods to specify the combo: -

              CollisionResult MethodUsage
              getContactPoint()Returns the contact point coordinate on the second party, as Vector3f.
              + + - - - + - + - +
              ComboMove MethodDescription
              press("A").done();
              -press("A","B").done();
              Combo step is recorded if A is entered.
              +
              press(“A”).done();
              +press(“A”,“B”).done();
              Combo step is recorded if A is entered.
              Combo step is recorded if A and B are entered simultaneously.
              notPress("A").done();
              -notPress("A","B").done();
              Combo step is recorded if A is released.
              +
              notPress(“A”).done();
              +notPress(“A”,“B”).done();
              Combo step is recorded if A is released.
              Combo step is recorded if A and B are both released.
              press("A").notPress("B").done();Combo step is recorded if A is entered, and not Bpress(“A”).notPress(“B”).done();Combo step is recorded if A is entered, and not B
              press("A").notPress("B").timeElapsed(0.11f).done();Combo step is recorded a certain time after A and not B is entered.
              -etc, etc ???
              press(“A”).notPress(“B”).timeElapsed(0.11f).done();Combo step is recorded a certain time after A and not B is entered.
              +etc, etc …
              setPriority(0.5f);If there is an ambiguity, a high-priority combo will trigger instead of a low-priority combo. This prevents that a similar looking combo step "hijacks" another Combo. Use only once per ComboMove.setPriority(0.5f);If there is an ambiguity, a high-priority combo will trigger instead of a low-priority combo. This prevents that a similar looking combo step “hijacks” another Combo. Use only once per ComboMove.
              setUseFinalState(false);
              @@ -131,18 +128,18 @@ True: This is the final state, do not chain combo steps. (?)

              - -The press() and notPress() methods accept sets of Input Triggers, e.g. fireball.press("A","B","C").done(). +The press() and notPress() methods accept sets of Input Triggers, e.g. fireball.press(“A”,“B”,“C”).done().

              The following getters give you more information about the game state: -

              + + @@ -156,11 +153,10 @@ The following getters give you more information about the game state: -

              Detect Combos in ActionListener

              +

              Detect Combos in ActionListener

              - Now that you have specified the combo steps, you want to detect them. You do that in the onAction() method that you get from the ActionListener interface.

              @@ -215,11 +211,10 @@ public void onAction(String name, boolean isPressed, float tpf) {
              -

              Execute Combos in the Update Loop

              +

              Execute Combos in the Update Loop

              - Now that you have detected the current move, you want to execute it. You do that in the update loop.

              @Override
              @@ -245,26 +240,23 @@ Test currentMove.getMoveName() and proceed to call methods that imp
               
               
              -

              Why Combos?

              +

              Why Combos?

              - Depending on the game genre, the designer can reward the players' intrinsical or extrinsical skills: -

              • (intrinsical:) RPGs typically calculate the success of an attack from the character's in-game training level: The player plays the role of a character whose skill level is defined in numbers. RPGs typically do not offer any Combos.
              • -
              • (extrinsical:) Sport and fighter games typically choose to reward the player's "manual" skills: The success of a special move solely depends on the player's own dexterity. These games typically offer optional Combos.
                +
              • (extrinsical:) Sport and fighter games typically choose to reward the player's “manual” skills: The success of a special move solely depends on the player's own dexterity. These games typically offer optional Combos.
              - + +

              +tag_keyinput_input_documentation +

              -

              view online version

              \ No newline at end of file +

              view online version

              \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/custom_controls.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/custom_controls.html index ee83db106..12c7dfcc9 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/custom_controls.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/custom_controls.html @@ -1,13 +1,13 @@ -

              Custom Controls

              +

              Custom Controls

              -A com.jme3.scene.control.Control is a customizable jME3 interface that allows you to cleanly steer the behaviour of game entities (Spatials), such as artificially intelligent behaviour in NPCs, traps, automatic alarms and doors, animals and pets, self-steering vehicles or platforms ??? anything that moves and interacts. Several instances of custom Controls together implement the behaviours of a type of Spatial. +A com.jme3.scene.control.Control is a customizable jME3 interface that allows you to cleanly steer the behaviour of game entities (Spatials), such as artificially intelligent behaviour in NPCs, traps, automatic alarms and doors, animals and pets, self-steering vehicles or platforms – anything that moves and interacts. Several instances of custom Controls together implement the behaviours of a type of Spatial.

              -To control global game behaviour see Application States ??? you often use AppStates and Control together. +To control global game behaviour see Application States – you often use AppStates and Control together.

              - Usage: Your custom subclass implements the three methods controlUpdate(), controlRender(), setSpatial(), and cloneForSpatial() as shown here:

              public class MyControl extends AbstractControl implements Savable, Cloneable {
              @@ -222,11 +214,10 @@ See also:
               
               
              -

              The Control Interface

              +

              The Control Interface

              -

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

              @@ -246,19 +237,15 @@ The AssetManager also uses this method if the same spatial is loaded twice. You

              - Usage example: 1. Create a custom control interface -

              public interface MyControlInterface extends Control {
                   public void setSomething(int x); // optionally, add custom methods
               }

              - 2. Create custom Controls implementing your Control interface. -

              public class MyControl extends MyCustomClass implements MyControlInterface {
                
              @@ -329,14 +316,12 @@ Usage example:
               
               
              -

              Best Practices

              +

              Best Practices

              - Tip: Use the getControl() accessor to get Control objects from Spatials. No need to pass around lots of object references. Here an example from the code: -

              public class CharacterAnimControl implements Control {
                 ...
              @@ -349,9 +334,7 @@ Here an example from the 
               
               

              - Then you create custom sub-Controls and implement the methods accordingly to the context: -

              public class ManualVehicleControl   extends ManualControl {...}

              and -

              public class ManualCharacterControl extends ManualControl {...}

              - Then add the appropriate controls to spatials: -

              characterSpatial.addControl(new ManualCharacterControl());
               ...
              @@ -386,13 +364,11 @@ vehicleSpatial.addControl(new ManualVehicleControl());
               ...

              - Tip: Use the getControl() method on a Spatial to get a specific Control object, and activate its behaviour! -

              ManualControl c = mySpatial.getControl(ManualControl.class);
               c.steerX(steerX);
              -

              view online version

              \ No newline at end of file +

              view online version

              \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/custom_meshes.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/custom_meshes.html index bec467405..3ebfabf16 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/custom_meshes.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/custom_meshes.html @@ -1,15 +1,14 @@ -

              Custom Mesh Shapes

              +

              Custom Mesh Shapes

              - + Use the Mesh class to create custom shapes that go beyond Quad, Box, Cylinder, and Sphere, even procedural shapes are possible. Thank you to KayTrance for providing the sample code!

              Note: In this tutorial, we (re)create a very simple rectangular mesh (a quad), and we have a look at different ways of coloring it. Coding a custom quad may not be very useful because it's exactly the same as the built-in com.jme3.scene.shape.Quad. We chose a simple quad to teach you how to build any shape out of triangles, without the distractions of more complex shapes. -

              • Full code sample:
                @@ -18,11 +17,10 @@ Use the Mesh class to create custom shapes that go beyond Quad, Box, Cylinder, a
              -

              Polygon Meshes

              +

              Polygon Meshes

              - Polygon meshes are made up of triangles. The corners of the triangles are called vertices. When ever you create any new shape, you break it down into triangles.

              @@ -35,17 +33,16 @@ The important thing is that you have to specify the vertices of each triangle in

              -Sounds harder than it is ??? let's create a simple custom mesh, a quad. +Sounds harder than it is – let's create a simple custom mesh, a quad.

              -

              Creating a Quad Mesh

              +

              Creating a Quad Mesh

              - -In this tutorial we want to create a 3x3 Quad. The quad has four vertices, and is made up of two triangles. In our example, we decide that the bottom left corner is at 0/0/0 and the top right is at 3/3/0. +In this tutorial we want to create a 3×3 Quad. The quad has four vertices, and is made up of two triangles. In our example, we decide that the bottom left corner is at 0/0/0 and the top right is at 3/3/0.

              0,3,0--3,3,0
               | \        |
              @@ -57,13 +54,11 @@ In this tutorial we want to create a 3x3 Quad. The quad has four vertices, and i
               
               
              -

              The Mesh Object

              +

              The Mesh Object

              - The base class for creating meshes is com.jme3.scene.Mesh. -

              Mesh mesh = new Mesh();
              @@ -73,13 +68,11 @@ Tip: If you create your own Mesh-based class (public class MyMesh extends
              -

              Vertex Coordinates

              +

              Vertex Coordinates

              - To define your own shape, determine the shape's vertex coordinates in 3D space. Store the list of corner positions in an com.jme3.math.Vector3f array. For a Quad, we need four vertices: Bottom left, bottom right, top left, top right. We name the array vertices[]. -

              Vector3f [] vertices = new Vector3f[4];
               vertices[0] = new Vector3f(0,0,0);
              @@ -89,12 +82,11 @@ vertices[3] = new Vector3f(3,3,0);
              -

              Texture Coordinates

              +

              Texture Coordinates

              Next, we define the Quad's 2D texture coordinates for each vertex, in the same order as the vertices: Bottom left, bottom right, top left, top right. We name this Vector2f array texCoord[] -

              Vector2f[] texCoord = new Vector2f[4];
               texCoord[0] = new Vector2f(0,0);
              @@ -103,13 +95,12 @@ texCoord[2] = new Vector2f(0,1);
               texCoord[3] = new Vector2f(1,1);

              - This syntax means, when you apply a texture to this mesh, the texture will fill the quad from corner to corner at 100% percent size. Especially when you stitch together a larger mesh, you use this to tell the renderer whether, and how exactly, you want to cover the whole mesh. E.g. if you use .5f or 2f as texture coordinates instead of 1f, textures will be stretched or shrunk accordingly.

              -

              Connecting the Dots

              +

              Connecting the Dots

              @@ -118,12 +109,10 @@ Next we turn these unrelated coordinates into triangles: We def

              Remember that you must specify the vertices counter-clockwise. -

              int [] indexes = { 2,0,1, 1,3,2 };

              - This syntax means:

                @@ -140,18 +129,17 @@ This syntax means: 0--1\1

                - -If the shape is more complex, it has more triangles, and therefor also more vertices/indices. Just continue expanding the list by adding groups of three indices for each triangle. (For example a three-triangle "house" shape has 5 vertices/indices and you'd specify three groups: int [] indexes = { 2,0,1, 1,3,2, 2,3,4 };.) +If the shape is more complex, it has more triangles, and therefor also more vertices/indices. Just continue expanding the list by adding groups of three indices for each triangle. (For example a three-triangle “house” shape has 5 vertices/indices and you'd specify three groups: int [] indexes = { 2,0,1, 1,3,2, 2,3,4 };.)

                -

                If you get the order wrong (clockwise) for some of the triangles, then these triangles face backwards. If the Spatial's material uses the default FaceCullMode.Back (see "face culling"), the broken triangles appear as holes in the rendered mesh. You need to identify and fix them in your code. +

                If you get the order wrong (clockwise) for some of the triangles, then these triangles face backwards. If the Spatial's material uses the default FaceCullMode.Back (see “face culling”), the broken triangles appear as holes in the rendered mesh. You need to identify and fix them in your code.

                -

                Setting the Mesh Buffer

                +

                Setting the Mesh Buffer

                @@ -181,18 +169,16 @@ mesh.setBuffer(Type.Index, 3, BufferUtils.createIntBuffer(indexes) mesh.updateBound();

                - Our Mesh is ready! Now we want to see it.

                - -

                Using the Mesh in a Scene

                + +

                Using the Mesh in a Scene

                -We create a com.jme3.scene.Geometry from our mesh, apply a simple color material to it, and attach it to the rootNode to make it appear in the scene. - +We create a com.jme3.scene.Geometry and com.jme3.material.Materialfrom our mesh, apply a simple color material to it, and attach it to the rootNode to make it appear in the scene.

                Geometry geo = new Geometry("OurMesh", mesh); // using our custom mesh object
                 Material mat = new Material(assetManager, 
                @@ -202,33 +188,58 @@ geo.setMaterial(mat);
                 rootNode.attachChild(geo);

                - +Library for assetManager? Ta-daa!

                - -

                Dynamic Meshes

                + +

                Using a Quad instead

                +We created a quad Mesh it can be replace by a Quad such as : +

                +
                Quad quad = new Quad(1,1); // replace the definition of Vertex and Textures Coordinates plus indexes
                +Geometry geo = new Geometry("OurQuad", quad); // using Quad object
                +Material mat = new Material(assetManager, 
                +    "Common/MatDefs/Misc/Unshaded.j3md");
                +mat.setColor("Color", ColorRGBA.Blue);
                +geo.setMaterial(mat);
                +rootNode.attachChild(geo);
                + +

                +If you want to change the Textures Coordinates, in order to change the scale of the texture, use : +

                +
                Quad quad = new Quad(1,1);
                +quad.scaleTextureCoordinates(new Vector2f(width , height));
                + +
                + +

                Dynamic Meshes

                +
                +

                If you are modifying a mesh dynamically in a way which changes the model's bounds, you need to update it:

                  -
                1. Call updateBounds() on the mesh object, and then
                  +
                2. Call updateBound() on the mesh object, and then
                3. call updateModelBound() on the Geometry object containing the mesh.

                -The updateModelBounds() method warns you about not usually needing to use it, but that can be ignored in this special case. +The updateModelBound() method warns you about not usually needing to use it, but that can be ignored in this special case. +

                + +

                +N.B.: This does not work on TerrainQuad. Please use the TerrainQuad.adjustHeight() function to edit the TerrainQuad mesh instead. Additionally, if you want to use collisions on them afterwards, you need to call TerrainPatch.getMesh().createCollisionData(); to update the collision data, else it will collide with what seems to be the old mesh.

                - -

                Optional Mesh Features

                + +

                Optional Mesh Features

                @@ -236,8 +247,8 @@ There are more vertex buffers in a Mesh than the three shown above. For an overv

                - -

                Example: Vertex Colors

                + +

                Example: Vertex Colors

                @@ -271,7 +282,6 @@ You create a float array color buffer:

              - Loop over the colorArray buffer to quickly set some RGBA value for each vertex. As usual, RGBA color values range from 0.0f to 1.0f. Note that the color values in this example are arbitrarily chosen. It's just a quick loop to give every vertex a different RGBA value (a purplish gray, purple, a greenish gray, green, see screenshot), without writing too much code. For your own mesh, you'd assign meaningful values for the color buffer depending on which color you want your mesh to have.

              // note: the red and green values are arbitray in this example
              @@ -288,23 +298,20 @@ for(int i = 0; i < 4; i++){
               
               

              Next, set the color buffer. An RGBA color value contains four float components, thus the parameter 4. -

              mesh.setBuffer(Type.Color, 4, colorArray);
               geo.setMaterial(matVC);

              - When you run this code, you see a gradient color extending from each vertex.

              - -

              Example: Using Meshes With Lighting.j3md

              + +

              Example: Using Meshes With Lighting.j3md

              - The previous examples used the mesh together with the Unshaded.j3md material. If you want to use the mesh with a Phong illuminated material (such as Lighting.j3md), the mesh must include information about its Normals. (Normal Vectors encode in which direction a mesh polygon is facing, which is important for calculating light and shadow!)

              float[] normals = new float[12];
              @@ -320,12 +327,11 @@ If the mesh is more complex or rounded, calculate cross products of neighbouring
               

              - -

              Example: Point Mode

              + +

              Example: Point Mode

              - Additionally to coloring the faces as just described, you can hide the faces and show only the vertices as colored corner points.

              Geometry coloredMesh = new Geometry ("ColoredMesh", cMesh);
              @@ -340,22 +346,20 @@ rootNode.attachChild(points);
               rootNode.attachChild(geo);

              - This will result in a 10 px dot being rendered for each of the four vertices. The dot has the vertex color you specified above. The Quad's faces are not rendered at all in this mode. You can use this to visualize a special debugging or editing mode in your game.

              - -

              Debugging Tip: Culling

              + +

              Debugging Tip: Culling

              - -By default, jME3 optimizes a mesh by "backface culling", this means not drawing the inside. It determines the side of a triangle by the order of the vertices: The frontface is the face where the vertices are specified counter-clockwise. +By default, jME3 optimizes a mesh by “backface culling”, this means not drawing the inside. It determines the side of a triangle by the order of the vertices: The frontface is the face where the vertices are specified counter-clockwise.

              -This means for you that, by default, your custom mesh is invisible when seen from "behind" or from the inside. This may not be a problem, typically this is even intended, because it's faster. The player will not look at the inside of most things anyway. For example, if your custom mesh is a closed polyhedron, or a flat wallpaper-like object, then rendering the backfaces (the inside of the pillar, the back of the painting, etc) would indeed be a waste of resources. +This means for you that, by default, your custom mesh is invisible when seen from “behind” or from the inside. This may not be a problem, typically this is even intended, because it's faster. The player will not look at the inside of most things anyway. For example, if your custom mesh is a closed polyhedron, or a flat wallpaper-like object, then rendering the backfaces (the inside of the pillar, the back of the painting, etc) would indeed be a waste of resources.

              @@ -373,22 +377,18 @@ In case however that your usecase requires the backfaces be visible, you have tw

              See also: -

                -
              • Spatial ??? contains more info about how to debug custom meshes (that do not render as expected) by changing the default culling behaviour.
                +
              • Spatial – contains more info about how to debug custom meshes (that do not render as expected) by changing the default culling behaviour.
              • -
              • Mesh ??? more details about advanced Mesh properties
                +
              • Mesh – more details about advanced Mesh properties
              - + +

              +tag_spatial_node_mesh_geometry_scenegraph +

              - -

              view online version

              \ No newline at end of file + +

              view online version

              \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/debug-shapes.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/debug-shapes.png index 998330a83..13ac04426 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/debug-shapes.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/debug-shapes.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/debugging.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/debugging.html index b7857aa62..7a951cfa8 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/debugging.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/debugging.html @@ -1,18 +1,17 @@ -

              Debugging

              +

              Debugging

              - When you deal with complex game engine features like animations or physics it is handy to get feedback from the engine how it interpreted the current state. Is the physical object's collision shape really where you think it is? Is the skeleton of the animated character moving like you think it should? This document shows you how to activate visual debug aides.

              -What if you just want to quickly write code that loads models and brings them in their start position? You may not want to hunt for a sample model, convert it, add lights, and load materials. Instead you use "hasslefree" simple shapes, and a "hasslefree" unshaded material or wireframe: No model, no light source, no materials are needed to see them in your test scene. +What if you just want to quickly write code that loads models and brings them in their start position? You may not want to hunt for a sample model, convert it, add lights, and load materials. Instead you use “hasslefree” simple shapes, and a “hasslefree” unshaded material or wireframe: No model, no light source, no materials are needed to see them in your test scene.

              -If you ever have problems with objects appearing in the wrong spot, with the wrong scale, or wrong orientation, simply attach debug shapes to your scene to have a point of reference in 3D space ??? just like a giant ruler. If your code positions the debug shapes correctly, but models remain invisible when you apply the same code to them, you know that the problem must be either the model (where is its origin coordinate?), or the light (too dark? too bright? missing?), or the model's material (missing?) ??? and not the positioning code. +If you ever have problems with objects appearing in the wrong spot, with the wrong scale, or wrong orientation, simply attach debug shapes to your scene to have a point of reference in 3D space – just like a giant ruler. If your code positions the debug shapes correctly, but models remain invisible when you apply the same code to them, you know that the problem must be either the model (where is its origin coordinate?), or the light (too dark? too bright? missing?), or the model's material (missing?) – and not the positioning code.

              @@ -25,17 +24,16 @@ Here are some different debug shapes:

              -

              Debug Shapes

              +

              Debug Shapes

              -

              Coordinate Axes

              +

              Coordinate Axes

              - -The coordinate axes (com.jme3.scene.debug.Arrow) help you see the cardinal directions (X,Y,Z) from their center point. Scale the arrows to use them as a "ruler" for a certain length. +The coordinate axes (com.jme3.scene.debug.Arrow) help you see the cardinal directions (X,Y,Z) from their center point. Scale the arrows to use them as a “ruler” for a certain length.

              private void attachCoordinateAxes(Vector3f pos){
                 Arrow arrow = new Arrow(Vector3f.UNIT_X);
              @@ -63,14 +61,13 @@ private Geometry putShape(Mesh shape, ColorRGBA color){
               
               
              -

              Wireframe Grid

              +

              Wireframe Grid

              - Use a wireframe grid (com.jme3.scene.debug.Grid) as a ruler or simple floor.

              -
              private void attachGrid(Vector3f pos, float size, ColorRGBA color){
              +
              private Geometry attachGrid(Vector3f pos, float size, ColorRGBA color){
                 Geometry g = new Geometry("wireframe grid", new Grid(size, size, 0.2f) );
                 Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
                 mat.getAdditionalRenderState().setWireframe(true);
              @@ -82,15 +79,14 @@ Use a wireframe grid (com.jme3.scene.debug.Grid) as a ruler or simple floor.
               }
              - -

              Wireframe Cube

              + +

              Wireframe Cube

              - Use a wireframe cube (com.jme3.scene.debug.WireBox) as a stand-in object to see whether your code scales, positions, or orients, loaded models right.

              -
              public void attachWireBox(Vector3f pos, float size, ColorRGBA color){
              +
              public Geometry attachWireBox(Vector3f pos, float size, ColorRGBA color){
                 Geometry g = new Geometry("wireframe cube", new WireBox(size, size, size));
                 Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
                 mat.getAdditionalRenderState().setWireframe(true);
              @@ -102,15 +98,14 @@ Use a wireframe cube (com.jme3.scene.debug.WireBox) as a stand-in object to see
               }
              - -

              Wireframe Sphere

              + +

              Wireframe Sphere

              - Use a wireframe sphere (com.jme3.scene.debug.WireSphere) as a stand-in object to see whether your code scales, positions, or orients, loaded models right.

              -
              private void attachWireSphere(Vector3f pos, float size, ColorRGBA color){
              +
              private Geometry attachWireSphere(Vector3f pos, float size, ColorRGBA color){
                 Geometry g = new Geometry("wireframe sphere", new WireSphere(size));
                 Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
                 mat.getAdditionalRenderState().setWireframe(true);
              @@ -122,12 +117,11 @@ Use a wireframe sphere (com.jme3.scene.debug.WireSphere) as a stand-in object to
               }
              - -

              Wireframe for Physics

              + +

              Wireframe for Physics

              - You can display a wireframe of the (usually invisible) collision shape around all physical objects. Use this for debugging when analyzing unexpected behaviour. Does not work with DETACHED physics, please switch to PARALLEL or SEQUENTIAL for debugging.

              physicsSpace.enableDebug(assetManager);
              @@ -149,12 +143,11 @@ With debugging enabled, colors are used to indicate various types of physical ob
              - -

              Wireframe for Animations

              + +

              Wireframe for Animations

              - Making the skeleton visible inside animated models can be handy for debugging animations. The control object is an AnimControl, player is the loaded model.

                   SkeletonDebugger skeletonDebug = 
              @@ -166,25 +159,23 @@ Making the skeleton visible inside animated models can be handy for debugging an
                    player.attachChild(skeletonDebug);
              - -

              Example: Toggle Wireframe on Model

              + +

              Example: Toggle Wireframe on Model

              - We assume that you have loaded a model with a material mat.

              Then you can add a switch to toggle the model's wireframe on and off, like this: -

              1. Create a key input trigger that switches between the two materials: E.g. we toggle when the T key is pressed:
                    inputManager.addMapping("toggle wireframe", new KeyTrigger(KeyInput.KEY_T));
                     inputManager.addListener(actionListener, "toggle wireframe");
              2. -
              3. Now add the toggle action to the action listener
                  private ActionListener actionListener = new ActionListener() {
                +
              4. Now add the toggle action to the action listener
                  private ActionListener() {
                     @Override
                     public void onAction(String name, boolean pressed, float tpf) {
                       // toggle wireframe
                @@ -197,7 +188,7 @@ Then you can add a switch to toggle the model's wireframe on and off, like
                   };
              5. -
              6. Alternatively you could traverse over the whole scene and toggle for all Geometry objects in there if you don't want to create a new SceneProcessor
                  private ActionListener actionListener = new ActionListener() {
                +
              7. Alternatively you could traverse over the whole scene and toggle for all Geometry objects in there if you don't want to create a new SceneProcessor
                  private ActionListener() {
                     boolean wireframe = false; 
                  
                     @Override
                @@ -224,12 +215,11 @@ TIP :: To set the line width of wireframe display, use mesh.setLineWidth(lineWid
                 

                - -

                Example: Toggle Wireframe on the scene

                + +

                Example: Toggle Wireframe on the scene

                - To display the wireframe of the entire scene instead on one material at a time, first create the following Scene Processor

                public class WireProcessor implements SceneProcessor {    
                @@ -273,19 +263,19 @@ To display the wireframe of the entire scene instead on one material at a time,
                 }

                -Then attach the scene processor to the GUI Viewport. +Then attach the scene processor to the GUI Viewport.

                getViewPort().addProcessor(new WireProcessor());
                - -

                See also

                + +

                See also

                  -
                • Spatial ??? if you can't see certain spatials, you can modify the culling behaviour to identify problems (such as inside-out custom meshes)
                  +
                • Spatial – if you can't see certain spatials, you can modify the culling behaviour to identify problems (such as inside-out custom meshes)
                - -

                view online version

                \ No newline at end of file + +

                view online version

                \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/dof-blur.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/dof-blur.png index 7fabbeeca..d2f6a13a8 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/dof-blur.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/dof-blur.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/effects_overview.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/effects_overview.html index e7f102619..42ec7fb53 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/effects_overview.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/effects_overview.html @@ -1,15 +1,14 @@ -

                jME3 Special Effects Overview

                +

                jME3 Special Effects Overview

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

                -

                Sample Code

                +

                Sample Code

                • There is one com.jme3.effect.ParticleEmitter class for all Particle Systems.
                  @@ -22,7 +21,7 @@ jME3 supports several types of special effects: Post-Processor Filters, ScenePro
                -

                Particle Emitter

                +

                Particle Emitter

                public class MyGame extends SimpleApplication {
                   public void simpleInitApp() {
                @@ -38,7 +37,7 @@ jME3 supports several types of special effects: Post-Processor Filters, ScenePro
                 
                 
                -

                Scene Processor

                +

                Scene Processor

                public class MyGame extends SimpleApplication {
                     private BasicShadowRenderer bsr;
                @@ -51,7 +50,7 @@ jME3 supports several types of special effects: Post-Processor Filters, ScenePro
                 
                 
                -

                Post-Processor Filter

                +

                Post-Processor Filter

                public class MyGame extends SimpleApplication {
                     private FilterPostProcessor fpp; // one FilterPostProcessor per app
                @@ -67,11 +66,10 @@ jME3 supports several types of special effects: Post-Processor Filters, ScenePro
                 
                 
                -

                Water

                +

                Water

                - 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. @@ -81,9 +79,9 @@ Use the SimpleWaterProcessor (SceneProcessor) for small, limited bodies of water See also the announcement with video.

                  -
                • ??? SimpleWaterProcessor (SceneProcessor)
                  +
                • – SimpleWaterProcessor (SceneProcessor)
                • -
                • ??? SimpleWaterProcessor (SceneProcessor)
                  +
                • – SimpleWaterProcessor (SceneProcessor)
                @@ -91,52 +89,51 @@ See also the

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

                Environment Effects

                +

                Environment Effects

                -

                Depth of Field Blur

                +

                Depth of Field Blur

                -

                  -
                • ??? DepthOfFieldFilter
                  +
                • – DepthOfFieldFilter
                -

                Fog

                +

                Fog

                  -
                • ??? FogFilter
                  +
                • – FogFilter
                -

                Light Scattering

                +

                Light Scattering

                  -
                • ??? LightScatteringFilter
                  +
                • – LightScatteringFilter
                -

                Vegetation

                +

                Vegetation

                • Contribution: Grass System
                  @@ -147,7 +144,7 @@ See also the -

                  Light and Shadows

                  +

                  Light and Shadows

                  @@ -156,47 +153,46 @@ See also the -

                  Bloom and Glow

                  +

                  Bloom and Glow

                  -

                  Light

                  +

                  Light

                    -
                  • ??? DirectionalLight, PointLight
                    +
                  • – DirectionalLight, PointLight
                  • -
                  • ??? DirectionalLight, PointLight
                    +
                  • – DirectionalLight, PointLight
                  • -
                  • ??? .j3o scene
                    +
                  • – .j3o scene
                  • More details: Light and Shadow

                  -

                  -

                  Shadow

                  +

                  Shadow

                    -
                  • ??? BasicShadowRenderer (SceneProcessor)
                    +
                  • – BasicShadowRenderer (SceneProcessor)
                  • -
                  • ??? PssmShadowRenderer (SceneProcessor), also known as Parallel-Split Shadow Mapping (PSSM).
                    +
                  • – PssmShadowRenderer (SceneProcessor), also known as Parallel-Split Shadow Mapping (PSSM).
                  • -
                  • , ??? SSAOFilter, also known as Screen-Space Ambient Occlusion shadows (SSOA).
                    +
                  • , – SSAOFilter, also known as Screen-Space Ambient Occlusion shadows (SSOA).
                  • -
                  • ??? SSAOFilter, also known as Screen-Space Ambient Occlusion shadows (SSOA), plus transparancy
                    +
                  • – SSAOFilter, also known as Screen-Space Ambient Occlusion shadows (SSOA), plus transparancy
                  • More details: Light and Shadow
                  • @@ -204,42 +200,39 @@ See also the -

                    Special: Glass, Metal, Dissolve, Toon

                    +

                    Special: Glass, Metal, Dissolve, Toon

                    - -

                    -

                    Toon Effect

                    +

                    Toon Effect

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

                    Fade in / Fade out

                    +

                    Fade in / Fade out

                      -
                    • Fade ??? FadeFilter
                      +
                    • Fade – FadeFilter
                    -

                    User Contributed

                    +

                    User Contributed

                    -

                    @@ -247,64 +240,61 @@ See also the ShaderBlow - GLSL Shader Library

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

                    - Thanks for your awesome contributions! Keep them coming!

                    -

                    Particle Emitters: Explosions, Fire, Smoke

                    +

                    Particle Emitters: Explosions, Fire, Smoke

                    - -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??? +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
                      +
                    • – debris, flame, flash, shockwave, smoke, sparks
                    • -
                    • ??? cluster of points
                      +
                    • – cluster of points
                    • -
                    • ??? dust, smoke
                      +
                    • – dust, smoke

                    -

                    Creating your own Filters

                    +

                    Creating your own Filters

                    - Here is an extract taken from @nehon in the forum thread ()

                    @@ -325,7 +315,7 @@ Those methods are optional in a filter, they are only there if you want to hook

                    -The material variable is here for convenience. You have a getMaterial method that returns the material that???s gonna be used to render the full screen quad. It just happened that in every implementation I had a material attribute in all my sub-classes, so I just put it back in the abstract class. Most of the time getMaterial returns this attribute. +The material variable is here for convenience. You have a getMaterial method that returns the material that’s gonna be used to render the full screen quad. It just happened that in every implementation I had a material attribute in all my sub-classes, so I just put it back in the abstract class. Most of the time getMaterial returns this attribute.

                    @@ -336,7 +326,7 @@ You assume well about the SSAO filer, the normal of the scene are rendered to a

                    Passes : these are filters in filters in a way. First they are a convenient way to initialize a FrameBuffer and the associated textures it needs, then you can use them for what ever you want. For example, a Pass can be (as in the SSAO filter) an extra render of the scene with a forced technique, and you have to handle the render yourself in the postQueue method. -It can be a post pass to do after the main filter has been rendered to screen (for example an additional blur pass used in SSAO again). You have a list of passes called postRenderPass in the Filter abstract class. If you add a pass to this list, it???ll be automatically rendered by the FilterPostProcessor during the filter chain. +It can be a post pass to do after the main filter has been rendered to screen (for example an additional blur pass used in SSAO again). You have a list of passes called postRenderPass in the Filter abstract class. If you add a pass to this list, it’ll be automatically rendered by the FilterPostProcessor during the filter chain.

                    @@ -345,7 +335,6 @@ The bloom Filter does an intensive use of passes.

                    Filters in a nutshell. -


                    @@ -360,13 +349,11 @@ See also:
                  • - + +

                    +tag_documentation_effect_light_water +

                    -

                    view online version

                    \ No newline at end of file +

                    view online version

                    \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/elephant-pointlights.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/elephant-pointlights.png index 7edbb1b61..2e4b766cf 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/elephant-pointlights.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/elephant-pointlights.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/endless_terraingrid.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/endless_terraingrid.html index f3ea78305..861988c07 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/endless_terraingrid.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/endless_terraingrid.html @@ -1,17 +1,25 @@ -

                    Endless Terrain

                    +

                    Endless Terrain

                    -TerrainGrid is an extension built on top of the TerraMonkey tools like TerrainQuad and HeightMap, that provides "infinite" Terrain paging routines.
                    +

                    Deprecated. Look at instead +

                    +

                    -Thanks to G??bor (@anthyon) and Brent (@sploreg) for this contribution! +

                    +TerrainGrid is DEPRECATED. +

                    +

                    +TerrainGrid is an extension built on top of the TerraMonkey tools like TerrainQuad and HeightMap, that provides “infinite” Terrain paging routines.
                    + +Thanks to Gábor (@anthyon) and Brent (@sploreg) for this contribution!

                    - -

                    Sample Code

                    + +

                    Sample Code

                    @@ -27,8 +35,8 @@ The classes with source code can be found in the org.jme3.terrain.geomipmapping

                    - -

                    Specification

                    + +

                    Specification

                    @@ -50,27 +58,25 @@ TerrainGrid is made up of the TerrainGrid class, and the HeightMapGrid and Terra


                    -Multiple listeners can be added to the TerrainGrid, they will be called in the order of addition, so it???s possible to have multiple changes to the material before completing the load of the tile. +Multiple listeners can be added to the TerrainGrid, they will be called in the order of addition, so it’s possible to have multiple changes to the material before completing the load of the tile.
                    -HeightMapGrid adds the possibility of loading terrain tiles on demand instead of having a simple height array. There???s no predefined way of how to store these tiles, it only takes care of loading one HeightMap object at given location at a time. - +HeightMapGrid adds the possibility of loading terrain tiles on demand instead of having a simple height array. There’s no predefined way of how to store these tiles, it only takes care of loading one HeightMap object at given location at a time.

                    - -

                    Motivation

                    + +

                    Motivation

                    -After playing around with the terrain in jME3, soon comes the requirement of having larger explorable lands. Increasing the size of one TerrainQuad leads to more memory usage, while it will still be easy to reach the worlds boundaries. That???s why TerrainGrid was designed. It extends the TerraindQuad class and uses 4 HeightMaps (dark blue) as the four sub-quad. This means that a terrain of size 513 will use tiles of 257. Also an LRUCache is built into the terrain package, so surrounding tiles (green) can be pre-cached on a different thread, lowering the loading time. The quads are updated as the camera approaches the boundary of the light blue section. - +After playing around with the terrain in jME3, soon comes the requirement of having larger explorable lands. Increasing the size of one TerrainQuad leads to more memory usage, while it will still be easy to reach the worlds boundaries. That’s why TerrainGrid was designed. It extends the TerraindQuad class and uses 4 HeightMaps (dark blue) as the four sub-quad. This means that a terrain of size 513 will use tiles of 257. Also an LRUCache is built into the terrain package, so surrounding tiles (green) can be pre-cached on a different thread, lowering the loading time. The quads are updated as the camera approaches the boundary of the light blue section.

                    - -

                    Rationale

                    + +

                    Rationale

                    @@ -80,13 +86,13 @@ There exist also two basic HeightMapGrid implementations:

                    • ImageBasedHeightMapGrid: uses a sequentially numbered, 16 bit grayscale heightmaps. The physical filename of these files can be generated through the Namer interface. When a tile cannot be found by the assetManager, an empty (all-zero) heightmap is created, and a warning is added to the log.
                    • -
                    • FractalHeightMapGrid: uses a noise library to create a landscape on the fly. The shape of the terrain can be controlled by the various parameters and postfilters of the fractals. With the help of this grid implementation there???s no limitation ??? above of floating point precision limits ??? how far the camera can get. The tiles generated this way can be cached to the filesystem, for later modification. The FractalHeightMapGrid will always load from cache if a tile exists there!
                      +
                    • FractalHeightMapGrid: uses a noise library to create a landscape on the fly. The shape of the terrain can be controlled by the various parameters and postfilters of the fractals. With the help of this grid implementation there’s no limitation – above of floating point precision limits – how far the camera can get. The tiles generated this way can be cached to the filesystem, for later modification. The FractalHeightMapGrid will always load from cache if a tile exists there!
                    - -

                    Usage

                    + +

                    Usage

                    1. instantiate a TerrainGrid object
                      @@ -112,5 +118,5 @@ Further information about terrain and TerrainQuad can be found in the wiki at:
                    - -

                    view online version

                    \ No newline at end of file + +

                    view online version

                    \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/explosion-5.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/explosion-5.png index a805cdb85..597477bd1 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/explosion-5.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/explosion-5.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/fade.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/fade.html index 1d784bba5..9872a9334 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/fade.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/fade.html @@ -1,16 +1,15 @@ -

                    Fade-in / Fade-out Effect

                    +

                    Fade-in / Fade-out Effect

                    You can use a fade in/fade out effect to make smooth transitions, for example between game levels. The effect fades in from black to the initialized scene, or fades out from the scene to black. The effect uses com.jme3.post.FilterPostProcessor and com.jme3.post.filters.FadeFilter. -

                    -

                    Setting up

                    +

                    Setting up

                    1. Create one FilterPostProcessor object per application.
                      @@ -37,7 +36,7 @@ public void simpleInitApp() {
                    -

                    Fading in and out

                    +

                    Fading in and out

                    @@ -47,4 +46,4 @@ You can also change the fade duration using fade.setDuration().

                    -

                    view online version

                    \ No newline at end of file +

                    view online version

                    \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/headless_server.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/headless_server.html index 13a786a0c..3bd6ed80a 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/headless_server.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/headless_server.html @@ -1,9 +1,8 @@ -

                    jME3 Headless Server

                    +

                    jME3 Headless Server

                    - When adding multiplayer to your game, you may find that your server needs to know about game state (e.g. where are players, objects? Was that a direct hit? etc.) You can code all this up yourself, but there's an easier way.

                    @@ -13,31 +12,29 @@ It's very easy to change your current (client) game to function as a server
                    -

                    What Does Headless Mean?

                    +

                    What Does Headless Mean?

                    - -A headless server??? +A headless server…

                      -
                    • does not display any output ??? no window opens, no audio plays, no graphics are rendered.
                      +
                    • does not display any output – no window opens, no audio plays, no graphics are rendered.
                    • -
                    • ignores all input ??? no input handling.
                      +
                    • ignores all input – no input handling.
                    • -
                    • keeps game state ??? you can attach to, transform, and save the rootNode, although the scene is not displayed.
                      +
                    • keeps game state – you can attach to, transform, and save the rootNode, although the scene is not displayed.
                    • -
                    • calls the simpleUpdate() loop ??? you can run tests and trigger events as usual.
                      +
                    • calls the simpleUpdate() loop – you can run tests and trigger events as usual.
                    -

                    Client Code

                    +

                    Client Code

                    - First, let's take a look at the default way of creating a new game (in its simplest form):

                    public static void main(String[] args) {
                    @@ -47,11 +44,10 @@ First, let's take a look at the default way of creating a new game (in its
                     
                     
                    -

                    Headless Server Code

                    +

                    Headless Server Code

                    - Now, with a simple change you can start your game in Headless mode. This means that all input and audio/visual output will be ignored. That's a good thing for a server.

                    import com.jme3.system.JmeContext;
                    @@ -64,16 +60,14 @@ public static void main(String[] args) {
                     
                     
                    -

                    Next steps

                    +

                    Next steps

                    - Okay, so you can now start your game in a headless 'server mode', where to go from here? -

                      -
                    • Parse String[] args from the main-method to enable server mode on demand (e.g. start your server like java -jar mygame.jar ???server.
                      +
                    • Parse String[] args from the main-method to enable server mode on demand (e.g. start your server like java -jar mygame.jar –server.
                    • Integrate SpiderMonkey, to provide game updates to the server over a network.
                    • @@ -82,14 +76,11 @@ Okay, so you can now start your game in a headless 'server mode', wher
                    • Add decent logging so your server actually makes sense.
                    - + +

                    +tag_server_spidermonkey_headless_network_documentation +

                    -

                    view online version

                    \ No newline at end of file +

                    view online version

                    \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/hinges_and_joints.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/hinges_and_joints.html index 27c50a87e..cfba1389c 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/hinges_and_joints.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/hinges_and_joints.html @@ -1,9 +1,8 @@ -

                    Physical Hinges and Joints

                    +

                    Physical Hinges and Joints

                    - The jMonkeyEngine3 has built-in support for via the com.jme3.bullet package.

                    @@ -17,7 +16,7 @@ In this example, we will create a pendulum. The joint is the (invisible) connect
                    -

                    Sample Code

                    +

                    Sample Code

                    • @@ -26,7 +25,7 @@ In this example, we will create a pendulum. The joint is the (invisible) connect
                    -

                    Overview of this Physics Application

                    +

                    Overview of this Physics Application

                    1. Create a SimpleApplication with a BulletAppState
                      @@ -37,13 +36,13 @@ In this example, we will create a pendulum. The joint is the (invisible) connect
                    2. For the pendulum, we use a Spatial with a PhysicsControl, and we apply physical forces to them.
                        -
                      • The parts of the "pendulum" are Physics Control'ed Spatials with Collision Shapes.
                        +
                      • The parts of the “pendulum” are Physics Control'ed Spatials with Collision Shapes.
                      • We create a fixed hookNode and a dynamic pendulumNode.
                    3. -
                    4. We can "crank the handle" and rotate the joint like a hinge, or we can let loose and expose the joints freely to gravity.
                      +
                    5. We can “crank the handle” and rotate the joint like a hinge, or we can let loose and expose the joints freely to gravity.
                      • For physical forces we will use the method joint.enableMotor();
                      • @@ -53,11 +52,10 @@ In this example, we will create a pendulum. The joint is the (invisible) connect
                    -

                    Creating a Fixed Node

                    +

                    Creating a Fixed Node

                    - The hookNode is the fixed point from which the pendulum hangs. It has no mass.

                    Node hookNode=PhysicsTestHelper.createPhysicsTestNode(
                    @@ -73,11 +71,10 @@ For a rope bridge, there would be two fixed nodes where the bridge is attached t
                     
                     
                    -

                    Creating a Dynamic Node

                    +

                    Creating a Dynamic Node

                    - The pendulumNode is the dynamic part of the construction. It has a mass.

                    Node pendulumNode=PhysicsTestHelper.createPhysicsTestNode(
                    @@ -92,16 +89,15 @@ For a rope bridge, each set of planks would be one dynamic node.
                     
                     
                    -

                    Understanding DOF, Joints, and Hinges

                    +

                    Understanding DOF, Joints, and Hinges

                    - -A PhysicsHingeJoint is an invisible connection between two nodes ??? here between the pendulum body and the hook. Why are hinges and joints represented by the same class? Hinges and joints have something in common: They constrain the mechanical degree of freedom (DOF) of another object. +A PhysicsHingeJoint is an invisible connection between two nodes – here between the pendulum body and the hook. Why are hinges and joints represented by the same class? Hinges and joints have something in common: They constrain the mechanical degree of freedom (DOF) of another object.

                    -Consider a free falling, "unchained" object in physical 3D space: It has 6 DOFs: +Consider a free falling, “unchained” object in physical 3D space: It has 6 DOFs:

                    • It translates along 3 axes
                      @@ -111,7 +107,6 @@ Consider a free falling, "unchained" object in physical 3D space: It h

                    - Now consider some examples of objects with joints:

                      @@ -124,18 +119,16 @@ Now consider some examples of objects with joints:

                    - You'll understand that, when creating any type of joint, it is important to correctly specify the DOFs that the joint restricts, and the DOFs that the joint allows. For the typical DOF of a ragDoll character's limbs, jME even offers a special joint, ConeJoint.

                    -

                    Creating the Joint

                    +

                    Creating the Joint

                    - -You create the HingeJoint after you have created the nodes that are to be chained together. In the code snippet you see that the HingeJoint constructor requires the two node objects. You also have to specify axes and pivots ??? they are the degrees of freedom that you just heard about. +You create the HingeJoint after you have created the nodes that are to be chained together. In the code snippet you see that the HingeJoint constructor requires the two node objects. You also have to specify axes and pivots – they are the degrees of freedom that you just heard about.

                    private HingeJoint joint;
                     ...
                    @@ -152,7 +145,6 @@ You create the HingeJoint after you have created the nodes that are to be chaine
                                          Vector3f.UNIT_Z  );        // DoF Axis of B (Z axis)

                    - The pivot point's position will be at (0,0,0) in the global 3D space. In A's local space that is at (0,0,0) and in B's local space (remember B's position was set to (0,-1,0)) that is at (0,1,0).

                    @@ -160,15 +152,15 @@ The pivot point's position will be at (0,0,0) in the global 3D Specify the following parameters for each joint:

                      -
                    • PhysicsControl A and B ??? the two nodes that are to be joined
                      +
                    • PhysicsControl A and B – the two nodes that are to be joined
                    • -
                    • Vector3f pivot A and pivot B ??? coordinates of the attachment point relative to A and B
                      +
                    • Vector3f pivot A and pivot B – coordinates of the attachment point relative to A and B
                      • The points typically lie on the surface of the PhysicsControl's Spatials, rarely in the middle.
                    • -
                    • Vector3f axisA and axisB ??? around which axes each node is allowed to spin.
                      +
                    • Vector3f axisA and axisB – around which axes each node is allowed to spin.
                      • In our example, we constrain the pendulum to swing only along the Z axis.
                      • @@ -177,7 +169,6 @@ Specify the following parameters for each joint:

                      - Remember to add all joint objects to the physicsSpace, just like you would do with any physical objects.

                      bulletAppState.getPhysicsSpace().add(joint);
                      @@ -188,12 +179,11 @@ Remember to add all joint objects to the physicsSpace, just like you would do wi
                    -

                    Apply Physical Forces

                    +

                    Apply Physical Forces

                    - -You can apply forces to dynamic nodes (the ones that have a mass), and see how other joined ("chained") objects are dragged along. +You can apply forces to dynamic nodes (the ones that have a mass), and see how other joined (“chained”) objects are dragged along.

                    @@ -219,17 +209,14 @@ joint.enableMotor(true, -1, .1f);

                    - When you disable the motor, the chained nodes are exposed to gravity again: -

                    joint.enableMotor(false, 0, 0);
                    - + +

                    +tag_documentation_physics_joint +

                    -

                    view online version

                    \ No newline at end of file +

                    view online version

                    \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/house-directionallight.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/house-directionallight.png index c4ad7a757..8ed397c17 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/house-directionallight.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/house-directionallight.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/hud.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/hud.html index 3188e3421..01832fa27 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/hud.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/hud.html @@ -1,10 +1,9 @@ -

                    Head-Up Display (HUD)

                    +

                    Head-Up Display (HUD)

                    - - +

                    @@ -15,48 +14,46 @@ A HUD (Head-Up Display) is part of a game's visual user interface. It' HUDs are used to supply players with essential information about the game state.

                      -
                    • Status: Score, minimap, points, stealth mode, ???
                      +
                    • Status: Score, minimap, points, stealth mode, …
                    • -
                    • Resources: Ammunition, lives/health, time, ???
                      +
                    • Resources: Ammunition, lives/health, time, …
                    • -
                    • Vehicle instruments: Cockpit, speedometer, ???
                      +
                    • Vehicle instruments: Cockpit, speedometer, …
                    • -
                    • Navigational aides: Crosshairs, mouse pointer or hand, ???
                      +
                    • Navigational aides: Crosshairs, mouse pointer or hand, …

                    - You have two options how to create HUDs. -

              ComboMove MethodUsage
              getCastTime()Returns the time since the last step has been recorded. (?)
              + + - +Supports XML and Java layouts.
              OptionProsCons
              Attach elements to default guiNode:Easy to learn. jMonkeyEngine built-in API for attaching plain images and bitmap text.Only basic features.
              +
              Attach elements to default guiNode:Easy to learn. jMonkeyEngine built-in API for attaching plain images and bitmap text.Only basic features.
              You will have to write custom controls / buttons / effects if you need them.
              Use advanced Nifty GUI integration:Full-featured interactive user interface.
              Includes buttons, effects, controls.
              -Supports XML and Java layouts.
              Steeper learning curve.Steeper learning curve.

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

              -

              Simple HUD: GUI Node

              +

              Simple HUD: GUI Node

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

              @@ -64,7 +61,7 @@ You already know the rootNode that holds the 3-dimensional scene gr This is how you use the guiNode for HUDs:

                -
              • Create a GUI element: a BitmapText or Picture object.
                +
              • Create a GUI element: a BitmapText or Picture object.
              • Attach the element to the guiNode.
              • @@ -77,7 +74,7 @@ The BitmapTexts and Pictures appear as 2 dimensional element on the screen.

                -

                By default, the guiNode has some scene graph statistics attached. To clear the guiNode before you attach your own GUI elements, use the following methods: +

                By default, the guiNode has some scene graph statistics attached. To clear the guiNode before you attach your own GUI elements, use the following methods:

                setDisplayStatView(false); setDisplayFps(false);
                @@ -88,11 +85,10 @@ The BitmapTexts and Pictures appear as 2 dimensional element on the screen.
                -

                Displaying Pictures in the HUD

                +

                Displaying Pictures in the HUD

                - A simple image can be displayed using com.jme3.ui.Picture.

                Picture pic = new Picture("HUD Picture");
                @@ -108,11 +104,10 @@ When you set the last boolean in setImage() to true, the alpha channel of your i
                 
                 
                -

                Displaying Text in the HUD

                +

                Displaying Text in the HUD

                - You use com.jme3.font.BitmapText to display text on the screen.

                BitmapText hudText = new BitmapText(guiFont, false);          
                @@ -130,12 +125,12 @@ hudText = new BitmapText(myFont, false);
                -

                Positioning HUD Elements

                +

                Positioning HUD Elements

                  -
                • When positioning GUI text and images in 2D, the bottom left corner of the screen is (0f,0f), and the top right corner is at (settings.getWidth(),settings.getHeight()).
                  +
                • When positioning GUI text and images in 2D, the bottom left corner of the screen is (0f,0f), and the top right corner is at (settings.getWidth(),settings.getHeight()).
                • -
                • If you have several 2D elements in the GUI bucket that overlap, define their depth order by specifing a Z value. For example use pic.move(x, y, -1) to move the picture to the background, or hudText.setLocalTranslation(x,y,1) to move text to the foreground.
                  +
                • If you have several 2D elements in the GUI bucket that overlap, define their depth order by specifing a Z value. For example use pic.move(x, y, -1) to move the picture to the background, or hudText.setLocalTranslation(x,y,1) to move text to the foreground.
                • Size and length values in the orthogonal render queue are treated like pixels. A 20*20-wu big quad is rendered 20 pixels wide.
                • @@ -143,26 +138,24 @@ hudText = new BitmapText(myFont, false);
                -

                Displaying Geometries in the HUD

                +

                Displaying Geometries in the HUD

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

                -

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

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

                -

                Keeping the HUD Up-To-Date

                +

                Keeping the HUD Up-To-Date

                - Use the update loop to keep the content up-to-date.

                public void simpleUpdate(float tpf) {
                @@ -175,25 +168,23 @@ Use the update loop to keep the content up-to-date.
                 
                 
                -

                Advanced HUD: Nifty GUI

                +

                Advanced HUD: Nifty GUI

                - The recommended approach to create HUDs is using Nifty GUI.

                  -
                1. Lay out the GUI in one or several Nifty XML or Java files.
                  +
                2. Lay out the GUI in one or several Nifty XML or Java files.
                3. Write the controller classes in Java.
                4. -
                5. Load the XML file with the controller object in your game's simpleInit() method.
                  +
                6. Load the XML file with the controller object in your game's simpleInit() method.

                - -The advantage of Nifty GUI is that it is well integrated into jME and the jMonkeyEngine SDK, and that it offers all the features that you expect from a professional modern user interface. +The advantage of Nifty GUI is that it is well integrated into jME and the jMonkeyEngine SDK, and that it offers all the features that you expect from a professional modern user interface.

                @@ -202,19 +193,17 @@ For HUDs, you basically follow the same instructions as for creating a normal -

                See also

                +

                See also

                -

                view online version

                \ No newline at end of file +

                view online version

                \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/input_handling.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/input_handling.html index 88a25a394..5a083d430 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/input_handling.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/input_handling.html @@ -1,15 +1,13 @@ -

                Input Handling

                +

                Input Handling

                - -Users interact with your jME3 application with different input devices ??? the mouse, the keyboard, or a joystick. To respond to inputs we use the inputManager object in SimpleApplication. +Users interact with your jME3 application with different input devices – the mouse, the keyboard, or a joystick. To respond to inputs we use the inputManager object in SimpleApplication.

                This is how you add interaction to your game: -

                1. For each action, choose the trigger(s) (a key or mouse click etc)
                  @@ -26,7 +24,7 @@ This is how you add interaction to your game:
                -

                Code Samples

                +

                Code Samples

                • @@ -37,22 +35,22 @@ This is how you add interaction to your game:
                -

                1. Choose Trigger

                +

                1. Choose Trigger

                - Choose one or several key/mouse events for the interaction. We use KeyTrigger, MouseAxisTrigger, MouseButtonTrigger, JoyAxisTrigger and JoyButtonTrigger constants from the com.jme3.input.controls package.

                Note: The MouseAxis and JoyAxis triggers go along the X axis (right/left) or Y axis (up/down). These Triggers come with extra booleans for the negative half of the axis (left, down). Remember to write code that listens to the negative (true) and positive (false) axis! -

                + + @@ -81,13 +79,13 @@ Choose one or several key/mouse events for the interaction. We use KeyTrig - + - + - + @@ -97,7 +95,7 @@ Choose one or several key/mouse events for the interaction. We use KeyTrig KeyTrigger(KeyInput.KEY_LSHIFT) - +
                Trigger Code
                Mouse button: Left Click MouseButtonTrigger(MouseInput.BUTTON_LEFT)
                Mouse wheel: Down MouseAxisTrigger(MouseInput.AXIS_WHEEL,true)
                NumPad: 1, 2, 3, ??? KeyTrigger(KeyInput.KEY_NUMPAD1) ??? NumPad: 1, 2, 3, … KeyTrigger(KeyInput.KEY_NUMPAD1) …
                Keyboard: 1, 2 , 3, ??? KeyTrigger(KeyInput.KEY_1) ??? Keyboard: 1, 2 , 3, … KeyTrigger(KeyInput.KEY_1) …
                Keyboard: A, B, C, ??? KeyTrigger(KeyInput.KEY_A) ??? Keyboard: A, B, C, … KeyTrigger(KeyInput.KEY_A) …
                Keyboard: Spacebar KeyTrigger(KeyInput.KEY_SPACE)
                Keyboard: F1, F2, ??? KeyTrigger(KeyInput.KEY_F1) ??? Keyboard: F1, F2, … KeyTrigger(KeyInput.KEY_F1) …
                Keyboard: Return, Enter KeyTrigger(KeyInput.KEY_RETURN),
                @@ -138,19 +136,20 @@ JoyButtonTrigger(0, JoyInput.AXIS_POV_Y) ?

                - -In your IDE, use code completion to quickly look up Trigger literals. In the jMonkeyEngine SDK for example, press ctrl-space or ctrl-/ after KeyInput.| to choose from the list of all keys. +In your IDE, use code completion to quickly look up Trigger literals. In the jMonkeyEngine SDK for example, press ctrl-space or ctrl-/ after KeyInput.| to choose from the list of all keys.

                -

                2. Remove Default Trigger Mappings

                +

                2. Remove Default Trigger Mappings

                inputManager.deleteMapping( SimpleApplication.INPUT_MAPPING_MEMORY );
                + + @@ -167,11 +166,10 @@ In your IDE, use code completion to quickly look up Trigger literals. In the jMo -

                3. Add Custom Trigger Mapping

                +

                3. Add Custom Trigger Mapping

                - When initializing the application, add a Mapping for each Trigger.

                @@ -193,11 +191,10 @@ inputManager.addMapping("Right", new KeyTrigger(KeyInput.KEY_D
                -

                4. Create Listeners

                +

                4. Create Listeners

                - The jME3 input manager supports two types of event listeners for inputs: AnalogListener and ActionListener. You can use one or both listeners in the same application. Add one or both of the following code snippets to your main SimpleApplication-based class to activate the listeners.

                @@ -207,15 +204,14 @@ The jME3 input manager supports two types of event listeners for inputs: AnalogL
                -

                ActionListener

                +

                ActionListener

                - com.jme3.input.controls.ActionListener

                  -
                • Use for absolute "button pressed or released?", "on or off?" actions.
                  +
                • Use for absolute “button pressed or released?”, “on or off?” actions.
                  • Examples: Pause/unpause, a rifle or revolver shot, jump, click to select.
                  • @@ -234,7 +230,7 @@ The jME3 input manager supports two types of event listeners for inputs: AnalogL
                  -
                  private ActionListener actionListener = new ActionListener() {
                  +
                  private ActionListener() {
                     public void onAction(String name, boolean keyPressed, float tpf) {
                        /** TODO: test for mapping names and implement actions */
                     }
                  @@ -242,11 +238,10 @@ The jME3 input manager supports two types of event listeners for inputs: AnalogL
                   
                   
                -

                AnalogListener

                +

                AnalogListener

                - com.jme3.input.controls.AnalogListener

                  @@ -275,21 +270,20 @@ The jME3 input manager supports two types of event listeners for inputs: AnalogL
                -

                4. Register Mappings to Listeners

                +

                4. Register Mappings to Listeners

                - To activate the mappings, you must register them to a Listener. Write your registration code after the code block where you have added the mappings to the inputManager.

                -In the following example, you register the "Pause Game" mapping to the actionListener object, because pausing a game is in "either/or" decision. +In the following example, you register the “Pause Game” mapping to the actionListener object, because pausing a game is in “either/or” decision.

                inputManager.addListener(actionListener, new String[]{"Pause Game"});

                -In the following example, you register navigational mappings to the analogListener object, because walking is a continuous action. Players typically keep the key pressed to express continuity, for example when they want to "walk on" or "accelerate". +In the following example, you register navigational mappings to the analogListener object, because walking is a continuous action. Players typically keep the key pressed to express continuity, for example when they want to “walk on” or “accelerate”.

                inputManager.addListener(analogListener, new String[]{"Left", "Right"});
                @@ -304,11 +298,10 @@ As you see, you can add several listeners in one String array. You can call the
                -

                5. Implement Actions in Listeners

                +

                5. Implement Actions in Listeners

                - You specify the action to be triggered where it says TODO in the Listener code snippets. Typically, you write a series of if/else conditions, testing for all the mapping names, and then calling the respective action.

                @@ -324,14 +317,13 @@ Make use of the distinction between if and else if in
                -

                ActionListener

                +

                ActionListener

                - In the most common case, you want an action to be triggered once, in the moment when the button or key trigger is released. For example, when the player presses a key to open a door, or clicks to pick up an item. For these cases, use an ActionListener and test for && !keyPressed, like shown in the following example.

                -
                private ActionListener actionListener = new ActionListener() {
                +
                private ActionListener() {
                     public void onAction(String name, boolean keyPressed, float tpf) {
                  
                       if (name.equals("Pause Game") && !keyPressed) { // test?
                @@ -345,11 +337,10 @@ In the most common case, you want an action to be triggered once, in the moment
                 
                 
                -

                AnalogListener

                +

                AnalogListener

                - The following example shows how you define actions with an AnalogListener. Thiese actions are triggered continuously, as long (intensity value) as the named key or mouse button is down. Use this listeners for semi-automatic weapons and navigational actions.

                private AnalogListener analogListener = new AnalogListener() {
                @@ -366,23 +357,21 @@ The following example shows how you define actions with an AnalogListener. Thies
                 
                 
                -

                Let Users Remap Keys

                +

                Let Users Remap Keys

                - -It is likely that your players have different keyboard layouts, are used to "reversed" mouse navigation, or prefer different navigational keys than the ones that you defined. You should create an options screen that lets users customize their mouse/key triggers for your mappings. Replace the trigger literals in the inputManager.addMapping() lines with variables, and load sets of triggers when the game starts. +It is likely that your players have different keyboard layouts, are used to “reversed” mouse navigation, or prefer different navigational keys than the ones that you defined. You should create an options screen that lets users customize their mouse/key triggers for your mappings. Replace the trigger literals in the inputManager.addMapping() lines with variables, and load sets of triggers when the game starts.

                The abstraction of separating triggers and mappings has the advantage that you can remap triggers easily. Your code only needs to remove and add some trigger mappings. The core of the code (the listeners and actions) remains unchanged.

                - + +

                +tag_keyinput_input_documentation +

                -

                view online version

                \ No newline at end of file +

                view online version

                \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/j3m_material_files.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/j3m_material_files.html index df5dd38fb..74c30a08b 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/j3m_material_files.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/j3m_material_files.html @@ -1,9 +1,8 @@ -

                Saving and Loading Materials with .j3m Files

                +

                Saving and Loading Materials with .j3m Files

                - In the Material Definitions article you learned how to configure Materials programmatically in Java code. If you have certain commonly used Materials that never change, you can clean up the amount of Java code that clutters your init method, by moving material settings into .j3m files. Then later in your code, you only need to call one setter instead of several to apply the material.

                @@ -13,7 +12,7 @@ If you want to colorize simple shapes (one texture all around), then .j3m are th
                -

                Writing the .j3m File

                +

                Writing the .j3m File

                1. For every Material, create a file and give it a name that describes it: e.g. SimpleBump.j3m
                  @@ -35,7 +34,6 @@ If you want to colorize simple shapes (one texture all around), then .j3m are th

                - How to this file is structured:

                  @@ -60,40 +58,36 @@ How to this file is structured:

                - -

                In the jMonkeyEngine SDK, use File???New File???Material???Empty Material File to create .j3m files. You can edit .j3m files directly in the SDK. On the other hand, they are plain text files, so you can also create them in any plain text editor. +

                In the jMonkeyEngine SDK, use File→New File→Material→Empty Material File to create .j3m files. You can edit .j3m files directly in the SDK. On the other hand, they are plain text files, so you can also create them in any plain text editor.

                -

                How to Use .j3m Materials

                +

                How to Use .j3m Materials

                - -This is how you use the prepared .j3m Material on a Spatial. Since you have saved the .j3m file to your project's Assets directory, the .j3m path is relative to MyGame/src/assets/???. +This is how you use the prepared .j3m Material on a Spatial. Since you have saved the .j3m file to your project's Assets directory, the .j3m path is relative to MyGame/src/assets/….

                myGeometry.setMaterial(assetManager.loadMaterial("Materials/SimpleBump.j3m"));

                -Tip: In the jMonkeyEngine SDK, open Windows>Palette and drag the JME Material: Set J3M snippet into your code. +Tip: In the jMonkeyEngine SDK, open Windows>Palette and drag the JME Material: Set J3M snippet into your code.

                -

                Syntax Reference for .j3m Files

                +

                Syntax Reference for .j3m Files

                -

                Paths

                +

                Paths

                - Make sure to get the paths to the textures (.png, .jpg) and material definitions (.j3md) right. -

                • The paths to the built-in .j3md files are relative to jME3's Core Data directory. Just copy the path stated in the Material table.
                  @@ -106,19 +100,19 @@ Make sure to get the paths to the textures (.png, .jpg) and material definitions
                  -

                  Data Types

                  +

                  Data Types

                  - All data types (except Color) are specified in com.jme3.shader.VarType. -"Color" is specified as Vector4 in J3MLoader.java. - +“Color” is specified as Vector4 in J3MLoader.java.

                Default MappingKeyDescription
                INPUT_MAPPING_HIDE_STATSF5Hides the statistics in the bottom left.
                + + @@ -183,7 +177,7 @@ All data types (except Color) are specified in com.jme3.shader.VarType. -

                Flip and Repeat Syntax

                +

                Flip and Repeat Syntax

                • A texture can be flipped using the following syntax NormalMap: Flip Textures/bump_rock_normal.png
                  @@ -196,26 +190,26 @@ All data types (except Color) are specified in com.jme3.shader.VarType.
                -

                Syntax for Additional Render States

                +

                Syntax for Additional Render States

                  -
                • A Boolean can be "On" or "Off"
                  +
                • A Boolean can be “On” or “Off”
                • -
                • Float is "123.0" etc
                  +
                • Float is “123.0” etc
                • Enum - values depend on the enum

                - See the javadoc for a detailed explanation of render states. -

                NamejME Java class.j3m file syntax
                Float (basic Java type) a float (e.g. 0.72) , no comma or parentheses
                + + @@ -247,12 +241,12 @@ See the

                -

                Examples

                +

                Examples

                -

                Example 1: Shiny

                +

                Example 1: Shiny

                Spatial signpost = (Spatial) assetManager.loadAsset(
                     new OgreMeshKey("Models/Sign Post/Sign Post.mesh.xml", null));
                @@ -278,12 +272,12 @@ The file assets/Models/Sign Post/Sign Post.j3m contains:
                 }

                -The JPG files are in the same directory, assets/Models/Sign Post/???. +The JPG files are in the same directory, assets/Models/Sign Post/….

                -

                Example 2: Repeating Texture

                +

                Example 2: Repeating Texture

                Material mat = assetManager.loadMaterial(
                     "Textures/Terrain/Pond/Pond.j3m");
                @@ -303,16 +297,15 @@ The file assets/Textures/Terrain/Pond/Pond.j3m contains:
                 }

                -The PNG files are in the same directory, assets/Textures/Terrain/Pond/ +The PNG files are in the same directory, assets/Textures/Terrain/Pond/

                -

                Example 3: Transparent

                +

                Example 3: Transparent

                - The file assets/Models/Tree/Leaves.j3m contains:

                Material Leaves : Common/MatDefs/Light/Lighting.j3md {
                @@ -337,26 +330,22 @@ The file assets/Models/Tree/Leaves.j3m contains:
                 }

                -The PNG file is in the same directory, assets/Models/Tree/??? +The PNG file is in the same directory, assets/Models/Tree/…

                -

                Related Links

                +

                Related Links

                -

                view online version

                \ No newline at end of file +

                view online version

                \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/jme3_shaders.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/jme3_shaders.html index f301a852e..8b30a345b 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/jme3_shaders.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/jme3_shaders.html @@ -1,33 +1,31 @@ -

                JME3 and Shaders

                +

                JME3 and Shaders


                -

                -

                Shaders Basics

                +

                Shaders Basics

                Shaders are sets of instructions that are executed on the GPU. They are used to take advantage of hardware acceleration available on the GPU for rendering purposes.
                -This paper only covers Vertex and Fragment shaders because they are the only ones supported by JME3 for the moment. But be aware that there are some other types of shaders (geometry, tessellation,???).
                +This paper only covers Vertex and Fragment shaders because they are the only ones supported by JME3 for the moment. But be aware that there are some other types of shaders (geometry, tessellation,…).
                There are multiple frequently used languages that you may encounter to code shaders but as JME3 is based on OpenGL, shaders in JME use GLSL and any example in this paper will be written in GLSL.

                -

                -

                How Does it work?

                +

                How Does it work?

                @@ -42,12 +40,11 @@ This is a very simplified graphic to describe the call stack:
                The main program sends mesh data to the vertex shader (vertex position in object space, normals, tangents, etc..). The vertex shader computes the screen position of the vertex and sends it to the Fragment shader. The fragment shader computes the color, and the result is displayed on screen or in a texture.
                -

                -

                Variables scope

                +

                Variables scope

                @@ -67,12 +64,11 @@ There is a large panel of variable types to be used, for more information about
                -

                -

                Spaces and Matrices

                +

                Spaces and Matrices

                @@ -84,12 +80,11 @@ The engine passes the object space coordinates to the vertex shader. We need to
                -

                -

                Simple example : rendering a solid color on an object

                +

                Simple example : rendering a solid color on an object

                @@ -97,7 +92,6 @@ Here is the simplest application to shaders, rendering a solid color.
                Vertex Shader :
                -

                //the global uniform World view projection matrix
                 //(more on global uniforms below)
                @@ -116,10 +110,8 @@ void main(){
                 }

                - Fragment Shader :
                -

                void main(){
                     //returning the color of the pixel (here solid blue)
                @@ -129,28 +121,25 @@ Fragment Shader : 
                }

                - For example applying this shader to a sphere would render a solid blue sphere on screen.

                -

                -

                How to use shaders in JME3

                +

                How to use shaders in JME3

                -You probably heard that JME3 is ???shader oriented???, but what does that mean?
                +You probably heard that JME3 is “shader oriented”, but what does that mean?
                Usually to use shaders you must create what is called a program. This program specify the vertex shader and the fragment shader to use.
                JME3 encloses this in the material system. Every material in JME3 uses shaders.
                -For example let???s have a look at the SolidColor.j3md file :
                - +For example let’s have a look at the SolidColor.j3md file :

                MaterialDef Solid Color {
                @@ -175,23 +164,21 @@ For example let???s have a look at the SolidColor.j3md file : 
                }

                - For more information on JME3 material system, i suggest you read this .

                -

                -

                JME3 Global uniforms

                +

                JME3 Global uniforms

                JME3 can expose pre-computed global uniforms to your shaders. You must specify the one that are required for your shader in the WorldParameters section of the material definition file (.j3md).
                -Note that in the shader the uniform names will be prefixed by a ???g_???.
                +Note that in the shader the uniform names will be prefixed by a “g_”.
                In the example above, WorldViewProjectionMatrix is declared as uniform mat4 g_WorldViewProjectionMatrix in the shader.
                @@ -199,12 +186,11 @@ The complete list of global uniforms that can be used in JME3 can be found -

                -

                JME3 Lighting Global uniforms

                +

                JME3 Lighting Global uniforms

                @@ -225,7 +211,7 @@ JME3 uses some global uniforms for lighting :

              • use for PointLight : x,y,z contain the world position of the light, the w component contains 1/lightRadius
              • -
              • use for DirectionalLight : strangely enough it's used for the direction of the light???this might change though. The fourth component contains -1 and it's used in the lighting shader to know if it's a directionalLight or not.
                +
              • use for DirectionalLight : strangely enough it's used for the direction of the light…this might change though. The fourth component contains -1 and it's used in the lighting shader to know if it's a directionalLight or not.
              • @@ -234,15 +220,14 @@ JME3 uses some global uniforms for lighting :

                -These uniforms are passed to the shader without having to declare them in the j3md file, but you have to specify in the technique definition " LightMode MultiPass" see lighting.j3md for more information. +These uniforms are passed to the shader without having to declare them in the j3md file, but you have to specify in the technique definition “ LightMode MultiPass” see lighting.j3md for more information.
                -

                -

                JME3 attributes

                +

                JME3 attributes

                @@ -250,7 +235,7 @@ Those are different attributes that are always passed to your shader.
                You can find a complete list of those attribute in the Type enum of the VertexBuffer .
                -Note that in the shader the attributes names will be prefixed by an ???in???.
                +Note that in the shader the attributes names will be prefixed by an “in”.

                @@ -259,14 +244,13 @@ When the enumeration lists some usual types for each attribute (for example texC

                -

                User's uniforms

                +

                User's uniforms

                At some point when making your own shader you'll need to pass your own uniforms
                -Any uniform has to be declared in the material definition file (.j3md) in the "MaterialParameters" section.
                - +Any uniform has to be declared in the material definition file (.j3md) in the “MaterialParameters” section.

                    MaterialParameters {
                @@ -279,7 +263,6 @@ You can also pass some define to your vertex/fragment programs to know if an uni
                 
                 You simply add it in the Defines section of your Technique in the definition file. 
                -

                    Defines {
                         COLORMAP : ColorMap
                @@ -298,7 +281,6 @@ If no value is set for that parameter, the define is not declared in the shader.
                 Those material parameters will be sent from the engine to the shader as follows, 
                 there are setXXXX methods for any type of uniform you want to pass.
                -

                   material.setColor("Color", new ColorRGBA(1.0f, 0.0f, 0.0f, 1.0f); // red color
                    material.setTexture("ColorMap", myTexture); // bind myTexture for that sampler uniform
                @@ -306,8 +288,7 @@ there are setXXXX methods for any type of uniform you want to pass.

                To use this uniform in the shader, you need to declare it in the .frag or .vert files (depending on where you need it). You can make use of the defines here and later in the code: -Note that the "m_" prefix specifies that the uniform is a material parameter.
                - +Note that the “m_” prefix specifies that the uniform is a material parameter.

                   uniform vec4 m_Color;
                @@ -321,7 +302,7 @@ The uniforms will be populated at runtime with the value you sent.
                 
                 
                -

                Example: Adding Color Keying to the Lighting.j3md Material Definition

                +

                Example: Adding Color Keying to the Lighting.j3md Material Definition

                @@ -340,7 +321,6 @@ to blend color on this texture: -

                Step by step

                +

                Step by step

                • Create a vertex shader (.vert) file
                  @@ -396,37 +373,37 @@ A result preview can be seen here: -

                  JME3 and OpenGL 3 & 4 compatibility

                  +

                  JME3 and OpenGL 3 & 4 compatibility

                  -GLSL 1.0 to 1.2 comes with built in attributes and uniforms (ie, gl_Vertex, gl_ModelViewMatrix, etc???).
                  +GLSL 1.0 to 1.2 comes with built in attributes and uniforms (ie, gl_Vertex, gl_ModelViewMatrix, etc…).
                  Those attributes are deprecated since GLSL 1.3 (opengl 3), hence JME3 global uniforms and attributes. Here is a list of deprecated attributes and their equivalent in JME3

                NameTypePurpose
                (Boolean) Enable wireframe rendering mode
                + + @@ -455,7 +432,7 @@ Those attributes are deprecated since GLSL 1.3 (opengl 3), hence JME3 global uni -

                Useful links

                +

                Useful links

                @@ -464,4 +441,4 @@ Those attributes are deprecated since GLSL 1.3 (opengl 3), hence JME3 global uni

                -

                view online version

                \ No newline at end of file +

                view online version

                \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/light-scattering-filter.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/light-scattering-filter.png index cd9c299a5..f95f66ff6 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/light-scattering-filter.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/light-scattering-filter.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/light-sources.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/light-sources.png index 40da7db40..b7af17605 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/light-sources.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/light-sources.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/light_and_shadow.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/light_and_shadow.html index 02d29c160..f2b34d253 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/light_and_shadow.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/light_and_shadow.html @@ -1,9 +1,8 @@ -

                Light and Shadow

                +

                Light and Shadow

                -

                @@ -18,18 +17,16 @@ Light and Shadow are two separate things in 3D engines, although we percieve the

                -

                A light source with a direction or location is required for all Geometries with Lighting.j3md-based Materials. An ambient light is not sufficient. In a scene with no appropriate light sources, Geometries with Lighting.j3md-based Materials do not render. Only Geometries with Unshaded.j3md-based Materials are visible independent of any light sources.

                -

                Light Sources and Colors

                +

                Light Sources and Colors

                -

                @@ -38,7 +35,7 @@ You can add several types of light sources to a scene using rootNode.addLi

                -The available light sources in com.???jme3.???light are: +The available light sources in com.​jme3.​light are:

                • SpotLight
                  @@ -52,7 +49,6 @@ The available light sources in com.???jme3.???light are:

                - You control the color and intensity of each light source. Typically you set the color to white (new ColorRGBA(1.0f,1.0f,1.0f,1.0f) or ColorRGBA.White), which makes all scene elements appear in their natural color.

                @@ -66,11 +62,10 @@ You can get a list of all lights added to a Spatial by calling getWorldLig
                -

                PointLight

                +

                PointLight

                -

                @@ -89,16 +84,15 @@ rootNode.addLight(lamp_light);
                -

                DirectionalLight

                +

                DirectionalLight

                -

                -A DirectionalLight has no position, only a direction. It sends out parallel beams of light and is considered "infinitely" far away. You typically have one directional light per scene. A DirectionalLight can be used together with shadows. +A DirectionalLight has no position, only a direction. It sends out parallel beams of light and is considered “infinitely” far away. You typically have one directional light per scene. A DirectionalLight can be used together with shadows.

                @@ -111,11 +105,10 @@ rootNode.addLight(sun);

                -

                SpotLight

                +

                SpotLight

                -

                @@ -136,16 +129,15 @@ spot.setDirection(cam.getDirection()); // shine forw rootNode.addLight(spot);

                -If you want the spotlight to follow the flycam, repeat the setDirection(???) and setPosition(???) calls in the update loop, and kee syncing them with the camera position and direction. +If you want the spotlight to follow the flycam, repeat the setDirection(…) and setPosition(…) calls in the update loop, and kee syncing them with the camera position and direction.

                -

                AmbientLight

                +

                AmbientLight

                - An AmbientLight simply influences the brightness and color of the scene globally. It has no direction and no location and shines equally everywhere. An AmbientLight does not cast any shadows, and it lights all sides of Geometries evenly, which makes 3D objects look unnaturally flat; this is why you typically do not use an AmbientLight alone without one of the other lights.

                @@ -164,11 +156,10 @@ Example: mylight.setColor(ColorRGBA.White.mult(1.3f));
                -

                Light Follows Spatial

                +

                Light Follows Spatial

                - You can use a com.jme3.scene.control.LightControl to make a SpotLight or PointLight follow a Spatial. This can be used for a flashlight being carried by a character, or for car headlights, or an aircraft's spotlight, etc.

                PointLight myLight = new PointLight();
                @@ -182,11 +173,10 @@ Obviously, this does not apply to AmbientLights, which have no position.
                 
                 
                -

                BasicShadowRenderer (deprecated)

                +

                BasicShadowRenderer (deprecated)

                - Full code sample

                  @@ -196,11 +186,10 @@ Full code sample
                -

                Casting Shadows

                +

                Casting Shadows

                - For each type of non-ambient light source, JME3 implements two ways to simulate geometries casting shadows on other geometries:

                  @@ -210,9 +199,11 @@ For each type of non-ambient light source, JME3 implements two ways to simulate
                GLSL 1.2 attributesJME3 equivalent
                gl_Vertex inPosition
                + + @@ -228,7 +219,6 @@ For each type of non-ambient light source, JME3 implements two ways to simulate
                light source class shadow renderer class shadow filter class
                DirectionalLight DirectionalLightShadowRenderer DirectionalLightShadowFilter

                - You only need one shadow simulation per light source: if you use shadow rendering, you won't need a shadow filter and vice versa. Which way is more efficient depends partly on the complexity of your scene. All six shadow simulation classes have similar interfaces, so once you know how to use one, you can easily figure out the rest.

                @@ -255,9 +245,7 @@ Here's a sample application which demonstrates both DirectionalLightShadowR

              - Here is the key code fragment: -

                      DirectionalLight sun = new DirectionalLight();
                       sun.setColor(ColorRGBA.White);
              @@ -280,26 +268,24 @@ Here is the key code fragment:
               

              Constructor arguments: * your AssetManager object - * size of the rendered shadow maps, in pixels per side (512, 1024, 2048, etc???) + * size of the rendered shadow maps, in pixels per side (512, 1024, 2048, etc…) * the number of shadow maps rendered (more shadow maps = better quality, but slower)

              Properties you can set: - * setDirection(Vector3f) ??? the direction of the light - * setLambda(0.65f) ??? to reduce the split size - * setShadowIntensity(0.7f) ??? shadow darkness (1=black, 0=invisible) - * setShadowZextend(float) ??? distance from camera to which shadows will be computed - + * setDirection(Vector3f) – the direction of the light + * setLambda(0.65f) – to reduce the split size + * setShadowIntensity(0.7f) – shadow darkness (1=black, 0=invisible) + * setShadowZextend(float) – distance from camera to which shadows will be computed

              -

              Parallel-Split Shadow Map (deprecated)

              +

              Parallel-Split Shadow Map (deprecated)

              - Full sample code

                @@ -308,7 +294,6 @@ Full sample code

              -

              private PssmShadowRenderer pssmRenderer;
              @@ -321,24 +306,22 @@ public void simpleInitApp() {
               
               
              -

              Screen Space Ambient Occlusion

              +

              Screen Space Ambient Occlusion

              - Full sample code

                -
              • ??? Screen-Space Ambient Occlusion shadows
                +
              • – Screen-Space Ambient Occlusion shadows
              • -
              • ??? Screen-Space Ambient Occlusion shadows plus transparancy
                +
              • – Screen-Space Ambient Occlusion shadows plus transparancy

              - Ambient Occlusion refers to the shadows which nearby objects cast on each other under an ambient lighting. Screen Space Ambient Occlusion (SSAO) approximates how light radiates in real life.

              @@ -352,9 +335,8 @@ viewPort.addProcessor(fpp);

              -

              -

              view online version

              \ No newline at end of file +

              view online version

              \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/loading_screen.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/loading_screen.html index 6afcb6782..11d22eb08 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/loading_screen.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/loading_screen.html @@ -1,9 +1,8 @@ -

              Nifty Loading Screen (Progress Bar)

              +

              Nifty Loading Screen (Progress Bar)

              - There is a good tutorial about creating a nifty progress bar here:

              @@ -28,7 +27,6 @@ This is the progress bar at 90%:

              nifty_loading.xml -

              <?xml version="1.0" encoding="UTF-8"?>
               <nifty>
              @@ -71,14 +69,12 @@ nifty_loading.xml
               
               
              -

              Understanding Nifty XML

              +

              Understanding Nifty XML

              - -The progress bar and text is done statically using nifty XML. +The progress bar and text is done statically using nifty XML. A custom control is created, which represents the progress bar. -

                  <controlDefinition name = "loadingbar" controller = "jme3test.TestLoadingScreen">
                       <image filename="Interface/border.png" childLayout="absolute" 
              @@ -90,7 +86,6 @@ A custom control is created, which represents the progress bar.
               
               

              This screen simply displays a button in the middle of the screen, which could be seen as a simple main menu UI. -

                  <screen id="start" controller = "jme3test.TestLoadingScreen">
                       <layer id="layer" childLayout="center">
              @@ -105,7 +100,6 @@ This screen simply displays a button in the middle of the screen, which could be
               
               

              This screen displays our custom progress bar control with a text control -

                  <screen id="loadlevel" controller = "jme3test.TestLoadingScreen">
                       <layer id="loadinglayer" childLayout="center" backgroundColor="#000000">
              @@ -119,7 +113,7 @@ This screen displays our custom progress bar control with a text control
               
               
              -

              Creating the bindings to use the Nifty XML

              +

              Creating the bindings to use the Nifty XML

              @@ -128,7 +122,6 @@ There are 3 main ways to update a progress bar. To understand why these methods

              Something like this in a single thread will not work: -

              load_scene();
               update_bar(30%);
              @@ -138,8 +131,7 @@ load_sounds();
               update_bar(100%);

              - -If you do all of this in a single frame, then it is sent to the graphics card only after the whole code block has executed. By this time the bar has reached 100% and the game has already begun ??? for the user, the progressbar on the screen would not have visibly changed. +If you do all of this in a single frame, then it is sent to the graphics card only after the whole code block has executed. By this time the bar has reached 100% and the game has already begun – for the user, the progressbar on the screen would not have visibly changed.

              @@ -154,13 +146,11 @@ The 2 main good solutions are:

              -

              Updating progress bar over a number of frames

              +

              Updating progress bar over a number of frames

              - The idea is to break down the loading of the game into discrete parts -

              package jme3test;
                
              @@ -324,12 +314,12 @@ public class TestLoadingScreen extends SimpleApplication implements ScreenContro
                   }
                
                   @Override
              -    public void bind(Nifty nifty, Screen screen, Element elmnt, Properties prprts, Attributes atrbts) {
              +    public void bind(Nifty nifty, Screen screen, Attributes atrbts) {
                       progressBarElement = elmnt.findElementByName("progressbar");
                   }
                
                   @Override
              -    public void init(Properties prprts, Attributes atrbts) {
              +    public void init(Attributes atrbts) {
                   }
                
                   public void onFocus(boolean getFocus) {
              @@ -346,7 +336,7 @@ Note:
               
               
              -

              Using multithreading

              +

              Using multithreading

              @@ -354,8 +344,7 @@ For more info on multithreading: XML file to point the controller to TestLoadingScreen1 - +Make sure to change the XML file to point the controller to TestLoadingScreen1

              package jme3test;
                
              @@ -504,7 +493,7 @@ public class TestLoadingScreen1 extends SimpleApplication implements ScreenContr
                       //since this method is called from another thread, we enqueue the changes to the progressbar to the update loop thread
                       enqueue(new Callable() {
                
              -            public Object call() throws Exception {
              +            public Exception {
                               final int MIN_WIDTH = 32;
                               int pixelWidth = (int) (MIN_WIDTH + (progressBarElement.getParent().getWidth() - MIN_WIDTH) * progress);
                               progressBarElement.setConstraintWidth(new SizeValue(pixelWidth + "px"));
              @@ -542,12 +531,12 @@ public class TestLoadingScreen1 extends SimpleApplication implements ScreenContr
                   }
                
                   @Override
              -    public void bind(Nifty nifty, Screen screen, Element elmnt, Properties prprts, Attributes atrbts) {
              +    public void bind(Nifty nifty, Screen screen, Attributes atrbts) {
                       progressBarElement = elmnt.findElementByName("progressbar");
                   }
                
                   @Override
              -    public void init(Properties prprts, Attributes atrbts) {
              +    public void init(Attributes atrbts) {
                   }
                
                   public void onFocus(boolean getFocus) {
              @@ -564,4 +553,4 @@ public class TestLoadingScreen1 extends SimpleApplication implements ScreenContr
               
               
               
              -

              view online version

              \ No newline at end of file +

              view online version

              \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/localization.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/localization.html index 338ac6654..829518326 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/localization.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/localization.html @@ -1,47 +1,42 @@ -

              Localizing jME 3 Games

              +

              Localizing jME 3 Games

              -

              Scope

              +

              Scope

              - Localizing an application can mean several things: -

              • At minimum you translate all messages and dialogs in the user interface to your target languages.
              • -
              • You should also translate the "read me", help, and other documentation.
                +
              • You should also translate the “read me”, help, and other documentation.
              • Also translating web content related to the application makes sure international users find out about your localized game.
              • -
              • If you go the whole way of internationalization, you also "translate" metaphors in icons or symbols used.
                +
              • If you go the whole way of internationalization, you also “translate” metaphors in icons or symbols used.
                E.g. For localizations to right-to-left languages, you must also adjust the whole flow of the UI (order of menus and buttons).

              - -There are tools that assist you with localizing Java Swing GUIs. jME3 applications do not typically have a Swing GUI, so those tools are not of much help. Just stick to the normal Java rules about using Bundle Properties: +There are tools that assist you with localizing Java Swing GUIs. jME3 applications do not typically have a Swing GUI, so those tools are not of much help. Just stick to the normal Java rules about using Bundle Properties:

              -

              Preparing the Localization

              +

              Preparing the Localization

              - -Tip: The jMonkeyEngine SDK supports opening and editing Bundle.properties files. Also note the Tools > Localization menu. +Tip: The jMonkeyEngine SDK supports opening and editing Bundle.properties files. Also note the Tools > Localization menu.

              To prepare the application for localization, you have to first identify all hard-coded messages. -

              1. Find every line in your jME3 game where you hard-coded message strings, e.g.
                @@ -56,31 +51,27 @@ UiText.setText("Score: "+score);
              score.display=Score: -
            • In the source code, replace every occurence of a hard-coded message with the appropriate Resource Bundle call to its unique key:
              System.out.print(ResourceBundle.getBundle("Bundle").getString("greeting"));
              +
            • In the source code, replace every occurence of a hard-coded message with the appropriate Resource Bundle call to its unique key:
              ResourceBundle.getBundle("Bundle").getString("greeting"));
               UiText.setText(ResourceBundle.getBundle("Bundle").getString("score.display")+score);
            • - The language used in the Bundle.properties files will be the default language for your game. -

              -

              Translating the Messages

              +

              Translating the Messages

              - Each additional language comes in a set of files that is marked with a (usually) two-letter suffix. Common locales are de for German, en for English, fr for French, ja for Japanese, pt for Portuguese, etc.

              To translate the messages to another language, for example, German: -

              1. Make a copy of the Bundle.properties files.
                @@ -100,23 +91,20 @@ score.display=Spielstand:

              - -Tip: In the jMonkeyEngine SDK, you set this VM Option in the Project properties under Run. Here you can also save individual run configuraions for each language you want to test. +Tip: In the jMonkeyEngine SDK, you set this VM Option in the Project properties under Run. Here you can also save individual run configuraions for each language you want to test.

              To get the full list of language suffixes use -

              -
              System.out.println(Arrays.toString(Locale.getISOLanguages()));
              +
              Locale.getISOLanguages()));
              -

              Which Strings Not to Translate

              +

              Which Strings Not to Translate

              - Important: In the Bundle.properties file, do not include any strings that are asset paths, node or geometry names, input mappings, or material layers.

                @@ -137,47 +125,43 @@ inputManager.addListener(actionListener, "Shoot");

              - Only localize messages and UI text!

              -

              Common Localization Problems

              +

              Common Localization Problems

              - Typical problems include:

                -
              • Localized strings will be of vastly different lengths and will totally break your UI layout. ??? Test every localization.
                +
              • Localized strings will be of vastly different lengths and will totally break your UI layout. ⇒ Test every localization.
              • -
              • Strings with variable text or numbers don't work the same in different languages. ??? Either work in grammatical cases/numbers/gender for each language, or use or .
                +
              • Strings with variable text or numbers don't work the same in different languages. ⇒ Either work in grammatical cases/numbers/gender for each language, or use or .
              • -
              • The localizer only sees the strings, without any context. E.g. does "Search History" mean "display the history of searches", or "search through the history"? ??? Use clear key labels. Work closely with the localizers if they require extra info, and add that info as comments to the translation file.
                +
              • The localizer only sees the strings, without any context. E.g. does “Search History” mean “display the history of searches”, or “search through the history”? ⇒ Use clear key labels. Work closely with the localizers if they require extra info, and add that info as comments to the translation file.
              • -
              • Broken international characters ??? Make sure the files are saved with the same character encoding as the font file(s) you're using. Nowadays, that usually means UTF-8 since font files tend to come for Unicode.
                +
              • Broken international characters ⇒ Make sure the files are saved with the same character encoding as the font file(s) you're using. Nowadays, that usually means UTF-8 since font files tend to come for Unicode.
              • -
              • Missing international characters ??? Make sure that there's a glyph for every needed character in your font, either by using more complete font files or by having the translation changed.
                +
              • Missing international characters ⇒ Make sure that there's a glyph for every needed character in your font, either by using more complete font files or by having the translation changed.
              -

              More Documentation

              +

              More Documentation

              -

              -

              -

              view online version

              \ No newline at end of file +

              view online version

              \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/logging.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/logging.html index f76baff61..25f87f48a 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/logging.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/logging.html @@ -1,24 +1,22 @@ -

              Logging and Monitoring

              +

              Logging and Monitoring

              -

              Logging Like a Newbie

              +

              Logging Like a Newbie

              - Many developers just use System.out.println() to print diagnostic strings to the terminal. The problem with that is that before the release, you have to go through all your code and make certain you removed all these println() calls. You do not want your customers to see them, and needlessly worry about ominous outdated debugging diagnostics.

              -

              Logging Like a Pro

              +

              Logging Like a Pro

              - Instead of println(), use the standard Java logger from java.util.logging. It has many advantages for professional game development:

                @@ -37,7 +35,6 @@ Instead of println(), use the standard Java logger from java.

              - To print comments like a pro, you use the following logger syntax.

                @@ -64,8 +61,7 @@ Example: Vector3f a = cam.getLocation();

              - -

              As you see in the examples, you should phrase potentially "customer facing" errors in a neutral way and offer a reason and a solution for the error (if you don't, it has no value to your customer). If your deveopment team uses WARNINGs as replacement for casual printlns, make sure you deactivate them for the release. +

              As you see in the examples, you should phrase potentially “customer facing” errors in a neutral way and offer a reason and a solution for the error (if you don't, it has no value to your customer). If your deveopment team uses WARNINGs as replacement for casual printlns, make sure you deactivate them for the release.

              @@ -75,39 +71,34 @@ More details about -

              Switching the Logger on and off

              +

              Switching the Logger on and off

              - In the release version you will deactivate the logging output to the terminal.

              To deactivate the default logger for a release, you set the log level to only report severe messages: -

              -
              Logger.getLogger(??????).setLevel(Level.SEVERE);
              +
              Logger.getLogger(””).setLevel(Level.SEVERE);

              During development or a beta test, you can tune down the default logger, and set the log level to only report warnings: -

              -
              Logger.getLogger(??????).setLevel(Level.WARNING);
              +
              Logger.getLogger(””).setLevel(Level.WARNING);

              To activate full logging, e.g. for debugging and testing, use the fine level: -

              -
              Logger.getLogger(??????).setLevel(Level.FINE);
              +
              Logger.getLogger(””).setLevel(Level.FINE);
              -

              Advanced Error Handling

              +

              Advanced Error Handling

              - When an uncaught exception reaches certain parts of the jME3 system then the default response is to log the error and then exit the application. This is because an error happening every frame will rapidly fill logs with repeated failings and potentially mask or over-write the original cause of the problem or even the application may continue for a while and then suffer other errors caused by the first and make the root cause hard to determine.

              @@ -117,4 +108,4 @@ This behaviour can be partially modified by overriding the method handleError in
              -

              view online version

              \ No newline at end of file +

              view online version

              \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/making_the_camera_follow_a_character.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/making_the_camera_follow_a_character.html index ac6e4b82a..e73ae93a7 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/making_the_camera_follow_a_character.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/making_the_camera_follow_a_character.html @@ -1,9 +1,8 @@ -

              Making the Camera Follow a 3rd-Person Character

              +

              Making the Camera Follow a 3rd-Person Character

              - When players steer a game character with 1st-person view, they directly steer the camera (flyCam.setEnabled(true);), and they never see the walking character itself. In a game with 3rd-person view, however, the players see the character walk, and you (the game developer) want to make the camera follow the character around when it walks.

              @@ -18,13 +17,12 @@ There are two ways how the camera can do that:

              - Important: Using third-person view requires you to deactivate the default flyCam (first-person view). This means that you have to configure your own navigation (key inputs and analogListener) that make your player character walk. For moving a physical player character, use player.setWalkDirection(), for a non-physical character you can use player.move().

              -

              Code Samples

              +

              Code Samples

              @@ -39,7 +37,7 @@ Press the WASD or arrow keys to move. Drag with the left mouse button to rotate.

              -

              Camera Node

              +

              Camera Node

              @@ -60,12 +58,13 @@ camNode.lookAt(target.getLocalTranslation(), Vector3f.UNIT_Y); Important: Where the example says camNode.setLocalTranslation(new Vector3f(0, 5, -5));, you have to supply your own start position for the camera. This depends on the size of your target (the player character) and its position in your particular scene. Optimally, you set this to a spot a bit behind and above the target. -

              + +
              MethodsDescription
              setControlDir(ControlDirection.SpatialToCamera)User input steers the target spatial, and the camera follows the spatial.
              The spatial's transformation is copied over the camera's transformation.
              @@ -78,21 +77,19 @@ The camera's transformation is copied over the spatial's transformatio

              - Code sample:

                -
              • ??? Press the WASD or arrow keys to move. Drag with the left mouse button to rotate.
                +
              • – Press the WASD or arrow keys to move. Drag with the left mouse button to rotate.
              -

              Chase Camera

              +

              Chase Camera

              - To activate the chase camera, add the following code to your init method (e.g. simpleInitApp()). The target spatial is typically the player node. You will be able to rotate the target by dragging (keeping the left mouse button pressed and moving the mouse).

              // Disable the default flyby cam
              @@ -101,9 +98,11 @@ flyCam.setEnabled(false);
               ChaseCamera chaseCam = new ChaseCamera(cam, target, inputManager);
               chaseCam.setSmoothMotion(true);
              + + @@ -139,28 +138,27 @@ new KeyTrigger(KeyInput.KEY_SPACE))
              MethodDescription
              setInvertVerticalAxis(true)Invert the camera's vertical rotation Axis
              Activate mutiple triggers for the ro

              - Code sample:

                -
              • ??? Press the WASD or arrow keys to move. Drag with the left mouse button to rotate.
                +
              • – Press the WASD or arrow keys to move. Drag with the left mouse button to rotate.
              -

              Which to Choose?

              +

              Which to Choose?

              - What is the difference of the two code samples above? -

              + + @@ -174,4 +172,4 @@ What is the difference of the two code samples above? -

              view online version

              \ No newline at end of file +

              view online version

              \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/material_definitions.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/material_definitions.html index d3c6fea18..94fae48cb 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/material_definitions.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/material_definitions.html @@ -1,10 +1,9 @@ -

              How to Use Material Definitions (.j3md)

              +

              How to Use Material Definitions (.j3md)

              - -All Geometries need a Material to be visible. Every Material is based on a Material Definition. Material definitions provide the "logic" for the material, and a shader draws the material according to the parameters specified in the definition. The J3MD file abstracts the shader and its configuration away from the user, allowing a simple interface where the user can simply set a few parameters on the material to change its appearance and the way its handled by the shaders. +All Geometries need a Material to be visible. Every Material is based on a Material Definition. Material definitions provide the “logic” for the material, and a shader draws the material according to the parameters specified in the definition. The J3MD file abstracts the shader and its configuration away from the user, allowing a simple interface where the user can simply set a few parameters on the material to change its appearance and the way its handled by the shaders.

              @@ -13,7 +12,6 @@ The most common Material Definitions are included in the engine, advanced users

              Example: -

              Spatial myGeometry = assetManager.loadModel("Models/Teapot/Teapot.j3o");
               Material mat = new Material(assetManager,  // Create new material and...
              @@ -28,11 +26,10 @@ myGeometry.setMaterial(mat);               // Use material on this Geome
               
               
              -

              Preparing a Material

              +

              Preparing a Material

              - In the Materials Overview list:

                @@ -42,17 +39,17 @@ In the Materi -
              1. Look at the applicable parameters of the Material Definition and determine which parameters you need to achieve the desired effect (e.g. "glow" or "color"). Most parameters are optional!
                +
              2. Look at the applicable parameters of the Material Definition and determine which parameters you need to achieve the desired effect (e.g. “glow” or “color”). Most parameters are optional!
              3. Create and save the necessary Texture files to your assets/Textures directory.
                  -
                • E.g. mytex_diffuse.png as ColorMap / DiffuseMap, mytex_normal.png as NormalMap, mytex_alpha.png as AlphaMap, etc???
                  +
                • E.g. mytex_diffuse.png as ColorMap / DiffuseMap, mytex_normal.png as NormalMap, mytex_alpha.png as AlphaMap, etc…
              4. Determine the required values to achieve the effect that you want.
                  -
                • E.g. set colors, floats, booleans, etc???
                  +
                • E.g. set colors, floats, booleans, etc…
              5. @@ -60,11 +57,10 @@ In the
                Materi
              -

              Using a Material

              +

              Using a Material

              - In your Java code,

                @@ -83,36 +79,32 @@ In your Java code,

              - For details see also: How to Use Materials

              -

              Examples

              +

              Examples

              - Here are examples of the methods that set the different data types:

                -
              • mat.setColor( "Color", ColorRGBA.White );
                +
              • mat.setColor( “Color”, ColorRGBA.White );
              • -
              • mat.setTexture( "ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.png" ));
                +
              • mat.setTexture( “ColorMap”, assetManager.loadTexture(“Interface/Logo/Monkey.png” ));
              • -
              • mat.setFloat( "Shininess", 5f);
                +
              • mat.setFloat( “Shininess”, 5f);
              • -
              • mat.setBoolean( "SphereMap", true);
                +
              • mat.setBoolean( “SphereMap”, true);
              • -
              • mat.setVector3( "NormalScale", new Vector3f(1f,1f,1f));
                +
              • mat.setVector3( “NormalScale”, new Vector3f(1f,1f,1f));

              - A simpled textured material. -

              Material mat = new Material(assetManager, 
                   "Common/MatDefs/Misc/Unshaded.j3md");
              @@ -121,7 +113,6 @@ mat.setTexture("ColorMap", assetManager.loadTexture(
               
               

              A textured material with a color bleeding through transparent areas. -

              Material mat = new Material(assetManager, 
                   "Common/MatDefs/Misc/Unshaded.j3md");
              @@ -132,30 +123,28 @@ mat.setColor("Color", ColorRGBA.Blue);

              You can test these examples within the following code snippet. It creates a box and applies the material:

              -
               Box b = new Box(Vector3f.ZERO, 1, 1, 1);
              +
               Box(Vector3f.ZERO, 1, 1, 1);
               Geometry geom = new Geometry("Box", b);
               // ... insert Material definition...
               geom.setMaterial(mat);
               rootNode.attachChild(geom);

              -

              You can find these and other common code snippets in the jMonkeyEngine SDK Code Palette. Drag and drop them into your source code. +

              You can find these and other common code snippets in the jMonkeyEngine SDK Code Palette. Drag and drop them into your source code.

              -

              Creating a Custom Material Definition

              +

              Creating a Custom Material Definition

              - First read the developer specification of the jME3 material system (.j3md,.j3m). Also check out the engine source code and have a look at how some Material Definitions are implemented.

              You can create your own Material Definitions and place them in your project's assets/MatDefs directory. -

              1. Find the existing MatDefs in engine/src/core-data/Common/MatDefs/.
                @@ -174,20 +163,17 @@ You can create your own Material Definitions and place them in your project'
              -

              Related Links

              +

              Related Links

              -

              view online version

              \ No newline at end of file +

              view online version

              \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/materials_overview.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/materials_overview.html index a22728810..6853d0791 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/materials_overview.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/materials_overview.html @@ -1,11 +1,9 @@ -

              Material Definition Properties

              +

              Material Definition Properties

              - In jMonkeyEngine 3, colors and textures are represented as Material objects. -

              • All Geometries must have Materials. To improve performance, reuse Materials for similar models, don't create a new Material object for every Geometry. (E.g. use one bark Material for several tree models.)
                @@ -15,7 +13,6 @@ In jMonkeyEngine 3, colors and textures are represented as Material objects.

              -

              Find out quickly How to Use Materials, including the most commonly used code samples and RenderStates.
              Or find more background info on How to use Material Definitions.

              @@ -23,11 +20,10 @@ Or find more background info on -

              All Materials Definition Properties

              +

              All Materials Definition Properties

              - The following Materials table shows you the Material Definitions that jMonkeyEngine 3 supports.

              @@ -45,11 +41,10 @@ Most Material parameters are optional. For example, it is okay to specify solely
              -

              Unshaded Coloring and Textures

              +

              Unshaded Coloring and Textures

              - jMonkeyEngine supports illuminated and unshaded Material Definitions.

                @@ -60,54 +55,54 @@ jMonkeyEngine supports illuminated and unshaded Material Definitions.

              - -"Unshaded" materials look somewhat abstract because they ignore lighting and shading. Unshaded Materials work even if the scene does not include a light source. These Materials can be single-colored or textured. For example, they are used for cards and tiles, for the sky, billboards and UI elements, for toon-style games, or for testing. - +“Unshaded” materials look somewhat abstract because they ignore lighting and shading. Unshaded Materials work even if the scene does not include a light source. These Materials can be single-colored or textured. For example, they are used for cards and tiles, for the sky, billboards and UI elements, for toon-style games, or for testing.

              CameraNodeChaseCam
              Camera follows immediately, flies at same speed as target.Camera moves smoothly and accelerates and decelerates, flies more slowly than the target and catches up.
              + + +setTexture(“GlowMap”, assetManager.loadTexture(“”));
              +setColor(“GlowColor”, ColorRGBA.White);
              Standard Unshaded Material Definition Usage Material Parameters
              Common/MatDefs/Misc/Unshaded.j3md Standard, non-illuminated Materials.
              Use this for simple coloring and texturing, glow, and transparency.
              See also: Hello Material
              Texture Maps
              -setTexture("ColorMap", assetManager.loadTexture(""));
              - setBoolean("SeparateTexCoord",true);
              -setTexture("LightMap", assetManager.loadTexture(""));
              +setTexture(“ColorMap”, assetManager.loadTexture(“”));
              + setBoolean(“SeparateTexCoord”,true);
              +setTexture(“LightMap”, assetManager.loadTexture(“”));
              Colors
              -setColor("Color", ColorRGBA.White);
              -setBoolean("VertexColor",true);
              +setColor(“Color”, ColorRGBA.White);
              +setBoolean(“VertexColor”,true);
              Glow
              -setTexture("GlowMap", assetManager.loadTexture(""));
              -setColor("GlowColor", ColorRGBA.White);

              - Other useful, but less commonly used material definitions: -

              + + +See also: Sky +See also: Hello Terrain +setTexture(“slopeColorMap”, assetManager.loadTexture(“”));
              + setFloat(“slopeTileFactor”,1f); +See also: Hello Effects
              Special Unshaded Material Definitions Usage Material Parameters
              Common/MatDefs/Misc/Sky.j3md A solid skyblue, or use with a custom SkyDome texture.
              -See also: Sky
              setTexture("TextureCubeMap", assetManager.loadTexture(""));
              - setBoolean("SphereMap",true);
              -setVector3("NormalScale", new Vector3f(0,0,0));
              setTexture(“TextureCubeMap”, assetManager.loadTexture(“”));
              + setBoolean(“SphereMap”,true);
              +setVector3(“NormalScale”, new Vector3f(0,0,0));
              Common/MatDefs/Terrain/Terrain.j3md Splat textures for e.g. terrains.
              -See also: Hello Terrain
              setTexture("Tex1", assetManager.loadTexture("")); (red)
              - setFloat("Tex1Scale",1f);
              - setTexture("Tex2", assetManager.loadTexture("")); (green)
              - setFloat("Tex2Scale",1f);
              -setTexture("Tex3", assetManager.loadTexture("")); (blue)
              - setFloat("Tex3Scale",1f);
              -setTexture("Alpha", assetManager.loadTexture(""));
              setTexture(“Tex1”, assetManager.loadTexture(“”)); (red)
              + setFloat(“Tex1Scale”,1f);
              + setTexture(“Tex2”, assetManager.loadTexture(“”)); (green)
              + setFloat(“Tex2Scale”,1f);
              +setTexture(“Tex3”, assetManager.loadTexture(“”)); (blue)
              + setFloat(“Tex3Scale”,1f);
              +setTexture(“Alpha”, assetManager.loadTexture(“”));
              Common/MatDefs/Terrain/HeightBasedTerrain.j3mdA multi-layered texture for terrains.
              @@ -119,38 +114,37 @@ Texture regions can overlap.
              For example: Specify a seafloor texture for the lowest areas,
              a sandy texture for the beaches,
              a grassy texure for inland areas,
              -and a rocky texture for mountain tops.
              setFloat("terrainSize",512f);
              -setTexture("region1ColorMap", assetManager.loadTexture(""));
              -setTexture("region2ColorMap", assetManager.loadTexture(""));
              -setTexture("region3ColorMap", assetManager.loadTexture(""));
              -setTexture("region4ColorMap", assetManager.loadTexture(""));
              -setVector3("region1", new Vector3f(0,0,0));
              - setVector3("region2", new Vector3f(0,0,0));
              - setVector3("region3", new Vector3f(0,0,0));
              - setVector3("region4", new Vector3f(0,0,0));
              +and a rocky texture for mountain tops.
              setFloat(“terrainSize”,512f);
              +setTexture(“region1ColorMap”, assetManager.loadTexture(“”));
              +setTexture(“region2ColorMap”, assetManager.loadTexture(“”));
              +setTexture(“region3ColorMap”, assetManager.loadTexture(“”));
              +setTexture(“region4ColorMap”, assetManager.loadTexture(“”));
              +setVector3(“region1”, new Vector3f(0,0,0));
              + setVector3(“region2”, new Vector3f(0,0,0));
              + setVector3(“region3”, new Vector3f(0,0,0));
              + setVector3(“region4”, new Vector3f(0,0,0));
              Settings for steep areas:
              -setTexture("slopeColorMap", assetManager.loadTexture(""));
              - setFloat("slopeTileFactor",1f);
              Common/MatDefs/Misc/Particle.j3md Used with texture masks for particle effects, or for point sprites.
              The Quadratic value scales the particle for perspective view ().
              Does support an optional colored glow effect.
              -See also: Hello Effects
              setTexture("Texture", assetManager.loadTexture(""));
              -setTexture("GlowMap", assetManager.loadTexture(""));
              -setColor("GlowColor", ColorRGBA.White);
              - setFloat("Quadratic",1f);
              - setBoolean("PointSprite",true);
              setTexture(“Texture”, assetManager.loadTexture(“”));
              +setTexture(“GlowMap”, assetManager.loadTexture(“”));
              +setColor(“GlowColor”, ColorRGBA.White);
              + setFloat(“Quadratic”,1f);
              + setBoolean(“PointSprite”,true);
              -

              Phong Illuminated

              +

              Phong Illuminated

              - jMonkeyEngine supports illuminated and unshaded Material Definitions.

                @@ -161,52 +155,54 @@ jMonkeyEngine supports illuminated and unshaded Material Definitions.

              - Illuminated materials require a light source added to at least one of their parent nodes! (e.g. rootNode.) Illuminated materials are darker on the sides facing away from light sources. They use Phong illumination model (default), or the Ward isotropic gaussian specular shader (WardIso) which looks more like plastic. They do not cast drop shadows unless you use a FilterPostProcessor. -

              + + + setBoolean(“VTangent”,true);
              + setBoolean(“Minnaert”,true);3)
              +setBoolean(“WardIso”,true);4)
              Standard Illuminated Material Definition Usage Material Parameters
              Common/MatDefs/Light/Lighting.j3md Commonly used Material with Phong illumination.
              Use this material together with DiffuseMap, SpecularMap, BumpMap (NormalMaps, ParalaxMap) textures.
              Supports shininess, transparency, and plain material colors (Diffuse, Ambient, Specular colors).
              See also: Hello Material
              Texture Maps
              -setTexture("DiffuseMap", assetManager.loadTexture(""));
              -setBoolean("UseAlpha",true);1)
              -setTexture("NormalMap", assetManager.loadTexture(""));
              -setBoolean("LATC",true); 2)
              -setTexture("SpecularMap", assetManager.loadTexture(""));
              - setFloat("Shininess",64f);
              -setTexture("ParallaxMap", assetManager.loadTexture(""));
              -setTexture("AlphaMap", assetManager.loadTexture(""));
              - setFloat("AlphaDiscardThreshold",1f);
              -setTexture("ColorRamp", assetManager.loadTexture(""));
              +setTexture(“DiffuseMap”, assetManager.loadTexture(“”));
              +setBoolean(“UseAlpha”,true);1)
              +setTexture(“NormalMap”, assetManager.loadTexture(“”));
              +setBoolean(“LATC”,true); 2)
              +setTexture(“SpecularMap”, assetManager.loadTexture(“”));
              + setFloat(“Shininess”,64f);
              +setTexture(“ParallaxMap”, assetManager.loadTexture(“”));
              +setTexture(“AlphaMap”, assetManager.loadTexture(“”));
              + setFloat(“AlphaDiscardThreshold”,1f);
              +setTexture(“ColorRamp”, assetManager.loadTexture(“”));
              Glow
              -setTexture("GlowMap", assetManager.loadTexture(""));
              -setColor("GlowColor", ColorRGBA.White);
              +setTexture(“GlowMap”, assetManager.loadTexture(“”));
              +setColor(“GlowColor”, ColorRGBA.White);
              Performance and quality
              -setBoolean("VertexLighting",true);
              - setBoolean("UseVertexColor",true);
              - setBoolean("LowQuality",true);
              - setBoolean("HighQuality",true);
              +setBoolean(“VertexLighting”,true);
              + setBoolean(“UseVertexColor”,true);
              + setBoolean(“LowQuality”,true);
              + setBoolean(“HighQuality”,true);
              Material Colors
              - setBoolean("UseMaterialColors",true);
              -setColor("Diffuse", ColorRGBA.White);
              - setColor("Ambient", ColorRGBA.White);
              -setColor("Specular", ColorRGBA.White);
              + setBoolean(“UseMaterialColors”,true);
              +setColor(“Diffuse”, ColorRGBA.White);
              + setColor(“Ambient”, ColorRGBA.White);
              +setColor(“Specular”, ColorRGBA.White);
              Tangent shading:
              - setBoolean("VTangent",true);
              - setBoolean("Minnaert",true);3)
              -setBoolean("WardIso",true);4)
              + + +setColor(“Diffuse”, ColorRGBA.White);
              +setColor(“Ambient”, ColorRGBA.White);
              +setFloat(“Shininess”,64f);
              +setColor(“Specular”, ColorRGBA.White);
              +setTexture(“SpecularMap”, assetManager.loadTexture(“”));
              +setBoolean(“WardIso”,true);
              + setBoolean(“useTriPlanarMapping”,true);
              + setBoolean(“isTerrainGrid”,true); - +
              Special Illuminated Material Definitions Usage Material Parameters
              Common/MatDefs/Terrain/TerrainLighting.j3mdSame kind of multi-layered splat texture as Terrain.j3md, but with illumination and shading.
              Typically used for terrains, but works on any mesh.
              @@ -215,50 +211,52 @@ You can use a total of 11 texture maps in the terrain's splat texture:
              For example, you can use a maximum of 9 diffuse textures, two of which can have normal maps;
              or, five textures with both diffuse and normal maps.
              Texture Splat Maps
              - setTexture("DiffuseMap", assetManager.loadTexture(""));
              - setFloat("DiffuseMap_0_scale",1f);
              -setTexture("NormalMap", assetManager.loadTexture(""));
              -setTexture("DiffuseMap_1", assetManager.loadTexture(""));
              - setFloat("DiffuseMap_1_scale",1f);
              -setTexture("NormalMap_1", assetManager.loadTexture(""));
              -setTexture("DiffuseMap_2", assetManager.loadTexture(""));
              - setFloat("DiffuseMap_2_scale",1f);
              -setTexture("NormalMap_2", assetManager.loadTexture(""));
              -setTexture("DiffuseMap_3", assetManager.loadTexture(""));
              - setFloat("DiffuseMap_3_scale",1f);
              -setTexture("NormalMap_3", assetManager.loadTexture(""));
              + setTexture(“DiffuseMap”, assetManager.loadTexture(“”));
              + setFloat(“DiffuseMap_0_scale”,1f);
              +setTexture(“NormalMap”, assetManager.loadTexture(“”));
              +setTexture(“DiffuseMap_1”, assetManager.loadTexture(“”));
              + setFloat(“DiffuseMap_1_scale”,1f);
              +setTexture(“NormalMap_1”, assetManager.loadTexture(“”));
              +setTexture(“DiffuseMap_2”, assetManager.loadTexture(“”));
              + setFloat(“DiffuseMap_2_scale”,1f);
              +setTexture(“NormalMap_2”, assetManager.loadTexture(“”));
              +setTexture(“DiffuseMap_3”, assetManager.loadTexture(“”));
              + setFloat(“DiffuseMap_3_scale”,1f);
              +setTexture(“NormalMap_3”, assetManager.loadTexture(“”));
              etc, up to 11.
              Alpha Maps
              -setTexture("AlphaMap", assetManager.loadTexture(""));
              -setTexture("AlphaMap_1", assetManager.loadTexture(""));
              -setTexture("AlphaMap_2", assetManager.loadTexture(""));
              +setTexture(“AlphaMap”, assetManager.loadTexture(“”));
              +setTexture(“AlphaMap_1”, assetManager.loadTexture(“”));
              +setTexture(“AlphaMap_2”, assetManager.loadTexture(“”));
              Glowing
              -setTexture("GlowMap", assetManager.loadTexture(""));
              -setColor("GlowColor", ColorRGBA.White);
              +setTexture(“GlowMap”, assetManager.loadTexture(“”));
              +setColor(“GlowColor”, ColorRGBA.White);
              Miscellaneous
              -setColor("Diffuse", ColorRGBA.White);
              -setColor("Ambient", ColorRGBA.White);
              -setFloat("Shininess",64f);
              -setColor("Specular", ColorRGBA.White);
              -setTexture("SpecularMap", assetManager.loadTexture(""));
              -setBoolean("WardIso",true);
              - setBoolean("useTriPlanarMapping",true);
              - setBoolean("isTerrainGrid",true);
              Common/MatDefs/Light/Reflection.j3md Reflective glass material with environment map (CubeMap/SphereMap). See also: setTexture("Texture", assetManager.loadTexture(""));
              - setBoolean("SphereMap",true);
              Common/MatDefs/Light/Reflection.j3md Reflective glass material with environment map (CubeMap/SphereMap). See also: setTexture(“Texture”, assetManager.loadTexture(“”));
              + setBoolean(“SphereMap”,true);
              -

              Other: Test and Debug

              +

              Other: Test and Debug

              + + @@ -266,29 +264,31 @@ setBoolean("WardIso",true);
              -

              RenderStates

              +

              RenderStates

              -

              Transparency

              +

              Transparency

              Material Definition Usage
              Common/MatDefs/Misc/ShowNormals.j3md A color gradient calculated from the model's surface normals. You can use this built-in material to debug the generation of normals in meshes, to preview models that have no material and no lights, or as fall-back default material. This built-in material has no parameters.
              + + - + - + @@ -296,7 +296,7 @@ Deactivate Alpha Testing for gradually translucent objects, suc Note: Viewed in front of a white background, Additive textures become fully transparent! - + @@ -305,17 +305,15 @@ Deactivate Alpha Testing for gradually translucent objects, suc - + - +
              Material OptionDescriptionExample
              getAdditionalRenderState().setBlendMode(BlendMode.Off);This is the default, no transparency.Use for all opaque objects like walls, floors, people???getAdditionalRenderState().setBlendMode(BlendMode.Off);This is the default, no transparency.Use for all opaque objects like walls, floors, people…
              getAdditionalRenderState().setBlendMode(BlendMode.Alpha);Interpolates the background pixel with the current pixel by using the current pixel's alpha.Use this for normal every-day translucency: Frosted window panes, ice, glass, alpha-blended vegetation textures??? getAdditionalRenderState().setBlendMode(BlendMode.Alpha);Interpolates the background pixel with the current pixel by using the current pixel's alpha.Use this for normal every-day translucency: Frosted window panes, ice, glass, alpha-blended vegetation textures…
              getAdditionalRenderState().setDepthWrite(false);Disables writing of the pixel's depth value to the depth buffer.Use this on Materials if you have several transparent/translucent objects obscuring one another, but you want to see through both.
              getAdditionalRenderState().setAlphaFallOff(0.5f);
              -getAdditionalRenderState().setAlphaTest(true)
              Enables Alpha Testing with a "AlphaDiscardThreshold" in the AlphaMap.Activate Alpha Testing for (partially) transparent objects such as foliage, hair, etc.
              +getAdditionalRenderState().setAlphaTest(true)
              Enables Alpha Testing with a “AlphaDiscardThreshold” in the AlphaMap.Activate Alpha Testing for (partially) transparent objects such as foliage, hair, etc.
              Deactivate Alpha Testing for gradually translucent objects, such as colored glass, smoked glass, ghosts.
              This is the default for Particle.j3md-based textures that have a black color background.
              getAdditionalRenderState().setBlendMode(BlendMode.AlphaAdditive);Same as "Additive", except first it multiplies the current pixel color by the pixel alpha.This can be used for particle effects that have alpha as background. getAdditionalRenderState().setBlendMode(BlendMode.AlphaAdditive);Same as “Additive”, except first it multiplies the current pixel color by the pixel alpha.This can be used for particle effects that have alpha as background.
              getAdditionalRenderState().setBlendMode(BlendMode.Color);Blends by color.Generally useless.getAdditionalRenderState().setBlendMode(BlendMode.Modulate);Multiplies the background pixel by the current pixel.?
              getAdditionalRenderState().setBlendMode(BlendMode.ModulateX2);Same as "Modulate", except the result is doubled.?getAdditionalRenderState().setBlendMode(BlendMode.ModulateX2);Same as “Modulate”, except the result is doubled.?
              getAdditionalRenderState().setBlendMode(BlendMode.PremultAlpha);Pre-multiplied alpha blending. E.g. if the color of the object has already been multiplied by its alpha, this is used instead of "Alpha" blend mode.For use with Premult Alpha textures.getAdditionalRenderState().setBlendMode(BlendMode.PremultAlpha);Pre-multiplied alpha blending. E.g. if the color of the object has already been multiplied by its alpha, this is used instead of “Alpha” blend mode.For use with Premult Alpha textures.

              - If the DiffuseMap has an alpha channel, use: -

              mat.setBoolean("UseAlpha",true);
              @@ -333,12 +331,14 @@ Later, put the Geometry (not the Material!) in the appropriate render queue
              -

              Culling

              +

              Culling

              + + @@ -346,7 +346,7 @@ Later, put the Geometry (not the Material!) in the appropriate render queue - + @@ -355,14 +355,14 @@ Later, put the Geometry (not the Material!) in the appropriate render queue -

              Miscellaneous

              +

              Miscellaneous

              Material OptionUsageExample
              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); 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); 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.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)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.
              - + @@ -370,23 +370,16 @@ Later, put the Geometry (not the Material!) in the appropriate render queue
              getAdditionalRenderState().setColorWrite(false);Disable writing the color of pixels.Use this together with setDepthWrite(true) to write pixels only to the depth buffer, for example.
              getAdditionalRenderState().setPointSprite(true);Enables point-sprite mode, e.g. meshes with "Mode.Points" will be rendered as textured sprites. Note that gl_PointCoord must be set in the shader.Point sprites are used internally for hardware accelerated particle effects.getAdditionalRenderState().setPointSprite(true);Enables point-sprite mode, e.g. meshes with “Mode.Points” will be rendered as textured sprites. Note that gl_PointCoord must be set in the shader.Point sprites are used internally for hardware accelerated particle effects.
              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 -

              - + +

              +tag_material_texture_matdefs_light_culling_renderstates_documentation +

              @@ -399,4 +392,4 @@ Minnaert is a shader type.
              4) WardIso is a shader type.
              -

              view online version

              \ No newline at end of file +

              view online version

              \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/mesh.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/mesh.html index e23596283..4160ad9ab 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/mesh.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/mesh.html @@ -1,18 +1,16 @@ -

              Polygon Meshes

              +

              Polygon Meshes

              -

              All visible game elements in a scene, whether it is a Model or a Shape, are made up of polygon meshes. JME3 has a com.jme3.scene.Mesh class that represents all meshes. -

                -
              • Meshes are made up of triangles: getTriangleCount(???) and getTriangle(???)
                +
              • Meshes are made up of triangles: getTriangleCount(…) and getTriangle(…)
              • Each mesh has a unique ID: getId()
              • @@ -31,7 +29,6 @@ All visible game elements in a scene, whether it is a Model or a Shape, are made

              - You have several options when creating Geometries from meshes:

                @@ -45,22 +42,23 @@ You have several options when -

                Vertex Buffer

                +

                Vertex Buffer

                - The VertexBuffer contains a particular type of geometry data used by Meshes. Every VertexBuffer set on a Mesh is sent as an attribute to the vertex shader to be processed.

                -

                Mesh Vertex Buffers

                +

                Mesh Vertex Buffers

                + + @@ -107,12 +105,14 @@ The VertexBuffer contains a particular type of geometry data used by Meshes. Eve -

                Mesh Properties

                +

                Mesh Properties

                Vertex Buffer TypeDescription
                Type.Position Position of the vertex (3 floats)
                + + @@ -144,12 +144,14 @@ The VertexBuffer contains a particular type of geometry data used by Meshes. Eve -

                Mesh Rendering Modes

                +

                Mesh Rendering Modes

                Mesh methodDescription
                setLineWidth(1)the thickness of the line if using Mode.Lines
                + + @@ -178,21 +180,17 @@ The VertexBuffer contains a particular type of geometry data used by Meshes. Eve -

                Level of Detail

                +

                Level of Detail

                - Optionally, custom meshes can have a LOD (level of detail optimization) that renders more or less detail, depending on the distance of the mesh from the camera. You have to specify several vertex buffers, one for each level of detail you want (very far away with few details, close up with all details, and something in the middle). Use setLodLevels(VertexBuffer[] lodLevels).

                - + +

                +tag_spatial_node_mesh_geometry_scenegraph +

                -

                view online version

                \ No newline at end of file +

                view online version

                \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/monkey_zone.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/monkey_zone.html index 4f5cfc6f4..470294857 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/monkey_zone.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/monkey_zone.html @@ -1,5 +1,5 @@ -

                Monkey Zone: Multi-player Sample Project

                +

                Monkey Zone: Multi-player Sample Project

                @@ -10,7 +10,7 @@ MonkeyZone is an multi-player demo game provided by the jME core developer team.

              • (YouTube Video)
              • -
              • (news article)
                +
              • (news article)
              • @@ -22,20 +22,19 @@ This open-source demo:
                1. showcases one possible way to implement a game with jME3, and
                2. -
                3. helps the jME team verify the jME3 API in terms of usability.
                  +
                4. helps the jME team verify the jME3 API in terms of usability.

                -The game idea is based on ???BattleZone??? arcade game from the 1980s, a first-person shooter the with real-time strategy elements. -The game was written using the jMonkeyEngine SDK, and it's based off the BasicGame project template. It took us one week to create a playable pre-alpha, including networking. -The project design follows best practices that make it possible to edit maps, vehicles, etc, in jMonkeyEngine SDK without having to change the code ??? This allows 3D graphic designers to contribute models more easily. (If you feel like contributing assets or working on parts of the game code, drop us a note!) - +The game idea is based on “BattleZone” arcade game from the 1980s, a first-person shooter the with real-time strategy elements. +The game was written using the jMonkeyEngine SDK, and it's based off the BasicGame project template. It took us one week to create a playable pre-alpha, including networking. +The project design follows best practices that make it possible to edit maps, vehicles, etc, in jMonkeyEngine SDK without having to change the code – This allows 3D graphic designers to contribute models more easily. (If you feel like contributing assets or working on parts of the game code, drop us a note!)

                -

                Implementation

                +

                Implementation

                @@ -44,96 +43,89 @@ When a human user or an AI performs an action (presses a button), the actual log

                -The way MonkeyZone is implemented is just one of the many possible ways to do a game like this in jME. Some things might be done more efficiently, some might be done in another way completely. MonkeyZone tries to do things the way that are most appropriate to implement the game at hand and it shows nicely how jME3 and the standard Java API can make game development easier and faster. Also note that the way MonkeyZone is designed is not scalable to a MMO style game, it will only work in a FPS style environment where the whole game world can be loaded at once. - +The way MonkeyZone is implemented is just one of the many possible ways to do a game like this in jME. Some things might be done more efficiently, some might be done in another way completely. MonkeyZone tries to do things the way that are most appropriate to implement the game at hand and it shows nicely how jME3 and the standard Java API can make game development easier and faster. Also note that the way MonkeyZone is designed is not scalable to a MMO style game, it will only work in a FPS style environment where the whole game world can be loaded at once.

                -

                Terminology

                +

                Terminology

                The game uses certain terms that might be familiar to you but maybe used in another way, so heres a quick rundown on the terms being used.

                  -
                • Player ??? Logical human or AI player that can enter entities and generally act, only exists as PlayerData ???database??? with an id.
                  +
                • Player – Logical human or AI player that can enter entities and generally act, only exists as PlayerData “database” with an id.
                • -
                • Entity ??? Spatial with UserData, a world object like character, vehicle, box or factory. The base form is defined only by a String pointing to the j3o which already has all userdata like hitpoints, speed etc.
                  +
                • Entity – Spatial with UserData, a world object like character, vehicle, box or factory. The base form is defined only by a String pointing to the j3o which already has all userdata like hitpoints, speed etc.
                • -
                • User ??? Human player using a client
                  +
                • User – Human player using a client
                • -
                • Player Group ??? Group of players that play together (e.g. one human player and one AI companion per client). For now that's the same as client_id of human player for all AIControl???ed players originating from that client.
                  +
                • Player Group – Group of players that play together (e.g. one human player and one AI companion per client). For now that's the same as client_id of human player for all AIControl’ed players originating from that client.
                • -
                • Client ??? Computer connected to server
                  +
                • Client – Computer connected to server
                -

                Manager Classes

                +

                Manager Classes

                The WorldManager does the main work of organizing players, entities and the world and synchronizing them between the server and client. Both client and server use this class. Some other managers like ClientEffectsManager only exist on the client or server and manage e.g. effects display. The gameplay is largely controlled by the ServerGameManager which does gameplay logic on the server, combined with the actions issued by the AI and user on the client (see below) it implements the gameplay. It extensively uses the functions exposed by the WorldManager to perform actions and gather data. This is also the class where the actions of the players are actually executed on the server to determine the outcome (ray testing for shooting etc.). -

                -

                Use of Controls

                +

                Use of Controls

                Controls are used extensively in MonkeyZone for many aspects of the game. When a player enters an entity, the Spatials Controls are configured based on the player that enters. For example when the human user enters an entity, Controls that update the user interface (DefaultHUDControl) or user input (UserInputControl) are added to the current entity Spatial. -

                -

                ...As entity capabilities

                +

                ...As entity capabilities

                -Controls attached to Spatials are generally used like an ???array of capabilities??? that the entity posesses. So when an entity has a VehicleControl its expected to be a vehicle, when its got a CharacterControl its expected to be a character. +Controls attached to Spatials are generally used like an “array of capabilities” that the entity posesses. So when an entity has a VehicleControl its expected to be a vehicle, when its got a CharacterControl its expected to be a character. Other Controls work completely on their own, like CharacterAnimControl which just uses the CharacterControl of the entity to check if the character is running, jumping etc. and then animates the entity if it has an AnimControl. -

                -

                ... to abstract

                +

                ... to abstract

                Furthermore theres special interfaces for Controls that allow abstraction of different Controls into one base interface. For example ManualControl and AutonomousControl are interfaces for controls that manage the movement of a spatial in a generalized way. This way AI code and e.g. the UserInputControl only have to check for a valid AutonomousControl or ManualControl on the spatial to control and move it. The details of the movement are handled by classes like ManualVehicleControl and AutonomousCharacterControl. -

                -

                ... for AI functions

                +

                ... for AI functions

                A special Control called CommandControl handles the Commands that can be executed by user controlled players, see below. -

                -

                Artificial Intelligence

                +

                Artificial Intelligence

                MonkeyZone includes simple AI functions based on a command queue. -

                -

                Commands

                +

                Commands

                @@ -164,73 +156,67 @@ To implement autonomous AI players MonkeyZone uses a system of Commands that are

                -

                Triggers

                +

                Triggers

                -The SphereTrigger is a TriggerControl that is also attached to each AI players current entity. It consists of a GhostControl that checks the overlapping entities around the entity its attached to. It can be assigned a command that is checked with every entity entering the SphereTrigger and executed if applicable (e.g. normal ???attack enemy??? mode). - +The SphereTrigger is a TriggerControl that is also attached to each AI players current entity. It consists of a GhostControl that checks the overlapping entities around the entity its attached to. It can be assigned a command that is checked with every entity entering the SphereTrigger and executed if applicable (e.g. normal “attack enemy” mode).

                -

                NavMesh

                +

                NavMesh

                For each map a navigation mesh is generated that allows the entities to navigate the terrain. Autonomous entities automatically get a NavigationControl based on the current map. The AutonomousControl implementations automatically recognize the NavigationControl attached to the Spatial and use it for navigation. The NavMeshNavigationControl implementation contains a reference to the levels NavMesh and implements a navigation algorithm similar to the A* algorithm. -

                -

                Networking

                +

                Networking

                Networking is realized in the PhysicsSyncManager which we hope to extend to a state where it can serve as a general sync system for physics based network games. -The sync manager basically puts a timestamp on every message sent from the server and then buffers all arriving messages on the client within a certain time window. This allows to compensate for messages arriving too soon or too late within the constraints of the buffer, a future version might step the clients physics space different to compensate for network delays without ???snapping???. - +The sync manager basically puts a timestamp on every message sent from the server and then buffers all arriving messages on the client within a certain time window. This allows to compensate for messages arriving too soon or too late within the constraints of the buffer, a future version might step the clients physics space different to compensate for network delays without “snapping”.

                -

                Use of jMonkeyEngine SDK tools

                +

                Use of jMonkeyEngine SDK tools

                -All assets used in the game, like entity models and loaded maps can be preconfigured and edited using the jMonkeyEngine SDK. For example, to add a new vehicle type, a vehicle is created in the jMonkeyEngine SDK vehicle editor and UserData like Speed, HitPoints etc. is applied directly in the editor. When the model is loaded in the game it is automatically configured based on these settings, the same accounts for maps that are loaded, special Nodes that mark e.g. player start locations are recognized automatically etc. - +All assets used in the game, like entity models and loaded maps can be preconfigured and edited using the jMonkeyEngine SDK. For example, to add a new vehicle type, a vehicle is created in the jMonkeyEngine SDK vehicle editor and UserData like Speed, HitPoints etc. is applied directly in the editor. When the model is loaded in the game it is automatically configured based on these settings, the same accounts for maps that are loaded, special Nodes that mark e.g. player start locations are recognized automatically etc.

                -

                UserData

                +

                UserData

                -Entities (Nodes and Geometries) that are loaded from disk have certain UserData like HitPoints, Speed etc. that is used to configure the entity at runtime. The jMonkeyEngine SDK allows adding and editing this UserData, so entity properties are editable visually. - +Entities (Nodes and Geometries) that are loaded from disk have certain UserData like HitPoints, Speed etc. that is used to configure the entity at runtime. The jMonkeyEngine SDK allows adding and editing this UserData, so entity properties are editable visually.

                -

                Physics

                +

                Physics

                -VehicleControls, CharacterControls and RigidBodyControls with mesh collision shape for terrain and objects are generated in the jMonkeyEngine SDK and saved in the entity j3o file. When an entity is loaded, the type of entity is identified based on the available controls and UserData and it is configured accordingly. - +VehicleControls, CharacterControls and RigidBodyControls with mesh collision shape for terrain and objects are generated in the jMonkeyEngine SDK and saved in the entity j3o file. When an entity is loaded, the type of entity is identified based on the available controls and UserData and it is configured accordingly.

                -

                API Info

                +

                API Info

                -

                Designer Infos

                +

                Designer Infos

                @@ -271,7 +257,7 @@ Level Spatial marking Node names:

                -

                Developer Infos

                +

                Developer Infos

                @@ -302,17 +288,17 @@ Programmatic PlayerData:

                -

                The Future

                +

                The Future

                Have a look at the code and feel free to ask about it, if you want any new features, you are free to implement them. ;) -MonkeyZone is hosted at GoogleCode, where you can check out the jMonkeyEngine SDK-ready project via svn: +MonkeyZone is hosted at GoogleCode, where you can check out the jMonkeyEngine SDK-ready project via svn:

                  -
                1. jMonkeyEngine SDK???Team???Subversion???Checkout,
                  +
                2. jMonkeyEngine SDK→Team→Subversion→Checkout,
                3. -
                4. Enter the SVN URL
                  +
                5. Enter the SVN URL
                6. Download, open, and build the project
                7. @@ -322,20 +308,17 @@ MonkeyZone is hosted at GoogleCode, where you can check out the jMonkeyEngine -

                  Troubleshooting

                  +

                  Troubleshooting

                  1. After download, errors could appear because jme3tools.navmesh.util\NavMeshGenerator.java import com.jme3.terrain.Terrain is not known, you should correct this by setting Project Properties > Libraries > Add Library > jme3-libraries-terrain
                  - + +

                  +tag_network_basegame_physics_inputs_spidermonkey +

                  -

                  view online version

                  \ No newline at end of file +

                  view online version

                  \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/motionpath.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/motionpath.html index 453588f52..3814fc752 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/motionpath.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/motionpath.html @@ -1,9 +1,8 @@ -

                  MotionPath

                  +

                  MotionPath

                  - A MotionPath describes the motion of a spatial between waypoints. The path can be linear or rounded. You use MotionPaths to remote-control a spatial, or the camera.

                  @@ -13,7 +12,7 @@ A MotionPath describes the motion of a spatial between waypoints. The path can b
                  -

                  Sample Code

                  +

                  Sample Code

                  • @@ -24,11 +23,10 @@ A MotionPath describes the motion of a spatial between waypoints. The path can b
                  -

                  What Are Way Points?

                  +

                  What Are Way Points?

                  - When shooting a movie scene, the director tells actors where to walk, for example, by drawing a series of small crosses on the floor. Cameramen often mount the camera on rails (so called dolly track) so they can follow along complex scenes more easily.

                  @@ -48,13 +46,11 @@ The final shape of the path is computed using a linear interpolation or a -

                  Create a MotionPath

                  +

                  Create a MotionPath

                  - Create a Motionpath object and add way points to it. -

                  MotionPath path = new MotionPath();
                   path.addWayPoint(new Vector3f(10, 3, 0));
                  @@ -63,12 +59,13 @@ path.addWayPoint(new Vector3f(8, -2, 1));
                   
                   

                  You can configure the path as follows. -

                Mesh ModeDescription
                Mesh.Mode.PointsShow only corner points (vertices) of mesh
                + + @@ -95,11 +92,10 @@ removeWayPoint(index)
                MotionPath Method Usage
                path.setCycle(true)Sets whether the motion along this path should be closed (true) or open-ended (false).
                Removes a way point from this path. You can specif -

                MotionPathListener

                +

                MotionPathListener

                - You can hook interactions into a playing MotionPath. Register a MotionPathListener to the MotionPath to track whether way points have been reached, and then trigger a custom action. The onWayPointReach() method of the interface gives you access to the MotionTrack object control, and an integer value representing the current wayPointIndex.

                @@ -118,4 +114,4 @@ In this example, you just print the status at every way point. In a game you cou
                -

                view online version

                \ No newline at end of file +

                view online version

                \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/mouse_picking.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/mouse_picking.html index 1f6274912..5029f0ab1 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/mouse_picking.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/mouse_picking.html @@ -1,9 +1,8 @@ -

                Mouse Picking

                +

                Mouse Picking

                - Mouse picking means that the user clicks an object in the scene to select it, or to interact with it otherwise. Games use picking to implement aiming and shooting, casting spells, picking up objects, selecting targets, dragging and moving objects, etc. Mouse picking can be done using fixed crosshairs, or using the mouse pointer.

                @@ -17,13 +16,11 @@ See Input Handlin
                -

                Pick a Target Using Fixed Crosshairs

                +

                Pick a Target Using Fixed Crosshairs

                - The following pick target input mapping implements an action that determines what a user clicked. It assumes that the mouse pointer is invisible and there are crosshairs painted in the center of the screen. It assumes that the user aims the crosshairs at an object in the scene and clicks. You use Ray Casting to identify the geometry that was picked by the user. Use this method together with a first-person flyCam. -

                1. Activate the first-person camera: flyCam.setEnabled(true);
                  @@ -37,7 +34,7 @@ The following pick target input mapping implements an action that d

                -The following example rotates Spatials named "Red Box" or "Blue Box" when they are clicked. Modify this code to do whatever your game needs to do with the identified target (shoot it, take it, move it, etc). +The following example rotates Spatials named “Red Box” or “Blue Box” when they are clicked. Modify this code to do whatever your game needs to do with the identified target (shoot it, take it, move it, etc).

                  private AnalogListener analogListener = new AnalogListener() {
                     public void onAnalog(String name, float intensity, float tpf) {
                @@ -51,7 +48,7 @@ The following example rotates Spatials named "Red Box" or "Blue B
                          rootNode.collideWith(ray, results);
                          // Print the results so we see what is going on
                          for (int i = 0; i < results.size(); i++) {
                -           // For each ???hit???, we know distance, impact point, geometry.
                +           // For each “hit”, we know distance, impact point, geometry.
                            float dist = results.getCollision(i).getDistance();
                            Vector3f pt = results.getCollision(i).getContactPoint();
                            String target = results.getCollision(i).getGeometry().getName();
                @@ -73,17 +70,15 @@ The following example rotates Spatials named "Red Box" or "Blue B
                 
                 
                -

                Pick a Target Using the Mouse Pointer

                +

                Pick a Target Using the Mouse Pointer

                - The following pick target input mapping implements an action that determines what a user clicked. It assumes that the mouse pointer is visible, and the user aims the cursor at an object in the scene. You use ray casting to determine the geometry that was picked by the user.

                Note: Picking with a visible mouse pointer implies that your application can no longer use the default flyCam where the MouseAxisTrigger rotates the camera. You have to deactivate the flyCam mappings and provide custom mappings. Either different inputs rotate the camera, or the camera is fixed. -

                1. Map the pick target action to a MouseButtonTrigger.
                  @@ -97,8 +92,7 @@ The following pick target input mapping implements an action that d

                - -The following example rotates Spatials named "Red Box" or "Blue Box" when they are clicked. Modify this code to do whatever your game needs to do with the identified target (shoot it, take it, move it, etc). +The following example rotates Spatials named “Red Box” or “Blue Box” when they are clicked. Modify this code to do whatever your game needs to do with the identified target (shoot it, take it, move it, etc).

                private AnalogListener analogListener = new AnalogListener() {
                     public void onAnalog(String name, float intensity, float tpf) {
                @@ -115,7 +109,7 @@ The following example rotates Spatials named "Red Box" or "Blue B
                         rootNode.collideWith(ray, results);
                         // (Print the results so we see what is going on:)
                         for (int i = 0; i < results.size(); i++) {
                -          // (For each ???hit???, we know distance, impact point, geometry.)
                +          // (For each “hit”, we know distance, impact point, geometry.)
                           float dist = results.getCollision(i).getDistance();
                           Vector3f pt = results.getCollision(i).getContactPoint();
                           String target = results.getCollision(i).getGeometry().getName();
                @@ -135,16 +129,11 @@ The following example rotates Spatials named "Red Box" or "Blue B
                       } // else if ...
                     }
                   };
                - + +

                +tag_documentation_node_ray_click_collision_keyinput_input +

                -

                view online version

                \ No newline at end of file +

                view online version

                \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/multiple_camera_views.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/multiple_camera_views.html index 080c2aeaf..7fcdfa410 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/multiple_camera_views.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/multiple_camera_views.html @@ -1,9 +1,8 @@ -

                Multiple Camera Views

                +

                Multiple Camera Views

                - You can split the screen and look into the 3D scene from different camera angles at the same time. E.g. you can have two rootnodes with different scene graphs, and two viewPorts, each of which can only see its own subset of the scene with its own subset of port-processing filters, so you get two very different views of the scene.

                @@ -13,22 +12,19 @@ The packages used in this example are com.jme3.renderer.Camera and
                -

                How to resize and Position ViewPorts

                +

                How to resize and Position ViewPorts

                - The default viewPort is as big as the window. If you have several, they must be of different sizes, either overlapping or adjacent to one another. How do you tell jME which of the ViewPorts should appear where on the screen, and how big they should be?

                Imagine the window as a 1.0f x 1.0f rectangle. The default cam's viewPort is set to -

                cam.setViewPort(0f, 1f, 0f, 1f);

                - This setting makes the ViewPort take up the whole rectangle.

                @@ -44,9 +40,7 @@ The four values are read in the following order:

                - Here are a few examples: -

                cam1.setViewPort( 0.0f , 1.0f   ,   0.0f , 1.0f );
                 cam2.setViewPort( 0.5f , 1.0f   ,   0.0f , 0.5f );
                @@ -65,7 +59,7 @@ These viewport parameters are, (in this order) the left-right extend, and the bo 0.0 , 0.0 1.0 , 0.0

                -Example: Cam2's rectangle is int he bottom right: It extends from mid (x1=0.5f) bottom (y1=0.0f), to right (x2=1.0f) mid (y2=0.5f) +Example: Cam2's rectangle is in the bottom right: It extends from mid (x1=0.5f) bottom (y1=0.0f), to right (x2=1.0f) mid (y2=0.5f)

                @@ -75,43 +69,36 @@ Example: Cam2's rectangle is int he bottom right: It extends from mid (x1=0

                -

                Four-Time Split Screen

                +

                Four-Time Split Screen

                - -In this example, you create four views (2x2) with the same aspect ratio as the window, but each is only half the width and height. +In this example, you create four views (2×2) with the same aspect ratio as the window, but each is only half the width and height.

                -

                Set up the First View

                +

                Set up the First View

                - You use the preconfigured Camera cam and viewPort from SimpleApplication for the first view. It's in the bottom right. -

                cam.setViewPort(.5f, 1f, 0f, 0.5f); // Resize the viewPort to half its size, bottom right.

                - Optionally, place the main camera in the scene and rotate it in its start position. -

                cam.setLocation(new Vector3f(3.32f, 4.48f, 4.28f));
                 cam.setRotation(new Quaternion (-0.07f, 0.92f, -0.25f, -0.27f));
                -

                Set Up Three More Views

                +

                Set Up Three More Views

                - Here is the outline for how you create the three other cams and viewPorts (.) In the code snippet, cam_n stand for cam_2 - cam_4, respectively, same for view_n. -

                1. Clone the first cam to reuse its settings
                  @@ -130,9 +117,7 @@ The camera doesn't have to look at the rootNode, but that is the most commo

                - Here is the abstract code sample for camera n: -

                Camera cam_n    = cam.clone();
                 cam_n.setViewPort(...); // resize the viewPort
                @@ -170,11 +155,10 @@ cam4.setViewPort( 0.5f , 1.0f  ,  0.5f , 1.0f);
                -

                Picture in Picture

                +

                Picture in Picture

                - The following code snippet sets up two views, one covers the whole screen, and the second is a small view in the top center.

                       +-----+-----+
                @@ -200,34 +184,28 @@ viewPort2.attachScene(rootNode);
                -

                ViewPort Settings

                +

                ViewPort Settings

                - You can customize the camera and the viewPort of each view individually. For example, each view can have a different background color: -

                viewPort.setBackgroundColor(ColorRGBA.Blue);

                - -You have full control to determine which Nodes the camera can see! It can see the full rootNode??? - +You have full control to determine which Nodes the camera can see! It can see the full rootNode…

                viewPort1.attachScene(rootNode);

                - -??? or you can give each camera a special node whose content it can see: - +… or you can give each camera a special node whose content it can see:

                viewPort2.attachScene(spookyGhostDetectorNode);
                - + +

                +tag_camera_documentation +

                -

                view online version

                \ No newline at end of file +

                view online version

                \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/multithreading.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/multithreading.html index b0a93d3a5..eb022d604 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/multithreading.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/multithreading.html @@ -1,9 +1,8 @@ -

                The jME3 Threading Model

                +

                The jME3 Threading Model

                - jME3 is similar to Swing in that, for speed and efficiency, all changes to the scene graph must be made in a single update thread. If you make changes only in Control.update(), AppState.update(), or SimpleApplication.simpleUpdate(), this will happen automatically. However, if you pass work to another thread, you may need to pass results back to the main jME3 thread so that scene graph changes can take place there.

                public void rotateGeometry(final Geometry geo, final Quaternion rot) {
                @@ -20,16 +19,14 @@ Note that this example does not fetch the returned value by calling get()<
                 
                 

                If the processing thread needs to wait or needs the return value then get() or the other methods in the returned Future object such as isDone() can be used. -

                -

                Multithreading Optimization

                +

                Multithreading Optimization

                - First, make sure you know what Application States and Custom Controls are.

                @@ -47,13 +44,11 @@ Effectively, each for-loop in the main update loop might be a chance for multith
                -

                Java Multithreading

                +

                Java Multithreading

                - The java.util.concurrent package provides a good foundation for multithreading and dividing work into tasks that can be executed concurrently (hence the name). The three basic components are the Executor (supervises threads), Callable Objects (the tasks), and Future Objects (the result). You can , I will give just a short introduction. -

                • A Callable is one of the classes that gets executed on a thread in the Executor. The object represents one of several concurrent tasks (e.g, one NPC's path finding task). Each Callable is started from the updateloop by calling a method named call().
                  @@ -66,11 +61,10 @@ The java.util.concurrent package provides a good foundation for multithreading a
                -

                Multithreading in jME3

                +

                Multithreading in jME3

                - So how do we implement multithreading in jME3?

                @@ -84,11 +78,10 @@ To avoid slowdown, we decide to keep the pathfinding operations in the NPC Contr
                -

                Executor

                +

                Executor

                - You create the executor object in a global AppState (or the initSimpleApp() method), in any case in a high-level place where multiple controls can access it.

                /* This constructor creates a new executor with a core pool size of 4. */
                @@ -101,7 +94,6 @@ Pool size means the executor will keep four threads alive at any time. Having mo
                 

                !!! 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 destroy method and shutdown the executor: -

                    @Override
                     public void destroy() {
                @@ -111,11 +103,10 @@ In your simple application you can override the destroy method and shutdown the
                 
                 
                -

                Control Class Fields

                +

                Control Class Fields

                - In the NPC Control, we create the individual objects that the thread manipulates. In our example case (the pathfinding control), the task is about locations and path arrays, so we need the following variables:

                //The vector to store the desired location in:
                @@ -131,11 +122,10 @@ Here we also created the Future variable to track the state of this task.
                 
                 
                -

                Control Update() Method

                +

                Control Update() Method

                - Next let's look at the update() call of the Control where the time-intensive task starts. In our example, the task is the findWay Callable (which contains the pathfinding process). So instead of spelling out the pathfinding process in the Control's update() loop, we start the process via future = executor.submit(findWay);.

                public void update(float tpf) {
                @@ -174,16 +164,15 @@ Note how this logic makes its decision based on the Future object.
                 

                -Remember not to mess with the class fields after starting the thread, because they are being accessed and modified on the new thread. In more obvious terms: You cannot change the "desired location" of the NPC while the path finder is calculating a different path. You have to cancel the current Future first. +Remember not to mess with the class fields after starting the thread, because they are being accessed and modified on the new thread. In more obvious terms: You cannot change the “desired location” of the NPC while the path finder is calculating a different path. You have to cancel the current Future first.

                -

                The Callable

                +

                The Callable

                - The next code sample shows the Callable that is dedicated to performing the long-running task (here, wayfinding). This is the task that used to block the rest of the application, and is now executed on a thread of its own. You implement the task in the Callable always in an inner method named call().

                @@ -193,7 +182,6 @@ The task code in the Callable should be self-contained! It should not write or r

                In reality, you might need access to the game state. If you must read or write a current state from the scene graph, you must have a clone of the data in your thread. There are only two ways: -

                • Use the execution queue application.enqueue() to create a sub-thread that clones the info. Only disadvantage is, it may be slower.
                  @@ -205,7 +193,6 @@ The following example gets the object Data data = myWorld.getData();

                  - These two ways are thread-safe, they don't mess up the game logic, and keep the Callable code readable.

                  // A self-contained time-intensive task:
                  @@ -214,10 +201,10 @@ private Callable<MyWayList> findWay = new Callable<MyWayList>(&#
                    
                           //Read or write data from the scene graph -- via the execution queue:
                           Vector3f location = application.enqueue(new Callable<Vector3f>() {
                  -        ????????public Vector3f call() throws Exception {
                  -        ????????????????//we clone the location so we can use the variable safely on our thread
                  -        ????????????????return mySpatial.getLocalTranslation().clone();
                  -        ????????}
                  +            public Vector3f call() throws Exception {
                  +                //we clone the location so we can use the variable safely on our thread
                  +                return mySpatial.getLocalTranslation().clone();
                  +            }
                           }).get();
                    
                           // This world class allows safe access via synchronized methods
                  @@ -231,33 +218,23 @@ private Callable<MyWayList> findWay = new Callable<MyWayList>(&#
                   
                   
                  -

                  Useful Links

                  +

                  Useful Links

                  - -High level description which describes how to manage the game state and the rendering in different threads - +High level description which describes how to manage the game state and the rendering in different threads - Outdated link. A C++ example can be found at

                  - -

                  Conclusion

                  + +

                  Conclusion

                  - The cool thing about this approach is that every entity creates one self-contained Callable for the Executor, and they are all executed in parallel. In theory, you can have one thread per entity without changing anything else but the settings of the executor. - +tag_loop_game_performance_state_states_documentation

                  -
                  - -

                  view online version

                  \ No newline at end of file + +

                  view online version

                  \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/networking.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/networking.html index 78b2a1974..f3b5b06d1 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/networking.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/networking.html @@ -1,11 +1,9 @@ -

                  SpiderMonkey: Multi-Player Networking

                  +

                  SpiderMonkey: Multi-Player Networking

                  - -This document introduces you to the SpiderMonkey networking API. You use this API when you develop games where several players compete with one another in real time. A multi-player game is made up of several clients connecting to a server: - +This document introduces you to the SpiderMonkey networking API. You use this API when you develop games where several players compete with one another in real time. A multi-player game is made up of several clients connecting to a server:

                  • The central server (one headless SimpleApplication) coordinates the game in the background.
                    @@ -15,35 +13,33 @@ This document introduces you to the SpiderMonkey networking -

                    SpiderMonkey API Overview

                    +

                    SpiderMonkey API Overview

                    - -The SpiderMonkey API is a set of interfaces and helper classes in the 'com.jme3.network' package. For most users, this package and the 'message' package is all they need to worry about. (The 'base' and 'kernel' packages only come into play when implementing custom network transports or alternate client/server protocols, which is now possible). +The SpiderMonkey API is a set of interfaces and helper classes in the 'com.jme3.network' package. For most users, this package and the 'message' package is all they need to worry about. (The 'base' and 'kernel' packages only come into play when implementing custom network transports or alternate client/server protocols, which is now possible).

                    -The SpiderMonkey API assists you in creating a Server, Clients, and Messages. Once a Server instance is created and started, the Server accepts remote connections from Clients, and you can send and receive Messages. Client objects represent the client-side of the client-server connection. Within the Server, these Client objects are referred to as HostedConnections. HostedConnections can hold application-defined client-specific session attributes that the server-side listeners and services can use to track player information, etc. - +The SpiderMonkey API assists you in creating a Server, Clients, and Messages. Once a Server instance is created and started, the Server accepts remote connections from Clients, and you can send and receive Messages. Client objects represent the client-side of the client-server connection. Within the Server, these Client objects are referred to as HostedConnections. HostedConnections can hold application-defined client-specific session attributes that the server-side listeners and services can use to track player information, etc.

                    + +
                    Seen from the Client Seen from the Server
                    com.jme3.network.Client == com.jme3.network.HostedConnection

                    - You can register several types of listeners to be notified of changes.

                      @@ -59,17 +55,16 @@ You can register several types of listeners to be notified of changes.
                    -

                    Client and Server

                    +

                    Client and Server

                    -

                    Creating a Server

                    +

                    Creating a Server

                    - -The game server is a "headless" com.jme3.app.SimpleApplication: +The game server is a “headless” com.jme3.app.SimpleApplication:

                    public class ServerMain extends SimpleApplication {
                       public static void main(String[] args) {
                    @@ -99,11 +94,10 @@ When you run this app on a host, the server is ready to accept clients. Let'
                     
                     
                    -

                    Creating a Client

                    +

                    Creating a Client

                    - A game client is a standard com.jme3.app.SimpleApplication.

                    public class ClientMain extends SimpleApplication {
                    @@ -119,7 +113,6 @@ A game client is a standard com.jme3.app.SimpleApplication.
                     

                    - Create a com.jme3.network.Client in the simpleInitApp() method and specify the servers IP address, and the same communication port as for the server, here 6143.

                    public void simpleInitApp() {
                    @@ -129,7 +122,7 @@ Create a com.jme3.network.Client in the simpleInitApp() method and
                        ...

                    -The server address can be in the format "localhost" or "127.0.0.1" (for local testing), or an IP address of a remote host in the format ???123.456.78.9???. In this example, we assume the server is running on the localhost. +The server address can be in the format “localhost” or “127.0.0.1” (for local testing), or an IP address of a remote host in the format “123.456.78.9”. In this example, we assume the server is running on the localhost.

                    @@ -138,18 +131,18 @@ When you run this client, it connects to the server.

                    -

                    Getting Info About a Client

                    +

                    Getting Info About a Client

                    - The server refers to a connected client as com.jme3.network.HostedConnection objects. The server can get info about clients as follows: -

                    + + @@ -162,34 +155,33 @@ The server refers to a connected client as com.jme3.network.HostedConnection obj
                    AccessorPurpose
                    myServer.getConnections()Server gets a collection of all connected HostedConnection objects (all connected clients).

                    - 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: -

                    + + - + - +
                    AccessorPurpose
                    conn.setAttribute("MyState", new MyState()); Server can change an attribute of the HostedConnection. conn.setAttribute(“MyState”, new MyState()); Server can change an attribute of the HostedConnection.
                    MyState state = conn.getAttribute("MyState") Server can read an attribute of the HostedConnection. MyState state = conn.getAttribute(“MyState”) Server can read an attribute of the HostedConnection.
                    -

                    Messaging

                    +

                    Messaging

                    -

                    Creating Message Types

                    +

                    Creating Message Types

                    - Each message represents data that you want to transmit between client and server. Common message examples include transformation updates or game actions. For each message type, create a message class that extends com.jme3.network.AbstractMessage. Use the @Serializable annotation from com.jme3.network.serializing.Serializable and create an empty default constructor. Custom constructors, fields, and methods are up to you and depend on the message data that you want to transmit.

                    @Serializable
                    @@ -206,23 +198,20 @@ You must register each message type to the com.jme3.network.serializing.Serializ
                     
                     
                    -

                    Responding to Messages

                    +

                    Responding to Messages

                    - -After a Message was received, a Listener responds to it. The listener can access fields of the message, and send messages back, start new threads, etc. There are two listeners, one on the server, one on the client. For each message type, you implement the responses in either Listeners??? messageReceived() method. +After a Message was received, a Listener responds to it. The listener can access fields of the message, and send messages back, start new threads, etc. There are two listeners, one on the server, one on the client. For each message type, you implement the responses in either Listeners’ messageReceived() method.

                    -

                    ClientListener.java

                    +

                    ClientListener.java

                    - Create one ClientListener.java and make it extend com.jme3.network.MessageListener. -

                    public class ClientListener implements MessageListener<Client> {
                       public void messageReceived(Client source, Message message) {
                    @@ -240,11 +229,10 @@ For each message type, register a client listener to the client.
                     
                     
                    -

                    ServerListener.java

                    +

                    ServerListener.java

                    - Create one ServerListener.java and make it extend com.jme3.network.MessageListener.

                    public class ServerListener implements MessageListener<HostedConnection> {
                    @@ -263,11 +251,10 @@ For each message type, register a server listener to the server:
                     
                     
                    -

                    Creating and Sending Messages

                    +

                    Creating and Sending Messages

                    - Let's create a new message of type HelloMessage:

                    Message message = new HelloMessage("Hello World!");
                    @@ -290,7 +277,6 @@ Or the server can send the message to a specific subset of clients (e.g. to Host

                    Or the server can send the message to all but a few selected clients (e.g. to all HostedConnections but conn4): -

                    myServer.broadcast( Filters.notEqualTo( conn4 ), message );
                    @@ -300,11 +286,10 @@ The last two broadcasting methods use com.jme3.network.Filters to select a subse
                    -

                    Identification and Rejection

                    +

                    Identification and Rejection

                    - The ID of the Client and HostedConnection are the same at both ends of a connection. The ID is given out authoritatively by the Server.

                    ... myClient.getId() ...
                    @@ -316,21 +301,19 @@ A server has a game version and game name property. Each client expects to commu

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

                    -

                    -

                    Closing Clients and Server Cleanly

                    +

                    Closing Clients and Server Cleanly

                    -

                    Closing a Client

                    +

                    Closing a Client

                    - You must override the client's destroy() method to close the connection cleanly when the player quits the client:

                      @Override
                    @@ -342,11 +325,10 @@ You must override the client's destroy() method to close the connection cle
                     
                     
                    -

                    Closing a Server

                    +

                    Closing a Server

                    - You must override the server's destroy() method to close the connection when the server quits:

                      @Override
                    @@ -358,44 +340,42 @@ You must override the server's destroy() method to close the connection whe
                     
                     
                    -

                    Kicking a Client

                    +

                    Kicking a Client

                    - -The server can kick a HostedConnection to make it disconnect. You should provide a String with further info (an explanation to the user what happened, e.g. "Shutting down for maintenance") for the server to send along. This info message can be used (displayed to the user) by a ClientStateListener. (See below) +The server can kick a HostedConnection to make it disconnect. You should provide a String with further info (an explanation to the user what happened, e.g. “Shutting down for maintenance”) for the server to send along. This info message can be used (displayed to the user) by a ClientStateListener. (See below)

                    conn.close("We kick cheaters.");
                    -

                    Listening to Connection Notification

                    +

                    Listening to Connection Notification

                    - The server and clients are notified about connection changes.

                    -

                    ClientStateListener

                    +

                    ClientStateListener

                    - The com.jme3.network.ClientStateListener notifies the Client when the Client has fully connected to the server (including any internal handshaking), and when the Client is kicked (disconnected) from the server.

                    The ClientStateListener when it receives a network exception applies the default close action. This just stops the client and you'll have to build around it so your application knows what to do. If you need more control when a network exception happens and the client closes, you may want to investigate in a ErrorListener.

                    -

                    + + @@ -405,25 +385,24 @@ The com.jme3.network.ClientStateListener notifies the Client when the Client has
                    ClientStateListener interface method Purpose
                    public void clientConnected(Client c){} Implement here what happens as soon as this client has fully connected to the server.

                    - First implement the ClientStateListener interface in the Client class. Then register it to myClient in MyGameClient's simpleInitApp() method:

                    myClient.addClientStateListener(this);
                    -

                    ConnectionListener

                    +

                    ConnectionListener

                    - The com.jme3.network.ConnectionListener notifies the Server whenever new HostedConnections (clients) come and go. The listener notifies the server after the Client connection is fully established (including any internal handshaking). -

                    + + @@ -433,19 +412,16 @@ The com.jme3.network.ConnectionListener notifies the Server whenever new HostedC
                    ConnectionListener interface method Purpose
                    public void connectionAdded(Server s, HostedConnection c){} Implemenent here what happens after a new HostedConnection has joined the Server.

                    - First implement the ConnectionListener interface in the Server class. Then register it to myServer in MyGameServer's simpleInitApp() method. -

                    myServer.addConnectionListener(this);
                    -

                    ErrorListener

                    +

                    ErrorListener

                    - The com.jme3.network.ErrorListener is a listener for when network exception happens. This listener is built so that you can override the default actions when a network exception happens.

                    @@ -453,19 +429,19 @@ The com.jme3.network.ErrorListener is a listener for when network exception happ

                    If you intend on using the default network mechanics, don't use this! If you do override this, make sure you add a mechanic that can close the client otherwise your client will get stuck open and cause errors.

                    -

                    + +
                    ErrorListener interface method Purpose
                    public void handleError(Client c, Throwable t){} Implemenent here what happens after a exception affects the network .

                    -

                    This interface was built for the client and server, but the code has never been put on the server to handle this listener.

                    @@ -484,22 +460,20 @@ In the class that implements the ErrorListener, a method would of been added cal

                    Replace exception part in the if statement for the type of exception that you would like it to handle. -

                    -

                    UDP versus TCP

                    +

                    UDP versus TCP

                    - SpiderMonkey supports both UDP (unreliable, fast) and TCP (reliable, slow) transport of messages.

                    message1.setReliable(true); // TCP
                     message2.setReliable(false); // UDP
                      -
                    • Choose reliable and slow transport for messages, if you want to make certain the message is delivered (resent) when lost, and if the order of a series of messages is relevant. E.g. game actions such as "1. wield weapon, 2. attack, 3. dodge".
                      +
                    • Choose reliable and slow transport for messages, if you want to make certain the message is delivered (resent) when lost, and if the order of a series of messages is relevant. E.g. game actions such as “1. wield weapon, 2. attack, 3. dodge”.
                    • Choose unreliable and fast transport for messages if the next message makes any previously delayed or lost message obsolete and synchronizes the state again. E.g. a series of new locations while walking.
                    • @@ -507,11 +481,10 @@ message2.setReliable(false); // UDP
                    -

                    Important: Use Multi-Threading

                    +

                    Important: Use Multi-Threading

                    -

                    You cannot modify the scenegraph directly from the network thread. A common example for such a modification is when you synchronize the player's position in the scene. You have to use Java Multithreading.

                    @@ -531,19 +504,17 @@ For general advice, see the articles -

                    Troubleshooting

                    +

                    Troubleshooting

                    - If you have set up a server in your home network, and the game clients cannot reach the server from the outside, it's time to learn about .

                    - + +

                    +tag_documentation_network_spidermonkey +

                    -

                    view online version

                    \ No newline at end of file +

                    view online version

                    \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty-gui-13.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty-gui-13.png index 3a05b90c7..d8b29a39b 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty-gui-13.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty-gui-13.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty-gui-example.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty-gui-example.png index 3b0284347..9f963dae6 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty-gui-example.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty-gui-example.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty-gui.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty-gui.png index af86c316f..2f0e86647 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty-gui.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty-gui.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty-screen-layer-panel.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty-screen-layer-panel.png index 9a142d924..274853c2d 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty-screen-layer-panel.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty-screen-layer-panel.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui.html index 52a536314..baee8dc13 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui.html @@ -1,5 +1,5 @@ -

                    Creating JME3 User Interfaces with Nifty GUI

                    +

                    Creating JME3 User Interfaces with Nifty GUI

                    @@ -7,12 +7,11 @@

                    -You may want your players to press a button to save a game, you want a scrolling text field for highscores, a text label to display the score, drop-downs to select keymap preferences, or checkboxes to specify multi-media options. Usually you solve these tasks by using Swing controls. Although it is possible to embed a jME3 canvas in a Swing GUI, a 3D game typically runs full-screen, or in a window of its own. +You may want your players to press a button to save a game, you want a scrolling text field for highscores, a text label to display the score, drop-downs to select keymap preferences, or checkboxes to specify multi-media options. Usually you solve these tasks by using Swing controls. Although it is possible to embed a jME3 canvas in a Swing GUI, a 3D game typically runs full-screen, or in a window of its own.

                    -This document introduces you to , a Java library for building interactive graphical user interfaces (GUIs) for games or similar applications. Nifty GUI (the de.lessvoid.nifty package) is well integrated with jME3 through the com.jme3.niftygui package. You define the base GUI layout in XML, and control it dynamically from your Java code. The necessary JAR libraries are included in your jME3 download, you do not need to install anything extra. (Just make sure they are on the classpath.) - +This document introduces you to , a Java library for building interactive graphical user interfaces (GUIs) for games or similar applications. Nifty GUI (the de.lessvoid.nifty package) is well integrated with jME3 through the com.jme3.niftygui package. You define the base GUI layout in XML, and control it dynamically from your Java code. The necessary JAR libraries are included in your jME3 download, you do not need to install anything extra. (Just make sure they are on the classpath.)

                    • @@ -21,12 +20,11 @@ This document introduces you to -

                      Tutorial Overview

                      +

                      Tutorial Overview

                      - -Learn to add a Nifty GUI to your jME3 game by going through this multi-part tutorial: +Learn to add a Nifty GUI to your jME3 game by going through this multi-part tutorial:

                      1. Understand the Nifty GUI Concepts described on this page.
                        @@ -35,15 +33,15 @@ Learn to add a Nifty GUI to
                      2. Lay out your graphical user interface:
                      3. -
                      4. Integrate the GUI into the game:
                        +
                      5. Integrate the GUI into the game:
                      -

                      Must Know: Nifty GUI Concepts

                      +

                      Must Know: Nifty GUI Concepts

                      -

                      Nifty GUIs are made up of the following elements: -

                        -
                      • A Nifty GUI contains one or more screens.
                        +
                      • A Nifty GUI contains one or more screens.
                        • Only one screen is visible at a time.
                        • @@ -100,7 +96,7 @@ Nifty GUIs are made up of the following elements:
                      -

                      Resources

                      +

                      Resources

                      -

                      JME-Nifty Sample Code

                      +

                      JME-Nifty Sample Code

                        -
                      • XML examples
                        +
                      • XML examples
                        • @@ -126,7 +122,7 @@ Nifty GUIs are made up of the following elements:
                      • -
                      • jME3-ready version of the Nifty GUI 1.3 demo (sample code, Java)
                        +
                      • jME3-ready version of the Nifty GUI 1.3 demo (sample code, Java)
                        • @@ -138,11 +134,10 @@ Nifty GUIs are made up of the following elements:
                      -

                      External Documentation

                      +

                      External Documentation

                      - Learn more from the NiftyGUI page:

                        @@ -164,12 +159,11 @@ Learn more from the NiftyGUI page:
                      -

                      Next Steps

                      +

                      Next Steps

                      - -Now that you understand the concepts and know where to find more information, learn how to lay out a simple graphical user interface. Typically, you start doing this in XML. +Now that you understand the concepts and know where to find more information, learn how to lay out a simple graphical user interface. Typically, you start doing this in XML.

                      • Lay out the GUI in XML (recommended)
                        @@ -182,22 +176,19 @@ Now that you understand the concepts and know where to find more information, le
                      -

                      Nifty Logging (Nifty 1.3.1)

                      +

                      Nifty Logging (Nifty 1.3.1)

                      If you want to disable the nifty log lines, add this code after you created nifty: -

                      Logger.getLogger("de.lessvoid.nifty").setLevel(Level.SEVERE); 
                       Logger.getLogger("NiftyInputEventHandlingLog").setLevel(Level.SEVERE); 
                      -
                      - gui, - documentation, - nifty, - hud -
                      + +

                      +tag_gui_documentation_nifty_hud +

                      -

                      view online version

                      \ No newline at end of file +

                      view online version

                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_java_interaction.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_java_interaction.html index d2ad0dba8..b2d78eaad 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_java_interaction.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_java_interaction.html @@ -1,5 +1,5 @@ -

                      Interacting with the GUI from Java

                      +

                      Interacting with the GUI from Java

                      1. @@ -10,32 +10,60 @@
                      2. -
                      3. Nifty GUI Java Interaction
                        +
                      4. Nifty GUI Java Interaction

                      - -In the previous parts of the tutorial, you created a two-screen user interface. But it is still static, and when you click the buttons, nothing happens yet. The purpose of the GUI is to communicate with your Java classes: Your game needs to know what the users clicked, which settings they chose, which values they entered into a field, etc. Similarly, the user needs to know what the currently game state is (score, health, etc). +In the previous parts of the tutorial, you created a two-screen user interface. But it is still static, and when you click the buttons, nothing happens yet. The purpose of the GUI is to communicate with your Java classes: Your game needs to know what the users clicked, which settings they chose, which values they entered into a field, etc. Similarly, the user needs to know what the currently game state is (score, health, etc).

                      -

                      Connect GUI to Java Controller

                      +

                      Connect GUI to Java Controller

                      - To let a Nifty screen communicate with the Java application, you register a ScreenController to every NiftyGUI screen. You create a ScreenController by creating a Java class that implements the de.lessvoid.nifty.screen.ScreenController interface and its abstract methods.

                      +

                      +Create an AppState MyStartScreen.java file in your package. ( Rightclick on your package → New → Other… → JME3 Classes → New AppState) +

                      +

                      Pro Tip: Since you are writing a jME3 application, you can additionally make the ScreenController class extend the AbstractAppState class! This gives the ScreenController access to the application object and to the update loop!

                      -
                      package tutorial;
                      +
                      +

                      +Now add implements ScreenController to public class MyStartScreen extends AbstractAppState{ and add import de.lessvoid.nifty.screen.ScreenController; +

                      + +

                      +Continue with adding: +

                      +
                      import de.lessvoid.nifty.screen.Screen;
                      + 
                      +...
                      + 
                      +public void bind(Nifty nifty, Screen screen) {
                      +    throw new UnsupportedOperationException("Not supported yet."); 
                      +}
                      + 
                      +public void onStartScreen() {
                      +    throw new UnsupportedOperationException("Not supported yet."); 
                      +}
                      + 
                      +public void onEndScreen() {
                      +    throw new UnsupportedOperationException("Not supported yet.");
                      +}
                      +
                      /*
                      + * To change this template, choose Tools | Templates
                      + * and open the template in the editor.
                      + */
                      +package mygame;
                        
                       import com.jme3.app.Application;
                      -import com.jme3.app.SimpleApplication;
                       import com.jme3.app.state.AbstractAppState;
                       import com.jme3.app.state.AppStateManager;
                       import de.lessvoid.nifty.Nifty;
                      @@ -44,47 +72,44 @@ import de.lessvoid.nifty.screen.ScreenController;
                        
                       public class MyStartScreen extends AbstractAppState implements ScreenController {
                        
                      -  private Nifty nifty;
                      -  private Screen screen;
                      -  private SimpleApplication app;
                      +    @Override
                      +    public void initialize(AppStateManager stateManager, Application app) {
                      +        super.initialize(stateManager, app);
                      +        //TODO: initialize your AppState, e.g. attach spatials to rootNode
                      +        //this is called on the OpenGL thread after the AppState has been attached
                      +    }
                        
                      -  /** custom methods */ 
                      +    @Override
                      +    public void update(float tpf) {
                      +        //TODO: implement behavior during runtime
                      +    }
                        
                      -  public MyStartScreen(String data) { 
                      -    /** Your custom constructor, can accept arguments */ 
                      -  } 
                      +    @Override
                      +    public void cleanup() {
                      +        super.cleanup();
                      +        //TODO: clean up what you initialized in the initialize method,
                      +        //e.g. remove all spatials from rootNode
                      +        //this is called on the OpenGL thread after the AppState has been detached
                      +    }
                        
                      -  /** Nifty GUI ScreenControl methods */ 
                      +    public void bind(Nifty nifty, Screen screen) {
                      +        throw new UnsupportedOperationException("Not supported yet.");
                      +    }
                        
                      -  public void bind(Nifty nifty, Screen screen) {
                      -    this.nifty = nifty;
                      -    this.screen = screen;
                      -  }
                      - 
                      -  public void onStartScreen() { }
                      - 
                      -  public void onEndScreen() { }
                      - 
                      -  /** jME3 AppState methods */ 
                      - 
                      -  @Override
                      -  public void initialize(AppStateManager stateManager, Application app) {
                      -    super.initialize(stateManager, app);
                      -    this.app=(SimpleApplication)app;
                      -  }
                      - 
                      -  @Override
                      -  public void update(float tpf) { 
                      -    /** jME update loop! */ 
                      -  }
                      +    public void onStartScreen() {
                      +        throw new UnsupportedOperationException("Not supported yet.");
                      +    }
                        
                      +    public void onEndScreen() {
                      +        throw new UnsupportedOperationException("Not supported yet.");
                      +    }
                       }

                      -The name and package of your custom ScreenController class (here tutorial.MyStartScreen) goes into the controller parameter of the respective XML screen it belongs to. For example: +The name and package of your custom ScreenController class (here mygame.MyStartScreen) goes into the controller parameter of the respective XML screen it belongs to. For example:

                      <nifty>
                      -  <screen id="start" controller="tutorial.MyStartScreen">
                      +  <screen id="start" controller="mygame.MyStartScreen">
                             <!-- layer and panel code ... -->
                         </screen>
                       </nifty>
                      @@ -93,61 +118,57 @@ The name and package of your custom ScreenController class (here tutorial. Or the same in a Java syntax, respectively:

                        nifty.addScreen("start", new ScreenBuilder("start") {{
                      -      controller(new tutorial.MyStartScreen())}});
                      + controller(new mygame.MyStartScreen())}});

                      -Now the Java class MyStartScreen and this GUI screen (start) are connected. For this example you can also connect the hud screen to MyStartScreen. +Now the Java class MyStartScreen and this GUI screen (start) are connected. For this example you can also connect the hud screen to MyStartScreen.

                      - -

                      Make GUI and Java Interact

                      + +

                      Make GUI and Java Interact

                      - In most cases, you will want to pass game data in and out of the ScreenController. Note that you can pass any custom arguments from your Java class into your ScreenController constructor (public MyStartScreen(GameData data) {}).

                      -Use any combination of the three following approaches to make Java classes interact with the GUI. +Use any combination of the three following approaches to make Java classes interact with the GUI.

                      - -

                      GUI Calls a Void Java Method

                      + +

                      GUI Calls a Void Java Method

                      - -This is how you respond to an GUI interaction such as clicks in XML GUIs: +This is how you respond to an GUI interaction such as clicks in XML GUIs:

                        -
                      1. Add visibleToMouse="true" to the parent element!
                        +
                      2. Add visibleToMouse=“true” to the parent element!
                      3. Embed the <interact /> element into the parent element.
                      4. Specify the Java methods that you want to call when the users performs certain actions, such as clicking.
                        -Example: <interact onClick="startGame(hud)" />
                        +Example: <interact onClick=“startGame(hud)” />

                      - -Or this is how you respond to an GUI interaction such as clicks in Java GUIs: +Or this is how you respond to an GUI interaction such as clicks in Java GUIs:

                      1. Add visibleToMouse(true); to the parent element!
                      2. -
                      3. Embed one of the interact???() elements into the parent element
                        +
                      4. Embed one of the interact…() elements into the parent element
                      5. Specify the Java method that you want to call after the interaction.
                        -Example: interactOnClick("startGame(hud)");
                        +Example: interactOnClick(“startGame(hud)”);

                      - In the following example, we call the startGame() method when the player clicks the Start button, and quitGame() when the player clicks the Quit button.

                              <panel id="panel_bottom_left" height="50%" width="50%" valign="center" childLayout="center">  
                      @@ -206,7 +227,7 @@ Back in the MyStartScreen class, you specify what the startGame() a
                       }

                      -The startGame() example simply switches the GUI to the hud screen when the user clicks Start. Of course, in a real game, you would perform more steps here: Load the game level, switch to in-game input and navigation handling, set a custom running boolean to true, attach custom in-game AppStates ??? and lots more. +The startGame() example simply switches the GUI to the hud screen when the user clicks Start. Of course, in a real game, you would perform more steps here: Load the game level, switch to in-game input and navigation handling, set a custom running boolean to true, attach custom in-game AppStates – and lots more.

                      @@ -214,13 +235,12 @@ The quitGame() example shows that you have access to the application app - -

                      GUI Gets Return Value from Java Method

                      + +

                      GUI Gets Return Value from Java Method

                      - -When the Nifty GUI is initialized, you can get data from Java. In this example, the Java class getPlayerName() in MyStartScreen defines the Text that is displayed in the textfield before the words 's Cool Game. +When the Nifty GUI is initialized, you can get data from Java. In this example, the Java class getPlayerName() in MyStartScreen defines the Text that is displayed in the textfield before the words 's Cool Game.

                      @@ -249,17 +269,16 @@ Or the same in a Java syntax, respectively: }});

                      -You can use this for Strings and numeric values (e.g. when you read settings from a file, you display the results in the GUI) and also for methods with side effects. +You can use this for Strings and numeric values (e.g. when you read settings from a file, you display the results in the GUI) and also for methods with side effects.

                      - -

                      Java Modifies Nifty Elements and Events

                      + +

                      Java Modifies Nifty Elements and Events

                      - -You can also alter the appearance and functions of your nifty elements from Java. Make certain that the element that you want to alter has its id="name" attribute set, so you can identy and address it. +You can also alter the appearance and functions of your nifty elements from Java. Make certain that the element that you want to alter has its id=“name” attribute set, so you can identy and address it.

                      @@ -273,7 +292,7 @@ Element niftyElement = nifty.getCurrentScreen().findElementByName(&q niftyElement.getRenderer(ImageRenderer.class).setImage(img);

                      -The same is valid for other elements, for example a text label "score": +The same is valid for other elements, for example a text label “score”:

                      // find old text
                       Element niftyElement = nifty.getCurrentScreen().findElementByName("score");
                      @@ -288,18 +307,16 @@ niftyElement.getElementInteraction().getPrimary().setOnMouseOver
                       
                       

                      For this to work, there already needs to be a (possibly inactive) <interact /> tag inside your xml element: -

                      <interact onClick="doNothing()"/>
                      - -

                      Next Steps

                      + +

                      Next Steps

                      - -You're done with the basic Nifty GUI for jME3 tutorial. You can proceed to advanced topics and learn how add controls and effects: +You're done with the basic Nifty GUI for jME3 tutorial. You can proceed to advanced topics and learn how add controls and effects:

                      -
                      - gui, - documentation, - input, - control, - hud, - nifty -
                      + +

                      +tag_gui_documentation_input_control_hud_nifty +

                      - -

                      view online version

                      \ No newline at end of file + +

                      view online version

                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_java_layout.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_java_layout.html index 8ac3878fe..8784bacca 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_java_layout.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_java_layout.html @@ -1,12 +1,12 @@ -

                      Laying Out the GUI in Java

                      +

                      Laying Out the GUI in Java

                      1. -
                      2. Nifty GUI XML Layout or Nifty GUI Java Layout
                        +
                      3. Nifty GUI XML Layout or Nifty GUI Java Layout
                      4. @@ -15,17 +15,15 @@

                      - -Work in progress You can "draw" the GUI to the screen by writing Java code ??? alternatively to using XML. Typically you lay out the static base GUI in XML, and use Java commands if you need to change the GUI dynamically at runtime. In theory, you can also lay out the whole GUI in Java (but we don't cover that here). +Work in progress You can “draw” the GUI to the screen by writing Java code – alternatively to using XML. Typically you lay out the static base GUI in XML, and use Java commands if you need to change the GUI dynamically at runtime. In theory, you can also lay out the whole GUI in Java (but we don't cover that here).

                      -

                      Sample Code

                      +

                      Sample Code

                      - Sample project

                        @@ -35,15 +33,15 @@ Sample project
                      • Download demo project: (jme3-ready)
                        The full demo ZIP is based on de.lessvoid.nifty.examples.controls.ControlsDemo.java.
                          -
                        1. The demo is a SimpleApplication-based game (use e.g. the BasicGame template in the jMonkeyEngine SDK).
                          +
                        2. The demo is a SimpleApplication-based game (use e.g. the BasicGame template in the jMonkeyEngine SDK).
                        3. Copy images and sound files into your project's assets/Interface/ directory. (In this example, I copied them from nifty-default-controls-examples/trunk/src/main/resources/ to assets/Interface/).
                        4. Make sure to use paths relative to your project's assets/ directory.
                            -
                          • E.g. for .fnt/.png/.jpg files use filename("Interface/yang.png"); ( not filename("yang.png");).
                            +
                          • E.g. for .fnt/.png/.jpg files use filename(“Interface/yang.png”); ( not filename(“yang.png”);).
                          • -
                          • E.g. for .wav/.ogg files use filename("Interface/sounds/gong.wav"); (not filename("sounds/gong.wav");).
                            +
                          • E.g. for .wav/.ogg files use filename(“Interface/sounds/gong.wav”); (not filename(“sounds/gong.wav”);).
                        5. @@ -52,8 +50,7 @@ The full demo ZIP is based on de.lessvoid.nifty.examples.controls.Controls

                      - -Just so you get a quick picture what Nifty GUI's Java Syntax looks like, here is the most basic example. It creates a screen with a layer and a panel that contains a button. +Just so you get a quick picture what Nifty GUI's Java Syntax looks like, here is the most basic example. It creates a screen with a layer and a panel that contains a button.

                      package mygame;
                        
                      @@ -122,16 +119,15 @@ public class Main extends SimpleApplication {
                       
                       
                      -

                      Implement Your GUI Layout

                      +

                      Implement Your GUI Layout

                      -

                      -In this tutorial, you recreate the same screen as in the Nifty GUI XML example. +In this tutorial, you recreate the same screen as in the Nifty GUI XML example.

                      @@ -140,11 +136,10 @@ Create an Screen.Java file in the assets/Interfaces/ directory of y

                      -

                      Make Screens

                      +

                      Make Screens

                      - The following minimal Java file contains a start screen and a HUD screen. (Neither has been defined yet.)

                      nifty.addScreen("start", new ScreenBuilder("start"){{
                      @@ -158,16 +153,15 @@ nifty.addScreen("hud", new ScreenBuilder("hud")&
                         }}.build(nifty));

                      -Every Nifty GUI must have a start screen. The others (in this example, the HUD screen) are optional. +Every Nifty GUI must have a start screen. The others (in this example, the HUD screen) are optional.

                      -

                      Make Layers

                      +

                      Make Layers

                      - The following Java code shows how we add layers to the start screen and HUD screen:

                      nifty.addScreen("start", new ScreenBuilder("start"){{
                      @@ -206,11 +200,10 @@ In a layer, you can now add panels and arrange them. Panels are containers that
                       
                       
                      -

                      Make Panels

                      +

                      Make Panels

                      - A panel is the inner-most container (that will contain the actual content: text, images, or controls). You place panels inside layers. The following panels go into in the start screen:

                          nifty.addScreen("start", new ScreenBuilder("start") {{
                      @@ -326,7 +319,7 @@ The following panels go into in the hud screen:
                           }}.build(nifty));

                      -Try the sample. Remember to activate a screen using nifty.gotoScreen("start"); or hud respectively. +Try the sample. Remember to activate a screen using nifty.gotoScreen(“start”); or hud respectively. The result should look as follows:

                      @@ -336,23 +329,20 @@ The result should look as follows:
                      -

                      Adding Content to Panels

                      +

                      Adding Content to Panels

                      - -See also on the Nifty GUI site. +See also on the Nifty GUI site.

                      -

                      Add Images

                      +

                      Add Images

                      - The start-background.png image is a fullscreen background picture. In the start screen, add the following image element: -

                          nifty.addScreen("start", new ScreenBuilder("start") {{
                               controller(new DefaultScreenController());
                      @@ -369,7 +359,6 @@ The start-background.png image is a fullscreen background picture. In the 
                       
                       

                      The hud-frame.png image is a transparent frame that we use as HUD decoration. In the hud screen, add the following image element: -

                          nifty.addScreen("hud", new ScreenBuilder("hud") {{
                               controller(new DefaultScreenController());
                      @@ -388,7 +377,6 @@ The hud-frame.png image is a transparent frame that we use as HUD decoration. In
                       

                      The face1.png image is an image that you want to use as a status icon. In the hud screen's foreground layer, add the following image element: -

                                      panel(new PanelBuilder("panel_top_right2") {{
                                           childLayoutCenter();
                      @@ -408,19 +396,16 @@ In the hud screen's foreground layer, add the fol
                                       }});

                      - This image is scaled to use 50% of the height and 30% of the width of its container.

                      -

                      Add Static Text

                      +

                      Add Static Text

                      - The game title is a typical example of static text. In the start screen, add the following text element: -

                                 // panel added
                                   panel(new PanelBuilder("panel_top") {{
                      @@ -441,7 +426,7 @@ The game title is a typical example of static text. In the start sc
                                   }});

                      -For longer pieces of static text, such as an introduction, you can use wrap="true". Add the following text element to the Start screen: +For longer pieces of static text, such as an introduction, you can use wrap=“true”. Add the following text element to the Start screen:

                                  panel(new PanelBuilder("panel_mid") {{
                                       childLayoutCenter();
                      @@ -462,16 +447,15 @@ For longer pieces of static text, such as an introduction, you can use wrap=&quo
                                   }});

                      -The font used is jME3's default font "Interface/Fonts/Default.fnt" which is included in the jMonkeyEngine.JAR. You can add your own fonts to your own assets/Interface directory. +The font used is jME3's default font “Interface/Fonts/Default.fnt” which is included in the jMonkeyEngine.JAR. You can add your own fonts to your own assets/Interface directory.

                      -

                      Add Controls

                      +

                      Add Controls

                      - Before you can use any control, you must load a Control Definition first. Add the following two lines before your screen definitions:

                          nifty.loadStyleFile("nifty-default-styles.xml");
                      @@ -479,11 +463,10 @@ Before you can use any control, you must load a Control Definition first. Add th
                       
                       
                      -

                      Label Control

                      +

                      Label Control

                      - Use label controls for text that you want to edit dynamically from Java. One example for this is the score display. In the hud screen's foreground layer, add the following text element:

                      @@ -506,12 +489,11 @@ Note that the width and height do not scale the bitmap font, but make indirectly
                      -

                      Button Control

                      +

                      Button Control

                      - -Our GUI plan asks for two buttons on the start screen. You add the Start and Quit buttons to the bottom panel of the start screen using the <control> element: +Our GUI plan asks for two buttons on the start screen. You add the Start and Quit buttons to the bottom panel of the start screen using the <control> element:

                                      panel(new PanelBuilder("panel_bottom_left") {{
                                           childLayoutCenter();
                      @@ -548,27 +530,25 @@ Our GUI plan asks for two bu
                                       }});

                      -Note that these controls don't do anything yet ??? we'll get to that soon. +Note that these controls don't do anything yet – we'll get to that soon.

                      -

                      Other Controls

                      +

                      Other Controls

                      - -Nifty additionally offers many customizable controls such as check boxes, text fields, menus, chats, tabs, ??? See also on the Nifty GUI site. +Nifty additionally offers many customizable controls such as check boxes, text fields, menus, chats, tabs, … See also on the Nifty GUI site.

                      -

                      Intermediate Result

                      +

                      Intermediate Result

                      - -When you preview this code in the jMonkeyEngine SDK, our tutorial demo should looks as follows: A start screen with two buttons, and a game screen with a simple HUD frame and a blue cube (which stands for any jME3 game content). +When you preview this code in the jMonkeyEngine SDK, our tutorial demo should looks as follows: A start screen with two buttons, and a game screen with a simple HUD frame and a blue cube (which stands for any jME3 game content).

                      @@ -581,25 +561,26 @@ When you preview this code in the jMonkeyEngine -

                      Nifty Java Settings

                      +

                      Nifty Java Settings

                      - Before initializing the nifty screens, you set up properties and register media.

                      + + - + - + - + @@ -610,19 +591,17 @@ Before initializing the nifty screens, you set up properties and register media.
                      Nifty Method Description
                      registerSound("mysound", "Interface/abc.wav"); registerSound(“mysound”, “Interface/abc.wav”);
                      registerMusic("mymusic", "Interface/xyz.ogg"); registerMusic(“mymusic”, “Interface/xyz.ogg”);
                      registerMouseCursor("mypointer", "Interface/abc.png", 5, 4); registerMouseCursor(“mypointer”, “Interface/abc.png”, 5, 4);
                      registerEffect(?); ?

                      - Example:

                      nifty.registerMouseCursor("hand", "Interface/mouse-cursor-hand.png", 5, 4);
                      -

                      Next Steps

                      +

                      Next Steps

                      - -Integrate the GUI into the game. Typically, you will overlay the GUI. +Integrate the GUI into the game. Typically, you will overlay the GUI.

                      -
                      - gui, - documentation, - nifty, - hud -
                      + +

                      +tag_gui_documentation_nifty_hud +

                      -

                      view online version

                      \ No newline at end of file +

                      view online version

                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_overlay.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_overlay.html index 76ca04101..97e1b0541 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_overlay.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_overlay.html @@ -1,5 +1,5 @@ -

                      Integrating Nifty GUI: Overlay

                      +

                      Integrating Nifty GUI: Overlay

                      1. @@ -8,29 +8,28 @@
                      2. -
                      3. Nifty GUI Overlay or Nifty GUI Projection
                        +
                      4. Nifty GUI Overlay or Nifty GUI Projection

                      -

                      -Typically, you define a key (for example escape) that switches the GUI on and off. The GUI can be a StartScreen, OptionsScreen, CharacterCreationScreen, etc. While the GUI is up, you pause the running game, and then overlay the GUI. You also must switch to a different set of user inputs while the game is paused, so the player can use the mouse pointer and keyboard to interact with the GUI. +Typically, you define a key (for example escape) that switches the GUI on and off. The GUI can be a StartScreen, OptionsScreen, CharacterCreationScreen, etc. While the GUI is up, you pause the running game, and then overlay the GUI. You also must switch to a different set of user inputs while the game is paused, so the player can use the mouse pointer and keyboard to interact with the GUI.

                      -You can also project the GUI as a texture onto a mesh texture (but then you cannot click to select). +You can also project the GUI as a texture onto a mesh texture (but then you cannot click to select). On this page, we look at the overlay variant, which is more commonly used in games.

                      -

                      Sample Code

                      +

                      Sample Code

                      • @@ -39,12 +38,11 @@ On this page, we look at the overlay variant, which is more commonly used in gam
                      -

                      Overlaying the User Interface Over the Screen

                      +

                      Overlaying the User Interface Over the Screen

                      - -This code shows you how to overlay anything on the screen with the GUI. This is the most common usecase. +This code shows you how to overlay anything on the screen with the GUI. This is the most common usecase.

                      NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(
                           assetManager, inputManager, audioRenderer, guiViewPort);
                      @@ -59,34 +57,37 @@ guiViewPort.addProcessor(niftyDisplay);
                       flyCam.setDragToRotate(true);

                      -Currently you do not have a ScreenController ??? we will create one in the next exercise. As soon as you have a screen controller, you will use the commented variant of the XML loading method: +Currently you do not have a ScreenController – we will create one in the next exercise. As soon as you have a screen controller, you will use the commented variant of the XML loading method:

                      nifty.fromXml("Interface/helloworld.xml", "start", new MySettingsScreen());

                      -The MySettingsScreen class is a custom de.lessvoid.nifty.screen.ScreenController in which you will implement your GUI behaviour. +The MySettingsScreen class is a custom de.lessvoid.nifty.screen.ScreenController in which you will implement your GUI behaviour. +

                      + +

                      +If you have many screens or you want to keep them organized in separate files there is a method available that will just load an additional XML file. The content of the files are +simply added to whatever XML data has been loaded before.

                      +
                      nifty.addXml("Interface/mysecondscreen.xml");
                      - -

                      Next Steps

                      + +

                      Next Steps

                      - -Now that you have layed out and integrated the GUI in your app, you want to respond to user input and display the current game. Time to create a ScreenController! +Now that you have layed out and integrated the GUI in your app, you want to respond to user input and display the current game. Time to create a ScreenController!

                      -
                      - gui, - documentation, - nifty, - hud -
                      + +

                      +tag_gui_documentation_nifty_hud +

                      - -

                      view online version

                      \ No newline at end of file + +

                      view online version

                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_popup_menu.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_popup_menu.html index 59281ce6c..bc31dd219 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_popup_menu.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_popup_menu.html @@ -1,10 +1,9 @@ -

                      Nifty GUI: Create a PopUp Menu

                      +

                      Nifty GUI: Create a PopUp Menu

                      - -Even though you create and populate the popup menu in Java, you still need a "placeholder" in your XML file. +Even though you create and populate the popup menu in Java, you still need a “placeholder” in your XML file. The popup element needs to be placed outside of any screen!

                      <useControls filename="nifty-default-controls.xml"/>
                      @@ -31,14 +30,13 @@ A brief explanation of some the attributes above:
                       
                       
                       

                      - The Java code within your defined ScreenController implementation:

                      private Element popup;
                       ...
                       public void createMyPopupMenu(){
                         popup = nifty.createPopup("niftyPopupMenu");
                      -  Menu myMenu = popup.findNiftyControl("#menu", Menu.class);
                      +  Menu.class);
                         myMenu.setWidth(new SizeValue("100px")); // must be set
                         myMenu.addMenuItem("Click me!", "menuItemIcon.png", 
                           new menuItem("menuItemid", "blah blah")); // menuItem is a custom class
                      @@ -60,7 +58,7 @@ public void showMenu() { // the method to trigger the menu
                       private class menuItem {
                         public String id;
                         public String name;
                      -  public menuItem(String id, String name){
                      +  public menuItem(String name){
                           this.id= id;
                           this.name = name;
                         }
                      @@ -75,7 +73,6 @@ private class menuItem {
                       
                       
                       

                      - To handle menu item events (i.e. calling a method when you click on a menu item), you register (subscribe) a EventTopicSubscriber<MenuItemActivatedEvent> class implementation to a nifty screen and element.

                        private class MenuItemActivatedEventSubscriber 
                      @@ -91,4 +88,4 @@ To handle menu item events (i.e. calling a method when you click on a menu item)
                         };
                      -

                      view online version

                      \ No newline at end of file +

                      view online version

                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_projection.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_projection.html index ff6c1f6b9..b73ca591f 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_projection.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_projection.html @@ -1,5 +1,5 @@ -

                      Integrating Nifty GUI: Projection

                      +

                      Integrating Nifty GUI: Projection

                      1. @@ -8,32 +8,31 @@
                      2. -
                      3. Nifty GUI Overlay or Nifty GUI Projection
                        +
                      4. Nifty GUI Overlay or Nifty GUI Projection

                      -

                      -Typically you define a key (for example escape) to switch the GUI on and off. Then you overlay the running game with the GUI (you will most likely pause the game then). +Typically you define a key (for example escape) to switch the GUI on and off. Then you overlay the running game with the GUI (you will most likely pause the game then).

                      -Alternatively, you can also project the GUI as a texture onto a mesh textures inside the game. Allthough this looks cool and "immersive", this approach is rarely used since it is difficult to record clicks this way. You can only interact with this projected GUI by keyboard, or programmatically. You can select input fields using the arrow keys, and trigger actions using the return key. +Alternatively, you can also project the GUI as a texture onto a mesh textures inside the game. Allthough this looks cool and “immersive”, this approach is rarely used since it is difficult to record clicks this way. You can only interact with this projected GUI by keyboard, or programmatically. You can select input fields using the arrow keys, and trigger actions using the return key.

                      -This GUI projection variant is less commonly used than the GUI overlay variant. Usecases for GUI projection are, for example, a player avatar using an in-game computer screen. +This GUI projection variant is less commonly used than the GUI overlay variant. Usecases for GUI projection are, for example, a player avatar using an in-game computer screen.

                      -

                      Sample Code

                      +

                      Sample Code

                      • @@ -42,12 +41,11 @@ This GUI projection variant
                      -

                      Projecting the User Interface Onto a Texture

                      +

                      Projecting the User Interface Onto a Texture

                      - -You can project the Nifty GUI onto a texture, load the texture into a material, and assign it to a Geometry (Quads or Boxes are best). +You can project the Nifty GUI onto a texture, load the texture into a material, and assign it to a Geometry (Quads or Boxes are best).

                      /** Create a special viewport for the Nifty GUI */
                       ViewPort niftyView = renderManager.createPreView("NiftyView", new Camera(1024, 768));
                      @@ -70,7 +68,7 @@ niftyView.setClearEnabled(true);
                       niftyView.setOutputFrameBuffer(fb);
                        
                       /** This is the 3D cube we project the GUI on */
                      -Box b = new Box(Vector3f.ZERO, 1, 1, 1);
                      +Box(Vector3f.ZERO, 1, 1, 1);
                       Geometry geom = new Geometry("Box", b);
                       Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
                       mat.setTexture("m_ColorMap", niftytex); /** Here comes the texture! */
                      @@ -78,34 +76,30 @@ geom.setMaterial(mat);
                       rootNode.attachChild(geom);

                      -The MySettingsScreen class is a custom de.lessvoid.nifty.screen.ScreenController in which you implement your GUI behaviour. The variable data contains an object that you use to exchange state info with the game. See Nifty GUI Java Interaction for details on how to create this class. +The MySettingsScreen class is a custom de.lessvoid.nifty.screen.ScreenController in which you implement your GUI behaviour. The variable data contains an object that you use to exchange state info with the game. See Nifty GUI Java Interaction for details on how to create this class.

                      -Run the code sample. You select buttons on this GUI with the arrow keys and then press return. Note that clicking on the texture will not work! +Run the code sample. You select buttons on this GUI with the arrow keys and then press return. Note that clicking on the texture will not work!

                      -

                      Next Steps

                      +

                      Next Steps

                      - -Now that you have layed out and integrated the GUI in your app, you want to respond to user input and display the current game. +Now that you have layed out and integrated the GUI in your app, you want to respond to user input and display the current game.

                      -
                      - gui, - documentation, - nifty, - hud, - texture -
                      + +

                      +tag_gui_documentation_nifty_hud_texture +

                      -

                      view online version

                      \ No newline at end of file +

                      view online version

                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_scenarios.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_scenarios.html index d6ec99bd6..a338e5f21 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_scenarios.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_scenarios.html @@ -1,23 +1,21 @@ -

                      Nifty GUI 1.3 - Usecase Scenarios

                      +

                      Nifty GUI 1.3 - Usecase Scenarios

                      - This document contains typical NiftyGUI usecase scenarios, such as adding effects, game states, and creating typical game screens.

                      -Requirements: These tips assume that you have read and understood the Creating JME3 User Interfaces with Nifty GUI tutorial, and have already laid out a basic GUI that interacts with your JME3 application. Here you learn how you integrate the GUI better, and add effects and advanced controls. +Requirements: These tips assume that you have read and understood the Creating JME3 User Interfaces with Nifty GUI tutorial, and have already laid out a basic GUI that interacts with your JME3 application. Here you learn how you integrate the GUI better, and add effects and advanced controls.

                      -

                      Switch Game States

                      +

                      Switch Game States

                      - In a JME game, you typically have three game states:

                        @@ -30,7 +28,6 @@ In a JME game, you typically have three game states:

                      - (Aside: Additionally, the Stopped state often contains a LoadScreen, LogonScreen, OptionsScreen, CharacterCreationScreen, HighScoreScreen, CreditsScreen, etc. Some games let you access the OptionsScreen in the Paused state as well. The Running state can also contain an InventoryScreen, ItemShopScreen, StatsScreen, SkillScreen, etc.)

                      @@ -42,22 +39,20 @@ In JME, game states are implemented as custom -

                      Get Access to Application and Update Loop

                      +

                      Get Access to Application and Update Loop

                      - Since you are writing a jME3 application, you can additionally make any ScreenController class extend the AbstractAppState class. This gives the ScreenController access to the application object and to the update loop!

                      @@ -81,6 +76,11 @@ public StartScreenState(SimpleApplication app){ @Override public void initialize(AppStateManager stateManager, Application app) { super.initialize(stateManager, app); +  + rootNode.attachChild(localRootNode); + guiNode.attachChild(localGuiNode); + viewPort.setBackgroundColor(backgroundColor); +  /** init the screen */ }   @@ -90,22 +90,16 @@ public StartScreenState(SimpleApplication app){ }   @Override - public void stateAttached(AppStateManager stateManager) { - rootNode.attachChild(localRootNode); - guiNode.attachChild(localGuiNode); - viewPort.setBackgroundColor(backgroundColor); - } -  - @Override - public void stateDetached(AppStateManager stateManager) { + public void cleanup() { rootNode.detachChild(localRootNode); guiNode.detachChild(localGuiNode); +  + super.cleanup(); }   }

                      -

                      It is not sufficient to just inherit from AbstractAppState. You need to instantiate your controller class, register it with app's stateManager and then pass it to nifty. See code sample below.

                      @@ -119,13 +113,15 @@ public StartScreenState(SimpleApplication app){ }
                      - -

                      Know Your Variables

                      + +

                      Know Your Variables

                      + + @@ -133,25 +129,23 @@ public StartScreenState(SimpleApplication app){ - + - +
                      VariableDescription
                      ${CALL.myMethod()} Calls a method in the current ScreenController and gets the method's return String. The method can also be void and have a side effect, e.g. play a sound etc.
                      ${ENV.HOME} Returns the path to user's home directory.
                      ${ENV.key} Looks up key in the environment variables. Use it like Java's System.getEnv("key").${ENV.key} Looks up key in the environment variables. Use it like Java's System.getEnv(“key”).
                      ${PROP.key} looks up key in the Nifty properties. Use Nifty.setGlobalproperties(properties) and Nifty.getGlobalproperties("key"). Or SystemGetProperties(key);${PROP.key} looks up key in the Nifty properties. Use Nifty.setGlobalproperties(properties) and Nifty.getGlobalproperties(“key”). Or SystemGetProperties(key);
                      - +

                      - See also:

                      - -

                      Use ScreenControllers for Mutally Exclusive Functionality

                      + +

                      Use ScreenControllers for Mutally Exclusive Functionality

                      - Technically you are free to create one ScreenController class for each screen, or reuse the same ScreenController for all or some of them. In the end it may be best to create individual ScreenControllers for functionality that is mutually exclusive.

                      @@ -166,32 +160,29 @@ For example, create a MyHudScreen.java for the hud scr
                      - -

                      Create a "Loading..." Screen

                      + +

                      Create a "Loading..." Screen

                      - Get the full Loading Screen tutorial here.

                      - -

                      Create a Popup Menu

                      + +

                      Create a Popup Menu

                      - Get the full Nifty GUI PopUp Menu tutorial here.

                      - -

                      Add Visual Effects

                      + +

                      Add Visual Effects

                      - You can register effects to screen elements.

                        @@ -202,7 +193,6 @@ You can register effects to screen elements.

                      - Here is an example that moves a panel when the startScreen opens. You place an < effect > tag inside the element that you want to be affected.

                      <panel height="25%" width="35%" ...>
                      @@ -220,12 +210,11 @@ Learn more from the NiftyGUI page:
                       
                       
                       
                      - -

                      Add Sound Effects

                      + +

                      Add Sound Effects

                      - Playing sounds using Nifty is also possible with a playSound effect as trigger. Remember to first register the sound that you want to play:

                      <registerSound id="myclick" filename="Interface/sounds/ButtonClick.ogg" />
                      @@ -237,44 +226,38 @@ Playing sounds using Nifty is also possible with a playSound effect
                       </label>
                      - -

                      Pass ClickLoc From Nifty to Java

                      + +

                      Pass ClickLoc From Nifty to Java

                      - After a mouse click, you may want to record the 2D clickLoc and send this info to your Java application. Typical ScreenController methods however only have a String argument. You'd have to convert the String to ints.

                      To pass the clickLoc as two ints, you can use the special (int x, int y) syntax in the ScreenController: -

                        public void clicked(int x, int y) {
                           // here you can use the x and y of the clickLoc
                         }

                      - -In the Nifty GUI screen code (e.g. XML file) you must call the (int x, int y) method without any parameters! - +In the Nifty GUI screen code (e.g. XML file) you must call the (int x, int y) method without any parameters!

                      <interact onClick="clicked()"/>  

                      - You can name the method (here clicked) what ever you like, as long as you keep the argument syntax.

                      - -

                      Load Several XML Files

                      + +

                      Load Several XML Files

                      - -The basic Nifty GUI example showed how to use the nifty.fromXML() method to load one XML file containing all Nifty GUI screens. -The following code sample shows how you can load several XML files into one nifty object. Loading several files with nifty.addXml() allows you to split up each screen into one XML file, instead of all into one hard-to-read XML file. +The basic Nifty GUI example showed how to use the nifty.fromXML() method to load one XML file containing all Nifty GUI screens. +The following code sample shows how you can load several XML files into one nifty object. Loading several files with nifty.addXml() allows you to split up each screen into one XML file, instead of all into one hard-to-read XML file.

                      NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager, inputManager, audioRenderer, viewPort);
                       Nifty nifty = niftyDisplay.getNifty();
                      @@ -288,17 +271,16 @@ stateManager.attach(optionsControl);
                       guiViewPort.addProcessor(niftyDisplay);
                      - -

                      Register additional explicit screen controllers

                      + +

                      Register additional explicit screen controllers

                      - -In addition to the nifty.addXml() methods to attach many nifty XML files, there exists a nifty.registerScreenController() method to explicitly attach more screen controllers. +In addition to the nifty.addXml() methods to attach many nifty XML files, there exists a nifty.registerScreenController() method to explicitly attach more screen controllers.

                      -The following code sample shows how you can explicitly attach several screen controllers before adding the XML file to nifty, which would otherwise cause nifty to implicitly instantiate the screen controller class. +The following code sample shows how you can explicitly attach several screen controllers before adding the XML file to nifty, which would otherwise cause nifty to implicitly instantiate the screen controller class.

                      NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager, inputManager, audioRenderer, viewPort);
                       Nifty nifty = niftyDisplay.getNifty();
                      @@ -307,13 +289,12 @@ nifty.registerScreenController(new OptionsScreenController(randomConstru
                       nifty.addXml("Interface/Screens/OptionsScreen.xml");
                      - -

                      Design Your Own Styles

                      + +

                      Design Your Own Styles

                      - -By default, your Nifty XML screens use the built.in styles: +By default, your Nifty XML screens use the built.in styles:

                       <useStyles filename="nifty-default-styles.xml" /> 
                      @@ -334,8 +315,7 @@ Inside myCustomStyles.xml you define styles like this: </nifty-styles>

                      -Learn more about how to create styles by looking at the for ???nifty-style-black???. Copy it as a template and change it to create your own style. - +Learn more about how to create styles by looking at the for “nifty-style-black”. Copy it as a template and change it to create your own style.


                      @@ -346,18 +326,11 @@ Learn more from the NiftyGUI page:
                    • -
                      - gui, - documentation, - nifty, - hud, - click, - state, - states, - sound, - effect -
                      + +

                      +tag_gui_documentation_nifty_hud_click_state_states_sound_effect +

                      - -

                      view online version

                      \ No newline at end of file + +

                      view online version

                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_xml_layout.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_xml_layout.html index 81fa57af9..f849d97c5 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_xml_layout.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nifty_gui_xml_layout.html @@ -1,12 +1,12 @@ -

                      Laying out the GUI in XML

                      +

                      Laying out the GUI in XML

                      1. -
                      2. Nifty GUI XML Layout or Nifty GUI Java Layout
                        +
                      3. Nifty GUI XML Layout or Nifty GUI Java Layout
                      4. @@ -15,22 +15,20 @@

                      - -You can "draw" the GUI to the screen by writing XML code (alternatively you can also use Java). +You can “draw” the GUI to the screen by writing XML code (alternatively you can also use Java).

                      -

                      Plan Your GUI Layout

                      +

                      Plan Your GUI Layout

                      -

                      -In this tutorial, you want to create two game screens: An out-of-game StartScreen that the players see before the game starts; and an in-game that displays info during the game. Before writing code, you plan the GUI layout, either on paper or in a graphic application. +In this tutorial, you want to create two game screens: An out-of-game StartScreen that the players see before the game starts; and an in-game that displays info during the game. Before writing code, you plan the GUI layout, either on paper or in a graphic application.

                      @@ -58,7 +56,6 @@ The StartScreen contains:

                      - The HUD contains:

                        @@ -76,31 +73,32 @@ The HUD contains:
                      -

                      Implement Your GUI Layout

                      +

                      Implement Your GUI Layout

                      -

                      -Create an empty screen.xml file in the assets/Interfaces/ directory of your project. One XML file can contain several, or even all screens. As a reminder: Nifty displays one screen at a time; a screen contains several layers on top of one another; each layer contains panels that are embedded into another; the panels contain the actual content (text, images, or controls). +Create an empty screen.xml file in the assets/Interface/ directory of your project. ( Rightclick on Interface → New → Other… → GUI → Empty NiftyGui file) +Afterwards create the directory assets/Interface/Fonts and add a new font e.g. Arial. ( Rightclick on Interface → New → Other… → Other → Folder and GUI → Font) +

                      + +

                      +One XML file can contain several, or even all screens. As a reminder: Nifty displays one screen at a time; a screen contains several layers on top of one another; each layer contains panels that are embedded into another; the panels contain the actual content (text, images, or controls).

                      - -

                      Make Screens

                      + +

                      Make Screens

                      - -The following minimal XML file contains a start screen and a HUD screen. (Neither has been defined yet.) +The following minimal XML file contains a start screen and a HUD screen. (Neither has been defined yet.)

                      <?xml version="1.0" encoding="UTF-8"?>
                      -<nifty xmlns="http://nifty-gui.sourceforge.net/nifty-1.3.xsd"
                      -  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                      -  xsi:schemaLocation="http://nifty-gui.sourceforge.net/nifty-1.3.xsd">
                      +<nifty xmlns="http://nifty-gui.sourceforge.net/nifty-1.3.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd">
                         <screen id="start">
                           <!-- ... -->
                         </screen>
                      @@ -110,21 +108,21 @@ The following minimal XML
                       </nifty>

                      -Every Nifty GUI must have a start screen. The others (in this example, the HUD screen) are optional. +Every Nifty GUI must have a start screen. The others (in this example, the HUD screen) are optional.

                      -Note: In the following examples, the XML schema header is abbreviated to just <nifty>. +Note: In the following examples, the XML schema header is abbreviated to just <nifty>.

                      - -

                      Make Layers

                      + +

                      Make Layers

                      - -The following minimal XML file shows how we added layers to the start screen and HUD screen: +The following minimal XML file shows how we added layers to the start screen and HUD screen. +Delete all from the file and add following code:

                      <nifty>
                         <screen id="start">
                      @@ -150,12 +148,11 @@ In a layer, you can now add panels and arrange them. Panels are containers that
                       

                      - -

                      Make Panels

                      + +

                      Make Panels

                      - A panel is the inner-most container (that will contain the actual content: text, images, or controls). You place panels inside layers. The following panels go into in the start screen's foreground layer:

                            <panel id="panel_top" height="25%" width="75%" align="center" childLayout="center"
                      @@ -203,76 +200,67 @@ The result should look as follows:
                       

                      - -

                      Adding Content to Panels

                      + +

                      Adding Content to Panels

                      - -See also on the Nifty GUI site. +See also on the Nifty GUI site.

                      - -

                      Add Images

                      + +

                      Add Images

                      - -The start-background.png image is a fullscreen background picture. In the start screen, add the following image element: - +The image is a fullscreen background picture. Add it to Interface. In the start screen, add the following image element:

                          <layer id="background" childLayout="center">
                      -        <image filename="Interface/tutorial/step2/start-background.png"></image>
                      +        <image filename="Interface/start-background.png"></image>
                           </layer>

                      -The hud-frame.png image is a transparent frame that we use as HUD decoration. In the hud screen, add the following image element: - +The image is a transparent frame that we use as HUD decoration. Add it to Interface. In the hud screen, add the following image element:

                          <layer id="background" childLayout="center">
                      -        <image filename="Interface/tutorial/step2/hud-frame.png"></image>
                      +        <image filename="Interface/hud-frame.png"></image>
                           </layer>

                      In order to make the hud-frame.png independent of the screen resolution you are using, you could use the imageMode attribute on the image element

                          <layer id="background" childLayout="center">
                      -        <image filename="Interface/tutorial/step2/hud-frame.png" imageMode="resize:40,490,110,170,40,560,40,270,40,560,40,40" width="100%" height="100%"/>
                      +        <image filename="Interface/hud-frame.png" imageMode="resize:40,490,110,170,40,560,40,270,40,560,40,40" width="100%" height="100%"/>
                           </layer>

                      -The face1.png image is an image that you want to use as a status icon. +The image is an image that you want to use as a status icon. Add it to Interface. In the hud screen's foreground layer, add the following image element: -

                      -
                              <panel id="panel_bottom_left" height="75%" width="20%" valign="center" childLayout="center">  
                      -            <image filename="Interface/tutorial/step2/face1.png" 
                      -                valign="center" align="center" height="50%" width="30%" >
                      -            </image>
                      +
                              <panel id="panel_top_right2" width="100%" height="15%" childLayout="center">
                      +            <image filename="Interface/face1.png" valign="center" align="center" height="50%" width="30%" >
                      +            </image>  
                               </panel>

                      - This image is scaled to use 50% of the height and 30% of the width of its container.

                      - -

                      Add Static Text

                      + +

                      Add Static Text

                      - The game title is a typical example of static text. In the start screen, add the following text element: -

                            <panel id="panel_top" height="25%" width="75%" align="center" childLayout="center">  
                                 <text text="My Cool Game" font="Interface/Fonts/Default.fnt" width="100%" height="100%" />
                             </panel>

                      -For longer pieces of static text, such as an introduction, you can use wrap="true". Add the following text element to the Start screen: +For longer pieces of static text, such as an introduction, you can use wrap=“true”. Add the following text element to the Start screen:

                            <panel id="panel_mid" height="50%" width="75%" align="center" childLayout="center">       
                               <text text="Here goes some text describing the game and the rules and stuff. Incidentally, 
                      @@ -281,16 +269,16 @@ For longer pieces of static text, such as an introduction, you can use wrap=&quo
                             </panel>

                      -The font used is jME3's default font "Interface/Fonts/Default.fnt" which is included in the jMonkeyEngine.JAR. You can add your own fonts to your own assets/Interface directory. +The font used is jME3's default font “Interface/Fonts/Default.fnt” which is included in the jMonkeyEngine.JAR. You can add your own fonts to your own assets/Interface/Fonts directory. +Adjust the path to your font-name.

                      - -

                      Add Controls

                      + +

                      Add Controls

                      - Before you can use any control, you must load a Control Definition first. Add the following two lines before your screen definitions:

                        <useStyles filename="nifty-default-styles.xml" />
                      @@ -302,11 +290,10 @@ Note that the useStyles tag must be the first child of the nifty tag, otherwise
                       
                       
                      -

                      Label Control

                      +

                      Label Control

                      - Use label controls for text that you want to edit dynamically from Java. One example for this is the score display. In the hud screen's foreground layer, add the following text element:

                      @@ -320,12 +307,11 @@ Note that the width and height do not scale the bitmap font, but indirectly make
                      -

                      Button Control

                      +

                      Button Control

                      - -Our GUI plan asks for two buttons on the start screen. You add the Start and Quit buttons to the bottom panel of the start screen using the <control> element: +Our GUI plan asks for two buttons on the start screen. You add the Start and Quit buttons to the bottom panel of the start screen using the <control> element:

                              <panel id="panel_bottom_left" height="50%" width="50%" valign="center" childLayout="center">  
                                 <control name="button" label="Start" id="StartButton" align="center" valign="center"> 
                      @@ -337,27 +323,76 @@ Our GUI plan asks for two bu
                               </panel>

                      -Note that these controls don't do anything yet ??? we'll get to that soon. +Note that these controls don't do anything yet – we'll get to that soon. +

                      + +

                      +Now remove all backgroundColor=““ tags from your code. They were only needed to show the layout.

                      +

                      +Your screen.xml should look like this: +

                      +
                      <?xml version="1.0" encoding="UTF-8"?>
                      +<nifty xmlns="http://nifty-gui.sourceforge.net/nifty-1.3.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd">
                      +  <useStyles filename="nifty-default-styles.xml" />
                      +  <useControls filename="nifty-default-controls.xml" />
                      +  <screen id="start">
                      +    <layer id="background" childLayout="center">
                      +      <image filename="Interface/start-background.png"></image>
                      +    </layer>
                      +    <layer id="foreground" childLayout="vertical">
                      +      <panel id="panel_top" height="25%" width="75%" align="center" childLayout="center">
                      +        <text text="My Cool Game" font="Interface/Fonts/Default.fnt" width="100%" height="100%" />
                      +      </panel>
                      +      <panel id="panel_mid" height="50%" width="75%" align="center" childLayout="center">
                      +        <text text="Here goes some text describing the game and the rules and stuff. Incidentally, the text is quite long and needs to wrap at the end of lines. ..." font="Interface/Fonts/Default.fnt" width="100%" height="100%" wrap="true" />
                      +      </panel>
                      +      <panel id="panel_bottom" height="25%" width="75%" align="center" childLayout="horizontal" >
                      +        <panel id="panel_bottom_left" height="50%" width="50%" valign="center" childLayout="center">
                      +          <control name="button" label="Start" id="StartButton" align="center" valign="center"></control>
                      +        </panel>
                      +        <panel id="panel_bottom_right" height="50%" width="50%" valign="center" childLayout="center">
                      +          <control name="button" label="Quit" id="QuitButton" align="center" valign="center"></control>
                      +        </panel>
                      +      </panel>
                      +    </layer>
                      +  </screen>
                      +  <screen id="hud">
                      +    <layer id="background" childLayout="center">
                      +      <image filename="Interface/hud-frame.png"></image>
                      +    </layer>
                      +    <layer id="foreground" childLayout="horizontal">
                      +      <panel id="panel_left" width="80%" height="100%" childLayout="vertical" ></panel>
                      +      <panel id="panel_right" width="20%" height="100%" childLayout="vertical">
                      +        <panel id="panel_top_right1" width="100%" height="15%" childLayout="center">
                      +          <control name="label" color="#000" text="123" width="100%" height="100%" />
                      +        </panel>
                      +        <panel id="panel_top_right2" width="100%" height="15%" childLayout="center">
                      +          <image filename="Interface/face1.png" valign="center" align="center" height="50%" width="30%" ></image>
                      +        </panel>
                      +        <panel id="panel_bot_right" width="100%" height="70%" valign="center" ></panel>
                      +      </panel>
                      +    </layer>
                      +  </screen>
                      +</nifty>
                      +
                      -

                      Other Controls

                      +

                      Other Controls

                      - -Nifty additionally offers many customizable controls such as check boxes, text fields, menus, chats, tabs, ??? See also on the Nifty GUI site. +Nifty additionally offers many customizable controls such as check boxes, text fields, menus, chats, tabs, … See also on the Nifty GUI site.

                      - -

                      Intermediate Result

                      + +

                      Intermediate Result

                      - -When you preview this code in the jMonkeyEngine SDK, our tutorial demo should looks as follows: A start screen with two buttons, and a game screen with a simple HUD frame and a blue cube (which stands for any jME3 game content). +When you preview this code in the jMonkeyEngine SDK, our tutorial demo should looks as follows: A start screen with two buttons, and a game screen with a simple HUD frame and a blue cube (which stands for any jME3 game content).

                      @@ -369,13 +404,12 @@ Compare this result with the layout draft above.

                      - -

                      Next Steps

                      + +

                      Next Steps

                      - -Integrate the GUI into the game. Typically, you will overlay the GUI. +Integrate the GUI into the game. Typically, you will overlay the GUI.

                      -
                      - gui, - documentation, - nifty, - hud -
                      + +

                      +tag_gui_documentation_nifty_hud +

                      - -

                      view online version

                      \ No newline at end of file + +

                      view online version

                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nurbs_3-d_surface.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nurbs_3-d_surface.png index 23358870c..70c9a5659 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nurbs_3-d_surface.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/nurbs_3-d_surface.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/ogrecompatibility.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/ogrecompatibility.html index 305f6d19a..7ae018156 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/ogrecompatibility.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/ogrecompatibility.html @@ -1,15 +1,16 @@ -

                      Working Blender and OgreXML Versions

                      +

                      Working Blender and OgreXML Versions

                      Here you can find working combinations of Blender and the OgreXML exporter, with any tips or bugs associated with each. -

                      + + @@ -26,11 +27,10 @@ Here you can find working combinations of Blender and the OgreXML exporter, with -

                      Tips

                      +

                      Tips

                      - Tips for exporting animations through OgreXML correctly:

                        @@ -47,7 +47,6 @@ Tips for exporting animations through OgreXML correctly:

                      - Test Character -

                      @@ -58,11 +57,10 @@ Test Character - -

                      Troubleshooting

                      +

                      Troubleshooting

                      - Q: My animation is stretched.

                      @@ -72,4 +70,4 @@ Test Character - -

                      view online version

                      \ No newline at end of file +

                      view online version

                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/open_game_finder.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/open_game_finder.html index de00e9f29..14a3e7231 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/open_game_finder.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/open_game_finder.html @@ -1,5 +1,5 @@ -

                      Open Game Finder

                      +

                      Open Game Finder

                      @@ -13,13 +13,12 @@ The Open Game Finder (OGF) by Mark Schrijver can be plugged into any Java game.

                      -Both on the client and the server side of OGF is written purely in Java. OGF has a pluggable architecture and comes with a full set of plugins to get the job done. You can add your own plugins, or replace existing plugins to make them more in line with your game. OGF uses NiftyGUI as the main GUI plugin. - +Both on the client and the server side of OGF is written purely in Java. OGF has a pluggable architecture and comes with a full set of plugins to get the job done. You can add your own plugins, or replace existing plugins to make them more in line with your game. OGF uses NiftyGUI as the main GUI plugin.

                      -

                      Installation

                      +

                      Installation

                      1. Go to
                        @@ -32,23 +31,23 @@ Both on the client and the server side of OGF is written purely in Java. OGF has
                      -

                      Setting up the Database

                      +

                      Setting up the Database

                      The OGF server uses an embedded Apache Derby database. You have to install the database, this means creating the data files and adding the tables. You can do this straight from the command line by running a script file.

                        -
                      • On Windows, use installServer.bat to create a new database from scratch. On Mac OS or Linux, run java -jar lib/Server-0.1.jar install in the Terminal.
                        +
                      • On Windows, use installServer.bat to create a new database from scratch. On Mac OS or Linux, run java -jar lib/Server-0.1.jar install in the Terminal.
                      • -
                      • On Windows, use updateServer.bat to update the difference between the current state of the database and the way it should be. On Mac OS and Linux, run java -jar lib/Server-0.1.jar update in the Terminal.
                        +
                      • On Windows, use updateServer.bat to update the difference between the current state of the database and the way it should be. On Mac OS and Linux, run java -jar lib/Server-0.1.jar update in the Terminal.
                        This new feature is currently untested.
                      -

                      Running the server

                      +

                      Running the server

                      @@ -65,12 +64,11 @@ Change into the OGF-Server directory and run the server: The server is now running and ready to accept connections.
                      Note: In the alpha release, the server runs on localhost. In the final release, you will be able to configure the host! -

                      -

                      Running the client

                      +

                      Running the client

                      1. Change into the OGF-Client directory and run the client:
                        @@ -89,12 +87,11 @@ The server is now running and ready to accept connections.
                        A client is now running, connects to the server, and displays a registration/login window. Note: You can run several clients on localhost for testing. -

                      -

                      Client: 1. Registration

                      +

                      Client: 1. Registration

                      @@ -114,12 +111,11 @@ On the main screen of the client:

                      The client registers the account and opens the chat window directly. -

                      -

                      Client: 2. Login

                      +

                      Client: 2. Login

                      @@ -135,22 +131,20 @@ On the main screen of the client:

                      The client logs you in and opens the chat window. -

                      -

                      Client: 3. Chat

                      +

                      Client: 3. Chat

                      The chat window shows a list of all users logged in to the server. Logged-in users can send public messages, and can receive public messages from others. -

                      -

                      Connecting to a Game

                      +

                      Connecting to a Game

                      @@ -172,12 +166,11 @@ In a JME3 Application's init method:

                      After this, continue writing your JME3 init method. -

                      -

                      Configuration

                      +

                      Configuration

                      • Q: How can I offer more avatars to choose from?
                        @@ -187,10 +180,11 @@ A: Save the image files in the path jMonkeyProjects/OGF-Client-1.0-bin/OGF A: TBD
                      -
                      - network -
                      + +

                      +tag_network +

                      -

                      view online version

                      \ No newline at end of file +

                      view online version

                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/otoglow.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/otoglow.png index 2dd4c8394..12f8c08d2 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/otoglow.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/otoglow.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/otonobloom.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/otonobloom.png index f1cb62c45..dd6bff1ac 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/otonobloom.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/otonobloom.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/particle.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/particle.png index 41a9f7077..00d0017e4 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/particle.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/particle.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/particle_emitters.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/particle_emitters.html index 9db856d47..9d099486c 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/particle_emitters.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/particle_emitters.html @@ -1,9 +1,8 @@ -

                      Particle Emmitter Settings

                      +

                      Particle Emmitter Settings

                      - You cannot create a 3D model for delicate things like fire, smoke, or explosions. Particle Emitters are quite an efficient solution to create these kinds of effects: The emitter renders a series of flat orthogonal images and manipulates them in a way that creates the illusion of a anything from a delicate smoke cloud to individual flames, etc. Creating an effect involves some trial and error to get the settings just right, and it's worth exploring the expressiveness of the options described below.

                      @@ -19,11 +18,11 @@ Creating an effect involves some trial and error to get the settings just ri
                      -

                      Create an Emitter

                      +

                      Create an Emitter

                      1. Create one emitter for each effect:
                        ParticleEmitter explosion = new ParticleEmitter(
                        -"My explosion effect", ParticleMesh.Type.Triangle, 30);
                        +"My explosion effect", Type.Triangle, 30);
                      2. Attach the emitter to the rootNode and position it in the scene:
                        rootNode.attachChild(explosion);
                        @@ -42,24 +41,26 @@ explosion.setLocalTranslation(bomb.getLocalTranslation());
                        Choose one of the following mesh shapes

                          -
                        • ParticleMesh.Type.Triangle
                          +
                        • Type.Triangle
                        • -
                        • ParticleMesh.Type.Point
                          +
                        • Type.Point
                        - -

                        Configure Parameters

                        + +

                        Configure Parameters

                        Not all of these parameters are required for all kinds of effects. If you don't specify one of them, a default value will be used.

                      Blender Version OgreXML Exporter Version Notes
                      2.6.3 Root bone, no transforms on object, no envelopes
                      + + @@ -82,8 +83,8 @@ Set both to different colors for a gradient effect (e.g. fire). @@ -115,23 +116,22 @@ false = Particles fly straight like you drew them in the sprite texture (e.g. in
                      Parameter Method Default Description
                      number setNumParticles() The maximum number of particles visible at the same time. Specified by user in constructor.
                      fanning out getParticleInfluencer(). setVelocityVariation(variation) 0.2f How much the direction (setInitialVelocity()) can vary among particles. Use a value between 1 and 0 to create a directed swarm-like cloud of particles.
                      -1 = Maximum variation, particles emit in random 360?? directions (e.g. explosion, butterflies).
                      -0.5f = particles are emitted within 180?? of the initial direction.
                      +1 = Maximum variation, particles emit in random 360° directions (e.g. explosion, butterflies).
                      +0.5f = particles are emitted within 180° of the initial direction.
                      0 = No variation, particles fly in a straight line in direction of start velocity (e.g. lasergun blasts).
                      start area setShape(new EmitterSphereShape( Vector3f.ZERO, 2f));EmitterPointShape()By default, particles are emitted from the emitters location (a point). You can increase the emitter shape to occupy a sphere, so that the start point of new particles can be anywhere inside the sphere, which makes the effect a bit more irregular.
                      - +

                      Build up you effect by specifying one parameter after the other. If you change several parameters at the same time, it's difficult to tell which of the values caused which outcome.

                      - -

                      Create an Effect Material

                      + +

                      Create an Effect Material

                      - - +

                      -Use the common Particle.j3md Material Definition and a texture to specify the shape of the particles. The shape is defined by the texture you provide and can be anything ??? debris, flames, smoke, mosquitoes, leaves, butterflies??? be creative. +Use the common Particle.j3md Material Definition and a texture to specify the shape of the particles. The shape is defined by the texture you provide and can be anything – debris, flames, smoke, mosquitoes, leaves, butterflies… be creative.

                          Material flash_mat = new Material(
                               assetManager, "Common/MatDefs/Misc/Particle.j3md");
                      @@ -143,7 +143,7 @@ Use the common Particle.j3md Material Definition and a texture to specify the sh
                           flash.setSelectRandomImage(true);

                      -The effect texture can be one image, or contain a sprite animation ??? a series of slightly different pictures in equally spaced rows and columns. If you choose the sprite animation: +The effect texture can be one image, or contain a sprite animation – a series of slightly different pictures in equally spaced rows and columns. If you choose the sprite animation:

                      • Specify the number of rows and columns using setImagesX(2) and setImagesY().
                        @@ -153,13 +153,12 @@ The effect texture can be one image, or contain a sprite animation ??? a series

                      - Examples: Have a look at the following default textures and you will see how you can create your own sprite textures after the same fashion.

                      - -

                      Default Particle Textures

                      + +

                      Default Particle Textures

                      @@ -167,45 +166,46 @@ The Material is used together with grayscale texture: The black parts will be tr The following effect textures are available by default from test-data.jar. You can also load your own textures from your assets directory.

                      + + - + - + - + - + - + - + - + - +
                      Texture Path Dimension Preview
                      Effects/Explosion/Debris.png 3*3 Effects/Explosion/Debris.png 3*3
                      Effects/Explosion/flame.png 2*2 Effects/Explosion/flame.png 2*2
                      Effects/Explosion/flash.png 2*2 Effects/Explosion/flash.png 2*2
                      Effects/Explosion/roundspark.png 1*1 Effects/Explosion/roundspark.png 1*1
                      Effects/Explosion/shockwave.png 1*1 Effects/Explosion/shockwave.png 1*1
                      Effects/Explosion/smoketrail.png 1*3 Effects/Explosion/smoketrail.png 1*3
                      Effects/Explosion/spark.png 1*1 Effects/Explosion/spark.png 1*1
                      Effects/Smoke/Smoke.png 1*15 Effects/Smoke/Smoke.png 1*15
                      - +

                      - Tip: Use the setStartColor()/setEndColor() settings described above to colorize the white and gray parts of textures.

                      - -

                      Usage Example

                      + +

                      Usage Example

                      -
                          ParticleEmitter fire = new ParticleEmitter("Emitter", ParticleMesh.Type.Triangle, 30);
                      +
                          ParticleEmitter fire = new ParticleEmitter("Emitter", Type.Triangle, 30);
                           Material mat_red = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
                           mat_red.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/flame.png"));
                           fire.setMaterial(mat_red);
                      @@ -222,20 +222,18 @@ The following effect textures are available by default from test-data.jar<
                           rootNode.attachChild(fire);

                      - Browse the full source code of all here.


                      - See also: Effects Overview

                      - + +

                      +tag_documentation_effect +

                      - -

                      view online version

                      \ No newline at end of file + +

                      view online version

                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/physics.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/physics.html index d2af4ff00..058acf7c9 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/physics.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/physics.html @@ -1,9 +1,8 @@ -

                      Physics: Gravity, Collisions, Forces

                      +

                      Physics: Gravity, Collisions, Forces

                      - A physics simulation is used in games and applications where objects are exposed to physical forces: Think of games like pool billiard and car racing simulators. Massive objects are pulled by gravity, forces cause objects to gain momentum, friction slows them down, solid objects collide and bounce off one another, etc. Action and Adventure games also make use of physics to implement solid obstacles, falling, and jumping.

                      @@ -17,11 +16,11 @@ If you are looking for info on how to respond to physics events such as collisio
                      -

                      Technical Overview

                      +

                      Technical Overview

                      -jME3 has a complete, slightly adapted but fully wrapped Bullet API that uses normal jME math objects (Vector3f, Quaternion etc) as input/output data. All normal bullet objects like RigidBodies, Constraints (called "Joints" in jME3) and the various collision shapes are available, all mesh formats can be converted from jME to bullet. +jME3 has a complete, slightly adapted but fully wrapped Bullet API that uses normal jME math objects (Vector3f, Quaternion etc) as input/output data. All normal bullet objects like RigidBodies, Constraints (called “Joints” in jME3) and the various collision shapes are available, all mesh formats can be converted from jME to bullet.

                      @@ -29,7 +28,7 @@ The PhysicsSpace object is the central object in bullet and all objects have to

                      -The base bullet objects are also available as simple to use controls that can be attached to spatials to directly control these by physics forces and influences. The RigidBodyControl for example includes a simple constructor that automatically creates a hull collision shape or a mesh collision shape based on the given input mass and the mesh of the spatial it is attached to. This makes enabling physics on a Geometry as simple as "spatial.addControl(new RigidBodyControl(1));" +The base bullet objects are also available as simple to use controls that can be attached to spatials to directly control these by physics forces and influences. The RigidBodyControl for example includes a simple constructor that automatically creates a hull collision shape or a mesh collision shape based on the given input mass and the mesh of the spatial it is attached to. This makes enabling physics on a Geometry as simple as “spatial.addControl(new RigidBodyControl(1));”

                      @@ -75,7 +74,6 @@ Due to some differences in how bullet and jME handle the scene and other objects

                      - When you use this physics simulation, values correspond to the following units:

                        @@ -88,7 +86,6 @@ When you use this physics simulation, values correspond to the following units:

                      - Bullet physics runs internally at 60fps by default. This rate is not dependent on the actual framerate and it does not lock the framerate at 60fps. Instead, when the actual fps is higher than the physics framerate the system will display interpolated positions for the physics objects. When the framerate is lower than the physics framerate, the physics space will be stepped multiple times per frame to make up for the missing calculations.

                      @@ -108,11 +105,10 @@ Internally, the updating and syncing of the actual physics objects in the Bullet
                      -

                      Sample Code

                      +

                      Sample Code

                      - Full code samples are here:

                        @@ -128,11 +124,10 @@ Full code samples are here:
                      -

                      Physics Application

                      +

                      Physics Application

                      - A short overview of how to write a jME application with Physics capabilities:

                      @@ -153,7 +148,6 @@ Do the following once per application to gain access to the physicsSpace

                      -

                      In your application, you can always access the BulletAppState via the ApplicationStateManager:

                      BulletAppState bas = app.getStateManager().getState(BulletAppState.class);
                      @@ -182,28 +176,27 @@ For each Spatial that you want to be physical:

                      - Let's look at the details:

                      -

                      Create a CollisionShape

                      +

                      Create a CollisionShape

                      - A CollisionShape is a simplified shape for which physics are easier to calculate than for the true shape of the model. This simplication approach speeds up the simulation greatly.

                      -Before you can create a Physics Control, you must create a CollisionShape from the com.jme3.bullet.collision.shapes package. (Read the tip under "PhysicsControls Code Samples" how to use default CollisionShapes for Boxes and Spheres.) - +Before you can create a Physics Control, you must create a CollisionShape from the com.jme3.bullet.collision.shapes package. (Read the tip under “PhysicsControls Code Samples” how to use default CollisionShapes for Boxes and Spheres.)

                      + + @@ -229,14 +222,14 @@ Disc-shaped objects like wheels, plates.
                      Non-Mesh CollisionShape Usage Examples
                      BoxCollisionShape() Box-shaped behaviour, does not roll. Oblong or cubic objects like bricks, crates, furniture.

                      - All non-mesh CollisionShapes can be used for dynamic, kinematic, as well as static Spatials. (Code samples see below) -

                      + + @@ -256,13 +249,14 @@ All non-mesh CollisionShapes can be used for dynamic, kinematic, as well as stat
                      Mesh CollisionShapes Usage Examples
                      MeshCollisionShape A mesh-accurate shape for static or kinematic Spatials. Can have complex shapes with openings and appendages.
                      Limitations: Collisions between two mesh-accurate shapes cannot be detected, only non-mesh shapes can collide with this shape. This Shape does not work with dynamic Spatials.
                      A whole static game level model.

                      - On a CollisionShape, you can apply a few properties

                      + + @@ -270,7 +264,6 @@ On a CollisionShape, you can apply a few properties
                      CollisionShape Method Property Examples
                      setScale(new Vector3f(2f,2f,2f)) You can change the scale of collisionshapes (whether it be, Simple or Mesh). You cannot change the scale of a CompoundCollisionShape however. A sphere collision shape, will change its radius based on the X component of the vector passed in. You must scale a collision shape before attaching it to the physicsSpace, or you must readd it to the physicsSpace each time the scale changes. Scale a player in the Y axis by 2:
                      new Vector3f(1f,2f,1f)

                      - The mesh-accurate shapes can use a CollisionShapeFactory as constructor (code samples see below).

                      @@ -286,7 +279,7 @@ The mesh-accurate shapes can use a CollisionShapeFactory as constructor (code sa
                      -

                      CollisionShape Code Samples

                      +

                      CollisionShape Code Samples

                      • One way of using a constructor and a Geometry's mesh for static Spatials:
                        MeshCollisionShape level_shape = 
                        @@ -317,54 +310,54 @@ The mesh-accurate shapes can use a CollisionShapeFactory as constructor (code sa
                         
                         
                        -

                        Create PhysicsControl

                        +

                        Create PhysicsControl

                        - BulletPhysics are available in jME3 through PhysicsControls classes from the com.jme3.bullet.control package. jME3's PhysicsControl classes directly extend BulletPhysics objects and are the recommended way to use physics in a jME3 application. PhysicsControls are flexible and can be added to any Spatial to make it act according to physical properties. -

                        + + - +
                        Standard PhysicsControls Usage Examples
                        RigidBodyControlThe most commonly used PhysicsControl. You can use it for dynamic objects (solid objects that freely affected by collisions, forces, or gravity), for static objects (solid but not affected by any forces), or kinematic objects (remote-controlled solid objects). Impacting projectiles, moving obstacles like crates, rolling and bouncing balls, elevators, flying aircaft or space ships.
                        Solid immobile floors, walls, static obstacles.
                        GhostControlUse for collision and intersection detection between physical objects. A GhostControl itself is non-solid and invisible. GhostControl moves with the Spatial it is attached to. Use GhostControls to implement custom game interactions by adding it to a visible Geometry. A monster's "aggro radius", CharacterControl collisions, motion detectors, photo-electric alarm sensors, poisonous or radioactive perimeters, life-draining ghosts, etc. GhostControlUse for collision and intersection detection between physical objects. A GhostControl itself is non-solid and invisible. GhostControl moves with the Spatial it is attached to. Use GhostControls to implement custom game interactions by adding it to a visible Geometry. A monster's “aggro radius”, CharacterControl collisions, motion detectors, photo-electric alarm sensors, poisonous or radioactive perimeters, life-draining ghosts, etc.
                        + + +PhysicsVehicleWheel - + - +
                        Special PhysicsControls Usage Examples
                        VehicleControl
                        -PhysicsVehicleWheel
                        Special Control used for "terrestrial" vehicles with suspension and wheels. Cars, tanks, hover crafts, ships, motorcycles??? Special Control used for "terrestrial" vehicles with suspension and wheels. Cars, tanks, hover crafts, ships, motorcycles…
                        CharacterControlSpecial Control used for Walking Characters.Upright walking persons, animals, robots??? CharacterControlSpecial Control used for Walking Characters.Upright walking persons, animals, robots…
                        RagDollControlSpecial Control used for collapsing, flailing, or falling characters Falling persons, animals, robots, "Rag dolls"RagDollControlSpecial Control used for collapsing, flailing, or falling characters Falling persons, animals, robots, “Rag dolls”

                        - Click the links for details on the special PhysicsControls. This article is about RigidBodyControl.

                        -

                        Physics Control Code Samples

                        +

                        Physics Control Code Samples

                        - The most commonly used physics control is RigidBodyControl. The RigidBodyControl constructor takes up to two parameters: a collision shape and a mass (a float in kilograms). The mass parameter also determines whether the object is dynamic (movable) or static (fixed). For a static object such as a floor or wall, specify zero mass.

                        RigidBodyControl myThing_phys = 
                        @@ -380,14 +373,12 @@ The most commonly used physics control is RigidBodyControl.  The RigidBodyContro
                         

                        The following creates a box Geometry with the correct default BoxCollisionShape:

                        -
                        Box b = new Box(1,1,1);
                        +
                        Box(1,1,1);
                         Geometry box_geo = new Geometry("Box", b);
                         box_geo.addControl(new RigidBodyControl( 1.0f )); // explicit non-zero mass, implicit BoxCollisionShape

                        - The following creates a MeshCollisionShape for a whole loaded (static) scene: -

                        ...
                         gameLevel.addControl(new RigidBodyControl(0.0f)); // explicit zero mass, implicit MeshCollisionShape
                        @@ -395,16 +386,14 @@ gameLevel.addControl(new RigidBodyControl(0.0f)); // explicit ze

                        Spheres and Boxes automatically fall back on the correct default CollisionShape if you do not specify a CollisionShape in the RigidBodyControl constructor. Complex static objects can fall back on MeshCollisionShapes, unless it is a Node, in which case it will become a CompoundCollisionShape containing a MeshCollisionShape

                        -

                        -

                        Add PhysicsControl to Spatial

                        +

                        Add PhysicsControl to Spatial

                        - For each physical Spatial in the scene:

                          @@ -417,13 +406,11 @@ For each physical Spatial in the scene:
                        -

                        Add PhysicsControl to PhysicsSpace

                        +

                        Add PhysicsControl to PhysicsSpace

                        - The PhysicsSpace is an object in BulletAppState that is like a rootNode for Physics Controls. -

                        • Just like you add the Geometry to the rootNode, you add its PhysicsControl to the PhysicsSpace.
                          bulletAppState.getPhysicsSpace().add(myThing_phys); 
                          @@ -437,14 +424,13 @@ myThing_geo.removeFromParent();

                        -

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

                        -

                        Changing the Scale of a PhysicsControl

                        +

                        Changing the Scale of a PhysicsControl

                        @@ -478,28 +464,27 @@ bulletAppState.getPhysicsSpace().add(geom); With the corresponding output below: -

                        -

                        PhysicsSpace Code Samples

                        +

                        PhysicsSpace Code Samples

                        - The PhysicsSpace also manages global physics settings. Typically, you can leave the defaults, and you don't need to change the following settings, but it's good to know what they are for: -

                        + + - + @@ -512,25 +497,25 @@ setWorldMin(new Vector3f(-10000f, -10000f, -10000f));
                        bulletAppState.getPhysicsSpace() MethodUsage
                        setGravity(new Vector3f(0, -9.81f, 0));Specifies the global gravity.
                        setAccuracy(1f/60f);Specifies physics accuracy. The higher the accuracy, the slower the game. Increase value if objects are passing through one another, or bounce oddly.setAccuracy(1f/60f);Specifies physics accuracy. The higher the accuracy, the slower the game. Decrease value if objects are passing through one another, or bounce oddly. (e.g. Change value from 1f/60f to something like 1f/80f.)
                        setMaxSubSteps(4);Compensates low FPS: Specifies the maximum amount of extra steps that will be used to step the physics when the game fps is below the physics fps. This maintains determinism in physics in slow (low-fps) games. For example a maximum number of 2 can compensate for framerates as low as 30 fps (physics has a default accuracy of 60 fps). Note that setting this value too high can make the physics drive down its own fps in case its overloaded.Specifies the size setCcdMotionThreshold()The amount of motion in 1 physics tick to trigger the continuous motion detection in moving objects that push one another. Rarely used, but necessary if your moving objects get stuck or roll through one another.
                        - +
                        - -

                        Specify Physical Properties

                        + +

                        Specify Physical Properties

                        - After you have registered, attached, and added everything, you can adjust physical properties or apply forces.

                        On a RigidBodyControl, you can set the following physical properties. -

                        + +
                        RigidBodyControl Method Property Examples
                        setGravity(new Vector3f(0f,-9.81f,0f)) You can change the gravity of individual physics objects after they were added to the PhysicsSpace. Gravity is a vector pointing from this Spatial towards the source of gravity. The longer the vector, the stronger is gravity.
                        If gravity is the same absolute direction for all objects (e.g. on a planet surface), set this vector globally on the PhysicsSpace object and not individually.
                        @@ -554,16 +539,16 @@ This setting has an impact on performance, so use it sparingly.
                        Brick: Rubber ball: 1.0f
                        - +

                        - On a RigidBodyControl, you can apply the following physical forces: -

                        + + @@ -575,15 +560,14 @@ On a RigidBodyControl, you can apply the following physical forces: (See detailed explanation below.)
                        RigidBodyControl Method Motion
                        setPhysicsLocation()Positions the objects. Do not use setLocalTranslation() for physical objects. Important: Make certain not to make CollisionShapes overlap when positioning them.
                        - +
                        - -

                        Kinematic vs Dynamic vs Static

                        + +

                        Kinematic vs Dynamic vs Static

                        - -All physical objects??? +All physical objects…

                        • must not overlap.
                          @@ -594,11 +578,13 @@ All physical objects???
                        + + - + @@ -627,42 +613,41 @@ setKinematic(true);
                        Property Static Kinematic Dynamic
                        ExamplesImmobile obstacles: Floors, walls, buildings, ???Remote-controlled solid objects: Airships, meteorites, elevators, doors; networked or remote-controlled NPCs; invisible "airhooks" for hinges and joints.Interactive objects: Rolling balls, movable crates, falling pillars, zero-g space ship??? ExamplesImmobile obstacles: Floors, walls, buildings, …Remote-controlled solid objects: Airships, meteorites, elevators, doors; networked or remote-controlled NPCs; invisible “airhooks” for hinges and joints.Interactive objects: Rolling balls, movable crates, falling pillars, zero-g space ship…
                        Does it have a mass?no, 0.0fyes1), >0.0f yes, >0.0fsetMass(1f);
                        setKinematic(false);
                        - +
                        -

                        When Do I Use Kinematic Objects?

                        +

                        When Do I Use Kinematic Objects?

                          -
                        • Kinematics are solid and characters can "stand" on them.
                          +
                        • Kinematics are solid and characters can “stand” on them.
                        • When they collide, Kinematics push dynamic objects, but a dynamic object never pushes a Kinematic.
                        • -
                        • You can hang kinematics up "in mid-air" and attach other PhysicsControls to them using hinges and joints. Picture them as "air hooks" for flying aircraft carriers, floating islands in the clouds, suspension bridges, swings, chains???
                          +
                        • You can hang kinematics up “in mid-air” and attach other PhysicsControls to them using hinges and joints. Picture them as “air hooks” for flying aircraft carriers, floating islands in the clouds, suspension bridges, swings, chains…
                        • -
                        • You can use Kinematics to create mobile remote-controlled physical objects, such as moving elevator platforms, flying blimps/airships. You have full control how Kinematics move, they never "fall" or "topple over".
                          +
                        • You can use Kinematics to create mobile remote-controlled physical objects, such as moving elevator platforms, flying blimps/airships. You have full control how Kinematics move, they never “fall” or “topple over”.

                        -

                        The position of a kinematic RigidBodyControl is updated automatically depending on its spatial's translation. You move Spatials with a kinematic RigidBodyControl programmatically, that means you write translation and rotation code in the update loop. You describe the motion of kinematic objects either by using methods such as setLocalTranslation() or move(), or by using a MotionPath.

                        - -

                        Forces: Moving Dynamic Objects

                        + +

                        Forces: Moving Dynamic Objects

                        - Use the following methods to move dynamic physical objects. -

                        + + @@ -670,39 +655,39 @@ Use the following methods to move dynamic physical objects. - + - + - + - + - +
                        PhysicsControl Method Motion
                        setLinearVelocity(new Vector3f(0f,0f,1f)) Set the linear speed of this object.
                        setAngularVelocity(new Vector3f(0f,0f,1f)) Set the rotational speed of the object; the x, y and z component are the speed of rotation around that axis.
                        applyCentralForce(???) Move (push) the object once with a certain moment, expressed as a Vector3f. applyCentralForce(…) Move (push) the object once with a certain moment, expressed as a Vector3f.
                        applyForce(???) Move (push) the object once with a certain moment, expressed as a Vector3f. Optionally, you can specify where on the object the pushing force hits. applyForce(…) Move (push) the object once with a certain moment, expressed as a Vector3f. Optionally, you can specify where on the object the pushing force hits.
                        applyTorque(???) Rotate (twist) the object once around its axes, expressed as a Vector3f. applyTorque(…) Rotate (twist) the object once around its axes, expressed as a Vector3f.
                        applyImpulse(???) An idealised change of momentum. This is the kind of push that you would use on a pool billiard ball. applyImpulse(…) An idealised change of momentum. This is the kind of push that you would use on a pool billiard ball.
                        applyTorqueImpulse(???) An idealised change of momentum. This is the kind of push that you would use on a pool billiard ball. applyTorqueImpulse(…) An idealised change of momentum. This is the kind of push that you would use on a pool billiard ball.
                        clearForces()Cancels out all forces (force, torque) etc and stops the motion.
                        - +

                        - -

                        It is technically possible to position PhysicsControls using setLocalTranslation(), e.g. to place them in their start position in the scene. However you must be very careful not to cause an "impossible state" where one physical object overlaps with another! Within the game, you typically use the setters shown here exclusively. +

                        It is technically possible to position PhysicsControls using setLocalTranslation(), e.g. to place them in their start position in the scene. However you must be very careful not to cause an “impossible state” where one physical object overlaps with another! Within the game, you typically use the setters shown here exclusively.

                        PhysicsControls also support the following advanced features: -

                        + + @@ -710,7 +695,7 @@ PhysicsControls also support the following advanced features: +removeCollideWithGroup(COLLISION_GROUP_01) @@ -725,23 +710,22 @@ removeCollideWithGroup(COLLISION_GROUP_01) - +
                        PhysicsControl Method Property
                        setCollisionShape(collisionShape)Changes the collision shape after creation.
                        setCollideWithGroups()
                        setCollisionGroup()
                        addCollideWithGroup(COLLISION_GROUP_01)
                        -removeCollideWithGroup(COLLISION_GROUP_01)
                        Collision Groups are integer bit masks ??? enums are available in the CollisionObject. All physics objects are by default in COLLISION_GROUP_01. Two objects collide when the collideWithGroups set of one contains the Collision Group of the other. Use this to improve performance by grouping objects that will never collide in different groups (the the engine saves times because it does not need to check on them).Collision Groups are integer bit masks – enums are available in the CollisionObject. All physics objects are by default in COLLISION_GROUP_01. Two objects collide when the collideWithGroups set of one contains the Collision Group of the other. Use this to improve performance by grouping objects that will never collide in different groups (the the engine saves times because it does not need to check on them).
                        setDamping(float, float)The first value is the linear threshold and the second the angular. This simulates dampening of forces, for example for underwater scenes.Collision Groups are integer setCcdMotionThreshold(0f) Sets the amount of motion that has to happen in one physics tick to trigger the continuous motion detection in moving objects that push one another. This avoids the problem of fast objects moving through other objects. Set to zero to disable (default).
                        setCcdSweptSphereRadius(.5f)Bullet does not use the full collision shape for continuous collision detection, instead it uses a "swept sphere" shape to approximate a motion, which can be imprecise and cause strange behaviors such as objects passing through one another or getting stuck. Only relevant for fast moving dynamic bodies. setCcdSweptSphereRadius(.5f)Bullet does not use the full collision shape for continuous collision detection, instead it uses a “swept sphere” shape to approximate a motion, which can be imprecise and cause strange behaviors such as objects passing through one another or getting stuck. Only relevant for fast moving dynamic bodies.
                        - +

                        -

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

                        - -

                        Best Practices

                        + +

                        Best Practices

                          -
                        • Multiple Objects Too Slow? Do not overuse PhysicsControls. Although PhysicsControls are put to ???sleep??? when they are not moving, creating a world solely out of dynamic physics objects will quickly bring you to the limits of your computer's capabilities.
                          -Solution: Improve performance by replacing some physical Spatials with non-physical Spatials. Use the non-physical ones for non-solid things for which you do not need to detect collisions ??? foliage, plants, effects, ghosts, all remote or unreachable objects.
                          +
                        • Multiple Objects Too Slow? Do not overuse PhysicsControls. Although PhysicsControls are put to “sleep” when they are not moving, creating a world solely out of dynamic physics objects will quickly bring you to the limits of your computer's capabilities.
                          +Solution: Improve performance by replacing some physical Spatials with non-physical Spatials. Use the non-physical ones for non-solid things for which you do not need to detect collisions – foliage, plants, effects, ghosts, all remote or unreachable objects.
                          @@ -750,7 +734,7 @@ removeCollideWithGroup(COLLISION_GROUP_01)
                Collision Groups are integer
                  -
                • Eject? If you have physical nodes jittering wildy and being ejected "for no apparent reason", it means you have created an impossible state ??? solid objects overlapping. This can happen when you position solid spatials too close to other solid spatials, e.g. when moving them with setLocalTranslation().
                  +
                • Eject? If you have physical nodes jittering wildy and being ejected “for no apparent reason”, it means you have created an impossible state – solid objects overlapping. This can happen when you position solid spatials too close to other solid spatials, e.g. when moving them with setLocalTranslation().
                  Solution: Use the debug mode to make CollisionShapes visible and verify that CollisionShapes do not overlap.
                  bulletAppState.getPhysicsSpace().enableDebug(assetManager);
                • @@ -765,15 +749,14 @@ removeCollideWithGroup(COLLISION_GROUP_01)
                Collision Groups are integer Solution: To specify how the game responds to collisions, you use Physics Listeners. - + +

                +tag_physics_documentation_control +

                -
                +
                1) Inertia is calculated for kinematic objects, and you need mass to do that.
                -

                view online version

                \ No newline at end of file +

                view online version

                \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/physics_listeners.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/physics_listeners.html index 4807163cd..0d23f5141 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/physics_listeners.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/physics_listeners.html @@ -1,5 +1,5 @@ -

                Physics Listeners

                +

                Physics Listeners

                @@ -8,7 +8,7 @@ You can control physical objects (push them around) by applying physical forces

                -

                Sample Code

                +

                Sample Code

                • @@ -21,11 +21,10 @@ You can control physical objects (push them around) by applying physical forces
                -

                PhysicsGhostObjects

                +

                PhysicsGhostObjects

                - Attach a com.jme3.bullet.control.GhostControl to any Spatial to turn it into a PhysicsGhostObject. Ghost objects automatically follow their spatial and detect collisions. The attached ghost itself is invisible and non-solid (!) and doesn't interfere with your game otherwise, it only passively reports collisions.

                @@ -34,7 +33,7 @@ You can leave the GhostControl non-solid and invisible and attach it to an (invi

                -The shape of the ghost depends on the CollisionShape that you gave the GhostControl. This means that the GhostControl's shape can be different from the RigidBodyControl's shape. For example, the non-solid ghost shape can be bigger than the solid shape of the Spatial (so you can "feel" ahead). +The shape of the ghost depends on the CollisionShape that you gave the GhostControl. This means that the GhostControl's shape can be different from the RigidBodyControl's shape. For example, the non-solid ghost shape can be bigger than the solid shape of the Spatial (so you can “feel” ahead).

                GhostControl ghost = new GhostControl(
                   new BoxCollisionShape(new Vector3f(1,1,1)));  // a box-shaped ghost
                @@ -46,9 +45,11 @@ node.addControl(ghost);                         // the ghost follows thi
                 rootNode.attachChild(node);
                 getPhysicsSpace().add(ghost);
                + + @@ -62,22 +63,20 @@ getPhysicsSpace().add(ghost); -

                Physics Tick Listener

                +

                Physics Tick Listener

                - The jBullet Physics implementation is stepped at a constant 60 physics ticks per second frame rate. Applying forces or checking for overlaps only has an effect right at a physics update cycle, which is not every frame. If you do physics interactions at arbitrary spots in the simpleUpdate() loop, calls will be dropped at irregular intervals, because they happen out of cycle.

                -

                When (Not) to Use Tick Listener?

                +

                When (Not) to Use Tick Listener?

                - When you write game mechanics that apply forces, you must implement a tick listener (com.jme3.bullet.PhysicsTickListener) for it. The tick listener makes certain the forces are not dropped, but applied in time for the next physics tick.

                @@ -91,11 +90,10 @@ When your game mechanics however just poll the current state (e.g. getPhysicsLoc
                -

                How to Listen to Physics Ticks

                +

                How to Listen to Physics Ticks

                - Here's is the declaration of an examplary Physics Control that listens to ticks. (The example shows a RigidBodyControl, but it can also be GhostControl.)

                public class MyCustomControl
                @@ -125,17 +123,16 @@ public void physicsTick(PhysicsSpace space, float tpf){
                 
                 
                -

                Physics Collision Listener

                +

                Physics Collision Listener

                -

                When (Not) to Use Collision Listener

                +

                When (Not) to Use Collision Listener

                - -If you do not implement the Collision Listener interface (com.jme3.bullet.collision.PhysicsCollisionListener), a collisions will just mean that physical forces between solid objects are applied automatically. If you just want "Balls rolling, bricks falling" you do not need a listener. +If you do not implement the Collision Listener interface (com.jme3.bullet.collision.PhysicsCollisionListener), a collisions will just mean that physical forces between solid objects are applied automatically. If you just want “Balls rolling, bricks falling” you do not need a listener.

                @@ -150,17 +147,16 @@ If however you want to respond to a collision event (com.jme3.bullet.collision.P

              • Playing a sound (e.g. explosion, ouch)
              • -
              • ??? and countless more, depending on your game
                +
              • … and countless more, depending on your game
              • -

                How to Listen to Collisions

                +

                How to Listen to Collisions

                - You need to add the PhysicsCollisionListener to the physics space before collisions will be listened for. Here's an example of a Physics Control that uses a collision listener. (The example shows a RigidBodyControl, but it can also be GhostControl.)

                public class MyCustomControl extends RigidBodyControl
                @@ -188,24 +184,24 @@ After you identify the colliding nodes, specify the action to trigger when this
                     }

                -

                Note that after the collision() method ends, the PhysicsCollisionEvent is cleared. You must get all objects and values you need within the collision() method.

                -

                Reading Details From a PhysicsCollisionEvent

                +

                Reading Details From a PhysicsCollisionEvent

                - The PhysicsCollisionEvent event gives you access to detailed information about the collision. You already know the event objects can identify which nodes collided, but it even knows how hard they collided:

                Ghost methodsUsage
                getOverlappingObjects()Returns the List of objects that are currently colliding (overlapping) with the ghost.
                + + @@ -233,11 +229,10 @@ Note that after the collision method has been called the object is not valid any -

                Collision Groups

                +

                Collision Groups

                - You can improve performance by resricting the number of tests that collision detection has to perform. If you have a case where you are only interested in collisions between certain objects but not others, you can assign sets of physical obejcts to different collision groups.

                @@ -246,14 +241,11 @@ For example, for a click-to-select, you only care if the selection ray collides

                myNode.getControl(RigidBodyControl.class).setCollisionGroup(PhysicsCollisionObject.COLLISION_GROUP_02);
                 myNode.getControl(RigidBodyControl.class).setCollideWithGroups(PhysicsCollisionObject.COLLISION_GROUP_02);
                - + +

                +tag_documentation_physics_collision_forces_interaction +

                -

                view online version

                \ No newline at end of file +

                view online version

                \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/post-processor_water.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/post-processor_water.html index f19599224..9c00f2cdf 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/post-processor_water.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/post-processor_water.html @@ -1,10 +1,9 @@ -

                Rendering Water as Post-Process Effect

                +

                Rendering Water as Post-Process Effect

                - -The awesome SeaMonkey WaterFilter is highly configurable. It can render any type of water and also simulates the underwater part of the effect, including light effects called caustics. The effect is based on published on gamedev.net. Here's a video: +The awesome SeaMonkey WaterFilter is highly configurable. It can render any type of water and also simulates the underwater part of the effect, including light effects called caustics. The effect is based on published on gamedev.net. Here's a video:

                @@ -18,16 +17,15 @@ The awesome SeaMonkey WaterFilter is highly configurable. It can render any type

                -

                The Theory

                +

                The Theory

                - -The effect is part of a deferred rendering process, taking advantage of the pre-computed position buffer and back buffer (a texture representing the screen???s pixels position in view space, and a texture of the rendered scene). +The effect is part of a deferred rendering process, taking advantage of the pre-computed position buffer and back buffer (a texture representing the screen’s pixels position in view space, and a texture of the rendered scene).

                -After some calculation, this allows to reconstruct the position in world space for each pixel on the screen. "If a pixel is under a given water height, let???s render it as a blue pixel!" Blue pixel? Not exactly, we want waves, we want ripples, we want foam, we want reflection and refraction. +After some calculation, this allows to reconstruct the position in world space for each pixel on the screen. “If a pixel is under a given water height, let’s render it as a blue pixel!” Blue pixel? Not exactly, we want waves, we want ripples, we want foam, we want reflection and refraction.

                @@ -36,11 +34,10 @@ The GameDev.net article describes how those effects are achieved, but the main i

                -

                How Did We Implement it in jME3?

                +

                How Did We Implement it in jME3?

                - jME3 default behavior is to use a forward rendering process, so there is no position buffer rendered that we can take advantage of. But while rendering the main scene to a frame buffer in the FilterPostPorcessor, we can write the hardware depth buffer to a texture, with nearly no additional cost.

                @@ -49,22 +46,20 @@ There are several ways of reconstructing the world space position of a pixel fro

                -Now we have the rendered scene in a texture, and we can reconstruct the position in world space of each pixel. We???re good to go! +Now we have the rendered scene in a texture, and we can reconstruct the position in world space of each pixel. We’re good to go!

                -??? Nehon +– Nehon

                -

                Sample Code

                +

                Sample Code

                - There are two test cases in the jME3 repository: -

                • (ocean island)
                  @@ -77,11 +72,10 @@ There are two test cases in the jME3 repository:
                -

                Using the Water Filter

                +

                Using the Water Filter

                - In the simpleInitApp() method, you attach your scene to the rootNode, typically a terrain with a sky. Remember to add a directional light, since the water relies on the light direction vector. The WaterFilter constructor expects a node with the scene attached that should be reflected in the water, and vector information from the light source's direction.

                @@ -110,11 +104,10 @@ Usually you make the water reflect everything attached to the rootNode. But you
                -

                Optional: Waves

                +

                Optional: Waves

                - If you want waves, set the water height in the update loop. We reuse the initialWaterHeight variable, and repeatedly reset the waterHeight value according to time. This causes the waves.

                private float time = 0.0f;
                @@ -130,22 +123,22 @@ public void simpleUpdate(float tpf) {
                 
                 
                -

                Optional: Water Wave and Color Effects

                +

                Optional: Water Wave and Color Effects

                -

                All these effects are optional. Every setter also has a getter. -

                Method Purpose
                getObjectA()
                getObjectB()
                The two participants in the collision. You cannot know in advance whether some node will be recorded as A or B, you always have to consider both cases.
                + + @@ -163,11 +156,11 @@ All these effects are optional. Every setter also has a getter. +manager.loadTexture(“Textures/waveheight.png”) ) +manager.loadTexture(“Textures/wavenormals.png”) ) @@ -177,9 +170,11 @@ manager.loadTexture("Textures/wavenormals.png") )
                Water method exampleEffects: Waves Default
                water.setWaterHeight(-6);Use this waterheight method for causing waves.0.0f
                water.setHeightTexture( (Texture2D)
                -manager.loadTexture("Textures/waveheight.png") )
                This height map describes the shape of the waves"Common/MatDefs/Water/Textures/heightmap.jpg"This height map describes the shape of the waves“Common/MatDefs/Water/Textures/heightmap.jpg”
                water.setNormalTexture( (Texture2D)
                -manager.loadTexture("Textures/wavenormals.png") )
                This normal map describes the shape of the waves"Common/MatDefs/Water/Textures/gradient_map.jpg"This normal map describes the shape of the waves“Common/MatDefs/Water/Textures/gradient_map.jpg”
                water.setUseRipples(false);Switches the ripples effect on or off.trueThis normal
                + + @@ -198,13 +193,15 @@ ColorRGBA(0.0f, 0.0f,0.2f,1.0f) - +
                Water method example Effects: ColorDefault
                water.setLightDirection(new Vector3f(-0.37f,-0.50f,-0.78f))Usually you set this to the same as the light source's direction. Use this to set the light direction if the sun is moving.Value given to WaterFilter() constructor.
                water.setWaterTransparency(0.2f);Sets how fast colors fade out. use this to control how clear (e.g. 0.05f) or muddy (0.2f) water is. 0.1f
                water.setColorExtinction(new Vector3f(10f,20f,30f));Sets At what depth the refraction color extincts. The three values are RGB (red, green, blue) in this order. Play with these parameters to "muddy" the water.Vector3f(5f,20f,30f)water.setColorExtinction(new Vector3f(10f,20f,30f));Sets At what depth the refraction color extincts. The three values are RGB (red, green, blue) in this order. Play with these parameters to “muddy” the water.Vector3f(5f,20f,30f)
                + + @@ -217,9 +214,11 @@ water.setRadius(260);
                Water method example Effects: ShoreDefault
                water.setCenter(Vector3f.ZERO);
                water.setRadius(260);
                Limit the water filter to a semisphere with the given center and radius. Use this for lakes and smaller bodies of water. Skip this for oceans.unusedLimit the water filter to a semisphere with the gi
                + + @@ -231,13 +230,15 @@ water.setRadius(260); +manager.loadTexture(“Textures/foam.png”) )
                Water method example Effects: FoamDefault
                water.setUseFoam(false);Switches the white foam on or offtrue
                Limit the water filter to a semisphere with the gi
                water.setFoamTexture( (Texture2D)
                -manager.loadTexture("Textures/foam.png") )
                This foam texture will be used with WrapMode.Repeat"Common/MatDefs/Water/Textures/foam.jpg"This foam texture will be used with WrapMode.Repeat“Common/MatDefs/Water/Textures/foam.jpg”
                + + @@ -263,11 +264,10 @@ manager.loadTexture("Textures/foam.png") )
                Water method example Effects: LightDefault
                water.setSunScale(1f);Sets how big the sun should appear in the light's specular effect on the water.3.0f
                This foam texture w -

                Sound Effects

                +

                Sound Effects

                - You should also add audio nodes with water sounds to complete the effect.

                AudioNode waves = new AudioNode(assetManager, "Sounds/Environment/Ocean Waves.ogg", false);
                @@ -275,7 +275,6 @@ waves.setLooping(true);
                 audioRenderer.playSource(waves);

                - See also: audio.


                @@ -292,4 +291,4 @@ See also:
                -

                view online version

                \ No newline at end of file +

                view online version

                \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/ragdoll.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/ragdoll.html index 9908a0312..6b2e351ab 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/ragdoll.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/ragdoll.html @@ -1,9 +1,8 @@ -

                Ragdoll Physics

                +

                Ragdoll Physics

                - The jMonkeyEngine3 has built-in support for via the com.jme3.bullet package. Physics are not only responsible for handing collisions, but they also make hinges and joints possible. One special example of physical joints are ragdoll physics, shown here.

                @@ -13,18 +12,18 @@ The jMonkeyEngine3 has built-in support for -

                Sample Code

                +

                Sample Code

                • (Tip: Click to pull the ragdoll up)
                • -
                • ??? This ragdoll replaces a rigged model of a character in the moment it is "shot" to simulate a collapsing person. (Also note DoF of the limbs.)
                  +
                • – This ragdoll replaces a rigged model of a character in the moment it is “shot” to simulate a collapsing person. (Also note DoF of the limbs.)
                -

                Preparing the Physics Game

                +

                Preparing the Physics Game

                1. Create a SimpleApplication with a BulletAppState
                  @@ -39,21 +38,19 @@ The jMonkeyEngine3 has built-in support for -

                  Creating the Ragdoll

                  +

                  Creating the Ragdoll

                  - -A ragdoll is a simple "person" (dummy) that you build out of cylinder collision shapes. The ragdoll has 11 limbs: 1 for shoulders, 1 for the body, 1 for hips; plus 2 arms and 2 legs that are made up of two limbs each. In your game, you will likely replace the cylinders with your own (better looking) limb models. In this example here we just use simple cylinders. +A ragdoll is a simple “person” (dummy) that you build out of cylinder collision shapes. The ragdoll has 11 limbs: 1 for shoulders, 1 for the body, 1 for hips; plus 2 arms and 2 legs that are made up of two limbs each. In your game, you will likely replace the cylinders with your own (better looking) limb models. In this example here we just use simple cylinders.

                  -

                  Limbs

                  +

                  Limbs

                  - Since you're just creating the ragdoll for this example, all the limbs have the same shape, and you can write a simple helper method to create them. The function returns a PhysicsControl with CollisionShape with the width, height, location, and rotation (vertical or horizontal) that you specify. You choose a CapsuleCollisionShape (a cylinder with rounded top and bottom) so the limbs collide smoothly against one another.

                  private Node createLimb(float width, float height, Vector3f location, boolean rotate) {
                  @@ -92,16 +89,15 @@ Node     lLegL = createLimb(0.2f, 0.5f, new Vector3f(-0.25f,-2.2f, 0)
                   Node     lLegR = createLimb(0.2f, 0.5f, new Vector3f( 0.25f,-2.2f, 0), false);

                  -You now have the outline of a person. But if you ran the application now, the individual limbs would fall down independently of one another ??? the ragdoll is still lacking joints. +You now have the outline of a person. But if you ran the application now, the individual limbs would fall down independently of one another – the ragdoll is still lacking joints.

                  -

                  Joints

                  +

                  Joints

                  - As before, you write a small helper method. This time its purpose is to quickly join two limbs A and B at the connection point that we specify.

                    @@ -123,7 +119,6 @@ As before, you write a small helper method. This time its purpose is to quickly

                  - Use the helper method to connect all limbs with joints where they belong, at one end of the limb.

                  join(body,  shoulders, new Vector3f( 0.00f,  1.4f, 0));
                  @@ -143,11 +138,10 @@ Now the ragdoll is connected. If you ran the app now, the doll would collapse, b
                   
                   
                  -

                  Attaching Everything to the Scene

                  +

                  Attaching Everything to the Scene

                  - We create one (non-physical) Node named ragDoll, and attach all other nodes to it.

                  ragDoll.attachChild(shoulders);
                  @@ -170,48 +164,41 @@ bulletAppState.getPhysicsSpace().addAll(ragDoll);
                  -

                  Applying Forces

                  +

                  Applying Forces

                  - To pull the doll up, you could add an input handler that triggers the following action:

                  Vector3f upforce = new Vector3f(0, 200, 0);
                   shoulders.applyContinuousForce(true, upforce);

                  -We can use the action to pick the doll up and put it back on its feet, or what ever. Read more about Forces here. +We can use the action to pick the doll up and put it back on its feet, or what ever. Read more about Forces here.

                  -

                  Detecting Collisions

                  +

                  Detecting Collisions

                  - -Read the Responding to a PhysicsCollisionEvent chapter in the general physics documentation on how to detect collisions. You can detect collisions between limbs or between limbs and the floor, and trigger game events. +Read the Responding to a PhysicsCollisionEvent chapter in the general physics documentation on how to detect collisions. You can detect collisions between limbs or between limbs and the floor, and trigger game events.

                  -

                  Best Practices

                  +

                  Best Practices

                  +If you experience weird behaviour in a ragdoll – such as exploding into pieces and then reassembling – check your collision shapes. Verify you did not position the limbs too close to one another when assmebling the ragdoll. You typically see physical nodes being ejected when their collision shapes intersect, which puts physics in an impossible state. +

                  -If you experience weird behaviour in a ragdoll ??? such as exploding into pieces and then reassembling ??? check your collision shapes. Verify you did not position the limbs too close to one another when assmebling the ragdoll. You typically see physical nodes being ejected when their collision shapes intersect, which puts physics in an impossible state. +

                  +tag_documentation_physics_character_npc_forces_collisions

                  -
                  -

                  view online version

                  \ No newline at end of file +

                  view online version

                  \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/read_graphic_card_capabilites.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/read_graphic_card_capabilites.html index 1dedb032c..34848a793 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/read_graphic_card_capabilites.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/read_graphic_card_capabilites.html @@ -1,9 +1,8 @@ -

                  Read Graphic Card Capabilites

                  +

                  Read Graphic Card Capabilites

                  - When different people test your new game, you may get feedback that the game doesn't run on their hardware, or that some details don't look as expected. You need to detect which fetaures the user's hardware supports, and offer a replacement for non-supported features on olde hardware (or deactivate them automatically).

                  @@ -11,7 +10,7 @@ When different people test your new game, you may get feedback that the game doe You can read (and print) the capabilities of the user's graphic card using the com.jme3.renderer.Caps class:

                  Collection<Caps> caps = renderer.getCaps();
                  -Logger.getLogger(HelloWorld.class.getName()).log(Level.INFO, ???Caps: {0}???, caps.toString());
                  +Logger.getLogger(HelloWorld.class.getName()).log(Level.INFO, “Caps: {0}”, caps.toString());

                  Note: Replace HelloWorld by the name of the class where you are using this line. @@ -19,11 +18,10 @@ Logger.getLogger(HelloWorld.class.getName()).log(Level.INFO,

                  -

                  Examples

                  +

                  Examples

                  - A newer graphic card has modern capabilities, for example OpenGL 2.1 and NonPowerOfTwoTextures:

                  INFO: Running on jMonkeyEngine 3.0.0 
                  @@ -61,7 +59,7 @@ VertexTextureFetch, FloatTexture,
                   TextureCompressionLATC, NonPowerOfTwoTextures]

                  -This next example is lacking NonPowerOfTwoTextures, this tells you that this user's graphic card cannot handle textures with sizes that are not square powers of two (such as "128x128"). +This next example is lacking NonPowerOfTwoTextures, this tells you that this user's graphic card cannot handle textures with sizes that are not square powers of two (such as “128×128”).

                  INFO: Capabilities: [FrameBuffer, FrameBufferMRT, FrameBufferMultisample, 
                   OpenGL20, ARBprogram, GLSL100, GLSL110, GLSL120, 
                  @@ -69,4 +67,4 @@ VertexTextureFetch, FloatTexture, TextureCompressionLATC]
                  -

                  view online version

                  \ No newline at end of file +

                  view online version

                  \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/remote-controlling_the_camera.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/remote-controlling_the_camera.html index 0c9af2669..4476b6a49 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/remote-controlling_the_camera.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/remote-controlling_the_camera.html @@ -1,14 +1,13 @@ -

                  Remote-Controlling the Camera

                  +

                  Remote-Controlling the Camera

                  -

                  Positioning the Camera

                  +

                  Positioning the Camera

                  - You can steer the camera using Cinematics:

                    @@ -19,14 +18,14 @@ You can steer the camera using -

                    Code Sample

                    +

                    Code Sample

                    flyCam.setEnabled(false);
                     Cinematic cinematic = new Cinematic(rootNode, 20);
                    @@ -41,19 +40,17 @@ camNodeSide.getControl(0).setEnabled(false);
                    -

                    Moving the Camera

                    +

                    Moving the Camera

                    - If desired, attach the camNode to a MotionTrack to let it travel along waypoints. This is demonstrated in the .

                    - + +

                    +tag_camera_documentation_cinematics +

                    -

                    view online version

                    \ No newline at end of file +

                    view online version

                    \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/save_and_load.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/save_and_load.html index fbb87dd4f..ca530aabd 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/save_and_load.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/save_and_load.html @@ -1,28 +1,27 @@ -

                    Saving and Loading Games (.j3o)

                    +

                    Saving and Loading Games (.j3o)

                    - Spatials (that is Nodes and Geometries) can contain audio and light nodes, particle emitters, controls, and user data (player score, health, inventory, etc). For your game distribution, you must convert all original models to a faster binary format. You save individual Spatials as well as scenes using com.jme3.export.binary.BinaryExporter.

                    -The jMonkeyEngine's binary file format is called .j3o. You can convert, view and edit .j3o files and their materials in the jMonkeyEngine SDK and compose scenes (this does not include editing meshes). For the conversion, you can either use the BinaryExporters, or a context menu in the SDK. +The jMonkeyEngine's binary file format is called .j3o. You can convert, view and edit .j3o files and their materials in the jMonkeyEngine SDK and compose scenes (this does not include editing meshes). For the conversion, you can either use the BinaryExporters, or a context menu in the SDK.

                    -

                    The jMonkeyEngine's serialization system is the com.jme3.export.Savable interface. JME3's BinaryExporter can write standard Java objects, JME3 objects, and primitive data types that are included in a spatial's user data. If you use custom game data classes, see below how to make them "Savable". +

                    The jMonkeyEngine's serialization system is the com.jme3.export.Savable interface. JME3's BinaryExporter can write standard Java objects, JME3 objects, and primitive data types that are included in a spatial's user data. If you use custom game data classes, see below how to make them “Savable”.

                    -There is also a com.jme3.export.xml.XMLExporter and com.jme3.export.xml.XMLImporter that similarly converts jme3 spatials to an XML format. But you wouldn't use that to load models at runtime (quite slow). +There is also a com.jme3.export.xml.XMLExporter and com.jme3.export.xml.XMLImporter that similarly converts jme3 spatials to an XML format. But you wouldn't use that to load models at runtime (quite slow).

                    -

                    Sample Code

                    +

                    Sample Code

                    • @@ -31,24 +30,23 @@ There is also a com.jme3.export.xml.XMLExporter and com.jme3.export.xml.XMLImpor
                    -

                    Saving a Node

                    +

                    Saving a Node

                    - The following example overrides stop() in SimpleApplication to save the rootNode to a file when the user quits the application. The saved rootNode is a normal .j3o binary file that you can open in the SDK.

                    -

                    Note that when you save a model that has textures, the references to those textures are stored as absolute paths, so when loading the j3o file again, the textures have to be accessible at the exact location (relative to the assetmanager root, by default the assets directory) they were loaded from. This is why the SDK manages the conversion on the project level. +

                    Note that when you save a model that has textures, the references to those textures are stored as absolute paths, so when loading the j3o file again, the textures have to be accessible at the exact location (relative to the assetmanager root, by default the assets directory) they were loaded from. This is why the SDK manages the conversion on the project level.

                      /* This is called when the user quits the app. */
                       @Override
                       public void stop() {
                    -    String userHome = System.getProperty("user.home");
                    +    System.getProperty("user.home");
                         BinaryExporter exporter = BinaryExporter.getInstance();
                    -    File file = new File(userHome+"/Models/"+"MyModel.j3o");
                    +    File(userHome+"/Models/"+"MyModel.j3o");
                         try {
                           exporter.save(rootNode, file);
                         } catch (IOException ex) {
                    @@ -59,16 +57,15 @@ The following example overrides stop() in SimpleApplication to save
                     
                     
                    -

                    Loading a Node

                    +

                    Loading a Node

                    - The following example overrides simpleInitApp() in SimpleApplication to load Models/MyModel.j3o when the game is initialized.

                      @Override
                       public void simpleInitApp() {
                    -     String userHome = System.getProperty("user.home");
                    +     System.getProperty("user.home");
                          assetManager.registerLocator(userHome, FileLocator.class);
                          Node loadedNode = (Node)assetManager.loadModel("Models/MyModel.j3o");
                          loadedNode.setName("loaded node");
                    @@ -77,26 +74,24 @@ The following example overrides simpleInitApp() in SimpleApplicatio
                      

                    -

                    Here you see why we save user data inside spatials ??? so it can be saved and loaded together with the .j3o file. If you have game data outside Spatials, you have to remember to save() and load(), and get() and set() it yourself. +

                    Here you see why we save user data inside spatials – so it can be saved and loaded together with the .j3o file. If you have game data outside Spatials, you have to remember to save() and load(), and get() and set() it yourself.

                    -

                    Custom Savable Class

                    +

                    Custom Savable Class

                    - JME's BinaryExporter can write standard Java objects (String, ArrayList, buffers, etc), JME objects (Savables, such as Material), and primitive data types (int, float, etc). If you are using any custom class together with a Spatial, then the custom class must implement the com.jme3.export.Savable interface. There are two common cases where this is relevant: -

                    • The Spatial is carrying any Custom Controls.
                      Example: You used something like mySpatial.addControl(myControl);
                    • The Spatial's user data can contain a custom Java object.
                      -Example: You used something like mySpatial.setUserData("inventory", myInventory);
                      +Example: You used something like mySpatial.setUserData(“inventory”, myInventory);
                    @@ -153,11 +148,11 @@ To make a custom class savable: -
                  1. Add one line that read???()s the data to the JmeImport input capsule.
                    +
                  2. Add one line that read…()s the data to the JmeImport input capsule.
                    • On the left side of the assignment, specify the class field that you are restoring
                    • -
                    • On the right side, use the appropriate capsule.read???() method for the data type. Specify the String name of the variable (must be the same as you used in the write() method), and again specify a default value.
                      +
                    • On the right side, use the appropriate capsule.read…() method for the data type. Specify the String name of the variable (must be the same as you used in the write() method), and again specify a default value.
                  3. @@ -166,28 +161,14 @@ To make a custom class savable:

                  -

                  As with all serialization, remember that if you ever change data types in custom classes, the updated read() methods will no longer be able to read your old files. Also there has to be a constructor that takes no Parameters.

                  - + +

                  +tag_convert_j3o_models_load_save_documentation_serialization_import_export_spatial_node_mesh_geometry_scenegraph_sdk +

                  -

                  view online version

                  \ No newline at end of file +

                  view online version

                  \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/screenshots.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/screenshots.html index 33a0986bd..e7036f7b5 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/screenshots.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/screenshots.html @@ -1,27 +1,24 @@ -

                  Taking Screenshots

                  +

                  Taking Screenshots

                  - The com.jme3.app.state.ScreenshotAppState enables your users to take screenshots of the running game.

                  You activate this feature as follows in your simpleInitApp() method: -

                  ScreenshotAppState screenShotState = new ScreenshotAppState();
                   this.stateManager.attach(screenShotState);

                  -The default screenshot key is KeyInput.KEY_SYSRQ, alos known as "System Request / Print Screen" key. On Mac keyboards, this key does not exist, so on Mac OS you take screenshots using Command+Shift+3 (fullscreen) or Command+Shift+4 (windowed: press space to select a window and then click). +The default screenshot key is KeyInput.KEY_SYSRQ, alos known as “System Request / Print Screen” key. On Mac keyboards, this key does not exist, so on Mac OS you take screenshots using Command+Shift+3 (fullscreen) or Command+Shift+4 (windowed: press space to select a window and then click).

                  The screenshot is saved to the user directory. -

                  -

                  view online version

                  \ No newline at end of file +

                  view online version

                  \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shaderblow_glass.jpg b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shaderblow_glass.jpg index fd68080e5..e67c0c208 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shaderblow_glass.jpg and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shaderblow_glass.jpg differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shaderblow_light1.jpg b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shaderblow_light1.jpg index 113de5ea1..44c94ff31 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shaderblow_light1.jpg and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shaderblow_light1.jpg differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shaderblow_light2.jpg b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shaderblow_light2.jpg index 34727e790..34b7e36a3 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shaderblow_light2.jpg and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shaderblow_light2.jpg differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shaderblow_matcap.jpg b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shaderblow_matcap.jpg index 28881fd41..323fbd36d 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shaderblow_matcap.jpg and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shaderblow_matcap.jpg differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shadow-sponza-ssao.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shadow-sponza-ssao.png index 7bf0dea76..aeabbefc4 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shadow-sponza-ssao.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shadow-sponza-ssao.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shadow.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shadow.png index 2ea538a4c..3170451e2 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shadow.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shadow.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shape.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shape.html index 33eaf1416..aaf2273a6 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shape.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/shape.html @@ -1,5 +1,5 @@ -

                  Shapes

                  +

                  Shapes

                  @@ -8,34 +8,30 @@ The simplest type of Meshes are the built-in JME Shapes. You can create Shapes w

                  -

                  3D shapes

                  +

                  3D shapes

                  - - - +

                    -
                  • com.jme3.scene.shape.Box ??? A cube or cuboid. Single-sided Quad faces (outside only).
                    +
                  • com.jme3.scene.shape.Box – A cube or cuboid. Single-sided Quad faces (outside only).
                  • -
                  • com.jme3.scene.shape.StripBox ??? A cube or cuboid. Solid filled faces (inside and outside).
                    +
                  • com.jme3.scene.shape.StripBox – A cube or cuboid. Solid filled faces (inside and outside).
                    -
                  • com.jme3.scene.shape.Cylinder ??? A disk or pillar.
                    +
                  • com.jme3.scene.shape.Cylinder – A disk or pillar.
                  • -
                  • com.jme3.scene.shape.Sphere ??? A ball or elipsoid.
                    +
                  • com.jme3.scene.shape.Sphere – A ball or elipsoid.

                  - - - +

                    -
                  • com.jme3.scene.shape.Dome ??? A semi-sphere, e.g. SkyDome.
                    +
                  • com.jme3.scene.shape.Dome – A semi-sphere, e.g. SkyDome.
                    • For a cone, set the Dome's radialSamples>4 and planes=2.
                    • @@ -45,42 +41,41 @@ The simplest type of Meshes are the built-in JME Shapes. You can create Shapes w
                      -
                    • com.jme3.scene.shape.Torus ??? An single-holed torus or "donut".
                      +
                    • com.jme3.scene.shape.Torus – An single-holed torus or “donut”.
                    • -
                    • com.jme3.scene.shape.PQTorus ??? A parameterized torus. A PQ-Torus looks like a .
                      +
                    • com.jme3.scene.shape.PQTorus – A parameterized torus. A PQ-Torus looks like a .
                    • -
                    • com.jme3.scene.shape.Surface ??? A curved surface (called ) described by knots, weights and control points. Compare with shape.Curve.
                      +
                    • com.jme3.scene.shape.Surface – A curved surface (called ) described by knots, weights and control points. Compare with shape.Curve.
                  -

                  Non-3D shapes

                  +

                  Non-3D shapes

                    -
                  • com.jme3.scene.shape.Quad ??? A flat 2D rectangle (single-sided, center is in bottom-left corner)
                    +
                  • com.jme3.scene.shape.Quad – A flat 2D rectangle (single-sided, center is in bottom-left corner)
                  • -
                  • com.jme3.scene.shape.Line ??? A straight 1D line defined by a start and end point.
                    +
                  • com.jme3.scene.shape.Line – A straight 1D line defined by a start and end point.
                  • -
                  • com.jme3.scene.shape.Curve ??? A curved 1D spline. Compare with shape.Surface.
                    +
                  • com.jme3.scene.shape.Curve – A curved 1D spline. Compare with shape.Surface.
                  -

                  com.jme3.math versus com.jme3.shape?

                  +

                  com.jme3.math versus com.jme3.shape?

                  - Do not mix up these visible com.jme3.shapes with similarly named classes from the com.jme3.math package. Choose the right package when letting your IDE fill in the import statements!

                    -
                  • com.jme3.math.Line ??? is invisible, has a direction, goes through a point, infinite length.
                    +
                  • com.jme3.math.Line – is invisible, has a direction, goes through a point, infinite length.
                  • -
                  • com.jme3.math.Ray ??? is invisible, has a direction and start point, but no end.
                    +
                  • com.jme3.math.Ray – is invisible, has a direction and start point, but no end.
                  • -
                  • com.jme3.math.Spline ??? is an invisible curve.
                    +
                  • com.jme3.math.Spline – is an invisible curve.
                  • etc
                  • @@ -92,16 +87,15 @@ These maths objects are invisible and are used for collision testing (ray castin
                  -

                  Usage

                  +

                  Usage

                  -

                  Basic Usage

                  +

                  Basic Usage

                  - To add a shape to the scene:

                    @@ -116,22 +110,20 @@ To add a shape to the scene:

                  -

                  Create one static shape as mesh and use it in several geometries, or clone() the geometries.

                  -

                  Complex Shapes

                  +

                  Complex Shapes

                  - -You can compose more complex custom Geometries out of simple Shapes. Think of the buildings in games like Angry Birds, or the building blocks in Second Life ("prims") and in Tetris ("Tetrominos"). +You can compose more complex custom Geometries out of simple Shapes. Think of the buildings in games like Angry Birds, or the building blocks in Second Life (“prims”) and in Tetris (“Tetrominos”).

                    -
                  1. Create a Node. By default it is located at the origin (0/0/0) ??? leave the Node there for now.
                    +
                  2. Create a Node. By default it is located at the origin (0/0/0) – leave the Node there for now.
                  3. Create your shapes and wrap each into a Geometry, as just described.
                  4. @@ -144,18 +136,16 @@ You can compose more complex custom Geometries out of simple Shapes. Think of th

                  -The order is important: First arrange around origin, then transform. Otherwise, transformations are applied around the wrong center (pivot). Of course, you can attach your constellation to other pivot Nodes to create even more complex shapes (a chair, a furnished room, a house, a city, ???), but again, arrange them around the origin first before you transform them. Obviously, such composed Geometries are simpler than hand-sculpted meshes from a mesh editor. +The order is important: First arrange around origin, then transform. Otherwise, transformations are applied around the wrong center (pivot). Of course, you can attach your constellation to other pivot Nodes to create even more complex shapes (a chair, a furnished room, a house, a city, …), but again, arrange them around the origin first before you transform them. Obviously, such composed Geometries are simpler than hand-sculpted meshes from a mesh editor.

                  -

                  Code Examples

                  +

                  Code Examples

                  - Create the Mesh shape: -

                  Sphere mesh = new Sphere(32, 32, 10, false, true);
                  Dome mesh = new Dome(Vector3f.ZERO, 2, 4, 1f,false); // Pyramid
                  @@ -166,9 +156,7 @@ Create the Mesh shape:
                  PQTorus mesh = new PQTorus(3,8, 2f, 1f, 32, 32); // Flower torus

                  - Use one of the above examples together with the following geometry in a scene: -

                  Geometry geom = new Geometry("A shape", mesh); // wrap shape into geometry
                   Material mat = new Material(assetManager,      
                  @@ -179,21 +167,17 @@ rootNode.attachChild(geom);                    // attach geometry to a n
                   
                   
                  -

                  See also

                  +

                  See also

                  +* Optimization – The GeometryBatchFactory class combines several of your shapes with the same texture into one mesh with one texture. +

                  -* Optimization ??? The GeometryBatchFactory class combines several of your shapes with the same texture into one mesh with one texture. +

                  +tag_spatial_node_mesh_geometry_scenegraph

                  -
                  -

                  view online version

                  \ No newline at end of file +

                  view online version

                  \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/simplewater.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/simplewater.png index f201ebcea..7f9b62845 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/simplewater.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/simplewater.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/sky.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/sky.html index 4c68a71da..8d0226a02 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/sky.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/sky.html @@ -1,25 +1,23 @@ -

                  How to add a Sky to your Scene

                  +

                  How to add a Sky to your Scene

                  -

                  Here is an example for how you add a static horizon (a background landscape and a sky) to a scene. -Having a discernable horizon with a suitable landscape (or space, or ocean, or whatever) in the background makes scenes look more realistic than just a single-colored "sky" background. +Having a discernable horizon with a suitable landscape (or space, or ocean, or whatever) in the background makes scenes look more realistic than just a single-colored “sky” background.

                  -

                  Adding the Sky

                  +

                  Adding the Sky

                  - Adding a sky is extremely easy using the com.jme3.util.SkyFactory.

                  rootNode.attachChild(SkyFactory.createSky(
                  @@ -39,7 +37,6 @@ Tip: Cube map is the default. You would know if you had created a sphere map.
                   
                   

                  - Internally, the SkyFactory calls the following methods:

                    @@ -53,17 +50,15 @@ Internally, the SkyFactory calls the following methods:
                  -

                  Creating the Textures

                  +

                  Creating the Textures

                  - As the sky texture we use the sample BrightSky.dds file from jme3test-test-data.

                  How to create a sky textures? -

                  • There are many tools out there that generate cube and sphere maps.
                    @@ -74,12 +69,11 @@ Of course the higher the resolution, the better it will look. On the other hand,
                  • A box or sphere map is the simplest solution. But you can use any Node as sky, even complex sets of geometries and quads with animated clouds, blinking stars, city skylines, etc.
                  • -
                  • JME3 supports cube maps in PNG, JPG, or (compressed) DDS format.
                    +
                  • JME3 supports cube maps in PNG, JPG, or (compressed) DDS format.

                  - Box or Sphere?

                    @@ -89,7 +83,7 @@ Box or Sphere?
                  -
                2. If you have access to sphere map textures ??? specially projected sky images that fit inside a sphere ??? then you use a SkySphere or SkyDome.
                  +
                3. If you have access to sphere map textures – specially projected sky images that fit inside a sphere – then you use a SkySphere or SkyDome.
                  • @@ -99,4 +93,4 @@ Box or Sphere?
                4. -

                  view online version

                  \ No newline at end of file +

                  view online version

                  \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/spatial.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/spatial.html index 2ac9597db..743dcba05 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/spatial.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/spatial.html @@ -1,9 +1,8 @@ -

                  Spatial

                  +

                  Spatial

                  - This is an introduction to the concept of Spatials, the elements of the 3D scene graph. The scene graph is a data structure that manages all objects in your 3D world. For example, the scene graph keeps track of the 3D models that you load and position. When you extend a Java class from com.jme3.app.SimpleApplication, you automatically inherit the scene graph and its rootNode.

                  @@ -17,22 +16,22 @@ If you think you need to understand the scene graph concept better, please read
                  -

                  Node versus Geometry

                  +

                  Node versus Geometry

                  - 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:

                  -

                  + + @@ -40,7 +39,7 @@ In your Java code, a Spatial is either an instance of com.jme3.scene.Node< - + - +
                  com.jme3.scene.Spatial
                  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
                  Visibility: A Geometry represents a visible 3D object in the scene graph. A Node is an invisible "handle" for a group of Spatials in the scene graph. Visibility: A Geometry represents a visible 3D object in the scene graph. A Node is an invisible “handle” for a group of Spatials in the scene graph.
                  Purpose: Use Geometries to represent an object's look: Every Geometry contains a polygon mesh and a material, specifying its shape, color, texture, and opacity/transparency.
                  @@ -53,30 +52,27 @@ mesh and material;
                  Transformations; custom user data;
                  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. 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 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. +

                  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

                  +

                  Mesh

                  - The polygon Mesh inside a Geometry can be one of three things: -

                  • Shapes: The simplest type of Meshes are jME's default Shapes such as cubes and spheres. You can use several Shapes to build complex Geometries. Shapes are built-in and can be created without using the AssetManager.
                  • -
                  • 3D Models: 3D models and scenes are also made up of meshes, but are more complex than Shapes. You create Models and Scenes in external 3D Mesh Editors and export them as Ogre XML or Wavefront OBJ. Use the Asset Manager to load models into a your jME3 game.
                    +
                  • 3D Models: 3D models and scenes are also made up of meshes, but are more complex than Shapes. You create Models and Scenes in external 3D Mesh Editors and export them as Ogre XML or Wavefront OBJ. Use the Asset Manager to load models into a your jME3 game.
                  • Custom Meshes: Advanced users can create Custom Meshes programmatically.
                  • @@ -84,11 +80,10 @@ The polygon Mesh inside
                  -

                  What is a Clone?

                  +

                  What is a Clone?

                  - Cloned spatials share the same mesh, while each cloned spatial can have its own local transformation (translation, rotation, and scale) in the scene. This means you only use clone() on spatials whose meshes never change. The most common use case for cloning is when you use several Spatials that are based on the same Shapes (e.g. trees, crates).

                  @@ -103,23 +98,21 @@ The second use case is: When you load a model using loadModel() fro

                  - Usually there is no need to manually use any of the clone() methods on models. Using the Asset Manager's loadModel() method will automatically do the right thing for your models.

                  -

                  "Box worlds" are not made up of statically cloned Box() shapes, this would still be too slow for large worlds. To learn how to make real fast box worlds, search the web for voxelization techniques. +

                  “Box worlds” are not made up of statically cloned Box() shapes, this would still be too slow for large worlds. To learn how to make real fast box worlds, search the web for voxelization techniques.

                  -

                  How to Add Fields and Methods to a Spatial

                  +

                  How to Add Fields and Methods to a Spatial

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

                  @@ -129,7 +122,6 @@ You can include custom user data ???that is, custom Java objects and methods???

                  This first example adds an integer field named health to the Spatial playerNode, and initializes it to 100. -

                  playerNode.setUserData("health", 100);
                  @@ -157,14 +149,13 @@ playerNode.getControl(PlayerControl.class).setHealth(99);
                  • You can add as many data objects (of String, Boolean, Integer, Float, Array types) to a Spatial as you want. Just make sure to label them with unique case-sensitive strings (health, Inventory, equipment, etc).
                  • -
                  • The saved data can even be a custom Java object if you make the custom Java class implement the Savable interface!
                    +
                  • The saved data can even be a custom Java object if you make the custom Java class implement the Savable interface!
                  • When you save a Spatial as a .j3o file, the custom data is saved, too, and all Savables are restored the next time you load the .j3o!

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

                  for(String key : spatial.getUserDataKeys()){
                  @@ -173,16 +164,14 @@ This is how you list all data keys that are already defined for one Spatial:
                   
                   
                  -

                  How to Access a Named Sub-Mesh

                  +

                  How to Access a Named Sub-Mesh

                  - Often after you load a scene or model, you need to access a part of it as an individual Geometry in the scene graph. Maybe you want to swap a character's weapon, or you want to play a door-opening animation. First you need to know the unique name of the sub-mesh. -

                    -
                  1. Open the model in a 3D mesh editor, or in the jMonkeyEngine SDK's Scene Composer.
                    +
                  2. Open the model in a 3D mesh editor, or in the jMonkeyEngine SDK's Scene Composer.
                  3. Find out the existing names of sub-meshes in the model.
                  4. @@ -191,14 +180,13 @@ Often after you load a scene or model, you need to access a part of it as an ind

                  - In the following example, the Node house is the loaded model. The sub-meshes in the Node are called its children. The String, here door 12, is the name of the mesh that you are searching.

                  Geometry submesh = (Geometry) houseScene.getChild("door 12");
                  -

                  What is Culling?

                  +

                  What is Culling?

                  @@ -210,73 +198,66 @@ There are two types of culling: Face culling, and view frustrum culling.

                  -Usage: The "inside" of a mesh (the so called backface) is typically never visible to the player, and as an optimization, the Back mode skips calculating all backfaces by default. Activating the Off or Front modes can be useful when you are debugging custom meshes and try to identify accidental inside-out faces. +Usage: The “inside” of a mesh (the so called backface) is typically never visible to the player, and as an optimization, the Back mode skips calculating all backfaces by default. Activating the Off or Front modes can be useful when you are debugging custom meshes and try to identify accidental inside-out faces.

                  You can switch the com.jme3.material.RenderState.FaceCullMode to either:

                    -
                  • FaceCullMode.Back (default) ??? Only the frontsides of a mesh are drawn. Backface culling is the default behaviour.
                    +
                  • FaceCullMode.Back (default) – Only the frontsides of a mesh are drawn. Backface culling is the default behaviour.
                  • -
                  • FaceCullMode.Front ??? Only the backsides of a mesh are drawn. A mesh with frontface culling will most likely be invisible. Used for debugging "inside-out" custom meshes.
                    +
                  • FaceCullMode.Front – Only the backsides of a mesh are drawn. A mesh with frontface culling will most likely be invisible. Used for debugging “inside-out” custom meshes.
                  • -
                  • FaceCullMode.FrontAndBack ??? Use this to make a mesh temporarily invisible.
                    +
                  • FaceCullMode.FrontAndBack – Use this to make a mesh temporarily invisible.
                  • -
                  • FaceCullMode.Off ??? Every side of the mesh is drawn. Looks normal, but slows down large scenes.
                    +
                  • FaceCullMode.Off – Every side of the mesh is drawn. Looks normal, but slows down large scenes.

                  - Example: -

                  material.getAdditionalRenderState().setFaceCullMode(FaceCullMode.FrontAndBack);

                  -View frustum culling refers to not drawing (and not even calculating) certain whole models in the scene. At any given moment, half of the scene is behind the player and out of sight anyway. View frustum culling is an optimization to not calculate scene elements that are not visible ??? elements that are "outside the view frustrum". +View frustum culling refers to not drawing (and not even calculating) certain whole models in the scene. At any given moment, half of the scene is behind the player and out of sight anyway. View frustum culling is an optimization to not calculate scene elements that are not visible – elements that are “outside the view frustrum”.

                  The decision what is visible and what not, is done automatically by the engine (CullHint.Dynamic). Optionally, you can manually control whether the engine culls individual spatials (and children) from the scene graph:

                    -
                  • CullHint.Dynamic ??? Default, faster because it doesn't waste time with objects that are out of view.
                    +
                  • CullHint.Dynamic – Default, faster because it doesn't waste time with objects that are out of view.
                  • -
                  • CullHint.Never ??? Calculate and draw everything always (even if it does not end up on the user's screen because it's out of sight). Slower, but can be used while debugging custom meshes.
                    +
                  • CullHint.Never – Calculate and draw everything always (even if it does not end up on the user's screen because it's out of sight). Slower, but can be used while debugging custom meshes.
                  • -
                  • CullHint.Always ??? The whole spatial is culled and is not visible. A fast way to hide a Spatial temporarily. Culling a Spatial is faster then detaching it, but it uses more memory.
                    +
                  • CullHint.Always – The whole spatial is culled and is not visible. A fast way to hide a Spatial temporarily. Culling a Spatial is faster then detaching it, but it uses more memory.
                  • -
                  • CullHint.Inherit ??? Inherit culling behaviour from parent node.
                    +
                  • CullHint.Inherit – Inherit culling behaviour from parent node.

                  - Example: -

                  spatial.setCullHint(CullHint.Never); // always drawn
                  -

                  See also

                  +

                  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.
                    +
                  • Traverse SceneGraph – Find any Node or Geometry in the scenegraph.
                  - + +

                  +tag_spatial_node_mesh_geometry_scenegraph +

                  -

                  view online version

                  \ No newline at end of file +

                  view online version

                  \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/swing_canvas.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/swing_canvas.html index 179c055a0..a256e63e4 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/swing_canvas.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/swing_canvas.html @@ -1,5 +1,5 @@ -

                  JME3 Canvas in a Swing GUI

                  +

                  JME3 Canvas in a Swing GUI

                  @@ -15,7 +15,7 @@ This can be useful when you create some sort of interactive 3D viewer with a use

                  • You can use Swing components (frame, panels, menus, controls) next to your jME3 game.
                  • -
                  • The NetBeans GUI builder is compatible with the jMonkeyEngine; you can use it it to lay out the Swing GUI frame, and then add() the jME canvas into it. Install the GUI builder via Tools ??? Plugins ??? Available Plugins.
                    +
                  • The NetBeans GUI builder is compatible with the jMonkeyEngine; you can use it it to lay out the Swing GUI frame, and then add() the jME canvas into it. Install the GUI builder via Tools → Plugins → Available Plugins.
                  @@ -29,12 +29,11 @@ This can be useful when you create some sort of interactive 3D viewer with a use

                  Here is the full code sample. -

                  -

                  Extending SimpleApplication

                  +

                  Extending SimpleApplication

                  @@ -42,7 +41,6 @@ You start out just the same as for any jME3 game: The base application, here Swi
                  The camera's default behaviour in SimpleApplication is to capture the mouse, which doesn't make sense in a Swing window. You have to deactivate and replace this behaviour by flyCam.setDragToRotate(true); when you initialize the application: -

                  public void simpleInitApp() {
                     // activate windowed input behaviour
                  @@ -52,25 +50,22 @@ The camera's default behaviour in SimpleApplication is to capture the mouse
                   }

                  - In short: The first thing that is different is the main() method. We don't call start() on the SwingCanvasTest object as usual. Instead we create a Runnable() that creates and opens a standard Swing jFrame. In the runnable, we also create our SwingCanvasTest game with special settings, create a Canvas for it, and add that to the jFrame. Then we call startCanvas(). -

                  -

                  Main() and Runnable()

                  +

                  Main() and Runnable()

                  -The Swing isn't thread-safe and doesn't allow us to keep the jME3 canvas up-to-date. This is why we create a runnable for the jME canvas and queue it in the AWT event thread, so it can be invoked "later" in the loop, when Swing is ready with updating its own stuff.
                  +The Swing isn't thread-safe and doesn't allow us to keep the jME3 canvas up-to-date. This is why we create a runnable for the jME canvas and queue it in the AWT event thread, so it can be invoked “later” in the loop, when Swing is ready with updating its own stuff.

                  In the SwingCanvasTest's main() method, create a queued runnable(). It will contain the jME canvas and the Swing frame. -

                    public static void main(String[] args) {
                  -    java.awt.EventQueue.invokeLater(new Runnable() {
                  +    java.awt.Runnable() {
                         public void run() {
                            // ... see below ...
                         }
                  @@ -78,15 +73,13 @@ In the SwingCanvasTest's main() method, create a queued runnable(). It will
                     }

                  - -

                  Note that you have to use app.enqueue() when modifying objects in the scene from the AWT Event Queue like you have to use java.awt.EventQueue.invokeLater() from other threads (e.g. the update loop) when changing swing elements. This can get hairy quickly if you don???t have a proper threading model planned so you might want to use NiftyGUI as it is embedded in the update loop thread and is also cross-platform compatible (e.g. android etc.). +

                  Note that you have to use app.enqueue() when modifying objects in the scene from the AWT Event Queue like you have to use java.awt.EventQueue.invokeLater() from other threads (e.g. the update loop) when changing swing elements. This can get hairy quickly if you don’t have a proper threading model planned so you might want to use NiftyGUI as it is embedded in the update loop thread and is also cross-platform compatible (e.g. android etc.).

                  -

                  -

                  Creating the Canvas

                  +

                  Creating the Canvas

                  @@ -94,53 +87,45 @@ Here in the run() method, we start the jME application, create its
                  Specify the com.jme3.system.AppSettings so jME knows the size of the Swing panel that we put it into. The application will not ask the user for display settings, you have to specify them in advance. -

                  AppSettings settings = new AppSettings(true);
                   settings.setWidth(640);
                   settings.setHeight(480);

                  - We create our canvas application SwingCanvasTest, and give it the settings. We manually create a canvas for this game and configure the com.jme3.system.JmeCanvasContext. The method setSystemListener() makes sure that the listener receives events relating to context creation, update, and destroy. -

                  SwingCanvasTest canvasApplication = new SwingCanvasTest();
                   canvasApplication.setSettings(settings);
                   canvasApplication.createCanvas(); // create canvas!
                   JmeCanvasContext ctx = (JmeCanvasContext) canvasApplication.getContext();
                   ctx.setSystemListener(canvasApplication);
                  -Dimension dim = new Dimension(640, 480);
                  +Dimension(640, 480);
                   ctx.getCanvas().setPreferredSize(dim);

                  - Note that we have not called start() on the application, as we would usually do in the main() method. We will call startCanvas() later instead. -

                  -

                  Creating the Swing Frame

                  +

                  Creating the Swing Frame

                  -Inside the run() method, you create the Swing window as you would usually do. Create an empty jFrame and add() components to it, or create a custom jFrame object in another class file (for example, by using the NetBeans GUI builder) and create an instance of it here. +Inside the run() method, you create the Swing window as you would usually do. Create an empty jFrame and add() components to it, or create a custom jFrame object in another class file (for example, by using the NetBeans GUI builder) and create an instance of it here. Which ever you do, let's call the jFrame window. -

                  -
                  JFrame window = new JFrame("Swing Application");
                  +
                  JFrame("Swing Application");
                   window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

                  - -We create a standard JPanel inside the JFrame. Give it any Layout you wish ??? here we use a simple Flow Layout. Where the code sample says "Some Swing Component", this is where you add your buttons and controls.
                  +We create a standard JPanel inside the JFrame. Give it any Layout you wish – here we use a simple Flow Layout. Where the code sample says “Some Swing Component”, this is where you add your buttons and controls.

                  The important step is to add() the canvas component into the panel, like all the other Swing components. -

                  -
                  JPanel panel = new JPanel(new FlowLayout()); // a panel
                  +
                  FlowLayout()); // a panel
                   // add all your Swing components ...
                   panel.add(new JButton("Some Swing Component"));
                   ...
                  @@ -148,41 +133,31 @@ panel.add(new JButton("Some Swing Component"));
                   panel.add(ctx.getCanvas());

                  - OK, the jFrame and the panel are ready. We add the panel into the jFrame, and pack everything together. Set the window's visibility to true make it appear. -

                  window.add(panel);
                   window.pack();
                   window.setVisible(true);

                  - Remember that we haven't called start() on the jME appliation yet? For the canvas, there is a special startCanvas() method that you must call now: -

                  canvasApplication.startCanvas();

                  - Clean, build, and run! -

                  -

                  Navigation

                  +

                  Navigation

                  Remember, to navigate in the scene, click and drag (!) the mouse, or press the WASD keys. Depending on your game you may even want to define custom inputs to handle navigation in this untypical environment. - +tag_documentation_gui

                  -
                  -

                  view online version

                  \ No newline at end of file +

                  view online version

                  \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/tanlglow1.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/tanlglow1.png index aaf4e4faf..3c12587fb 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/tanlglow1.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/tanlglow1.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/terrain.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/terrain.html index 28a753092..a2f8f22ab 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/terrain.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/terrain.html @@ -1,9 +1,8 @@ -

                  TerraMonkey - The jMonkeyEngine Terrain System

                  +

                  TerraMonkey - The jMonkeyEngine Terrain System

                  - The goal of TerraMonkey is to provide a base implementation that will be usable for 80% of people's goals, while providing tools and a good foundation for the other 20% to build off of. Check out the videos in the following announcements:

                    @@ -15,12 +14,11 @@ The goal of TerraMonkey is to provide a base implementation that will be usable
                  -

                  Overview

                  +

                  Overview

                  - - +

                  @@ -39,7 +37,7 @@ TerraMonkey is a GeoMipMapping quad tree of terrain tiles that supports real tim

                  -

                  Current Features:

                  +

                  Current Features:

                  • Support for 16 splat textures. You use a custom combination of Diffuse, Normal, Specular, and Glow Maps.
                    @@ -48,15 +46,15 @@ TerraMonkey is a GeoMipMapping quad tree of terrain tiles that supports real tim
                  • Terrain can be randomized or generated from a heightmap
                  • -
                  • jMonkeyEngine SDK terrain editor
                    +
                  • jMonkeyEngine SDK terrain editor
                  • -
                  • Streaming terrain grid (ie. "infinite" terrain)
                    +
                  • Streaming terrain grid (ie. “infinite” terrain)
                  -

                  Planned Features:

                  +

                  Planned Features:

                  • Hydraulic erosion and procedural texture generation
                    @@ -67,7 +65,7 @@ TerraMonkey is a GeoMipMapping quad tree of terrain tiles that supports real tim
                  -

                  Sample Code

                  +

                  Sample Code

                  • @@ -84,11 +82,10 @@ TerraMonkey is a GeoMipMapping quad tree of terrain tiles that supports real tim
                  -

                  Geo Mip Mapping

                  +

                  Geo Mip Mapping

                  -

                  @@ -97,7 +94,7 @@ You have seen GeoMipMapping implemented in games before. This is where the farth

                  -GeoMipMapping often leads to "popping" where you see the terrain switch from one LOD to another. TerraMonkey has been designed so you can swap out different LOD calculation algorithms based on what will look best for your game. You can do this with the LodCalculator interface. +GeoMipMapping often leads to “popping” where you see the terrain switch from one LOD to another. TerraMonkey has been designed so you can swap out different LOD calculation algorithms based on what will look best for your game. You can do this with the LodCalculator interface.

                  @@ -106,30 +103,28 @@ GeoMipMapping in TerraMonkey has been split into several parts: the terrain quad

                  -

                  Terrain Quad Tree

                  +

                  Terrain Quad Tree

                  - TerraMonkey is a quad tree. Each node is a TerrainQuad, and each leaf is a TerrainPatch. A TerrainQuad has either 4 child TerrainQuads, or 4 child TerrainPatches. The TerrainPatch holds the actual mesh geometry. This structure is almost exactly the same as JME2's TerrainPage system. Except now each leaf has a reference to its neighbours, so it doesn't ever have to traverse the tree to get them.

                  -

                  Texture Splatting

                  +

                  Texture Splatting

                  - -When you "slap" a texture on a mesh, the whole mesh looks the same. For big meshes (such as terrains) that is undesirable because it looks very boring (your whole landscape would be all rock, or all grass, or all sand). Texture Splatting is a technique that lets you "paint" several textures into one combined texure. Each of the splat textures has an opacity value so you can define where it is visible in the final overall texture. +When you “slap” a texture on a mesh, the whole mesh looks the same. For big meshes (such as terrains) that is undesirable because it looks very boring (your whole landscape would be all rock, or all grass, or all sand). Texture Splatting is a technique that lets you “paint” several textures into one combined texure. Each of the splat textures has an opacity value so you can define where it is visible in the final overall texture.

                  -The default material for TerraMonkey is TerrainLighting.j3md. This material combines several texture maps to produce the final custom texture. Remember, Diffuse Maps are the main textures that define the look; optionally, each Diffuse Map can be enhanced with a Normal Map; Alpha Maps describe the opacity of each Diffuse Map used (one color ???red, green, blue, or alpha??? stands for one Diffuse Map's opacity); Glow and Specular Maps define optional effects. +The default material for TerraMonkey is TerrainLighting.j3md. This material combines several texture maps to produce the final custom texture. Remember, Diffuse Maps are the main textures that define the look; optionally, each Diffuse Map can be enhanced with a Normal Map; Alpha Maps describe the opacity of each Diffuse Map used (one color –red, green, blue, or alpha– stands for one Diffuse Map's opacity); Glow and Specular Maps define optional effects.

                  -

                  We recommend to , and not do it manually. If you are simply curious about how the SDK's terrain texture plugin works, or if you indeed want to generate materials manually, then read on for the implementation details. +

                  We recommend to , and not do it manually. If you are simply curious about how the SDK's terrain texture plugin works, or if you indeed want to generate materials manually, then read on for the implementation details.

                  @@ -138,7 +133,7 @@ Here are the names of TerrainLighting.j3md's material properties:

                  - +

                  • 1-3 Alpha Maps
                    @@ -159,17 +154,17 @@ Here are the names of TerrainLighting.j3md's material properties:
                  • DiffuseMap_2, DiffuseMap_2_scale, NormalMap_2
                  • -
                  • DiffuseMap_3, DiffuseMap_3_scale, NormalMap_3
                    +
                  • DiffuseMap_3, DiffuseMap_3_scale, NormalMap_3
                  • DiffuseMap_4, DiffuseMap_4_scale, NormalMap_4
                  • -
                  • ???
                    +
                  • DiffuseMap_11, DiffuseMap_11_scale, NormalMap_11
                  -
                5. "Light" maps
                  +
                6. “Light” maps
                  • GlowMap
                  • @@ -180,7 +175,6 @@ Here are the names of TerrainLighting.j3md's material properties:

                  - Note: DiffuseMap_0_scale is a float value (e.g. 1.0f); you must specify one scale per Diffuse Map.

                  @@ -190,7 +184,7 @@ OpenGL supports a maximum of 16 samplers in any given shader. This mean

                  Adhere to the following constraints: - +

                  • 1-12 Diffuse Maps. One Diffuse Map is the minimum!
                    @@ -208,9 +202,8 @@ Adhere to the following constraints:

                  - Here are some common examples what this means: - +

                  • 3 Alpha + 11 Diffuse + 1 Normal.
                    @@ -232,18 +225,16 @@ Here are some common examples what this means:

                  - You can hand-paint Alpha, Diffuse, Glow, and Specular maps in a drawing program, like Photoshop. Define each splat texture in the Alpha Map in either Red, Green, Blue, or Alpha (=RGBA). The JmeTests project bundled in the SDK includes some image files that show you how this works. The example images show a terrain heightmap next to its Alpha Map (which has been prepare for 3 Diffuse Maps), and one examplary Diffuse/Normal Map pair.

                7. -

                  Code Sample: Terrain.j3md

                  +

                  Code Sample: Terrain.j3md

                  - -This example shows the simpler material definition Terrain.j3md, which only supports 1 Alpha Map, 3 Diffuse Maps, 3 Normal Maps, and does not support Phong illumination. It makes the exmaple shorter ??? TerrainLighting.j3md works accordingly (The list of material properties see above. Links to extended sample code see above.) +This example shows the simpler material definition Terrain.j3md, which only supports 1 Alpha Map, 3 Diffuse Maps, 3 Normal Maps, and does not support Phong illumination. It makes the exmaple shorter – TerrainLighting.j3md works accordingly (The list of material properties see above. Links to extended sample code see above.)

                  @@ -282,9 +273,9 @@ heightmap.load(); Next we create the actual terrain.

                    -
                  • The terrain tiles are 65x65.
                    +
                  • The terrain tiles are 65×65.
                  • -
                  • The total size of the terrain is 513x513, but it can easily be up to 1025x1025.
                    +
                  • The total size of the terrain is 513×513, but it can easily be up to 1025×1025.
                  • It uses the heightmap to generate the height values.
                  • @@ -305,4 +296,4 @@ PS: As an alternative to an image-based height map, you can also generate a Hill
                  -

                  view online version

                  \ No newline at end of file +

                  view online version

                  \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/terrain_collision.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/terrain_collision.html index 519b0f564..1fd70ad82 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/terrain_collision.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/terrain_collision.html @@ -1,15 +1,14 @@ -

                  Terrain Collision

                  +

                  Terrain Collision

                  - This tutorial expands the HelloTerrain tutorial and makes the terrain solid. You combine what you learned in Hello Terrain and Hello Collision and add a CollisionShape to the terrain. The terrain's CollisionShape lets the first-person player (who is also a CollisionShape) collide with the terrain, i.e. walk on it and stand on it.

                  -

                  Sample Code

                  +

                  Sample Code

                  package jme3test.helloworld;
                    
                  @@ -202,7 +201,7 @@ public class HelloTerrainCollision extends SimpleApplication
                   }

                  -To try this code, create a New Project ??? JME3 ??? BasicGame using the default settings. Paste the sample code over the pregenerated Main.java class. Chnage the package to "mygame" if necessary. Open the Project Properties, Libraries, and add the jme3-test-data library to make certain you have all the files. +To try this code, create a New Project → JME3 → BasicGame using the default settings. Paste the sample code over the pregenerated Main.java class. Chnage the package to “mygame” if necessary. Open the Project Properties, Libraries, and add the jme3-test-data library to make certain you have all the files.

                  @@ -211,16 +210,15 @@ Compile and run the code. You should see a terrain. You can use the WASD keys an

                  -

                  Understanding the Code

                  +

                  Understanding the Code

                  -

                  The Terrain Code

                  +

                  The Terrain Code

                  - Read Hello Terrain for details of the following parts that we reuse:

                    @@ -234,7 +232,7 @@ Read Hello Terrain
                  -

                  The Collision Detection Code

                  +

                  The Collision Detection Code

                  @@ -258,13 +256,11 @@ Read Hello Colli

                  -

                  Combining the Two

                  +

                  Combining the Two

                  - Here are the changed parts to combine the two: -

                  1. You create a static (zero-mass) RigidBodyControl.
                    @@ -283,11 +279,10 @@ You attach the terrain and the first-person player to
                  -

                  Conclusion

                  +

                  Conclusion

                  - You see that you can combine snippets of sample code (such as HelloTerrain and HelloCollision), and create a new application from it that combines two features into soemthing new.

                  @@ -298,7 +293,6 @@ You should spawn high up in the area and fall down to the map, giving you a few

                  See also: -

                  - + +

                  +tag_terrain_collision +

                  -

                  view online version

                  \ No newline at end of file +

                  view online version

                  \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/toon-dino.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/toon-dino.png index b402d14c4..0689f8ddf 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/toon-dino.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/toon-dino.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/underwater2.jpg b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/underwater2.jpg index f4cb15a11..19fa597db 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/underwater2.jpg and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/underwater2.jpg differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/update_loop.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/update_loop.html index 8da02f3a6..2522702c7 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/update_loop.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/update_loop.html @@ -1,9 +1,8 @@ -

                  Main Update Loop

                  +

                  Main Update Loop

                  - Extending your application from com.jme3.app.SimpleApplication provides you with an update loop. This is where you implement your game logic (game mechanics).

                  @@ -15,19 +14,19 @@ Some usage examples: Here you remote-control NPCs (computer controlled character To let you see the main update loop in context, understand that the SimpleApplication does the following:

                    -
                  • Initialization ??? Execute simpleInitApp() method once.
                    +
                  • Initialization – Execute simpleInitApp() method once.
                  • Main Update Loop
                      -
                    1. Input listeners respond to mouse clicks and keyboard presses ??? Input handling
                      +
                    2. Input listeners respond to mouse clicks and keyboard presses – Input handling
                    3. Update game state:
                        -
                      1. Update overall game state ??? Execute Application States
                        +
                      2. Update overall game state – Execute Application States
                      3. -
                      4. User code update ??? Execute simpleUpdate() method
                        +
                      5. User code update – Execute simpleUpdate() method
                      6. -
                      7. Logical update of entities ??? Execute Custom Controls
                        +
                      8. Logical update of entities – Execute Custom Controls
                    4. @@ -37,7 +36,7 @@ To let you see the main update loop in context, understand that the SimpleApplic
                    5. Scene rendering.
                    6. -
                    7. User code rendering ??? Execute simpleRender() method.
                      +
                    8. User code rendering – Execute simpleRender() method.
                  • @@ -45,43 +44,36 @@ To let you see the main update loop in context, understand that the SimpleApplic -
                  • Quit ??? If user requests exit(), execute cleanup() and destroy().
                    +
                  • Quit – If user requests exit(), execute cleanup() and destroy().
                    The jME window closes and the loop ends.
                  -

                  Usage

                  +

                  Usage

                  - -In a trivial SimpleApplication (such as a Hello World tutorial), all code is either in the simpleInitApp() (initialization) or simpleUpdate() (behaviour) method ??? or in a helper method/class that is called from one of these two. This trivial approach will make your main class very long, hard to read, and hard to maintain. You don't need to load the whole scene at once, and you don't need to run all conditionals tests all the time. +In a trivial SimpleApplication (such as a Hello World tutorial), all code is either in the simpleInitApp() (initialization) or simpleUpdate() (behaviour) method – or in a helper method/class that is called from one of these two. This trivial approach will make your main class very long, hard to read, and hard to maintain. You don't need to load the whole scene at once, and you don't need to run all conditionals tests all the time.

                  It's a best practice to modularize your game mechanics and spread out initialization and update loop code over several Java objects:

                    -
                  • Move modular code blocks from the simpleInitApp() method into AppStates. Attach AppStates to initialize custom subsets of "one dungeon", and detach it when the player exits this "dungeon".
                    +
                  • Move modular code blocks from the simpleInitApp() method into AppStates. Attach AppStates to initialize custom subsets of “one dungeon”, and detach it when the player exits this “dungeon”.
                    Examples: Weather/sky audio and visuals, physics collision shapes, sub-rootnodes of individual dungeons including dungeon NPCs, etc.
                  • Move modular code blocks from the simpleUpdate() method into the update loops of Custom Controls to control individual entity behavior (NPCs), and into the update method of AppStates to control world events.
                    Examples: Weather behaviour, light behaviour, physics behaviour, individual NPC behaviour, trap behaviour, etc.
                  -
                  - basegame, - control, - input, - init, - keyinput, - loop, - states, - state -
                  + +

                  +tag_basegame_control_input_init_keyinput_loop_states_state +

                  -

                  view online version

                  \ No newline at end of file +

                  view online version

                  \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/vehicles.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/vehicles.html index 815488d78..b9fed84d9 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/vehicles.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/vehicles.html @@ -1,9 +1,8 @@ -

                  Controlling a Physical Vehicle

                  +

                  Controlling a Physical Vehicle

                  - For physical vehicles, jME's uses the jBullet ray-cast vehicle. In this vehicle implementation, the physical chassis 'floats' along on four non-physical vertical rays.

                  @@ -21,13 +20,11 @@ This article shows how you use this vehicle implementation in a jME3 application
                  -

                  Sample Code

                  +

                  Sample Code

                  - Full code samples are here: -

                  • @@ -38,13 +35,11 @@ Full code samples are here:
                  -

                  Overview of this Physics Application

                  +

                  Overview of this Physics Application

                  - The goal is to create a physical vehicle with wheels that can be steered and that interacts (collides with) with the floor and obstacles. -

                  1. Create a SimpleApplication with a BulletAppState
                    @@ -89,12 +84,11 @@ The goal is to create a physical vehicle with wheels that can be steered and tha
                  -

                  Creating the Vehicle Chassis

                  +

                  Creating the Vehicle Chassis

                  - -The vehicle that we create here in the example is just a "box on wheels", a basic vehicle shape that you can replace with a fancy car model, as demonstrated in . +The vehicle that we create here in the example is just a “box on wheels”, a basic vehicle shape that you can replace with a fancy car model, as demonstrated in .

                  @@ -126,7 +120,7 @@ Finally we add the behaviour (VehicleControl) to the visible Geometry (node).

                  vehicleNode.addControl(vehicle);

                  -We configure the physical properties of the vehicle's suspension: Compresion, Damping, Stiffness, and MaxSuspenionForce. Picking workable values for the wheel suspension can be tricky ??? for background info have a look at these . For now, let's work with the following values: +We configure the physical properties of the vehicle's suspension: Compresion, Damping, Stiffness, and MaxSuspenionForce. Picking workable values for the wheel suspension can be tricky – for background info have a look at these . For now, let's work with the following values:

                  float stiffness = 60.0f;//200=f1 car
                   float compValue = .3f; //(should be lower than damp)
                  @@ -137,16 +131,15 @@ vehicle.setSuspensionStiffness(stiffness);
                   vehicle.setMaxSuspensionForce(10000.0f);

                  -We now have a node vehicleNode with a visible "car" geometry, which acts like a vehicle. One thing that's missing are wheels. +We now have a node vehicleNode with a visible “car” geometry, which acts like a vehicle. One thing that's missing are wheels.

                  -

                  Adding the Wheels

                  +

                  Adding the Wheels

                  - We create four wheel Geometries and add them to the vehicle. Our wheel geometries are simple, non-physical discs (flat Cylinders), they are just visual decorations. Note that the physical wheel behaviour (the com.jme3.bullet.objects.VehicleWheel objects) is created internally by the vehicle.addWheel() method.

                  @@ -154,23 +147,22 @@ We create four wheel Geometries and add them to the vehicle. Our wheel geometrie The addWheel() method sets following properties:

                    -
                  • Vector3f connectionPoint ??? Coordinate where the suspension connects to the chassis (internally, this is where the Ray is casted downwards).
                    +
                  • Vector3f connectionPoint – Coordinate where the suspension connects to the chassis (internally, this is where the Ray is casted downwards).
                  • -
                  • Vector3f direction ??? Wheel direction is typically a (0,-1,0) vector.
                    +
                  • Vector3f direction – Wheel direction is typically a (0,-1,0) vector.
                  • -
                  • Vector3f axle ??? Axle direction is typically a (-1,0,0) vector.
                    +
                  • Vector3f axle – Axle direction is typically a (-1,0,0) vector.
                  • -
                  • float suspensionRestLength ??? Suspension rest length in world units
                    +
                  • float suspensionRestLength – Suspension rest length in world units
                  • -
                  • float wheelRadius ??? Wheel radius in world units
                    +
                  • float wheelRadius – Wheel radius in world units
                  • -
                  • boolean isFrontWheel ??? Whether this wheel is one of the steering wheels.
                    +
                  • boolean isFrontWheel – Whether this wheel is one of the steering wheels.
                    Front wheels are the ones that rotate visibly when the vehicle turns.

                  - We initialize a few variables that we will reuse when we add the four wheels. yOff, etc, are the particular wheel offsets for our small vehicle model.

                  Vector3f wheelDirection = new Vector3f(0, -1, 0);
                  @@ -187,7 +179,7 @@ We create a Cylinder mesh shape that we use to create the four visible wheel geo
                   
                  Cylinder wheelMesh = new Cylinder(16, 16, radius, radius * 0.6f, true);

                  -For each wheel, we create a Node and a Geometry. We attach the Cylinder Geometry to the Node. We rotate the wheel by 90?? around the Y axis. We set a material to make it visible. Finally we add the wheel (plus its properties) to the vehicle. +For each wheel, we create a Node and a Geometry. We attach the Cylinder Geometry to the Node. We rotate the wheel by 90° around the Y axis. We set a material to make it visible. Finally we add the wheel (plus its properties) to the vehicle.

                  Node node1 = new Node("wheel 1 node");
                   Geometry wheels1 = new Geometry("wheel 1", wheelMesh);
                  @@ -231,17 +223,15 @@ Not shown here is that we also created a Material mat.
                   
                   
                  -

                  Steering the Vehicle

                  +

                  Steering the Vehicle

                  - Not shown here is the standard way how we map the input keys to actions (see full code sample). Also refer to Input Handling).

                  In the ActionListener, we implement the actions that control the vehicle's direction and speed. For the four directions (accelerate=up, brake=down, left, right), we specify how we want the vehicle to move. -

                  • The braking action is pretty straightforward:
                    @@ -305,37 +295,33 @@ Remember, the standard input listener code that maps the actions to keys can be
                    -

                    Detecting Collisions

                    +

                    Detecting Collisions

                    - -Read the Responding to a PhysicsCollisionEvent chapter in the general physics documentation on how to detect collisions. You would do this if you want to react to collisions with custom events, such as adding points or substracting health. +Read the Responding to a PhysicsCollisionEvent chapter in the general physics documentation on how to detect collisions. You would do this if you want to react to collisions with custom events, such as adding points or substracting health.

                    -

                    Best Practices

                    +

                    Best Practices

                    - This example shows a very simple but functional vehicle. For a game you would implement steering behaviour and acceleration with values that are typical for the type of vehicle that you want to simulate. Instead of a box, you load a chassis model. You can consider using an AnalogListener to respond to key events in a more sophisticated way.

                    For a more advanced example, look at .

                    - + +

                    +tag_documentation_physics_vehicle_collision +

                    -

                    view online version

                    \ No newline at end of file +

                    view online version

                    \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/walking_character.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/walking_character.html index 362551789..a191f39a6 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/walking_character.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/walking_character.html @@ -1,9 +1,8 @@ -

                    Walking Character

                    +

                    Walking Character

                    - In the Hello Collision tutorial and the code sample you have seen how to create collidable landscapes and walk around in a first-person perspective. The first-person camera is enclosed by a collision shape and is steered by the BetterCharacterControl.

                    @@ -12,17 +11,16 @@ Other games however require a third-person perspective of the character: In thes

                    -

                    Some details on this page still need to be updated from old CharacterControl API to BetterCharacterControl API. +

                    Some details on this page still need to be updated from old CharacterControl API to BetterCharacterControl API.

                    -

                    Sample Code

                    +

                    Sample Code

                    - Several related code samples can be found here:

                      @@ -41,18 +39,15 @@ Several related code samples can be found here:

                    - The code in this tutorial is a combination of these samples. -

                    -

                    BetterCharacterControl

                    +

                    BetterCharacterControl

                    - Motivation: When you load a character model, give it a RigidBodyControl, and use forces to push it around, you do not get the desired behaviour: RigidBodyControl'ed objects (such as cubes and spheres) roll or tip over when pushed by physical forces. This is not the behaviour that you expect of a walking character. JME3's BulletPhysics integration offers a BetterCharacterControl with a setWalkDirection() method. You use it to create simple characters that treat floors and walls as solid, and always stays locked upright while moving.

                    @@ -70,18 +65,45 @@ myCharacter.addControl(myCharacter_phys); bulletAppState.getPhysicsSpace().add(myCharacter_phys);

                    -

                    The BulletPhysics CharacterControl only collides with "real" PhysicsControls (RigidBody). It does not detect collisions with other CharacterControls! If you need additional collision checks, add GhostControls to your characters and create a custom collision listener to respond. (The JME3 team may implement a better CharacterControl one day.) -

                    +To use the BetterCharacterControl, you may load your character like this:

                    +
                    // Load any model
                    +Spatial playerSpatial = assetManager.loadModel("Models/Oto/Oto.mesh.xml");
                    +player =  (Node)playerSpatial; // You can set the model directly to the player. (We just wanted to explicitly show that it's a spatial.)
                    +Node playerNode = new Node(); // You can create a new node to wrap your player to adjust the location. (This allows you to solve issues with character sinking into floor, etc.)
                    +playerNode.attachChild(player); // add it to the wrapper
                    +player.move(0,3.5f,0); // adjust position to ensure collisions occur correctly.
                    +player.setLocalScale(0.5f); // optionally adjust scale of model
                    +// setup animation:
                    +        control = player.getControl(AnimControl.class);
                    +        control.addListener(this);
                    +        channel = control.createChannel();
                    +        channel.setAnim("stand");
                    +playerControl = new BetterCharacterControl(1.5f, 6f, 1f); // construct character. (If your character bounces, try increasing height and weight.)
                    +playerNode.addControl(playerControl); // attach to wrapper
                    +// set basic physical properties:
                    +        playerControl.setJumpForce(new Vector3f(0,5f,0)); 
                    +        playerControl.setGravity(new Vector3f(0,1f,0));
                    +playerControl.warp(new Vector3f(0,10,10)); // warp character into landscape at particular location
                    +// add to physics state
                    +        bulletAppState.getPhysicsSpace().add(playerControl); 
                    +        bulletAppState.getPhysicsSpace().addAll(playerNode); 
                    +rootNode.attachChild(playerNode); // add wrapper to root

                    -A CharacterControl is a special kinematic object with restricted movement. CharacterControls have a fixed "upward" axis, this means they do not topple over when walking over an obstacle (as opposed to RigidBodyControls), which simulates a being's ability to balance upright. A CharacterControl can jump and fall along its upward axis, and it can scale steps of a certain height/steepness. +

                    The BulletPhysics CharacterControl only collides with “real” PhysicsControls (RigidBody). It does not detect collisions with other CharacterControls! If you need additional collision checks, add GhostControls to your characters and create a custom collision listener to respond. (The JME3 team may implement a better CharacterControl one day.) +

                    +

                    +

                    +A CharacterControl is a special kinematic object with restricted movement. CharacterControls have a fixed “upward” axis, this means they do not topple over when walking over an obstacle (as opposed to RigidBodyControls), which simulates a being's ability to balance upright. A CharacterControl can jump and fall along its upward axis, and it can scale steps of a certain height/steepness.

                    + + @@ -99,24 +121,23 @@ Default: 1, because for characters and vehicles, up is typically along the Y axi -
                    CharacterControl Method Property
                    setUpAxis(1) Fixed upward axis. Values: 0 = X axis , 1 = Y axis , 2 = Z axis.
                    Default: 1, because for characters and vehicles, up is typically along the Y axis.
                    setGravity(1f) The intensity of gravity for this CharacterControl'ed entity. Tip: To change the direction of gravity for a character, modify the up axis.
                    setWalkDirection(new Vector3f(0f,0f,0.1f)) (CharacterControl only) Make a physical character walk continuously while checking for floors and walls as solid obstacles. This should probably be called "setPositionIncrementPerSimulatorStep". This argument is neither a direction nor a velocity, but the amount to increment the position each physics tick: vector length = accuracy*speed in m/s.
                    +
                    setWalkDirection(new Vector3f(0f,0f,0.1f)) (CharacterControl only) Make a physical character walk continuously while checking for floors and walls as solid obstacles. This should probably be called “setPositionIncrementPerSimulatorStep”. This argument is neither a direction nor a velocity, but the amount to increment the position each physics tick: vector length = accuracy*speed in m/s.
                    Use setWalkDirection(Vector3f.ZERO) to stop a directional motion.
                    - +

                    - For best practices on how to use setWalkDirection(), see the Navigation Inputs example below.

                    - -

                    Walking Character Demo

                    + +

                    Walking Character Demo

                    - -

                    Code Skeleton

                    + +

                    Code Skeleton

                    public class WalkingCharacterDemo extends SimpleApplication
                             implements ActionListener, AnimEventListener {
                    @@ -137,12 +158,11 @@ For best practices on how to use setWalkDirection(), see the Naviga
                       public void onAnimChange(AnimControl control, AnimChannel channel, String animName) { }
                    - -

                    Overview

                    + +

                    Overview

                    - To create a walking character:

                      @@ -167,8 +187,8 @@ To create a walking character:
                    - -

                    Activate Physics

                    + +

                    Activate Physics

                    private BulletAppState bulletAppState;
                     ...
                    @@ -180,12 +200,11 @@ public void simpleInitApp() {
                     }
                    - -

                    Initialize the Scene

                    + +

                    Initialize the Scene

                    - In the simpleInitApp() method you initialize the scene and give it a MeshCollisionShape. The sample in the jme3 sources uses a custom helper class that simply creates a flat floor and drops some cubes and spheres on it:

                    public void simpleInitApp() {
                    @@ -223,16 +242,15 @@ Also, add a light source to be able to see the scene.
                       rootNode.addLight(light);
                    - -

                    Create the Animated Character

                    + +

                    Create the Animated Character

                    - You create an animated model, such as Oto.mesh.xml.

                      -
                    1. Place the "Oto" model into the assets/Models/Oto/ directory of your project.
                      +
                    2. Place the “Oto” model into the assets/Models/Oto/ directory of your project.
                    3. Create the CollisionShape and adjust the capsule radius and height to fit your character model.
                    4. @@ -265,12 +283,11 @@ public void simpleInitApp() {

                    - -

                    Set Up AnimControl and AnimChannels

                    + +

                    Set Up AnimControl and AnimChannels

                    - Create several AnimChannels, one for each animation that can happen simultaneously. In this example, you create one channel for walking and one for attacking. (Because the character can attack with its arms and walk with the rest of the body at the same time.)

                    private AnimChannel animationChannel;
                    @@ -293,8 +310,8 @@ The attackChannel only controls one arm, while the walking channels controls the
                     

                    - -

                    Add ChaseCam / CameraNode

                    + +

                    Add ChaseCam / CameraNode

                    private ChaseCamera chaseCam;
                      
                    @@ -307,12 +324,11 @@ public void simpleInitApp() {
                       ...
                    - -

                    Handle Navigation

                    + +

                    Handle Navigation

                    - Configure custom key bindings for WASD keys that you will use to make the character walk. Then calculate the vector where the user wants the character to move. Note the use of the special setWalkDirection() method below.

                    // track directional input, so we can walk left-forward etc
                    @@ -377,10 +393,12 @@ The variable airTime tracks how long the character is off the groun
                     private float airTime = 0;
                      
                     public void simpleUpdate(float tpf) {
                    -  Vector3f camDir = cam.getDirection().clone().multLocal(0.25f);
                    -  Vector3f camLeft = cam.getLeft().clone().multLocal(0.25f);
                    +  Vector3f camDir = cam.getDirection().clone();
                    +  Vector3f camLeft = cam.getLeft().clone();
                       camDir.y = 0;
                       camLeft.y = 0;
                    +  camDir.normalizeLocal();
                    +  camLeft.normalizeLocal();
                       walkDirection.set(0, 0, 0);
                      
                       if (left)  walkDirection.addLocal(camLeft);
                    @@ -388,13 +406,13 @@ public void simpleUpdate(float tpf) {
                       if (up) walkDirection.addLocal(camDir);
                       if (down) walkDirection.addLocal(camDir.negate());
                      
                    -  if (!character.onGround()) {
                    -      airTime = airTime + tpf;
                    +  if (!character.onGround()) { // use !character.isOnGround() if the character is a BetterCharacterControl type.
                    +      airTime += tpf;
                       } else {
                           airTime = 0;
                       }
                      
                    -  if (walkDirection.length() == 0) {
                    +  if (walkDirection.lengthSquared() == 0) { //Use lengthSquared() (No need for an extra sqrt())
                           if (!"stand".equals(animationChannel.getAnimationName())) {
                             animationChannel.setAnim("stand", 1f);
                           }
                    @@ -408,6 +426,8 @@ public void simpleUpdate(float tpf) {
                             animationChannel.setAnim("Walk", 0.7f);
                           }
                         }
                    + 
                    +  walkDirection.multLocal(25f).multLocal(tpf);// The use of the first multLocal here is to control the rate of movement multiplier for character walk speed. The second one is to make sure the character walks the same speed no matter what the frame rate is.
                       character.setWalkDirection(walkDirection); // THIS IS WHERE THE WALKING HAPPENS
                     }
                    @@ -421,23 +441,18 @@ This method resets the walk animation. public void onAnimChange(AnimControl control, AnimChannel channel, String animName) { }
                    - -

                    See also

                    + +

                    See also

                    - -

                    view online version

                    \ No newline at end of file + +

                    view online version

                    \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/water-post-muddy.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/water-post-muddy.png index 58423c3ba..0f1cbf291 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/water-post-muddy.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/water-post-muddy.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/water-reflection-muddy.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/water-reflection-muddy.png index 41aceed4e..0f1cbf291 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/water-reflection-muddy.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/water-reflection-muddy.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/water.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/water.html index ba7a0b04c..9d197ae8a 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/water.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/water.html @@ -1,9 +1,8 @@ -

                    Simple Water

                    +

                    Simple Water

                    - jMonkeyEngine offers a SimpleWaterProcessor that turns any quad (flat rectangle) into a reflective water surface with waves. You can use this quad for simple limited water surfaces such as water troughs, shallow fountains, puddles, shallow water in channels. The SimpleWaterProcessor has less performance impact on your game than the full featured SeaMonkey WaterFilter; the main difference is that the SimpleWaterProcessor does not include under-water effects.

                    @@ -20,30 +19,27 @@ Here is some background info for JME3's basic water implementation:

                  - - +

                  -

                  SimpleWaterProcessor

                  +

                  SimpleWaterProcessor

                  - A JME3 scene with water can use a com.jme3.water.SimpleWaterProcessor (which implements the SceneProcessor interface).

                  To achieve a water effect, JME3 uses shaders and a special material, Common/MatDefs/Water/SimpleWater.j3md. The water surface is a quad, and we use normal map and dU/dV map texturing to simulate the waves. -

                  1. Every frame, we render to three texture maps:
                      -
                    • For the water surface (reflection), we take a snapshot of the environment, flip it upside down, and clip it to the visible water surface. Note that we do not actually use a "water texture" color map: The "texture" of the water is solely a distorted reflection.
                      +
                    • For the water surface (reflection), we take a snapshot of the environment, flip it upside down, and clip it to the visible water surface. Note that we do not actually use a “water texture” color map: The “texture” of the water is solely a distorted reflection.
                    • -
                    • For the "wavy" distortion (refraction), we use the derivative of a normal map, a dU/dV map.
                      +
                    • For the “wavy” distortion (refraction), we use the derivative of a normal map, a dU/dV map.
                    • For the fogginess of water (depth) we use a depth map from the terrains z-buffer.
                    • @@ -51,7 +47,7 @@ To achieve a water effect, JME3 uses shaders and a special material, Commo
                    • In the shaders, we add all of the texture maps together.
                        -
                      • For the "bumpy" displacement of the waves, we use a normal map and a du/dv map that are shifted against each other over time to create the wave effect.
                        +
                      • For the “bumpy” displacement of the waves, we use a normal map and a du/dv map that are shifted against each other over time to create the wave effect.
                      • For the light reflection vectors on the water surface, we use the Fresnel formula, together with normal vectors.
                      • @@ -59,19 +55,17 @@ To achieve a water effect, JME3 uses shaders and a special material, Commo
                    • -
                    • (For the underwater caustics effect, we use splatted textures. ??? WIP/TODO)
                      +
                    • (For the underwater caustics effect, we use splatted textures. – WIP/TODO)
                  -

                  Usage

                  +

                  Usage

                  - -

                  1. Create a mainScene Node
                    @@ -126,11 +120,10 @@ To achieve a water effect, JME3 uses shaders and a special material, Commo
                  -

                  Sample Code

                  +

                  Sample Code

                  - The sample code can be found in jme3/src/jme3test/water/TestSimpleWater.java and jme3/src/jme3test/water/TestSceneWater.java.

                  @@ -165,53 +158,45 @@ rootNode.attachChild(water);
                  -

                  Settings

                  +

                  Settings

                  - You can lower the render size to gain higher performance: -

                  waterProcessor.setRenderSize(128,128);

                  The deeper the water, the more transparent. (?) -

                  waterProcessor.setWaterDepth(40);

                  A higher distortion scale makes bigger waves. -

                  waterProcessor.setDistortionScale(0.05f);

                  A lower wave speed makes calmer water. -

                  waterProcessor.setWaveSpeed(0.05f);

                  If your scene does not have a lightsource, you can set the light direction for the water: -

                  waterProcessor.setLightDirection( new Vector3f(0.55f, -0.82f, 0.15f));

                  Instead of creating a quad and specifying a plane, you can get a default waterplane from the processor: -

                  Geometry waterPlane = waterProcessor.createWaterGeometry(10, 10);
                   waterPlane.setLocalTranslation(-5, 0, 5);
                   waterPlane.setMaterial(waterProcessor.getMaterial());

                  -You can offer a switch to set the water Material to a static texture ??? for users with slow PCs. - +You can offer a switch to set the water Material to a static texture – for users with slow PCs.

                  -

                  view online version

                  \ No newline at end of file +

                  view online version

                  \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/water.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/water.png index e01cf49e4..1dc0aaf92 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/water.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/advanced/water.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/android.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/android.html index 398f280b6..dc35cef47 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/android.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/android.html @@ -1,62 +1,82 @@ -

                  Android Support in the jMonkeyEngine

                  +

                  Android Support in the jMonkeyEngine

                  - -This is a draft of a feature that is work in progress. If you have questions or suggestions, please leave a comment on the ! +jMonkeyEngine supports android deployment, and it's fully integrated in the SDK. +The android support is in constant enhancement so if you have questions or suggestions, please leave a comment on the !

                  - -

                  Requirements

                  + +

                  Requirements

                  - -

                  Developer Requirements

                  + +

                  Developer Requirements

                    -
                  • Install or better.
                    +
                  • Install jMonkeyEngine SDK (Remember to install )
                    +
                  • +
                  • Install or newer.
                    +
                      +
                    1. (You don't need the ADT Bundle for Windows. Choose “USE AN EXISTING IDE” and download the SDK Tools)
                      +
                    2. +
                    3. It's recommended to choose another destination folder.
                      +
                    4. +
                    5. Start the SDK Manager and install the default selected 13 packages (accept licenses)
                    6. -
                    7. Install jMonkeyEngine SDK
                      +
                  • -
                  • (Optional) Install NBAndroid in the jMonkeyEngine SDK:
                    +
                  + +

                  + +

                  +
                    +
                  • (Optional) Install NBAndroid in the jMonkeyEngine SDK:
                      -
                    1. Go to Tools???Plugins???Available Plugins.
                      +
                    2. Go to Tools→Plugins→Available Plugins.
                    3. -
                    4. Install the "Android" plugin.
                      +
                    5. Install the “Android” plugin.
                  - -

                  User Requirements

                  + +

                  User Requirements

                    -
                  • Android 2.2 device or better with development mode enabled
                    +
                  • Android 2.3 device or better with development mode (“USB-Debugging”) enabled
                  • Graphic card that supports OpenGL ES 2.0 or better
                  • +
                  • Remember to install the driver software on your computer
                    +
                  - -

                  Features

                  + +

                  Features

                  - -

                  JMonkeyEngine3 Android Integration

                  + +

                  jMonkeyEngine3 Android Integration

                    -
                  • Android touch events are translated into mouse events.
                    +
                  • JME app encapsulated in an Android activity (the AndroidHarness).
                    +
                  • +
                  • JME display in a GlSurfaceView.
                  • -
                  • No more unhandled exceptions (i.e. no more black screens)
                    +
                  • Android touch events are encapsulated into JME touch event or translated into mouse events.
                    +
                  • +
                  • Errors are handled universally in the Harness.
                  • Lifecycle management
                      @@ -68,24 +88,23 @@ This is a draft of a feature that is work in progress. If you have questions or
                    • Currently supports all jmetests except:
                        -
                      • Framebuffers - WIP
                        +
                      • Post processing filters. Functional but most of the time very slow
                      • -
                      • Shadows - WIP
                        +
                      • Shadows. Functional but most of the time very slow
                      • -
                      • Water - not tested yet
                        +
                      • Water. Functional but very slow.
                  - -

                  jMonkeyEngine SDK Android Integration

                  + +

                  jMonkeyEngine SDK Android Integration

                  - -Mobile deployment is a "one-click" option next to Desktop/WebStart/Applet deployment in the jMonkeyEngine SDK. +Mobile deployment is a “one-click” option next to Desktop/WebStart/Applet deployment in the jMonkeyEngine SDK.

                  • Automatic creation of Android harness and settings.
                    @@ -97,27 +116,27 @@ Mobile deployment is a "one-click" option next to Desktop/WebStart/App
                  - -

                  Beta Instructions

                  + +

                  Instructions

                    -
                  1. Make sure you have installed the Android Project Support into the jMonkeyEngine SDK.
                    +
                  2. Make sure you have installed the Android Project Support into the jMonkeyEngine SDK.
                  3. -
                  4. Open the jMonkeyEngine SDK Options>Mobile and enter the path to your Android SDK directory, and click OK. E.g. /opt/android-sdk
                    +
                  5. Open the jMonkeyEngine SDK Options>Mobile and enter the path to your Android SDK directory, and click OK. E.g. C:\Program Files\android-sdk
                  -

                  Activate Android Deployment

                  +

                  Activate Android Deployment

                  1. Open an existing JME3 project, or create a new JME3 project.
                  2. Right-click the project node in the Projects Window and open the Properties.
                  3. -
                  4. In the Application>Mobile Properties, enable Mobile Deployment, and select an Android target.
                    -This creates a "mobile" folder in your projects directory. This folder contains a complete android project with correct settings to run the application using the AndroidHarness.
                    +
                  5. In the Application>Android Properties, enable Android Deployment, and select an Android target. E.g. Android 4.2.2
                    +This creates a “mobile” folder in your projects directory. This folder contains a complete android project with correct settings to run the application using the AndroidHarness.
                  6. (Restart the jMonkeyEngine)
                  7. @@ -127,7 +146,6 @@ It lets you edit the MainActivitity.java, the AndroidManifest.xml, and build.pro

                  -

                  @@ -137,12 +155,11 @@ The Android deployment option creates a separate sub-project for android and mak
                  -

                  Build and Run

                  +

                  Build and Run

                  - -Open your game project in the jMonkeyEngine SDK. +Open your game project in the jMonkeyEngine SDK.

                  @@ -150,31 +167,29 @@ Open your game project in the jMonkeyEngine SDK.

                  +
                8. The application will run and output its log to the “Output” window of the SDK.
                9. -
                10. When finished testing, click the "x" next to the run status in the lower right to quit the logging output.
                  +
                11. When finished testing, click the “x” next to the run status in the lower right to quit the logging output.
                12. - The default android run target uses the default device set in the Android configuration utility. If you set that to a phone you can run the application directly on your phone, the emulator does not support OpenGLES 2.0 and cannot run the engine.

                  @@ -197,29 +212,28 @@ During build, the libraries and main jar file from the main project are copied t
                  -

                  Installing NBAndroid

                  +

                  Installing NBAndroid

                  -Activating the nbandroid plugin in the jMonkeyEngine SDK is optional, but recommended. You do not need the nbandroid plugin for Android support to work, however nbandroid will not interfere and will in fact allow you to edit the android source files and project more conveniently. To be able to edit, extend and code android-specific code in Android projects, install NBAndroid from the update center: +Activating the nbandroid plugin in the jMonkeyEngine SDK is optional, but recommended. You do not need the nbandroid plugin for Android support to work, however nbandroid will not interfere and will in fact allow you to edit the android source files and project more conveniently. To be able to edit, extend and code android-specific code in Android projects, install NBAndroid from the update center:

                    -
                  1. Open Tools???Plugins???Settings
                    +
                  2. Open Tools→Plugins→Settings
                  3. -
                  4. Go to Tools???Plugins???Available Plugins.
                    +
                  5. Go to Tools→Plugins→Available Plugins.
                  6. Install the NbAndroid plugin. (Will show up as Android)

                  - *If the android plugin is not in that list follow .*

                  -

                  Notes

                  +

                  Notes

                  • The package name parameter is only used when creating the project and only sets the android MainActivity package name
                    @@ -230,41 +244,38 @@ Activating the nbandroid plugin in the jMonkeyEngine -

                    Android Considerations

                    + +

                    Android Considerations

                    - -You can use the jMonkeyEngine SDK to save (theoretically) any jMonkeyEngine app as Android app. But the application has to be prepared for the fact that Android devices have a smaller screen resolution, touchscreens instead of mouse buttons, and (typically) no keyboards. - +You can use the jMonkeyEngine SDK to save (theoretically) any jMonkeyEngine app as Android app. But the application has to be prepared for the fact that Android devices have a smaller screen resolution, touchscreens instead of mouse buttons, and (typically) no keyboards.

                    • Inputs: Devise an alternate control scheme that works for Android users (e.g. using com.jme3.input.controls.TouchListener). This mobile scheme is likely quite different from the desktop scheme.
                    • -
                    • Effects: Android devices do no support 3D features as well as PCs ??? or even not at all. This restriction includes post-processor filters (depth-of-field blur, bloom, light scattering, cartoon, etc), drop shadows, water effects, 3D Audio. Be prepared that these effects will (at best) slow down the application or (in the worst case) not work at all. Provide the option to switch to a low-fi equivalent!
                      +
                    • Effects: Android devices do no support 3D features as well as PCs – or even not at all. This restriction includes post-processor filters (depth-of-field blur, bloom, light scattering, cartoon, etc), drop shadows, water effects, 3D Audio. Be prepared that these effects will (at best) slow down the application or (in the worst case) not work at all. Provide the option to switch to a low-fi equivalent!
                    • -
                    • Nifty GUI: Use different base UI layout XML files for the mobile version of your app to account for a different screen resolution.
                      +
                    • Nifty GUI: Use different base UI layout XML files for the mobile version of your app to account for a different screen resolution.

                    - Best Practice: Ideally, you write the core application code in a way that it checks for the environment it's being run on, and automatically adapts the device's limitations by switching off effects, changing input mechanisms etc. Learn how to read graphic card capabilites here.

                    - -

                    Using Android specific functions

                    + +

                    Using Android specific functions

                    @@ -272,7 +283,7 @@ As described above, you should always try to design your application as platform

                    -Since the main project is not configured to access the android api directly, you have to install NBAndroid (see above) to be able to edit the created android project in the SDK. After installing, click the "open project" button and navigate to the "mobile" folder inside the main project folder (it should show up with an android "a" icon) and open it. +Since the main project is not configured to access the android api directly, you have to install NBAndroid (see above) to be able to edit the created android project in the SDK. After installing, click the “open project” button and navigate to the “mobile” folder inside the main project folder (it should show up with an android “a” icon) and open it.

                    @@ -285,14 +296,36 @@ Note that you have to build the whole project once to make (new) classes in the

                    - -

                    More Info

                    + +

                    Signing an APK

                    -There be no proper guidanceof runing on androidf -The SDK will later provide tools to adapt the material and other graphics settings of the Android deployment version automatically. +When you have a mobile project in the “important files” section you have an “Android Properties” file.
                    + +There are 2 entries in this file :
                    + +key.store=path/to/your/keystore/on/your/drive/mykeystore.keystore
                    + +key.alias=mykeystorealias
                    + +

                    + +

                    +If those entries are filled, the apk will be signed during the build.
                    +You’ll be prompted when building to enter the password (twice). It will generate a signed apk in the dist folder of your project.
                    + +

                    + +
                    + +

                    More Info

                    +
                    + +

                    +There is currently no proper guidance of running on android. +The SDK will later provide tools to adapt the materials and other graphics settings of the Android deployment version automatically.

                    • @@ -302,14 +335,11 @@ The SDK will later provide t
                    - + +

                    +tag_documentation_sdk_android_deployment_tool +

                    - -

                    view online version

                    \ No newline at end of file + +

                    view online version

                    \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/android_sdk_manager.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/android_sdk_manager.png new file mode 100644 index 000000000..91bc20bc9 Binary files /dev/null and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/android_sdk_manager.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/beginner-assets-models.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/beginner-assets-models.png index d87c3d238..4f5ab4642 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/beginner-assets-models.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/beginner-assets-models.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/beginner-effect-fire.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/beginner-effect-fire.png index 24096dc49..526611f63 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/beginner-effect-fire.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/beginner-effect-fire.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/beginner-materials.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/beginner-materials.png index b98e4f987..5d2c0aae6 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/beginner-materials.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/beginner-materials.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/beginner-physics.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/beginner-physics.png index 7b02a3744..1216c1976 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/beginner-physics.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/beginner-physics.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/beginner-scene.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/beginner-scene.png index 7eaf67bde..06bf0f7b4 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/beginner-scene.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/beginner-scene.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/beginner-terrain.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/beginner-terrain.png index e42e21b9d..eecf8baee 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/beginner-terrain.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/beginner-terrain.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_animation.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_animation.html index 754f16629..79a4f6328 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_animation.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_animation.html @@ -1,9 +1,8 @@ -

                    jMonkeyEngine 3 Tutorial (7) - Hello Animation

                    +

                    jMonkeyEngine 3 Tutorial (7) - Hello Animation

                    - Previous: Hello Material, Next: Hello Picking

                    @@ -17,14 +16,13 @@ This tutorial shows how to add an animation controller and channels, and how to

                    -

                    To use the example assets in a new jMonkeyEngine SDK project, right-click your project, select "Properties", go to "Libraries", press "Add Library" and add the "jme3-test-data" library. +

                    To use the example assets in a new jMonkeyEngine SDK project, right-click your project, select “Properties”, go to “Libraries”, press “Add Library” and add the “jme3-test-data” library.

                    -

                    -

                    Sample Code

                    +

                    Sample Code

                    package jme3test.helloworld;
                      
                    @@ -86,7 +84,7 @@ public class HelloAnimation extends SimpleApplication
                         inputManager.addMapping("Walk", new KeyTrigger(KeyInput.KEY_SPACE));
                         inputManager.addListener(actionListener, "Walk");
                       }
                    -  private ActionListener actionListener = new ActionListener() {
                    +  private ActionListener() {
                         public void onAction(String name, boolean keyPressed, float tpf) {
                           if (name.equals("Walk") && !keyPressed) {
                             if (!channel.getAnimationName().equals("Walk")) {
                    @@ -100,11 +98,10 @@ public class HelloAnimation extends SimpleApplication
                     
                     
                    -

                    Creating and Loading Animated Models

                    +

                    Creating and Loading Animated Models

                    - You create animated models with a tool such as Blender. Take some time and learn how to create your own models in these . For now, download and use a free model, such as the one included here as an example (, and ).

                    @@ -129,11 +126,10 @@ Don't forget to add a light source to make the material visible.
                    -

                    Animation Controller and Channel

                    +

                    Animation Controller and Channel

                    - After you load the animated model, you register it to the Animation Controller.

                      @@ -151,7 +147,7 @@ After you load the animated model, you register it to the Animation Controller. ... /* Load the animation controls, listen to animation events, * create an animation channel, and bring the model in its default position. */ - control = player.getControl(AnimControl.class); + control = player.getControl(AnimControl.class); control.addListener(this); channel = control.createChannel(); channel.setAnim("stand"); @@ -162,7 +158,7 @@ After you load the animated model, you register it to the Animation Controller.

                      -"You have to consider channels as part of the skeleton that are animated. The default behavior is to use the whole skeleton for a channel. +“You have to consider channels as part of the skeleton that are animated. The default behavior is to use the whole skeleton for a channel. In your example the first channel plays the walk anim, then the second channel plays the dodge animation. Arms and feet are probably not affected by the doge animation so you can see the walk anim for them, but the rest of the body plays the dodge animation.

                      @@ -172,17 +168,31 @@ Usually multiple channels are used to animate different part of the body. For ex

                      -In your case, where you want animations to chain for the whole skeleton, you just have to use one channel." +In your case, where you want animations to chain for the whole skeleton, you just have to use one channel.” +

                    +

                    + +

                    +

                    +

                    +
                    control = player.getControl(AnimControl.class);
                    + +

                    +This line of code will return NULL if the AnimeControl is not in the main node of your model. To check this, right click your model and click “Edit in SceneComposer” You can then see the tree for the model. You can then move everything to the main node. You can also access a subnode with the following code. +

                    +
                    player.getChild("Subnode").getControl(AnimControl.class);
                    + +

                    +

                    - -

                    Responding to Animation Events

                    + +

                    Responding to Animation Events

                    - Add implements AnimEventListener to the class declaration. This interface gives you access to events that notify you when a sequence is done, or when you change from one sequence to another, so you can respond to it. In this example, you reset the character to a standing position after a Walk cycle is done.

                    public class HelloAnimation extends SimpleApplication
                    @@ -202,12 +212,11 @@ Add implements AnimEventListener to the class declaration. This int
                       }
                    - -

                    Trigger Animations After User Input

                    + +

                    Trigger Animations After User Input

                    - There are ambient animations like animals or trees that you may want to trigger in the main event loop. In other cases, animations are triggered by user interaction, such as key input. You want to play the Walk animation when the player presses a certain key (here the spacebar), at the same time as the avatar performs the walk action and changes its location.

                      @@ -232,9 +241,7 @@ There are ambient animations like animals or trees that you may want to trigger }

                      -To use the input controller, you need to implement the actionLister: -Test for each action by name, and set the channel to the corresponding animation to run. - +To use the input controller, you need to implement the actionListener by testing for each action by name, then set the channel to the corresponding animation to run.

                      • The second parameter of setAnim() is the blendTime (how long the current animation should overlap with the last one).
                        @@ -246,7 +253,7 @@ Test for each action by name, and set the channel to the corresponding animation
                      • Optionally, use channel.setTime() to Fast-forward or rewind to a certain moment in time of this animation.
                      -
                        private ActionListener actionListener = new ActionListener() {
                      +
                        private ActionListener() {
                           public void onAction(String name, boolean keyPressed, float tpf) {
                               if (name.equals("Walk") && !keyPressed) {
                                   if (!channel.getAnimationName().equals("Walk")){
                      @@ -258,17 +265,16 @@ Test for each action by name, and set the channel to the corresponding animation
                         };
                    - -

                    Exercises

                    + +

                    Exercises

                    -

                    Exercise 1: Two Animations

                    +

                    Exercise 1: Two Animations

                    - Make a mouse click trigger another animation sequence!

                      @@ -276,19 +282,18 @@ Make a mouse click trigger another animation sequence!
                    1. Create a new key trigger mapping and action (see: Hello Input)
                    2. -
                    3. Tip: Do you want to find out what animation sequences are available in the model? Use:
                      for (String anim : control.getAnimationNames()) { System.out.println(anim); }
                      +
                    4. Tip: Do you want to find out what animation sequences are available in the model? Use:
                      for (System.out.println(anim); }
                    -

                    Exercise 2: Revealing the Skeleton (1)

                    +

                    Exercise 2: Revealing the Skeleton (1)

                    - -Open the skeleton.xml file in a text editor of your choice. You don't have to be able to read or write these xml files (Blender does that for you) ??? but it is good to know how skeletons work. "There's no magic to it!" +Open the skeleton.xml file in a text editor of your choice. You don't have to be able to read or write these xml files (Blender does that for you) – but it is good to know how skeletons work. “There's no magic to it!”

                    • Note how the bones are numbered and named. All names of animated models follow a naming scheme.
                      @@ -301,11 +306,10 @@ Open the skeleton.xml file in a text editor of your choice. You don
                    -

                    Exercise 3: Revealing the Skeleton (2)

                    +

                    Exercise 3: Revealing the Skeleton (2)

                    - Add the following import statements for the SkeletonDebugger and Material classes:

                         import com.jme3.scene.debug.SkeletonDebugger;
                    @@ -327,35 +331,27 @@ Can you identify individual bones in the skeleton?
                     

                    - -

                    Conclusion

                    + +

                    Conclusion

                    - Now you can load animated models, identify stored animations, and trigger animations by using onAnimCycleDone() and onAnimChange(). You also learned that you can play several animations simultaneously, by starting each in a channel of its own. This could be useful if you ever want to animate the lower and upper part of the characters body independently, for example the legs run, while the arms use a weapon.

                    Now that your character can walk, wouldn't it be cool if it could also pick up things, or aim a weapon at things, or open doors? Time to reveal the secrets of mouse picking! -


                    See also:

                    - + +

                    +tag_beginner_intro_animation_documentation_keyinput_input_node_model +

                    - -

                    view online version

                    \ No newline at end of file + +

                    view online version

                    \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_asset.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_asset.html index db71a3421..ff4d7a39a 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_asset.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_asset.html @@ -1,9 +1,8 @@ -

                    jMonkeyEngine 3 Tutorial (3) - Hello Assets

                    +

                    jMonkeyEngine 3 Tutorial (3) - Hello Assets

                    - Previous: Hello Node, Next: Hello Update Loop

                    @@ -17,13 +16,13 @@ In this tutorial we will learn to load 3D models and text into the scene graph,

                    -

                    Trouble finding the files to run this sample? To get the assets (3D models) used in this example, add the included jme3-test-data.jar to your classpath. In project created with the jMonkeyEngine SDK (recommended), simply right-click your project, choose "Properties", go to "Libraries", press "Add Library" and add the preconfigured "jme3-test-data" library. +

                    Trouble finding the files to run this sample? To get the assets (3D models) used in this example, add the included jME3-testdata.jar to your classpath. In project created with the jMonkeyEngine SDK (recommended), simply right-click your project, choose “Properties”, go to “Libraries”, press “Add Library” and add the preconfigured “jme3-test-data” library.

                    - -

                    Code Sample

                    + +

                    Code Sample

                    package jme3test.helloworld;
                      
                    @@ -55,7 +54,7 @@ public class HelloAssets extends SimpleApplication {
                             rootNode.attachChild(teapot);
                      
                             // Create a wall with a simple texture from test_data
                    -        Box box = new Box(2.5f,2.5f,1.0f);
                    +        Box(2.5f,2.5f,1.0f);
                             Spatial wall = new Geometry("Box", box );
                             Material mat_brick = new Material( 
                                 assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
                    @@ -89,16 +88,15 @@ public class HelloAssets extends SimpleApplication {
                     }

                    -Build and run the code sample. You should see a green Ninja with a colorful teapot standing behind a wall. The text on the screen should say "Hello World". +Build and run the code sample. You should see a green Ninja with a colorful teapot standing behind a wall. The text on the screen should say “Hello World”.

                    - -

                    The Asset Manager

                    + +

                    The Asset Manager

                    - By game assets we mean all multi-media files, such as models, materials, textures, whole scenes, custom shaders, music and sound files, and custom fonts. JME3 comes with a handy AssetManager object that helps you access your assets. The AssetManager can load files from:

                    @@ -112,7 +110,6 @@ The AssetManager can load files from:

                  - The following is the recommended directory structure for storing assets in your project directoy:

                  MyGame/assets/               
                  @@ -133,16 +130,15 @@ This is just a suggested best practice, and it's what you get by default wh
                   

                  - -

                  Loading Textures

                  + +

                  Loading Textures

                  - Place your textures in a subdirectory of assets/Textures/. Load the texture into the material before you set the Material. The following code sample is from the simpleInitApp() method and loads a simple wall model:

                  // Create a wall with a simple texture from test_data
                  -Box box = new Box(2.5f,2.5f,1.0f);
                  +Box(2.5f,2.5f,1.0f);
                   Spatial wall = new Geometry("Box", box );
                   Material mat_brick = new Material( 
                       assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
                  @@ -153,17 +149,16 @@ wall.setLocalTranslation(2.0f,-2.5f,0.0f);
                   rootNode.attachChild(wall);

                  -In this case, you create your own Material and apply it to a Geometry. You base Materials on default material descriptions (such as "Unshaded.j3md"), as shown in this example. +In this case, you create your own Material and apply it to a Geometry. You base Materials on default material descriptions (such as “Unshaded.j3md”), as shown in this example.

                  - -

                  Loading Text and Fonts

                  + +

                  Loading Text and Fonts

                  - -This example displays the text "Hello World" in the default font at the bottom edge of the window. You attach text to the guiNode ??? this is a special node for flat (orthogonal) display elements. You display text to show the game score, player health, etc. +This example displays the text “Hello World” in the default font at the bottom edge of the window. You attach text to the guiNode – this is a special node for flat (orthogonal) display elements. You display text to show the game score, player health, etc. The following code sample goes into the simpleInitApp() method.

                  // Display a line of text with a default font
                  @@ -180,12 +175,11 @@ guiNode.attachChild(helloText);

                  - -

                  Loading a Model

                  + +

                  Loading a Model

                  - Export your 3D model in OgreXML format (.mesh.xml, .scene, .material, .skeleton.xml) and place it in a subdirectory of assets/Models/. The following code sample goes into the simpleInitApp() method.

                  // Load a model from test_data (OgreXML + material + texture)
                  @@ -204,12 +198,11 @@ Note that you do not need to create a Material if you exported the model with a
                   

                  - -

                  Loading Assets From Custom Paths

                  + +

                  Loading Assets From Custom Paths

                  - What if your game relies on user supplied model files, that are not included in the distribution? If a file is not located in the default location (e.g. assets directory), you can register a custom Locator and load it from any path.

                  @@ -234,24 +227,23 @@ JME3 offers ClasspathLocator, ZipLocator, FileLocator, HttpZipLocator, and UrlLo

                  - -

                  Creating Models and Scenes

                  + +

                  Creating Models and Scenes

                  - To create 3D models and scenes, you need a 3D Mesh Editor. If you don't have any tools, install Blender and the OgreXML Exporter plugin. Then you and export them to your project. Then you use the SDK to load models, convert models, and create 3D scenes from them.

                  -Example: From Blender, you export your models as Ogre XML meshes with materials as follows: +Example: From Blender, you export your models as Ogre XML meshes with materials as follows:

                  1. Open the menu File > Export > OgreXML Exporter to open the exporter dialog.
                  2. -
                  3. In the Export Materials field: Give the material the same name as the model. For example, the model something.mesh.xml goes with something.material, plus (optionally) something.skeleton.xml and some JPG texture files.
                    +
                  4. In the Export Materials field: Give the material the same name as the model. For example, the model something.mesh.xml goes with something.material, plus (optionally) something.skeleton.xml and some JPG texture files.
                  5. In the Export Meshes field: Select a subdirectory of your assets/Models/ directory. E.g. assets/Models/something/.
                  6. @@ -274,16 +266,15 @@ Then you use the SDK to -

                    Model File Formats

                    + +

                    Model File Formats

                    - JME3 can convert and load

                      -
                    • Ogre XML models + materials,
                      +
                    • Ogre XML models + materials,
                    • Ogre DotScenes,
                    • @@ -294,8 +285,7 @@ JME3 can convert and load

                    - -The loadModel() method loads these original file formats when you run your code directly from the SDK. If you however build the executables using the default build script, then the original model files (XML, OBJ, etc) are not included. This means, when you run the executable outside the SDK, and load any original models directly, you get the following error message: +The loadModel() method loads these original file formats when you run your code directly from the SDK. If you however build the executables using the default build script, then the original model files (XML, OBJ, etc) are not included. This means, when you run the executable outside the SDK, and load any original models directly, you get the following error message:

                    com.jme3.asset.DesktopAssetManager loadAsset
                     WARNING: Cannot locate resource: Models/Ninja/Ninja.mesh.xml
                    @@ -304,7 +294,7 @@ SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
                     java.lang.NullPointerException

                    -You see that loading the XML/OBJ/Blend files directly is only acceptable during the development phase in the SDK. For example, every time your graphic designer pushes updated files to the asset directory, you can quickly review the latest version in your development environment. +You see that loading the XML/OBJ/Blend files directly is only acceptable during the development phase in the SDK. For example, every time your graphic designer pushes updated files to the asset directory, you can quickly review the latest version in your development environment.

                    @@ -312,10 +302,10 @@ But for QA test builds and for the final release build, you use .j3o fil

                    -Open your JME3 Project in the jMonkeyEngine SDK. +Open your JME3 Project in the jMonkeyEngine SDK.

                      -
                    1. Right-click a .Blend, .OBJ, or .mesh.xml file in the Projects window, and choose "convert to JME3 binary".
                      +
                    2. Right-click a .Blend, .OBJ, or .mesh.xml file in the Projects window, and choose “convert to JME3 binary”.
                    3. The .j3o file appears next to the .mesh.xml file and has the same name.
                    4. @@ -325,20 +315,20 @@ Open your JME3 Project in the jMonkeyEngine -

                      Loading Models and Scenes

                      + +

                      Loading Models and Scenes

                      + +
                      Task? Solution!
                      Load a model with materials Use the asset manager's loadModel() method and attach the Spatial to the rootNode.
                      Spatial elephant = assetManager.loadModel("Models/Elephant/Elephant.mesh.xml");
                       rootNode.attachChild(elephant);
                      @@ -361,20 +351,19 @@ rootNode.attachChild(scene);
                      - +
                      - -

                      Excercise - How to Load Assets

                      + +

                      Excercise - How to Load Assets

                      - As an exercise, let's try different ways of loading a scene. You will learn how to load the scene directly, or from a zip file.

                      1. sample scene.
                      2. -
                      3. (Optional:) Unzip the town.zip to see the structure of the contained Ogre dotScene: You'll get a directory named town. It contains XML and texture files, and file called main.scene. (This is just for your information, you do not need to do anything with it.)
                        +
                      4. (Optional:) Unzip the town.zip to see the structure of the contained Ogre dotScene: You'll get a directory named town. It contains XML and texture files, and file called main.scene. (This is just for your information, you do not need to do anything with it.)
                      5. Place the town.zip file in the top level directory of your JME3 project, like so:
                        jMonkeyProjects/MyGameProject/assets/
                         jMonkeyProjects/MyGameProject/build.xml
                        @@ -386,9 +375,7 @@ jMonkeyProjects/MyGameProject/town.zip
                         

                      - Use the following method to load models from a zip file: -

                      1. Verify town.zip is in the project directory.
                        @@ -411,13 +398,11 @@ You should now see the Ninja+wall+teapot standing in a town.

                    - Tip: If you register new locators, make sure you do not get any file name conflicts: Don't name all scenes main.scene but give each scene a unique name.

                    Earlier in this tutorial, you loaded scenes and models from the asset directory. This is the most common way you will be loading scenes and models. Here is the typical procedure: -

                    1. Remove the code that you added for the previous exercise.
                      @@ -430,7 +415,7 @@ Earlier in this tutorial, you loaded scenes and models from the asset directory. rootNode.attachChild(gameLevel);

                      - Note that the path is relative to the assets/??? directory. + Note that the path is relative to the assets/… directory.

                    @@ -439,9 +424,7 @@ Earlier in this tutorial, you loaded scenes and models from the asset directory.

                  - Here is a third method you must know, loading a scene/model from a .j3o file: -

                  1. Remove the code from the previous exercise.
                    @@ -458,7 +441,7 @@ Here is a third method you must know, loading a scene/model from a .j3o file: rootNode.attachChild(gameLevel);

                    - Again, note that the path is relative to the assets/??? directory. + Again, note that the path is relative to the assets/… directory.

                  @@ -468,18 +451,16 @@ Again, you should see the Ninja+wall+teapot standing in a town.
                  - -

                  Conclusion

                  + +

                  Conclusion

                  - Now you know how to populate the scenegraph with static shapes and models, and how to build scenes. You have learned how to load assets using the assetManager and you have seen that the paths start relative to your project directory. Another important thing you have learned is to convert models to .j3o format for the executable JARs etc.

                  Let's add some action to the scene and continue with the Update Loop! -


                  @@ -498,19 +479,11 @@ Let's add some action to the scene and continue with the Hello Material
                  - + +

                  +tag_beginner_intro_documentation_lightnode_material_model_node_gui_hud_texture +

                  - -

                  view online version

                  \ No newline at end of file + +

                  view online version

                  \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_audio.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_audio.html index 64c73b799..9fdf688b1 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_audio.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_audio.html @@ -1,5 +1,5 @@ -

                  jMonkeyEngine 3 Tutorial (11) - Hello Audio

                  +

                  jMonkeyEngine 3 Tutorial (11) - Hello Audio

                  @@ -11,14 +11,13 @@ This tutorial explains how to add 3D sound to a game, and how to make sounds pla

                  -

                  To use the example assets in a new jMonkeyEngine SDK project, right-click your project, select "Properties", go to "Libraries", press "Add Library" and add the "jme3-test-data" library. +

                  To use the example assets in a new jMonkeyEngine SDK project, right-click your project, select “Properties”, go to “Libraries”, press “Add Library” and add the “jme3-test-data” library.

                  -

                  -

                  Sample Code

                  +

                  Sample Code

                  package jme3test.helloworld;
                    
                  @@ -49,7 +48,7 @@ public class HelloAudio extends SimpleApplication {
                       flyCam.setMoveSpeed(40);
                    
                       /** just a blue box floating in space */
                  -    Box box1 = new Box(1, 1, 1);
                  +    Box(1, 1, 1);
                       player = new Geometry("Player", box1);
                       Material mat1 = new Material(assetManager,"Common/MatDefs/Misc/Unshaded.j3md");
                       mat1.setColor("Color", ColorRGBA.Blue);
                  @@ -86,7 +85,7 @@ public class HelloAudio extends SimpleApplication {
                     }
                    
                     /** Defining the "Shoot" action: Play a gun sound. */
                  -  private ActionListener actionListener = new ActionListener() {
                  +  private ActionListener() {
                       @Override
                       public void onAction(String name, boolean keyPressed, float tpf) {
                         if (name.equals("Shoot") && !keyPressed) {
                  @@ -110,12 +109,11 @@ When you run the sample, you should see a blue cube. You should hear a nature-li
                   
                   
                  -

                  Understanding the Code Sample

                  +

                  Understanding the Code Sample

                  - -In the initSimpleApp() method, you create a simple blue cube geometry called player and attach it to the scene ??? this is just arbitrary sample content, so you see something when running the audio sample. +In the initSimpleApp() method, you create a simple blue cube geometry called player and attach it to the scene – this is just arbitrary sample content, so you see something when running the audio sample.

                  @@ -124,11 +122,10 @@ Let's have a closer look at initAudio() to learn how to use -

                  AudioNodes

                  +

                  AudioNodes

                  - Adding sound to your game is quite simple: Save your audio files into your assets/Sound directory. JME3 supports both Ogg Vorbis (.ogg) and Wave (.wav) file formats.

                  @@ -158,7 +155,6 @@ You want the gunshot sound to play once (you don't want it to loop rootNode.attachChild(audio_gun);

                  -

                  Note that setPositional(false) is pretty important when you use stereo sounds. Positional sounds must always be mono audio files, otherwise the engine will remind it to you with a crash.

                  @@ -191,11 +187,10 @@ Here you make audio_nature a positional sound that comes from a certain place. F
                  -

                  Triggering Sound

                  +

                  Triggering Sound

                  - Let's have a closer look at initKeys(): As you learned in previous tutorials, you use the inputManager to respond to user input. Here you add a mapping for a left mouse button click, and name this new action Shoot.

                    /** Declaring "Shoot" action, mapping it to a trigger (mouse left click). */
                  @@ -208,7 +203,7 @@ Let's have a closer look at initKeys(): As you learned in prev
                   Setting up the ActionListener should also be familiar from previous tutorials. You declare that, when the trigger (the mouse button) is pressed and released, you want to play a gun sound.
                   

                    /** Defining the "Shoot" action: Play a gun sound. */
                  -  private ActionListener actionListener = new ActionListener() {
                  +  private ActionListener() {
                       @Override
                       public void onAction(String name, boolean keyPressed, float tpf) {
                         if (name.equals("Shoot") && !keyPressed) {
                  @@ -219,16 +214,14 @@ Setting up the ActionListener should also be familiar from previous tutorials. Y
                   
                   

                  Since you want to be able to shoot fast repeatedly, so you do not want to wait for the previous gunshot sound to end before the next one can start. This is why you play this sound using the playInstance() method. This means that every click starts a new instance of the sound, so two instances can overlap. You set this sound not to loop, so each instance only plays once. As you would expect it of a gunshot. -

                  -

                  Ambient or Situational?

                  +

                  Ambient or Situational?

                  - The two sounds are two different use cases:

                    @@ -247,7 +240,6 @@ The two sounds are two different use cases:

                  - Now every sound knows whether it should loop or not.

                  @@ -259,7 +251,7 @@ Apart from the looping boolean, another difference is where play().playIns
                13. The gunshot sound, however, is triggered situationally, once, only as part of the Shoot input action that you defined in the ActionListener.
                    /** Defining the "Shoot" action: Play a gun sound. */
                  -  private ActionListener actionListener = new ActionListener() {
                  +  private ActionListener() {
                       @Override
                       public void onAction(String name, boolean keyPressed, float tpf) {
                         if (name.equals("Shoot") && !keyPressed) {
                  @@ -273,13 +265,11 @@ Apart from the looping boolean, another difference is where play().playIns
                   
                   
                  -

                  Buffered or Streaming?

                  +

                  Buffered or Streaming?

                  - The Boolean in the AudioNode constructor defines whether the audio is buffered (false) or streamed (true). For example: -

                  audio_gunshot = new AudioNode(assetManager, "Sound/Effects/Gun.wav", false); // buffered
                   ...
                  @@ -291,17 +281,18 @@ Typically, you stream long sounds, and buffer short sounds.
                   
                   

                  Note that streamed sounds can not loop (i.e. setLooping will not work as you expect). Check the getStatus on the node and if it has stopped recreate the node. -

                  -

                  Play() or PlayInstance()?

                  +

                  Play() or PlayInstance()?

                  + + @@ -315,11 +306,10 @@ Note that streamed sounds can not loop (i.e. setLooping will not work as you exp -

                  Your Ear in the Scene

                  +

                  Your Ear in the Scene

                  - To create a 3D audio effect, JME3 needs to know the position of the sound source, and the position of the ears of the player. The ears are represented by an 3D Audio Listener object. The listener object is a default object in a SimpleApplication.

                  @@ -337,11 +327,10 @@ If you don't do that, the results of 3D audio will be quite random.
                  -

                  Global, Directional, Positional?

                  +

                  Global, Directional, Positional?

                  - In this example, you defined the nature sound as coming from a certain position, but not the gunshot sound. This means your gunshot is global and can be heard everywhere with the same volume. JME3 also supports directional sounds which you can only hear from a certain direction.

                  @@ -353,50 +342,44 @@ It makes equal sense to make the gunshot positional, and let the ambient sound c
                14. Similarly, you may have game levels where you want one background sound to play globally. In this case, you would make the AudioNode neither positional nor directional (set both to false).
                15. -
                16. If you want sound to be "absorbed by the walls" and only broadcast in one direction, you would make this AudioNode directional. This tutorial does not discuss directional sounds, you can read about Advanced Audio here.
                  +
                17. If you want sound to be “absorbed by the walls” and only broadcast in one direction, you would make this AudioNode directional. This tutorial does not discuss directional sounds, you can read about Advanced Audio here.
                18. - In short, you must choose in every situation whether it makes sense for a sound to be global, directional, or positional.

                  -

                  Conclusion

                  +

                  Conclusion

                  - You now know how to add the two most common types of sound to your game: Global sounds and positional sounds. You can play sounds in two ways: Either continuously in a loop, or situationally just once. You know the difference between buffering short sounds and streaming long sounds. You know the difference between playing overlapping sound instances, and playing unique sounds that cannot overlap with themselves. You also learned to use sound files that are in either .ogg or .wav format.

                  -Tip: JME's Audio implementation also supports more advanced effects such as reverberation and Doppler effect. Use these "pro" features to make audio sound different depending on whether it's in the hallway, in a cave, outdoors, or in a carpeted room. Find out more about environmental effects from the sample code included in the jme3test directory and from the advanced Audio docs. +Tip: JME's Audio implementation also supports more advanced effects such as reverberation and Doppler effect. Use these “pro” features to make audio sound different depending on whether it's in the hallway, in a cave, outdoors, or in a carpeted room. Find out more about environmental effects from the sample code included in the jme3test directory and from the advanced Audio docs.

                  Want some fire and explosions to go with your sounds? Read on to learn more about effects. -


                  - See also:

                  - + +

                  +tag_sound_documentation_beginner_intro +

                  -

                  view online version

                  \ No newline at end of file +

                  view online version

                  \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_collision.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_collision.html index 7b4661f34..692b6c26d 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_collision.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_collision.html @@ -1,5 +1,5 @@ -

                  jMonkeyEngine 3 Tutorial (9) - Hello Collision

                  +

                  jMonkeyEngine 3 Tutorial (9) - Hello Collision

                  @@ -19,11 +19,10 @@ You can use the solution shown here for first-person shooters, mazes, and simila

                  -

                  Sample Code

                  +

                  Sample Code

                  - If you don't have it yet, sample scene.

                  jMonkeyProjects$ ls -1 BasicGame
                  @@ -196,17 +195,15 @@ public class HelloCollision extends SimpleApplication
                   }

                  -Run the sample. You should see a town square with houses and a monument. Use the WASD keys and the mouse to navigate around with a first-person perspective. Run forward and jump by pressing W and Space. Note how you step over the sidewalk, and up the steps to the monument. You can walk in the alleys between the houses, but the walls are solid. Don't walk over the edge of the world! :-) - +Run the sample. You should see a town square with houses and a monument. Use the WASD keys and the mouse to navigate around with a first-person perspective. Run forward and jump by pressing W and Space. Note how you step over the sidewalk, and up the steps to the monument. You can walk in the alleys between the houses, but the walls are solid. Don't walk over the edge of the world! :-)

                  -

                  Understanding the Code

                  +

                  Understanding the Code

                  - Let's start with the class declaration:

                  public class HelloCollision extends SimpleApplication
                  @@ -246,18 +243,15 @@ You initialize a few private fields:
                   
                   
                   

                  - Let's have a look at all the details: -

                  -

                  Initializing the Game

                  +

                  Initializing the Game

                  - As usual, you initialize the game in the simpleInitApp() method.

                      viewPort.setBackgroundColor(new ColorRGBA(0.7f,0.8f,1f,1f));
                  @@ -267,21 +261,20 @@ As usual, you initialize the game in the simpleInitApp() method.
                   
                  1. You set the background color to light blue, since this is a scene with a sky.
                  2. -
                  3. You repurpose the default camera control "flyCam" as first-person camera and set its speed.
                    +
                  4. You repurpose the default camera control “flyCam” as first-person camera and set its speed.
                  5. The auxiliary method setUpLights() adds your light sources.
                  6. -
                  7. The auxiliary method setUpKeys() configures input mappings???we will look at it later.
                    +
                  8. The auxiliary method setUpKeys() configures input mappings–we will look at it later.
                  -

                  The Physics-Controlled Scene

                  +

                  The Physics-Controlled Scene

                  - The first thing you do in every physics game is create a BulletAppState object. It gives you access to jME3's jBullet integration which handles physical forces and collisions.

                      bulletAppState = new BulletAppState();
                  @@ -295,7 +288,7 @@ For the scene, you load the sceneModel from a zip file, and adjust
                       sceneModel.setLocalScale(2f);

                  -The file town.zip is included as a sample model in the JME3 sources ??? you can . (Optionally, use any OgreXML scene of your own.) For this sample, place the zip file in the application's top level directory (that is, next to src/, assets/, build.xml). +The file town.zip is included as a sample model in the JME3 sources – you can . (Optionally, use any OgreXML scene of your own.) For this sample, place the zip file in the application's top level directory (that is, next to src/, assets/, build.xml).

                      CollisionShape sceneShape =
                         CollisionShapeFactory.createMeshShape((Node) sceneModel);
                  @@ -318,18 +311,16 @@ To use collision detection, you add a RigidBodyControl to the sceneModel
                   
                   

                  - Tip: Remember to add a light source so you can see the scene.

                  -

                  The Physics-Controlled Player

                  +

                  The Physics-Controlled Player

                  - -A first-person player is typically invisible. When you use the default flyCam as first-person cam, it does not even test for collisons and runs through walls. This is because the flyCam control does not have any physical shape assigned. In this code sample, you represent the first-person player as an (invisible) physical shape. You use the WASD keys to steer this physical shape around, while the physics engine manages for you how it walks along solid walls and on solid floors and jumps over solid obstacles. Then you simply make the camera follow the walking shape's location ??? and you get the illusion of being a physical body in a solid environment seeing through the camera. +A first-person player is typically invisible. When you use the default flyCam as first-person cam, it does not even test for collisons and runs through walls. This is because the flyCam control does not have any physical shape assigned. In this code sample, you represent the first-person player as an (invisible) physical shape. You use the WASD keys to steer this physical shape around, while the physics engine manages for you how it walks along solid walls and on solid floors and jumps over solid obstacles. Then you simply make the camera follow the walking shape's location – and you get the illusion of being a physical body in a solid environment seeing through the camera.

                  @@ -349,7 +340,7 @@ Again, you create a CollisionShape: This time you choose a CapsuleCollisionShape

                      player = new CharacterControl(capsuleShape, 0.05f);

                  -

                  "Does that CollisionShape make me look fat?" If you ever get confusing physics behaviour, remember to have a look at the collision shapes. Add the following line after the bulletAppState initialization to make the shapes visible: +

                  “Does that CollisionShape make me look fat?” If you ever get confusing physics behaviour, remember to have a look at the collision shapes. Add the following line after the bulletAppState initialization to make the shapes visible:

                  bulletAppState.getPhysicsSpace().enableDebug(assetManager);
                  @@ -371,37 +362,35 @@ Apart from step height and character size, the CharacterControl let
                      player.setPhysicsLocation(new Vector3f(0, 10, 0));

                  -Finally we put the player in its starting position and update its state ??? remember to use setPhysicsLocation() instead of setLocalTranslation() now, since you are dealing with a physical object. +Finally we put the player in its starting position and update its state – remember to use setPhysicsLocation() instead of setLocalTranslation() now, since you are dealing with a physical object.

                  -

                  PhysicsSpace

                  +

                  PhysicsSpace

                  - Remember, in physical games, you must register all solid objects (usually the characters and the scene) to the PhysicsSpace!

                      bulletAppState.getPhysicsSpace().add(landscape);
                       bulletAppState.getPhysicsSpace().add(player);

                  -The invisible body of the character just sits there on the physical floor. It cannot walk yet ??? you will deal with that next. +The invisible body of the character just sits there on the physical floor. It cannot walk yet – you will deal with that next.

                  -

                  Navigation

                  +

                  Navigation

                  - The default camera controller cam is a third-person camera. JME3 also offers a first-person controller, flyCam, which we use here to handle camera rotation. The flyCam control moves the camera using setLocation().

                  -However, you must redefine how walking (camera movement) is handled for physics-controlled objects: When you navigate a non-physical node (e.g. the default flyCam), you simply specify the target location. There are no tests that prevent the flyCam from getting stuck in a wall! When you move a PhysicsControl, you want to specify a walk direction instead. Then the PhysicsSpace can calculate for you how far the character can actually move in the desired direction ??? or whether an obstacle prevents it from going any further. +However, you must redefine how walking (camera movement) is handled for physics-controlled objects: When you navigate a non-physical node (e.g. the default flyCam), you simply specify the target location. There are no tests that prevent the flyCam from getting stuck in a wall! When you move a PhysicsControl, you want to specify a walk direction instead. Then the PhysicsSpace can calculate for you how far the character can actually move in the desired direction – or whether an obstacle prevents it from going any further.

                  @@ -410,11 +399,10 @@ In short, you must re-define the flyCam's navigational key mappings to use

                  -

                  1. inputManager

                  +

                  1. inputManager

                  - In the simpleInitApp() method, you re-configure the familiar WASD inputs for walking, and Space for jumping.

                  private void setUpKeys() {
                  @@ -431,17 +419,16 @@ In the simpleInitApp() method, you re-configure the familiar WASD i
                   }

                  -You can move this block of code into an auxiliary method setupKeys() and call this method from simpleInitApp()??? to keep the code more readable. +You can move this block of code into an auxiliary method setupKeys() and call this method from simpleInitApp()– to keep the code more readable.

                  -

                  2. onAction()

                  +

                  2. onAction()

                  - -Remember that this class implements the an ActionListener interface, so you can customize the flyCam inputs. The ActionListener interface requires you to implement the onAction() method: You re-define the actions triggered by navigation key presses to work with physics. +Remember that this class implements the ActionListener interface, so you can customize the flyCam inputs. The ActionListener interface requires you to implement the onAction() method: You re-define the actions triggered by navigation key presses to work with physics.

                    public void onAction(String binding, boolean value, float tpf) {
                       if (binding.equals("Left")) {
                  @@ -466,13 +453,12 @@ For all other directions: Every time the user presses one of the WASD keys, you
                   

                  - -

                  3. setWalkDirection()

                  + +

                  3. setWalkDirection()

                  - -Previously in the onAction() method, you have collected the info in which direction the user wants to go in terms of "forward" or "left". In the update loop, you repeatedly poll the current rotation of the camera. You calculate the actual vectors to which "forward" or "left" corresponds in the coordinate system. +Previously in the onAction() method, you have collected the info in which direction the user wants to go in terms of “forward” or “left”. In the update loop, you repeatedly poll the current rotation of the camera. You calculate the actual vectors to which “forward” or “left” corresponds in the coordinate system.

                  @@ -506,7 +492,7 @@ This is how the walking is triggered:

                19. Add to walkDirection the recent motion vectors that you polled from the camera. This way it is posible for a character to move forward and to the left simultaneously, for example!
                20. -
                21. This one last line does the "walking magic":
                  player.setWalkDirection(walkDirection);
                  +
                22. This one last line does the “walking magic”:
                  player.setWalkDirection(walkDirection);

                  Always use setWalkDirection() to make a physics-controlled object move continuously, and the physics engine handles collision detection for you. @@ -519,30 +505,25 @@ This is how the walking is triggered:

                  - Important: Again, do not use setLocalTranslation() to walk the player around. You will get it stuck by overlapping with another physical object. You can put the player in a start position with setPhysicalLocation() if you make sure to place it a bit above the floor and away from obstacles. -

                  - -

                  Conclusion

                  + +

                  Conclusion

                  - -You have learned how to load a "solid" physical scene model and walk around in it with a first-person perspective. +You have learned how to load a “solid” physical scene model and walk around in it with a first-person perspective. You learned to speed up the physics calculations by using the CollisionShapeFactory to create efficient CollisionShapes for complex Geometries. You know how to add PhysicsControls to your collidable geometries and you register them to the PhysicsSpace. You also learned to use player.setWalkDirection(walkDirection) to move collision-aware characters around, and not setLocalTranslation().

                  Terrains are another type of scene in which you will want to walk around. Let's proceed with learning how to generate terrains now. -


                  - Related info:

                    @@ -555,16 +536,11 @@ Related info:
                  • FYI, there are simpler collision detection solutions without physics, too. Have a look at .
                  - + +

                  +tag_beginner_collision_control_intro_documentation_model_physics +

                  - -

                  view online version

                  \ No newline at end of file + +

                  view online version

                  \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_effects.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_effects.html index 0ea66d764..3d4085ffe 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_effects.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_effects.html @@ -1,9 +1,8 @@ -

                  jMonkeyEngine 3 Tutorial (12) - Hello Effects

                  +

                  jMonkeyEngine 3 Tutorial (12) - Hello Effects

                  - Previous: Hello Audio, Next: Hello Physics

                  @@ -31,7 +30,6 @@ When you see one of the following in a game, then a particle system is likely be

                  - These scene elements cannot be modeled by meshes. In very simple terms:

                    @@ -42,18 +40,17 @@ These scene elements cannot be modeled by meshes. In very simple terms:

                  - Particle effects can be animated (e.g. sparks, drops) and static (strands of grass, hair). Non-particle effects include bloom/glow, and motion blur/afterimage. In this tutorial you learn how to make animated particles (com.jme3.effect).

                  -

                  To use the example assets in a new jMonkeyEngine SDK project, right-click your project, select "Properties", go to "Libraries", press "Add Library" and add the "jme3-test-data" library. +

                  To use the example assets in a new jMonkeyEngine SDK project, right-click your project, select “Properties”, go to “Libraries”, press “Add Library” and add the “jme3-test-data” library.

                  -

                  Sample Code

                  +

                  Sample Code

                  package jme3test.helloworld;
                    
                  @@ -122,12 +119,11 @@ You should see an explosion that sends debris flying, and a fire.
                   
                   
                  -

                  Texture Animation and Variation

                  +

                  Texture Animation and Variation

                  - - +

                  @@ -152,7 +148,7 @@ Setting emitter textures works just as you have already learned in previous chap

                23. Create a material and load the texture.
                24. Tell the Emitter into how many animation steps (x*y) the texture is divided.
                  -The debris texture has 3x3 frames.
                  +The debris texture has 3×3 frames.
                25. Optionally, tell the Emitter whether the animation steps are to be at random, or in order.
                  For the debris, the frames play at random.
                  @@ -160,57 +156,54 @@ For the debris, the frames play at random.
                26. - -As you see in the debris example, texture animations improve effects because each "flame" or "piece of debris" now looks different. Also think of electric or magic effects, where you can create very interesting animations by using an ordered morphing series of lightning bolts; or flying leaves or snow flakes, for instance. +As you see in the debris example, texture animations improve effects because each “flame” or “piece of debris” now looks different. Also think of electric or magic effects, where you can create very interesting animations by using an ordered morphing series of lightning bolts; or flying leaves or snow flakes, for instance.

                  -The fire material is created the same way, just using "Effects/Explosion/flame.png" texture, which has with 2x2 ordered animation steps. +The fire material is created the same way, just using “Effects/Explosion/flame.png” texture, which has with 2×2 ordered animation steps.

                  -

                  Default Particle Textures

                  +

                  Default Particle Textures

                  - The following particle textures included in test-data.jar. You can copy and use them in your own effects. -

                  audio.play()audio.playInstance()
                  Plays buffered sounds.Plays buffered sounds.
                  + + - + - + - + - + - +
                  Texture Path Dimension Preview
                  Effects/Explosion/Debris.png 3*3 Effects/Explosion/Debris.png 3*3
                  Effects/Explosion/flame.png 2*2 Effects/Explosion/flame.png 2*2
                  Effects/Explosion/shockwave.png 1*1 Effects/Explosion/shockwave.png 1*1
                  Effects/Explosion/smoketrail.png 1*3 Effects/Explosion/smoketrail.png 1*3
                  Effects/Smoke/Smoke.png 1*15 Effects/Smoke/Smoke.png 1*15

                  - Copy them into your assets/Effects directory to use them.

                  -

                  Creating Custom Textures

                  +

                  Creating Custom Textures

                  - For your game, you will likely create custom particle textures. Look at the fire example again.

                      ParticleEmitter fire = 
                  @@ -227,7 +220,7 @@ For your game, you will likely create custom particle textures. Look at the fire
                    

                  - +

                  @@ -246,17 +239,15 @@ For fire, is's a gradient from yellow to red.

                  - -Create a grayscale texture in a graphic editor, and save it to your assets/Effects directory. If you split up one image file into x*y animation steps, make sure each square is of equal size???just as you see in the examples here. +Create a grayscale texture in a graphic editor, and save it to your assets/Effects directory. If you split up one image file into x*y animation steps, make sure each square is of equal size–just as you see in the examples here.

                27. -

                  Emitter Parameters

                  +

                  Emitter Parameters

                  - A particle system is always centered around an emitter.

                  @@ -264,11 +255,11 @@ A particle system is always centered around an emitter. Use the setShape() method to change the EmitterShape:

                    -
                  • EmitterPointShape(Vector3f.ZERO) ??? particles emit from a point (default)
                    +
                  • EmitterPointShape(Vector3f.ZERO) – particles emit from a point (default)
                  • -
                  • EmitterSphereShape(Vector3f.ZERO,2f) ??? particles emit from a sphere-sized area
                    +
                  • EmitterSphereShape(Vector3f.ZERO,2f) – particles emit from a sphere-sized area
                  • -
                  • EmitterBoxShape(new Vector3f(-1f,-1f,-1f),new Vector3f(1f,1f,1f)) ??? particles emit from a box-sized area
                    +
                  • EmitterBoxShape(new Vector3f(-1f,-1f,-1f),new Vector3f(1f,1f,1f)) – particles emit from a box-sized area
                  @@ -279,14 +270,15 @@ Example:

                  You create different effects by changing the emitter parameters: -

                  + + - + @@ -325,24 +317,22 @@ Vector3f.NAN
                  Parameter Method Default Description
                  number setNumParticles() N/A The maximum number of particles visible at the same time. Value is specified by user in constructor. This influences the density and length of the "trail". number setNumParticles() N/A The maximum number of particles visible at the same time. Value is specified by user in constructor. This influences the density and length of the “trail”.
                  velocity getParticleInfluencer(). setInitialVelocity() Vector3f.ZERO Specify a vector how fast particles move and in which start direction.

                  - -You can find details about effect parameters here. +You can find details about effect parameters here. Add and modify one parameter at a time, and try different values until you get the effect you want.

                  -

                  Tip: Use the SceneComposer in the jMonkeyEngine SDK to create effects more easily. Create an empty scene and add an emitter object to it. Change the emitter properties and watch the outcome live. You can save created effects as .j3o file and load them like scenes or models. +

                  Tip: Use the SceneComposer in the jMonkeyEngine SDK to create effects more easily. Create an empty scene and add an emitter object to it. Change the emitter properties and watch the outcome live. You can save created effects as .j3o file and load them like scenes or models.

                  -

                  Exercise

                  +

                  Exercise

                  - -Can you "invert" the fire effect into a small waterfall? Here some tips: +Can you “invert” the fire effect into a small waterfall? Here some tips:

                  • Change the Red and Yellow color to Cyan and Blue
                    @@ -357,27 +347,22 @@ Can you "invert" the fire effect into a small waterfall? Here some tip
                  -

                  Conclusion

                  +

                  Conclusion

                  - You have learned that many different effects can be created by changing the parameters and textures of one general emitter object.

                  -Now you move on to another exciting chapter ??? the simulation of . Let's shoot some cannon balls at a brick wall! - +Now you move on to another exciting chapter – the simulation of . Let's shoot some cannon balls at a brick wall!


                  - + +

                  +tag_beginner_documentation_intro_transparency_effect +

                  -

                  view online version

                  \ No newline at end of file +

                  view online version

                  \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_input_system.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_input_system.html index 4f7c5e1f5..bcdfac33c 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_input_system.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_input_system.html @@ -1,9 +1,8 @@ -

                  jMonkeyEngine 3 Tutorial (5) - Hello Input System

                  +

                  jMonkeyEngine 3 Tutorial (5) - Hello Input System

                  - Previous: Hello Update Loop, Next: Hello Material

                  @@ -18,7 +17,7 @@ Every game has its custom keybindings, and this tutorial explains how you define
                  -

                  Sample Code

                  +

                  Sample Code

                  package jme3test.helloworld;
                    
                  @@ -47,7 +46,7 @@ public class HelloInput extends SimpleApplication {
                    
                     @Override
                     public void simpleInitApp() {
                  -    Box b = new Box(Vector3f.ZERO, 1, 1, 1);
                  +    Box(1, 1, 1);
                       player = new Geometry("Player", b);
                       Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
                       mat.setColor("Color", ColorRGBA.Blue);
                  @@ -70,7 +69,7 @@ public class HelloInput extends SimpleApplication {
                    
                     }
                    
                  -  private ActionListener actionListener = new ActionListener() {
                  +  private ActionListener() {
                       public void onAction(String name, boolean keyPressed, float tpf) {
                         if (name.equals("Pause") && !keyPressed) {
                           isRunning = !isRunning;
                  @@ -112,35 +111,33 @@ Build and run the example.
                   
                   
                   
                  - -

                  Defining Mappings and Triggers

                  + +

                  Defining Mappings and Triggers

                  - First you register each mapping name with its trigger(s). Remember the following:

                  • An input trigger can be a key press or mouse action.
                    -For example a mouse movement, a mouse click, or pressing the letter "P".
                    +For example a mouse movement, a mouse click, or pressing the letter “P”.
                28. The mapping name is a string that you can choose.
                  -The name should describe the action (e.g. "Rotate"), and not the trigger. Because the trigger can change.
                  +The name should describe the action (e.g. “Rotate”), and not the trigger. Because the trigger can change.
                29. One named mapping can have several triggers.
                  -For example, the "Rotate" action can be triggered by a click and by pressing the spacebar.
                  +For example, the “Rotate” action can be triggered by a click and by pressing the spacebar.
                30. - Have a look at the code:

                    -
                  1. You register the mapping named "Rotate" to the Spacebar key trigger.
                    +
                  2. You register the mapping named “Rotate” to the Spacebar key trigger.
                    new KeyTrigger(KeyInput.KEY_SPACE)).
                  3. -
                  4. In the same line, you also register "Rotate" to an alternative mouse click trigger.
                    +
                  5. In the same line, you also register “Rotate” to an alternative mouse click trigger.
                    new MouseButtonTrigger(MouseInput.BUTTON_LEFT)
                  6. You map the Pause, Left, Right mappings to the P, J, K keys, respectively.
                    @@ -154,11 +151,10 @@ Have a look at the code: new MouseButtonTrigger(MouseInput.BUTTON_LEFT));

                    - Now you need to register your trigger mappings.

                      -
                    1. You register the pause action to the ActionListener, because it is an "on/off" action.
                      +
                    2. You register the pause action to the ActionListener, because it is an “on/off” action.
                    3. You register the movement actions to the AnalogListener, because they are gradual actions.
                    4. @@ -168,17 +164,15 @@ Now you need to register your trigger mappings. inputManager.addListener(analogListener,"Left", "Right", "Rotate");

                      -This code goes into the simpleInitApp() method. But since we will likely add many keybindings, we extract these lines and wrap them in an auxiliary method, initKeys(). The initKeys() method is not part of the Input Controls interface ??? you can name it whatever you like. Just don't forget to call your method from the initSimpleApp() method. - +This code goes into the simpleInitApp() method. But since we will likely add many keybindings, we extract these lines and wrap them in an auxiliary method, initKeys(). The initKeys() method is not part of the Input Controls interface – you can name it whatever you like. Just don't forget to call your method from the initSimpleApp() method.

                      - -

                      Implementing the Actions

                      + +

                      Implementing the Actions

                      - You have mapped action names to input triggers. Now you specify the actions themselves.

                      @@ -188,7 +182,6 @@ The two important methods here are the ActionListener with its In this example, we trigger the following actions: -

                      1. The Rotate mapping triggers the action player.rotate(0, value, 0).
                        @@ -200,7 +193,7 @@ In this example, we trigger the following actions:
                      2. We also want to check the boolean isRunning before any action (other than unpausing) is executed.
                      -
                        private ActionListener actionListener = new ActionListener() {
                      +
                        private ActionListener() {
                           public void onAction(String name, boolean keyPressed, float tpf) {
                             if (name.equals("Pause") && !keyPressed) {
                               isRunning = !isRunning;
                      @@ -230,7 +223,6 @@ In this example, we trigger the following actions:
                       
                       

                      You can also combine both listeners into one, the engine will send the appropriate events to each method (onAction or onAnalog). For example: -

                        private MyCombinedListener combinedListener = new MyCombinedListener();
                        
                      @@ -265,17 +257,15 @@ inputManager.addListener(combinedListener, new String[]{"P
                       
                       

                      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?

                      + +

                      Analog, Pressed, or Released?

                      - -Technically, every input can be either an "analog" or a "digital" action. Here is how you find out which listener is the right one for which type of input. +Technically, every input can be either an “analog” or a “digital” action. Here is how you find out which listener is the right one for which type of input.

                      @@ -293,7 +283,6 @@ Mappings registered to the AnalogListener are triggered repeate

                      - In order to see the total time that a key has been pressed for then the incoming value can be accumulated. The analogue listener may also need to be combined with an action listener so that you are notified when the key is released.

                        @@ -302,7 +291,7 @@ In order to see the total time that a key has been pressed for then the incoming

                      -Mappings registered to the ActionListener are digital either-or actions ??? "Pressed or released? On or off?" +Mappings registered to the ActionListener are digital either-or actions – “Pressed or released? On or off?”

                      • Parameters:
                        @@ -318,27 +307,26 @@ Mappings registered to the ActionListener are digital either-or

                      - -Tip: It's very common that you want an action to be only triggered once, in the moment when the key is released. For instance when opening a door, flipping a boolean state, or picking up an item. To achieve that, you use an ActionListener and test for ??? && !keyPressed. For an example, look at the Pause button code: +Tip: It's very common that you want an action to be only triggered once, in the moment when the key is released. For instance when opening a door, flipping a boolean state, or picking up an item. To achieve that, you use an ActionListener and test for … && !keyPressed. For an example, look at the Pause button code:

                            if (name.equals("Pause") && !keyPressed) {
                               isRunning = !isRunning;
                             }
                      - -

                      Table of Triggers

                      + +

                      Table of Triggers

                      - You can find the list of input constants in the files src/core/com/jme3/input/KeyInput.java, JoyInput.java, and MouseInput.java. Here is an overview of the most common triggers constants: -

                      + + @@ -362,19 +350,24 @@ You can find the list of input constants in the files src/core/com/jme3/in KeyTrigger(KeyInput.KEY_LEFT), KeyTrigger(KeyInput.KEY_RIGHT)
                      Trigger Code
                      Mouse button: Left Click MouseButtonTrigger(MouseInput.BUTTON_LEFT)
                      - +

                      - 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

                      + +

                      Exercises

                      1. Add mappings for moving the player (box) up and down with the H and L keys!
                      2. +
                      3. Switch off the flyCam and override the WASD keys.
                        + +
                      4. Modify the mappings so that you can also trigger the up an down motion with the mouse scroll wheel!
                        • Tip: Use new MouseAxisTrigger(MouseInput.AXIS_WHEEL, true)
                          @@ -389,35 +382,28 @@ inputManager.addMapping("Pause", new KeyTrigger(usersPauseKey

                      -

                      Link to user-proposed solutions: Be sure to try to solve them for yourself first!

                      -

                      - -

                      Conclusion

                      + +

                      Conclusion

                      - -You are now able to add custom interactions to your game: You know that you first have to define the key mappings, and then the actions for each mapping. You have learned to respond to mouse events and to the keyboard. You understand the difference between "analog" (gradually repeated) and "digital" (on/off) inputs. +You are now able to add custom interactions to your game: You know that you first have to define the key mappings, and then the actions for each mapping. You have learned to respond to mouse events and to the keyboard. You understand the difference between “analog” (gradually repeated) and “digital” (on/off) inputs.

                      Now you can already write a little interactive game! But wouldn't it be cooler if these old boxes were a bit more fancy? Let's continue with learning about materials.

                      - + +

                      +tag_input_intro_beginner_documentation_keyinput_click +

                      - -

                      view online version

                      \ No newline at end of file + +

                      view online version

                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_main_event_loop.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_main_event_loop.html index 782b4d97e..5b0e539f7 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_main_event_loop.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_main_event_loop.html @@ -1,9 +1,8 @@ -

                      jMonkeyEngine 3 Tutorial (4) - Hello Update Loop

                      +

                      jMonkeyEngine 3 Tutorial (4) - Hello Update Loop

                      - Previous: Hello Assets, Next: Hello Input System

                      @@ -14,7 +13,7 @@ Now that you know how to load assets, such as 3D models, you want to implement s
                      -

                      Code Sample

                      +

                      Code Sample

                      package jme3test.helloworld;
                        
                      @@ -39,7 +38,7 @@ public class HelloLoop extends SimpleApplication {
                           @Override
                           public void simpleInitApp() {
                               /** this blue box is our player character */
                      -        Box b = new Box(1, 1, 1);
                      +        Box(1, 1, 1);
                               player = new Geometry("blue cube", b);
                               Material mat = new Material(assetManager,
                                 "Common/MatDefs/Misc/Unshaded.j3md");
                      @@ -58,26 +57,24 @@ public class HelloLoop extends SimpleApplication {
                       
                       

                      Build and run the file: You see a constantly rotating cube. -

                      -

                      Understanding the Code

                      +

                      Understanding the Code

                      - Compared to our previous code samples you note that the player Geometry is now a class field. This is because we want the update loop to be able to access and transform this Geometry. As usual, we initialize the player object in the simpleInitApp() method.

                      -Now have a closer look at the simpleUpdate() method ??? this is the update loop. +Now have a closer look at the simpleUpdate() method – this is the update loop.

                      • The player.rotate(0, 2*tpf, 0); line changes the rotation of the player object.
                      • -
                      • We use the tpf variable ("time per frame") to time this action depending on the current frames per second rate. This simply means that the cube rotates with the same speed on fast and slow machines, and the game remains playable.
                        +
                      • We use the tpf variable (“time per frame”) to time this action depending on the current frames per second rate. This simply means that the cube rotates with the same speed on fast and slow machines, and the game remains playable.
                      • When the game runs, the rotate() code is executed again and again.
                      • @@ -85,13 +82,11 @@ Now have a closer look at the simpleUpdate() method ??? this is the
                      -

                      Using the Update Loop

                      +

                      Using the Update Loop

                      - A rotating object is just a simple example. In the update loop, you typically have many tests and trigger various game actions. This is where you update score and health points, check for collisions, make enemies calculate their next move, roll the dice whether a trap has been set off, play random ambient sounds, and much more. -

                      • The simpleUpdate() method starts running after the simpleInitApp() method has initialized the scene graph and state variables.
                        @@ -110,11 +105,10 @@ A rotating object is just a simple example. In the update loop, you typically ha
                      -

                      Init - Update - Render

                      +

                      Init - Update - Render

                      - Note the the three phases of every game:

                        @@ -127,20 +121,18 @@ Note the the three phases of every game:

                      - Since rendering is automatic, initialization and updating are the two most important concepts in a SimpleApplication-based game for you:

                        -
                      • The simpleInitApp() method is the application's "first breath".
                        +
                      • The simpleInitApp() method is the application's “first breath”.
                        Here you load and create game data (once).
                      • -
                      • The simpleUpdate() method is the application's "heartbeat" (the time unit is called ticks).
                        +
                      • The simpleUpdate() method is the application's “heartbeat” (the time unit is called ticks).
                        Here you change their properties to update the game state (repeatedly).

                      -

                      Everything in a game happens either during initialization, or during the update loop. This means that these two methods grow very long over time. Follwo these two strategies to spread out init and update code over several modular Java classes:

                        @@ -158,11 +150,10 @@ Keep this in mind for later when your application grows.
                      -

                      Exercises

                      +

                      Exercises

                      - Here are some fun things to try:

                        @@ -179,7 +170,6 @@ Here are some fun things to try:

                      - Look back at the Hello Node tutorial if you do not remember the transformation methods for scaling, translating, and rotating.

                      @@ -187,17 +177,15 @@ Look back at the Hell

                      Link to user-proposed solutions: Be sure to try to solve them for yourself first!

                      -

                      -

                      Conclusion

                      +

                      Conclusion

                      - -Now you are listening to the update loop, "the heart beat" of the game, and you can add all kinds of action to it. +Now you are listening to the update loop, “the heart beat” of the game, and you can add all kinds of action to it.

                      @@ -212,16 +200,11 @@ See also:

                    5. Advanced jME3 developers use Application States and Custom Controls to implement game mechanics in their update loops. You will come across these topics again later when you proceed to more advanced documentation.
                    6. - + +

                      +tag_documentation_state_states_intro_beginner_control_loop +

                      -

                      view online version

                      \ No newline at end of file +

                      view online version

                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_material.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_material.html index 628a9fb06..6bdbc8cb6 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_material.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_material.html @@ -1,9 +1,8 @@ -

                      jMonkeyEngine 3 Tutorial (6) - Hello Materials

                      +

                      jMonkeyEngine 3 Tutorial (6) - Hello Materials

                      - Previous: Hello Input System, Next: Hello Animation

                      @@ -14,14 +13,13 @@ The term Material includes everything that influences what the surface of a 3D m

                      - -

                      To use the example assets in a new jMonkeyEngine SDK project, right-click your project, select "Properties", go to "Libraries", press "Add Library" and add the "jme3-test-data" library. +

                      To use the example assets in a new jMonkeyEngine SDK project, right-click your project, select “Properties”, go to “Libraries”, press “Add Library” and add the “jme3-test-data” library.

                      -

                      Sample Code

                      +

                      Sample Code

                      package jme3test.helloworld;
                        
                      @@ -51,7 +49,7 @@ public class HelloMaterial extends SimpleApplication {
                         public void simpleInitApp() {
                        
                           /** A simple textured cube -- in good MIP map quality. */
                      -    Box cube1Mesh = new Box( 1f,1f,1f);
                      +    Box( 1f,1f,1f);
                           Geometry cube1Geo = new Geometry("My Textured Box", cube1Mesh);
                           cube1Geo.setLocalTranslation(new Vector3f(-3f,1.1f,0f));
                           Material cube1Mat = new Material(assetManager, 
                      @@ -63,7 +61,7 @@ public class HelloMaterial extends SimpleApplication {
                           rootNode.attachChild(cube1Geo);
                        
                           /** A translucent/transparent texture, similar to a window frame. */
                      -    Box cube2Mesh = new Box( 1f,1f,0.01f);
                      +    Box( 1f,1f,0.01f);
                           Geometry cube2Geo = new Geometry("window frame", cube2Mesh);
                           Material cube2Mat = new Material(assetManager, 
                               "Common/MatDefs/Misc/Unshaded.j3md");
                      @@ -107,9 +105,9 @@ public class HelloMaterial extends SimpleApplication {
                       You should see
                       

                        -
                      • Left ??? A cube with a brown monkey texture.
                        +
                      • Left – A cube with a brown monkey texture.
                      • -
                      • Right ??? A translucent monkey picture in front of a shiny bumpy rock.
                        +
                      • Right – A translucent monkey picture in front of a shiny bumpy rock.
                      @@ -119,15 +117,14 @@ Move around with the WASD keys to have a closer look at the translucency, and th
                      -

                      Simple Unshaded Texture

                      +

                      Simple Unshaded Texture

                      - -Typically you want to give objects in your scene textures: It can be rock, grass, brick, wood, water, metal, paper??? A texture is a normal image file in JPG or PNG format. In this example, you create a box with a simple unshaded Monkey texture as material. +Typically you want to give objects in your scene textures: It can be rock, grass, brick, wood, water, metal, paper… A texture is a normal image file in JPG or PNG format. In this example, you create a box with a simple unshaded Monkey texture as material.

                          /** A simple textured cube -- in good MIP map quality. */
                      -    Box cube1Mesh = new Box( 1f,1f,1f);
                      +    Box( 1f,1f,1f);
                           Geometry cube1Geo = new Geometry("My Textured Box", cube1Mesh);
                           cube1Geo.setLocalTranslation(new Vector3f(-3f,1.1f,0f));
                           Material cube1Mat = new Material(assetManager, 
                      @@ -156,11 +153,10 @@ Here is what we did: to create a textured box:
                       
                       
                      -

                      Transparent Unshaded Texture

                      +

                      Transparent Unshaded Texture

                      - Monkey.png is the same texture as Monkey.jpg, but with an added alpha channel. The alpha channel allows you to specify which areas of the texture you want to be opaque or transparent: Black areas of the alpha channel remain opaque, gray areas become translucent, and white areas become transparent.

                      @@ -177,7 +173,7 @@ This bucket ensures that the transparent object is drawn on top of objects behin
                          /** A translucent/transparent texture, similar to a window frame. */
                      -    Box cube2Mesh = new Box( 1f,1f,0.01f);
                      +    Box( 1f,1f,0.01f);
                           Geometry cube2Geo = new Geometry("window frame", cube2Mesh);
                           Material cube2Mat = new Material(assetManager, 
                           "Common/MatDefs/Misc/Unshaded.j3md");
                      @@ -200,7 +196,7 @@ What you did for the transparent texture is the same as before, with only one ad
                       
                       
                    7. Create a Material cube2Mat based on jME3's default Unshaded.j3md material definition.
                    8. -
                    9. Create a texture cube2Tex from the Monkey.png file in the assets/Textures/ColoredTex/ directory of the project. This PNG file must have an alpha layer.
                      +
                    10. Create a texture cube2Tex from the Monkey.png file in the assets/Textures/ColoredTex/ directory of the project. This PNG file must have an alpha layer.
                    11. Activate transparency in the material by setting the blend mode to Alpha.
                    12. @@ -213,18 +209,16 @@ What you did for the transparent texture is the same as before, with only one ad

                    - -Tip: Learn more about creating PNG images with an alpha layer in the help system of your graphic editor. +Tip: Learn more about creating PNG images with an alpha layer in the help system of your graphic editor.

                    -

                    Shininess and Bumpiness

                    +

                    Shininess and Bumpiness

                    - -But textures are not all. Have a close look at the shiny sphere ??? you cannot get such a nice bumpy material with just a plain texture. You see that JME3 also supports so-called Phong-illuminated materials: +But textures are not all. Have a close look at the shiny sphere – you cannot get such a nice bumpy material with just a plain texture. You see that JME3 also supports so-called Phong-illuminated materials:

                    @@ -252,11 +246,11 @@ Let's have a look at the part of the code example where you create the shin

                    1. Set a standard rocky texture in the DiffuseMap layer.
                      -
                          sphereMat.setTexture("DiffuseMap", 
                      +
                          sphereMat.setTexture("DiffuseMap", 
                               assetManager.loadTexture("Textures/Terrain/Pond/Pond.jpg"));
                    2. -
                    3. Set the NormalMap layer that contains the bumpiness. The NormalMap was generated for this particular DiffuseMap with a special tool (e.g. Blender).
                          sphereMat.setTexture("NormalMap", 
                      +
                    4. Set the NormalMap layer that contains the bumpiness. The NormalMap was generated for this particular DiffuseMap with a special tool (e.g. Blender).
                          sphereMat.setTexture("NormalMap", 
                               assetManager.loadTexture("Textures/Terrain/Pond/Pond_normal.png"));
                    5. @@ -279,7 +273,6 @@ Let's have a look at the part of the code example where you create the shin

                    - Remember that any Lighting.j3md-based material requires a light source, as shown in the full code sample above.

                    @@ -289,18 +282,18 @@ Remember that any Lighting.j3md-based material requires a light source, as shown -

                    Default Material Definitions

                    +

                    Default Material Definitions

                    - -As you have seen, you can find the following default materials in jme/core-data/Common/???. - +As you have seen, you can find the following default materials in jme/core-data/Common/….

                    + +
                    Default Definition Usage Parameters
                    Common/MatDefs/Misc/Unshaded.j3md Colored: Use with mat.setColor() and ColorRGBA.
                    Textured: Use with mat.setTexture() and Texture.
                    Color : Color
                    @@ -315,22 +308,20 @@ Shininess : Float

                    - -For a game, you create custom Materials based on these existing MaterialDefintions ??? as you have just seen in the example with the shiny rock's material. +For a game, you create custom Materials based on these existing MaterialDefintions – as you have just seen in the example with the shiny rock's material.

                    -

                    Exercises

                    +

                    Exercises

                    -

                    Exercise 1: Custom .j3m Material

                    +

                    Exercise 1: Custom .j3m Material

                    - Look at the shiny rocky sphere above again. It takes several lines to create and set the Material.

                      @@ -345,7 +336,6 @@ Look at the shiny rocky sphere above again. It takes several lines to create and

                    - If you want to use one custom material for several models, you can store it in a .j3m file, and save a few lines of code every time.

                    @@ -384,17 +374,15 @@ You create a j3m file as follows:

                  - Using this new custom material MyCustomMaterial.j3m only takes one line. You have replaced the eight lines of an on-the-fly material definition with one line that loads a custom material from a file. Using .j3m files is very handy if you use the same material often.

                  -

                  Exercise 2: Bumpiness and Shininess

                  +

                  Exercise 2: Bumpiness and Shininess

                  - Go back to the bumpy rock sample above:

                    @@ -420,11 +408,10 @@ Go back to the bumpy rock sample above:
                  -

                  Conclusion

                  +

                  Conclusion

                  - You have learned how to create a Material, specify its properties, and use it on a Geometry. You know how to load an image file (.png, .jpg) as texture into a material. You know to save texture files in a subfolder of your project's assets/Textures/ directory.

                  @@ -434,7 +421,6 @@ You have also learned that a material can be stored in a .j3m file. The file ref

                  Now that you know how to load models and how to assign good-looking materials to them, let's have a look at how to animate models in the next chapter, Hello Animation. -


                  @@ -448,7 +434,7 @@ See also
                31. forum thread
                32. -
                33. (PDF)
                  +
                34. (PDF)
                35. @@ -457,17 +443,11 @@ See also
                36. (Not done with JME3, this is just to show the fantastic range of Material parameters in the hands of an expert, until we have a JME3 demo for it.)
                37. - + +

                  +tag_documentation_beginner_intro_model_material_color_texture_transparency +

                  -

                  view online version

                  \ No newline at end of file +

                  view online version

                  \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_node.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_node.html index 1f8dd4dc3..202e4b9d9 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_node.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_node.html @@ -1,9 +1,8 @@ -

                  jMonkeyEngine 3 Tutorial (2) - Hello Node

                  +

                  jMonkeyEngine 3 Tutorial (2) - Hello Node

                  - Previous: Hello SimpleApplication, Next: Hello Assets.

                  @@ -19,7 +18,6 @@ In this tutorial we will have a look at the creation of a 3D scene.

                  - When creating a 3D game

                    @@ -32,13 +30,12 @@ When creating a 3D game

                  - -You will learn that the scene graph represents the 3D world, and why the rootNode is important. You will learn how to create simple objects, how to let them carry custom data (such as health points), and how to "transform" them by moving, scaling, and rotating. You will understand the difference between the two types of "Spatials" in the scene graph: Nodes and Geometries. +You will learn that the scene graph represents the 3D world, and why the rootNode is important. You will learn how to create simple objects, how to let them carry custom data (such as health points), and how to “transform” them by moving, scaling, and rotating. You will understand the difference between the two types of “Spatials” in the scene graph: Nodes and Geometries.

                  -

                  Code Sample

                  +

                  Code Sample

                  package jme3test.helloworld;
                    
                  @@ -64,7 +61,7 @@ public class HelloNode extends SimpleApplication {
                       public void simpleInitApp() {
                    
                           /** create a blue box at coordinates (1,-1,1) */
                  -        Box box1 = new Box(1,1,1);
                  +        Box(1,1,1);
                           Geometry blue = new Geometry("Box", box1);
                           blue.setLocalTranslation(new Vector3f(1,-1,1));
                           Material mat1 = new Material(assetManager, 
                  @@ -73,7 +70,7 @@ public class HelloNode extends SimpleApplication {
                           blue.setMaterial(mat1);
                    
                           /** create a red box straight above the blue one at (1,3,1) */
                  -        Box box2 = new Box(1,1,1);      
                  +        Box(1,1,1);      
                           Geometry red = new Geometry("Box", box2);
                           red.setLocalTranslation(new Vector3f(1,3,1));
                           Material mat2 = new Material(assetManager, 
                  @@ -99,18 +96,18 @@ Build and run the code sample. You should see two colored boxes tilted at the sa
                   
                   
                  -

                  Understanding the Terminology

                  +

                  Understanding the Terminology

                  - In this tutorial, you learn some new terms: -

                  + + @@ -129,7 +126,6 @@ In this tutorial, you learn some new terms:
                  What you want to doHow you say it in JME3 terminology
                  Lay out the 3D scenePopulate the scene graph

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

                    @@ -141,29 +137,29 @@ Every JME3 application has a rootNode: Your game automatically inherits the
                  + + - + - +
                  Geometry Node
                  Visibility: A Geometry is a visible scene object. A Node is an invisible "handle" for scene objects. Visibility: A Geometry is a visible scene object. A Node is an invisible “handle” for scene objects.
                  Purpose: A Geometry stores an object's looks. A Node groups Geometries and other Nodes together.
                  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??? 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

                  +

                  Understanding the Code

                  - What happens in the code snippet? You use the simpleInitApp() method that was introduced in the first tutorial to initialize the scene. -

                  1. You create the first box Geometry.
                    @@ -176,7 +172,7 @@ What happens in the code snippet? You use the simpleInitApp() metho
                  2. Create a blue material.
                  3. -
                  4. Apply the blue material to the Box Geometry.
                        Box box1 = new Box(1,1,1);
                    +
                  5. Apply the blue material to the Box Geometry.
                        Box(1,1,1);
                         Geometry blue = new Geometry("Box", box1);
                         blue.setLocalTranslation(new Vector3f(1,-1,1));
                         Material mat1 = new Material(assetManager,"Common/MatDefs/Misc/Unshaded.j3md");
                    @@ -196,7 +192,7 @@ What happens in the code snippet? You use the simpleInitApp() metho
                     
                  6. Create a red material.
                  7. -
                  8. Apply the red material to the Box Geometry.
                        Box box2 = new Box(1,1,1);
                    +
                  9. Apply the red material to the Box Geometry.
                        Box(1,1,1);
                         Geometry red = new Geometry("Box", box2);
                         red.setLocalTranslation(new Vector3f(1,3,1));
                         Material mat2 = new Material(assetManager,
                    @@ -209,7 +205,7 @@ What happens in the code snippet? You use the simpleInitApp() metho
                     
                  10. You create a pivot Node.
                      -
                    • Name the Node "pivot".
                      +
                    • Name the Node “pivot”.
                    • By default the Node is positioned at (0,0,0).
                    • @@ -236,7 +232,7 @@ If you run the app with only the code up to here, you see two cubes: A red cube
                    • Rotate the pivot node.
                              pivot.rotate( 0.4f , 0.4f , 0.0f );

                      - If you run the app now, you see two boxes on top of each other ??? both tilted at the same angle. + If you run the app now, you see two boxes on top of each other – both tilted at the same angle.

                    • @@ -244,13 +240,11 @@ If you run the app with only the code up to here, you see two cubes: A red cube
                  11. -

                    What is a Pivot Node?

                    +

                    What is a Pivot Node?

                    - You can transform (e.g. rotate) Geometries around their own center, or around a user defined center point. A user defined center point for one or more Geometries is called a pivot. -

                    • In this example, you have grouped two Geometries by attaching them to one pivot Node. You use the pivot Node as a handle to rotate the two Geometries together around one common center. Rotating the pivot Node rotates all attached Geometries, in one step. The pivot node is the center of the rotation. Before attaching the other Geometries, make certain that the pivot node is at (0,0,0). Transforming a parent Node to transform all attached child Spatials is a common task. You will use this method a lot in your games when you move Spatials around.
                      @@ -263,14 +257,16 @@ You can transform (e.g. rotate) Geometries around their own center, or around a
                      -

                      How do I Populate the Scenegraph?

                      +

                      How do I Populate the Scenegraph?

                      + - + + -
                      Task???? Solution! Task…? Solution!
                      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
                      +		
                      Create a Spatial Create a Mesh shape, wrap it into a Geometry, and give it a Material. For example:
                      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");
                      @@ -299,18 +295,18 @@ thing.setMaterial(mat);
                      -

                      How do I Transform Spatials?

                      +

                      How do I Transform Spatials?

                      - There are three types of 3D transformation: Translation, Scaling, and Rotation. -

                      + +
                      Translation moves Spatials X-axis Y-axis Z-axis
                      Specify the new location in three dimensions: How far away is it from the origin going right-up-forward?
                      To move a Spatial to specific coordinates, such as (0,40.2f,-2), use:
                      thing.setLocalTranslation( new Vector3f( 0.0f, 40.2f, -2.0f ) );
                      @@ -323,9 +319,11 @@ To move a Spatial to specific coordinates, such as (0,40.2f,-2), use: <
                      + +
                      Scaling resizes Spatials X-axis Y-axis Z-axis
                      Specify the scaling factor in each dimension: length, height, width.
                      A value between 0.0f and 1.0f shrinks the Spatial; bigger than 1.0f stretches it; 1.0f keeps it the same.
                      @@ -335,12 +333,14 @@ To scale a Spatial 10 times longer, one tenth the height, and keep the same widt
                      + +
                      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.
                      -To roll an object 180?? around the z axis:
                      thing.rotate( 0f , 0f , 180*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. @@ -353,18 +353,18 @@ To roll an object 180?? around the z axis:

                      thing.rotate( 0f , 0f , 180*
                       
                       
                       
                      -

                      How do I Troubleshoot Spatials?

                      +

                      How do I Troubleshoot Spatials?

                      - If you get unexpected results, check whether you made the following common mistakes: -

                      + + -

                      How do I Add Custom Data to Spatials?

                      +

                      How do I Add Custom Data to Spatials?

                      - Many Spatials represent game characters or other entities that the player can interact with. The above code that rotates the two boxes around a common center (pivot) could be used for a spacecraft docked to a orbiting space station, for example.

                      @@ -400,48 +399,35 @@ Depending on your game, game entities do not only change their position, rotatio

                      You can add custom data directly to any Node or Geometry. You do not need to extend the Node class to include variables! For example, to add a custom id number to a node, you would use: -

                      pivot.setUserData( "pivot id", 42 );

                      - To read this Node's id number elsewhere, you would use: -

                      int id = pivot.getUserData( "pivot id" ); 

                      - By using different Strings keys (here the key is pivot id), you can get and set several values for whatever data the Spatial needs to carry. When you start writing your game, you might add a fuel value to a car node, speed value to an airplane node, or number of gold coins to a player node, and much more. However, one should note that only custom objects that implements Savable can be passed.

                      -

                      Conclusion

                      +

                      Conclusion

                      - You have learned that your 3D scene is a scene graph made up of Spatials: Visible Geometries and invisible Nodes. You can transform Spatials, or attach them to nodes and transform the nodes. You know the easiest way how to add custom entity properties (such as player health or vehicle speed) to Spatials.

                      Since standard shapes like spheres and boxes get old fast, continue with the next chapter where you learn to load assets such as 3-D models.

                      - + +

                      +tag_beginner_rootnode_node_intro_documentation_color_spatial_geometry_scenegraph_mesh +

                      -

                      view online version

                      \ No newline at end of file +

                      view online version

                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_physics.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_physics.html index d52e8af40..317ad1ddf 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_physics.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_physics.html @@ -1,5 +1,5 @@ -

                      jMonkeyEngine 3 Tutorial (13) - Hello Physics

                      +

                      jMonkeyEngine 3 Tutorial (13) - Hello Physics

                      -

                      Sample Code

                      +

                      Sample Code

                      Thanks to double1984 for contributing this fun sample! -

                      package jme3test.helloworld;
                        
                      @@ -141,7 +139,7 @@ public class HelloPhysics extends SimpleApplication {
                          * Every time the shoot action is triggered, a new cannon ball is produced.
                          * The ball is set up to fly from the camera position in the camera direction.
                          */
                      -  private ActionListener actionListener = new ActionListener() {
                      +  private ActionListener() {
                           public void onAction(String name, boolean keyPressed, float tpf) {
                             if (name.equals("shoot") && !keyPressed) {
                               makeCannonBall();
                      @@ -252,12 +250,11 @@ You should see a brick wall. Click to shoot cannon balls. Watch the bricks fall
                       
                       
                      -

                      A Basic Physics Application

                      +

                      A Basic Physics Application

                      - -In the previous tutorials, you used static Geometries (boxes, spheres, and models) that you placed in the scene. Depending on their translation, Geometries can "float in mid-air" and even overlap ??? they are not affected by "gravity" and have no physical mass. This tutorial shows how to add physical properties to Geometries. +In the previous tutorials, you used static Geometries (boxes, spheres, and models) that you placed in the scene. Depending on their translation, Geometries can “float in mid-air” and even overlap – they are not affected by “gravity” and have no physical mass. This tutorial shows how to add physical properties to Geometries.

                      @@ -280,17 +277,16 @@ The BulletAppState gives the game access to a PhysicsSpace. The PhysicsSpace let

                      -

                      Creating Bricks and Cannon Balls

                      +

                      Creating Bricks and Cannon Balls

                      -

                      Geometries

                      +

                      Geometries

                      - -In this "shoot at the wall" example, you use Geometries such as cannon balls and bricks. Geometries contain meshes, such as Shapes. Let's create and initialize some Shapes: Boxes and Spheres. +In this “shoot at the wall” example, you use Geometries such as cannon balls and bricks. Geometries contain meshes, such as Shapes. Let's create and initialize some Shapes: Boxes and Spheres.

                        /** Prepare geometries and physical nodes for bricks and cannon balls. */
                         private static final Box    box;
                      @@ -314,11 +310,10 @@ In this "shoot at the wall" example, you use Geometries such as cannon
                       
                       
                      -

                      RigidBodyControl: Brick

                      +

                      RigidBodyControl: Brick

                      - We want to create brick Geometries from those boxes. For each Geometry with physical properties, you create a RigidBodyControl.

                        private RigidBodyControl brick_phy;
                      @@ -376,11 +371,10 @@ This code sample does the following:
                      -

                      RigidBodyControl: Cannonball

                      +

                      RigidBodyControl: Cannonball

                      - You notice that the cannon ball is created in the same way, using the custom makeCannonBall() method. The cannon ball has the following properties:

                        @@ -433,17 +427,15 @@ This code sample does the following:

                        - Since you are shooting cannon balls, the last line accelerates the ball in the direction the camera is looking, with a speed of 25f.

                      -

                      RigidBodyControl: Floor

                      +

                      RigidBodyControl: Floor

                      - The (static) floor has one important difference compared to the (dynamic) bricks and cannonballs: Static objects have a mass of zero. As before, you write a custom initFloor() method that creates a flat box with a rock texture that you use as floor. The floor has the following properties:

                      @@ -482,7 +474,7 @@ This code sample does the following:
                    • You create a RigidBodyControl floor_phy for floor_geo.
                        -
                      • floor_phy has a mass of 0f :!:
                        +
                      • floor_phy has a mass of 0f :!:
                      • You add floor_phy to floor_geo.
                      • @@ -494,36 +486,33 @@ This code sample does the following:
                    • -

                      Creating the Scene

                      +

                      Creating the Scene

                      - Let's have a quick look at the custom helper methods:

                        -
                      • initMaterial() ??? This method initializes all the materials we use in this demo.
                        +
                      • initMaterial() – This method initializes all the materials we use in this demo.
                      • -
                      • initWall() ??? A double loop that generates a wall by positioning brick objects: 15 rows high with 6 bricks per row. It's important to space the physical bricks so they do not overlap.
                        +
                      • initWall() – A double loop that generates a wall by positioning brick objects: 15 rows high with 6 bricks per row. It's important to space the physical bricks so they do not overlap.
                      • -
                      • initCrossHairs() ??? This method simply displays a plus sign that you use as crosshairs for aiming. Note that screen elements such as crosshairs are attached to the guiNode, not the rootNode!
                        +
                      • initCrossHairs() – This method simply displays a plus sign that you use as crosshairs for aiming. Note that screen elements such as crosshairs are attached to the guiNode, not the rootNode!
                      • -
                      • initInputs() ??? This method sets up the click-to-shoot action.
                        +
                      • initInputs() – This method sets up the click-to-shoot action.

                      - These methods are each called once from the simpleInitApp() method at the start of the game. As you see, you can write any number of custom methods to set up your game's scene.

                      -

                      The Cannon Ball Shooting Action

                      +

                      The Cannon Ball Shooting Action

                      - In the initInputs() method, you add an input mapping that triggers a shoot action when the left mouse button is pressed.

                        private void initInputs() {
                      @@ -535,7 +524,7 @@ In the initInputs() method, you add an input mapping that triggers
                       

                      You define the actual action of shooting a new cannon ball as follows:

                      -
                          private ActionListener actionListener = new ActionListener() {
                      +
                          private ActionListener() {
                               public void onAction(String name, boolean keyPressed, float tpf) {
                                   if (name.equals("shoot") && !keyPressed) {
                                       makeCannonBall();
                      @@ -549,105 +538,92 @@ In the moment the cannonball appears in the scene, it flies off with the velocit
                       
                       
                      -

                      Moving a Physical Spatial

                      +

                      Moving a Physical Spatial

                      - -The location of the dynamic Spatial is controlled by its RigidBodyControl. Move the RigidBodyControl to move the Spatial. If it's a dynamic PhysicsControl, you can use setLinearVelocity() and apply forces and torques to it. Other RigidBodyControl'led objects can push the dynamic Spatial around (like pool billard balls). +The location of the dynamic Spatial is controlled by its RigidBodyControl. Move the RigidBodyControl to move the Spatial. If it's a dynamic PhysicsControl, you can use setLinearVelocity() and apply forces and torques to it. Other RigidBodyControl'led objects can push the dynamic Spatial around (like pool/billiard balls).

                      You can make Spatials that are not dynamic: Switch the RigidBodyControl to setKinematic(true) to have it move along with its Spatial.

                        -
                      • A kinematic is unaffected by the forces nor gravity, that means it can float in mid-air and cannot be pushed away by dynamic "cannon balls" etc.
                        +
                      • A kinematic is unaffected by forces or gravity, which means it can float in mid-air and cannot be pushed away by dynamic “cannon balls” etc.
                      • A kinematic RigidBody has a mass.
                      • -
                      • A kinematic can be moved and can exert forces on dynamic RigidBodys. This means you can use a kinematic node like a billard queue or a remote-controlled battering ram.
                        +
                      • A kinematic can be moved and can exert forces on dynamic RigidBodys. This means you can use a kinematic node as a billiard cue or a remote-controlled battering ram.

                      - Learn more about static versus kinematic versus dynamic in the advanced physics doc.

                      - -

                      Excercises

                      + +

                      Excercises

                      - -

                      Exercise 1: Debug Shapes

                      + +

                      Exercise 1: Debug Shapes

                      - Add the following line after the bulletAppState initialization. -

                      bulletAppState.getPhysicsSpace().enableDebug(assetManager);

                      - Now you see the collisionShapes of the bricks and spheres, and the floor highlighted.

                      - -

                      Exercise 2: No Mo' Static

                      + +

                      Exercise 2: No Mo' Static

                      - What happens if you give a static node, such as the floor, a mass of more than 0.0f?

                      - -

                      Exercise 3: Behind the Curtain

                      + +

                      Exercise 3: Behind the Curtain

                      - Fill your scene with walls, bricks, and cannon balls. When do you begin to see a performance impact?

                      -Popular AAA games use a clever mix of physics, animation and prerendered graphics to give you the illusion of a real, "physical" world. Think of your favorite video games and try to spot where and how the game designers trick you into believing that the whole scene is physical. For example, think of a building "breaking" into 4-8 parts after an explosion. The pieces most likely fly on predefined (so called kinematic) paths and are only replaced by dynamic Spatials after they touch the ground??? Now that you start to implement game physics yourself, look behind the curtain! +Popular AAA games use a clever mix of physics, animation and prerendered graphics to give you the illusion of a real, “physical” world. Think of your favorite video games and try to spot where and how the game designers trick you into believing that the whole scene is physical. For example, think of a building “breaking” into 4-8 parts after an explosion. The pieces most likely fly on predefined (so called kinematic) paths and are only replaced by dynamic Spatials after they touch the ground… Now that you start to implement game physics yourself, look behind the curtain!

                      -Using physics everywhere in a game sounds like a cool idea, but it is easily overused. Although the physics nodes are put to "sleep" when they are not moving, creating a world solely out of dynamic physics nodes will quickly bring you to the limits of your computer's capabilities. +Using physics everywhere in a game sounds like a cool idea, but it is easily overused. Although the physics nodes are put to “sleep” when they are not moving, creating a world solely out of dynamic physics nodes will quickly bring you to the limits of your computer's capabilities.

                      - -

                      Conclusion

                      + +

                      Conclusion

                      - You have learned how to activate the jBullet PhysicsSpace in an application by adding a BulletAppState. You have created PhysicsControls for simple Shape-based Geometries (for more complex shapes, read up on CollisionShapes). You have learned that physical objects are not only attached to the rootNode, but also registered to the PhysicsSpace. You know that it makes a difference whether a physical object has a mass (dynamic) or not (static). You are aware that overusing physics has a huge performance impact.

                      -

                      Congratulations! ??? You have completed the last beginner tutorial. Now you are ready to start combining what you have learned, to create a cool 3D game of your own. Show us what you can do, and feel free to share your demos, game videos, and screenshots on the ! +

                      Congratulations! – You have completed the last beginner tutorial. Now you are ready to start combining what you have learned, to create a cool 3D game of your own. Show us what you can do, and feel free to share your demos, game videos, and screenshots on the !

                      - + +

                      +tag_beginner_intro_physics_documentation_input_model_control +

                      - -

                      view online version

                      \ No newline at end of file + +

                      view online version

                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_picking.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_picking.html index b678e91c6..fa1a614ee 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_picking.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_picking.html @@ -1,9 +1,8 @@ -

                      jMonkeyEngine 3 Tutorial (8) - Hello Picking

                      +

                      jMonkeyEngine 3 Tutorial (8) - Hello Picking

                      - Previous: Hello Animation, Next: Hello Collision

                      @@ -13,7 +12,7 @@ Typical interactions in games include shooting, picking up objects, and opening

                      -You can pick something by either pressing a key on the keyboard, or by clicking with the mouse. In either case, you identify the target by aiming a ray ???a straight line??? into the scene. This method to implement picking is called ray casting (which is not the same as ray tracing). +You can pick something by either pressing a key on the keyboard, or by clicking with the mouse. In either case, you identify the target by aiming a ray –a straight line– into the scene. This method to implement picking is called ray casting (which is not the same as ray tracing).

                      @@ -26,7 +25,7 @@ This tutorial relies on what you have learned in the -

                      Sample Code

                      +

                      Sample Code

                      package jme3test.helloworld;
                        
                      @@ -86,7 +85,7 @@ public class HelloPicking extends SimpleApplication {
                           inputManager.addListener(actionListener, "Shoot");
                         }
                         /** Defining the "Shoot" action: Determine what was hit and how to respond. */
                      -  private ActionListener actionListener = new ActionListener() {
                      +  private ActionListener() {
                        
                           public void onAction(String name, boolean keyPressed, float tpf) {
                             if (name.equals("Shoot") && !keyPressed) {
                      @@ -123,7 +122,7 @@ public class HelloPicking extends SimpleApplication {
                        
                         /** A cube object for target practice */
                         protected Geometry makeCube(String name, float x, float y, float z) {
                      -    Box box = new Box(1, 1, 1);
                      +    Box(1, 1, 1);
                           Geometry cube = new Geometry(name, box);
                           cube.setLocalTranslation(x, y, z);
                           Material mat1 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
                      @@ -134,7 +133,7 @@ public class HelloPicking extends SimpleApplication {
                        
                         /** A floor to show that the "shot" can go through several objects. */
                         protected Geometry makeFloor() {
                      -    Box box = new Box(15, .2f, 15);
                      +    Box(15, .2f, 15);
                           Geometry floor = new Geometry("the Floor", box);
                           floor.setLocalTranslation(0, -4, -5);
                           Material mat1 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
                      @@ -184,31 +183,28 @@ You should see four colored cubes floating over a gray floor, and cross-hairs. A
                       
                       

                      Keep an eye on the application's output stream, it will give you more details: The name of the mesh that was hit, the coordinates of the hit, and the distance. -

                      -

                      Understanding the Helper Methods

                      +

                      Understanding the Helper Methods

                      - The methods makeCube(), makeFloor(), initMark(), and initCrossHairs, are custom helper methods. We call them from simpleInitApp() to initialize the scenegraph with sample content. -

                        -
                      1. makeCube() creates simple colored boxes for "target practice".
                        +
                      2. makeCube() creates simple colored boxes for “target practice”.
                      3. -
                      4. makeFloor() creates a gray floor node for "target practice".
                        +
                      5. makeFloor() creates a gray floor node for “target practice”.
                      6. -
                      7. initMark() creates a red sphere ("mark"). We will use it later to mark the spot that was hit.
                        +
                      8. initMark() creates a red sphere (“mark”). We will use it later to mark the spot that was hit.
                        • Note that the mark is not attached and therefor not visible at the start!
                      9. -
                      10. initCrossHairs() creates simple cross-hairs by printing a "+" sign in the middle of the screen.
                        +
                      11. initCrossHairs() creates simple cross-hairs by printing a “+” sign in the middle of the screen.
                        • Note that the cross-hairs are attached to the guiNode, not to the rootNode.
                        • @@ -217,18 +213,16 @@ The methods makeCube(), makeFloor(), initMark()

                      - -In this example, we attached all "shootable" objects to one custom node, Shootables. This is an optimization so the engine only has to calculate intersections with objects we are actually interested in. The Shootables node is attached to the rootNode as usual. +In this example, we attached all “shootable” objects to one custom node, Shootables. This is an optimization so the engine only has to calculate intersections with objects we are actually interested in. The Shootables node is attached to the rootNode as usual.

                      -

                      Understanding Ray Casting for Hit Testing

                      +

                      Understanding Ray Casting for Hit Testing

                      - -Our goal is to determine which box the user "shot" (picked). In general, we want to determine which mesh the user has selected by aiming the cross-hairs at it. Mathematically, we draw a line from the camera and see whether it intersects with objects in the 3D scene. This line is called a ray. +Our goal is to determine which box the user “shot” (picked). In general, we want to determine which mesh the user has selected by aiming the cross-hairs at it. Mathematically, we draw a line from the camera and see whether it intersects with objects in the 3D scene. This line is called a ray.

                      @@ -255,18 +249,16 @@ Here is our simple ray casting algorithm for picking objects:

                      -

                      Implementing Hit Testing

                      +

                      Implementing Hit Testing

                      -

                      Loading the scene

                      +

                      Loading the scene

                      - First initialize some shootable nodes and attach them to the scene. You will use the mark object later. -

                        Node shootables;
                         Geometry mark;
                      @@ -288,13 +280,11 @@ First initialize some shootable nodes and attach them to the scene. You will use
                       
                       
                      -

                      Setting Up the Input Listener

                      +

                      Setting Up the Input Listener

                      - Next you declare the shooting action. It can be triggered either by clicking, or by pressing the space bar. The initKeys() method is called from simpleInitApp() to set up these input mappings. -

                        /** Declaring the "Shoot" action and its triggers. */
                         private void initKeys() {
                      @@ -306,11 +296,10 @@ Next you declare the shooting action. It can be triggered either by clicking, or
                       
                       
                      -

                      Picking Action Using Crosshairs

                      +

                      Picking Action Using Crosshairs

                      - Next we implement the ActionListener that responds to the Shoot trigger with an action. The action follows the ray casting algorithm described above:

                        @@ -327,11 +316,10 @@ Next we implement the ActionListener that responds to the Shoot trigger with an

                      - Note how it prints a lot of output to show you which hits were registered.

                        /** Defining the "Shoot" action: Determine what was hit and how to respond. */
                      -  private ActionListener actionListener = new ActionListener() {
                      +  private ActionListener() {
                           @Override
                           public void onAction(String name, boolean keyPressed, float tpf) {
                             if (name.equals("Shoot") && !keyPressed) {
                      @@ -367,18 +355,16 @@ Note how it prints a lot of output to show you which hits were registered.
                         };

                      -Tip: Notice how you use the provided method results.getClosestCollision().getContactPoint() to determine the closest hit's location. If your game includes a "weapon" or "spell" that can hit multiple targets, you could also loop over the list of results, and interact with each of them. +Tip: Notice how you use the provided method results.getClosestCollision().getContactPoint() to determine the closest hit's location. If your game includes a “weapon” or “spell” that can hit multiple targets, you could also loop over the list of results, and interact with each of them.

                      -

                      Picking Action Using Mouse Pointer

                      +

                      Picking Action Using Mouse Pointer

                      - -The above example assumes that the player is aiming crosshairs (attached to the center of the screen) at the target. But you can change the picking code to allow you to freely click at objects in the scene with a visible mouse pointer. In order to do this, and you have to convert the 2d screen coordinates of the click to 3D world coordinates to get the start point of the picking ray. - +The above example assumes that the player is aiming crosshairs (attached to the center of the screen) at the target. But you can change the picking code to allow you to freely click at objects in the scene with a visible mouse pointer. In order to do this you have to convert the 2d screen coordinates of the click to 3D world coordinates to get the start point of the picking ray.

                      1. Reset result list.
                        @@ -412,23 +398,21 @@ Note that since you now use the mouse for picking, you can no longer use it to r

                      - -

                      Exercises

                      + +

                      Exercises

                      - After a hit was registered, the closest object is identified as target, and marked with a red dot. Modify the code sample to solve these exercises:

                      - -

                      Exercise 1: Magic Spell

                      + +

                      Exercise 1: Magic Spell

                      - Change the color of the closest clicked target!
                      Here are some tips:

                      @@ -450,28 +434,26 @@ Here are some tips:
                      - -

                      Exercise 2: Shoot a Character

                      + +

                      Exercise 2: Shoot a Character

                      - -Shooting boxes isn't very exciting ??? can you add code that loads and positions a model in the scene, and shoot at it? +Shooting boxes isn't very exciting – can you add code that loads and positions a model in the scene, and shoot at it?

                        -
                      • Tip: You can use Spatial golem = assetManager.loadModel("Models/Oto/Oto.mesh.xml"); from the engine's jme3-test-data.jar.
                        +
                      • Tip: You can use Spatial golem = assetManager.loadModel(“Models/Oto/Oto.mesh.xml”); from the engine's jme3-test-data.jar.
                      • Tip: Models are shaded! You need some light!
                      - -

                      Exercise 3: Pick up into Inventory

                      + +

                      Exercise 3: Pick up into Inventory

                      - Change the code as follows to simulate the player picking up objects into the inventory: When you click once, the closest target is identified and detached from the scene. When you click a second time, the target is reattached at the location that you have clicked. Here are some tips:

                        @@ -481,9 +463,9 @@ Change the code as follows to simulate the player picking up objects into the in
                      1. You can make the inventory visible by attaching the inventory node to the guiNode (which attaches it to the HUD). Note the following caveats:
                          -
                        • If your nodes use a lit Material (not "Unshaded.j3md"), also add a light to the guiNode.
                          +
                        • If your nodes use a lit Material (not “Unshaded.j3md”), also add a light to the guiNode.
                        • -
                        • Size units are pixels in the HUD, therefor a 2-wu cube is displayed only 2 pixels wide in the HUD. ??? Scale it bigger!
                          +
                        • Size units are pixels in the HUD, therefor a 2-wu cube is displayed only 2 pixels wide in the HUD. – Scale it bigger!
                        • Position the nodes: The bottom left corner of the HUD is (0f,0f), and the top right corner is at (settings.getWidth(),settings.getHeight()).
                        • @@ -492,20 +474,17 @@ Change the code as follows to simulate the player picking up objects into the in

                      -

                      Link to user-proposed solutions: Be sure to try to solve them for yourself first!

                      -

                      - -

                      Conclusion

                      + +

                      Conclusion

                      - You have learned how to use ray casting to solve the task of determining what object a user selected on the screen. You learned that this can be used for a variety of interactions, such as shooting, opening, picking up and dropping items, pressing a button or lever, etc.

                      @@ -513,22 +492,19 @@ You have learned how to use ray casting to solve the task of determining what ob Use your imagination from here:

                        -
                      • In your game, the click can trigger any action on the identified Geometry: Detach it and put it into the inventory, attach something to it, trigger an animation or effect, open a door or crate, ??? etc.
                        +
                      • In your game, the click can trigger any action on the identified Geometry: Detach it and put it into the inventory, attach something to it, trigger an animation or effect, open a door or crate, – etc.
                      • -
                      • In your game, you could replace the red mark with a particle emitter, add an explosion effect, play a sound, calculate the new score after each hit depending on what was hit ??? etc.
                        +
                      • In your game, you could replace the red mark with a particle emitter, add an explosion effect, play a sound, calculate the new score after each hit depending on what was hit – etc.

                      - Now, wouldn't it be nice if those targets and the floor were solid objects and you could walk around between them? Let's continue to learn about Collision Detection. -


                      See also: -

                      - + +

                      +tag_beginner_documentation_intro_node_ray_click_collision_keyinput_input +

                      - -

                      view online version

                      \ No newline at end of file + +

                      view online version

                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_simpleapplication.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_simpleapplication.html index 0a0c3589f..809338bd3 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_simpleapplication.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_simpleapplication.html @@ -1,10 +1,9 @@ -

                      jMonkeyEngine 3 Tutorial (1) - Hello SimpleApplication

                      +

                      jMonkeyEngine 3 Tutorial (1) - Hello SimpleApplication

                      - -Previous: Installing JME3, +Previous: Installing JME3, Next: Hello Node

                      @@ -22,19 +21,18 @@ OK, let's get ready to create our first jMonkeyEngine3 application.
                      -

                      Create a Project

                      +

                      Create a Project

                      - -In the jMonkeyEngine SDK: +In the jMonkeyEngine SDK:

                        -
                      1. Choose File???New Project??? from the main menu.
                        +
                      2. Choose File→New Project… from the main menu.
                      3. -
                      4. In the New Project wizard, select the template JME3???Basic Game. Click Next.
                        +
                      5. In the New Project wizard, select the template JME3→Basic Game. Click Next.
                          -
                        1. Specify a project name, e.g. "HelloWorldTutorial"
                          +
                        2. Specify a project name, e.g. “HelloWorldTutorial”
                        3. Specify a path where to store your new project, e.g. a jMonkeyProjects directory in your home directory.
                        4. @@ -45,32 +43,30 @@ In the jMonkeyEngine SDK:

                        - If you have questions, read more about Project Creation here.

                        -

                        We recommend to go through the steps yourself, as described in the tutorials. Alternatively, you can create a project based on the JmeTests template in the jMonkeyEngine SDK. It will create a project that already contains the jme3test.helloworld samples (and many others). For example, you can use the JmeTests project to verify whether you got the solution right. +

                        We recommend to go through the steps yourself, as described in the tutorials. Alternatively, you can create a project based on the JmeTests template in the jMonkeyEngine SDK. It will create a project that already contains the jme3test.helloworld samples (and many others). For example, you can use the JmeTests project to verify whether you got the solution right.

                        -

                        Extend SimpleApplication

                        +

                        Extend SimpleApplication

                        - For this tutorial, you want to create a jme3test.helloworld package in your project, and create a file HelloJME3.java in it.

                        -In the jMonkeyEngine SDK: +In the jMonkeyEngine SDK:

                        1. Right-click the Source Packages node of your project.
                        2. -
                        3. Choose New??????Java Class to create a new file.
                          +
                        4. Choose New…→Java Class to create a new file.
                        5. Enter the class name: HelloJME3
                        6. @@ -81,16 +77,15 @@ In the jMonkeyEngine SDK:

                        -The SDK creates the file HelloJME3.java for you. +The SDK creates the file HelloJME3.java for you.

                        -

                        Sample Code

                        +

                        Sample Code

                        - Replace the contents of the HelloJME3.java file with the following code:

                        package jme3test.helloworld;
                        @@ -114,7 +109,7 @@ public class HelloJME3 extends SimpleApplication {
                          
                             @Override
                             public void simpleInitApp() {
                        -        Box b = new Box(1, 1, 1); // create cube shape
                        +        Box(1, 1, 1); // create cube shape
                                 Geometry geom = new Geometry("Box", b);  // create cube geometry from the shape
                                 Material mat = new Material(assetManager,
                                   "Common/MatDefs/Misc/Unshaded.j3md");  // create a simple material
                        @@ -144,21 +139,19 @@ Congratulations! Now let's find out how it works!
                         
                         
                        -

                        Understanding the Code

                        +

                        Understanding the Code

                        - The code above has initialized the scene, and started the application.

                        -

                        Start the SimpleApplication

                        +

                        Start the SimpleApplication

                        - Look at the first line. Your HelloJME3.java class extends com.jme3.app.SimpleApplication.

                        public class HelloJME3 extends SimpleApplication {
                        @@ -189,12 +182,14 @@ The app.start(); line opens the application window. Let's lear
                         
                         
                        -

                        Understanding the Terminology

                        +

                        Understanding the Terminology

                      Problem? Solution!
                      A created Geometry does not appear in the scene. Have you attached it to (a node that is attached to) the rootNode?
                      Does it have a Material?
                      @@ -385,11 +385,10 @@ Did you rotate around the right axis?
                      + + @@ -213,17 +208,15 @@ The app.start(); line opens the application window. Let's lear
                      What you want to doHow you say that in JME3 terminology
                      You want to create a cube.I create a Geometry with a 1x1x1 Box shape.

                      - If you are unfamiliar with the vocabulary, read more about the Scene Graph here.

                      -

                      Initialize the Scene

                      +

                      Initialize the Scene

                      - Look at rest of the code sample. The simpleInitApp() method is automatically called once at the beginning when the application starts. Every JME3 game must have this method. In the simpleInitApp() method, you load game objects before the game starts.

                          public void simpleInitApp() {
                      @@ -234,7 +227,7 @@ Look at rest of the code sample. The simpleInitApp() method is auto
                       The initialization code of a blue cube looks as follows:
                       

                          public void simpleInitApp() {
                      -        Box b = new Box(1, 1, 1); // create a 1x1x1 box shape
                      +        Box(1, 1, 1); // create a 1x1x1 box shape
                               Geometry geom = new Geometry("Box", b);  // create a cube geometry from the box shape
                               Material mat = new Material(assetManager,
                                 "Common/MatDefs/Misc/Unshaded.j3md");  // create a simple material
                      @@ -253,7 +246,7 @@ A typical JME3 game has the following initialization process:
                       
                       
                    • You make objects appear in the scene by attaching them to the rootNode.
                    • -
                    • Examples: Load player, terrain, sky, enemies, obstacles, ???, and place them in their start positions.
                      +
                    • Examples: Load player, terrain, sky, enemies, obstacles, …, and place them in their start positions.
                    • @@ -263,7 +256,7 @@ A typical JME3 game has the following initialization process:
                    • You set variables to their start values.
                    • -
                    • Examples: Set the score to 0, set health to 100%, ???
                      +
                    • Examples: Set the score to 0, set health to 100%, …
                    • @@ -271,17 +264,17 @@ A typical JME3 game has the following initialization process:
                      • The following input bindings are pre-configured:
                          -
                        • W,A,S,D keys ??? Move around in the scene
                          +
                        • W,A,S,D keys – Move around in the scene
                        • -
                        • Mouse movement and arrow keys ??? Turn the camera
                          +
                        • Mouse movement and arrow keys – Turn the camera
                        • -
                        • Escape key ??? Quit the game
                          +
                        • Escape key – Quit the game
                      • Define your own additional keys and mouse click actions.
                      • -
                      • Examples: Click to shoot, press Space to jump, ???
                        +
                      • Examples: Click to shoot, press Space to jump, …
                      @@ -289,11 +282,10 @@ A typical JME3 game has the following initialization process:
                      -

                      Conclusion

                      +

                      Conclusion

                      - You have learned that a SimpleApplication is a good starting point because it provides you with:

                        @@ -306,7 +298,6 @@ You have learned that a SimpleApplication is a good starting point because it pr

                      - When developing a game application, you want to:

                        @@ -324,7 +315,6 @@ The now following tutorials teach how you accomplish these tasks with the jMonke

                        Continue with the Hello Node tutorial, where you learn more details about how to initialize the game world, also known as the scene graph. -


                        @@ -339,15 +329,11 @@ See also:
                      1. - + +

                        +tag_beginner_intro_documentation_init_simpleapplication_basegame +

                      -

                      view online version

                      \ No newline at end of file +

                      view online version

                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_terrain.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_terrain.html index bc24b63cd..90a2f70c9 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_terrain.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/beginner/hello_terrain.html @@ -1,5 +1,5 @@ -

                      jMonkeyEngine 3 Tutorial (10) - Hello Terrain

                      +

                      jMonkeyEngine 3 Tutorial (10) - Hello Terrain

                      @@ -8,7 +8,7 @@ Next: Hello Audio

                      -One way to create a 3D landscape is to sculpt a huge terrain model. This gives you a lot of artistic freedom ??? but rendering such a huge model can be quite slow. This tutorial explains how to create fast-rendering terrains from heightmaps, and how to use texture splatting to make the terrain look good. +One way to create a 3D landscape is to sculpt a huge terrain model. This gives you a lot of artistic freedom – but rendering such a huge model can be quite slow. This tutorial explains how to create fast-rendering terrains from heightmaps, and how to use texture splatting to make the terrain look good.

                      @@ -16,17 +16,17 @@ One way to create a 3D landscape is to sculpt a huge terrain model. This gives y

                      -Note: If you get an error when trying to create your ImageBasedHeightMap object, you may need to update the SDK, click on "Help" / "Check for updates" +Note: If you get an error when trying to create your ImageBasedHeightMap object, you may need to update the SDK, click on “Help” / “Check for updates”

                      -

                      To use the example assets in a new jMonkeyEngine SDK project, right-click your project, select "Properties", go to "Libraries", press "Add Library" and add the "jme3-test-data" library. +

                      To use the example assets in a new jMonkeyEngine SDK project, right-click your project, select “Properties”, go to “Libraries”, press “Add Library” and add the “jme3-test-data” library.

                      -

                      Sample Code

                      +

                      Sample Code

                      package jme3test.helloworld;
                        
                      @@ -125,16 +125,15 @@ When you run this sample you should see a landscape with dirt mountains, grass p
                       
                       
                      -

                      What is a Heightmap?

                      +

                      What is a Heightmap?

                      - Heightmaps are an efficient way of representing the shape of a hilly landscape. Not every pixel of the landscape is stored, instead, a grid of sample values is used to outline the terrain height at certain points. The heights between the samples is interpolated.

                      -In Java, a heightmap is a float array containing height values between 0f and 255f. Here is a very simple example of a terrain generated from a heightmap with 5x5=25 height values. +In Java, a heightmap is a float array containing height values between 0f and 255f. Here is a very simple example of a terrain generated from a heightmap with 5×5=25 height values.

                      @@ -154,19 +153,17 @@ Important things to note:

                      - When looking at Java data types to hold an array of floats between 0 and 255, the Image class comes to mind. Storing a terrain's height values as a grayscale image has one big advantage: The outcome is a very userfriendly, like a topographical map:

                        -
                      • Low values (e.g. 0 or 50) are dark gray ??? these are valleys.
                        +
                      • Low values (e.g. 0 or 50) are dark gray – these are valleys.
                      • -
                      • High values (e.g. 200, 255) are light grays ??? these are hills.
                        +
                      • High values (e.g. 200, 255) are light grays – these are hills.

                      - -Look at the next screenshot: In the top left you see a 128x128 grayscale image (heightmap) that was used as a base to generate the depicted terrain. To make the hilly shape better visible, the mountain tops are colored white, valleys brown, and the areas inbetween green: +Look at the next screenshot: In the top left you see a 128×128 grayscale image (heightmap) that was used as a base to generate the depicted terrain. To make the hilly shape better visible, the mountain tops are colored white, valleys brown, and the areas inbetween green:

                      @@ -174,17 +171,16 @@ Look at the next screenshot: In the top left you see a 128x128 grayscale image (

                      -In a real game, you will want to use more complex and smoother terrains than the simple heightmaps shown here. Heightmaps typically have square sizes of 512x512 or 1024x1024, and contain hundred thousands to 1 million height values. No matter which size, the concept is the same as described here. +In a real game, you will want to use more complex and smoother terrains than the simple heightmaps shown here. Heightmaps typically have square sizes of 512×512 or 1024×1024, and contain hundred thousands to 1 million height values. No matter which size, the concept is the same as described here.

                      -

                      Looking at the Heightmap Code

                      +

                      Looking at the Heightmap Code

                      - - +

                      @@ -193,7 +189,7 @@ The first step of terrain creation is the heightmap. You can create one yourself

                      • The size must be square, and a power of two.
                          -
                        • Examples: 128x128, 256x256, 512x512, 1024x1024
                          +
                        • Examples: 128×128, 256×256, 512×512, 1024×1024
                      • @@ -208,7 +204,6 @@ The first step of terrain creation is the heightmap. You can create one yourself

                      - The file mountains512.png that you see here is a typical example of an image heightmap.

                      @@ -234,20 +229,19 @@ It requires an image from a JME Texture.
                      -

                      What is Texture Splatting?

                      +

                      What is Texture Splatting?

                      - Previously you learned how to create a material for a simple shape such as a cube. All sides of the cube have the same color. You can apply the same material to a terrain, but then you have one big meadow, one big rock desert, etc. This is not always what you want.

                      -Texture splatting allows you create a custom material, and "paint" textures on it like with a "paint brush". This is very useful for terrains: As you see in the example here, you can paint a grass texture into the valleys, a dirt texture onto the mountains, and free-form roads inbetween. +Texture splatting allows you create a custom material, and “paint” textures on it like with a “paint brush”. This is very useful for terrains: As you see in the example here, you can paint a grass texture into the valleys, a dirt texture onto the mountains, and free-form roads inbetween.

                      -

                      The jMonkeyEngine SDK comes with a TerrainEditor plugin. Using the TerrainEditor plugin, you can sculpt the terrain with the mouse, and save the result as heightmap. You can paint textures on the terrain and the plugin saves the resulting splat textures as alphamap(s). The following paragraphs describe the manual process for you. You can choose to create the terrain by hand, or using the TerrainEditor plugin. +

                      The jMonkeyEngine SDK comes with a TerrainEditor plugin. Using the TerrainEditor plugin, you can sculpt the terrain with the mouse, and save the result as heightmap. You can paint textures on the terrain and the plugin saves the resulting splat textures as alphamap(s). The following paragraphs describe the manual process for you. You can choose to create the terrain by hand, or using the TerrainEditor plugin.

                      @@ -259,22 +253,21 @@ Splat textures are based on the Terrain.j3md material defintion. If Before you can start painting, you have to make a few decisions:

                        -
                      1. Choose three textures. For example grass.jpg, dirt.jpg, and road.jpg.
                        +
                      2. Choose three textures. For example grass.jpg, dirt.jpg, and road.jpg.
                      3. -
                      4. You "paint" three texture layers by using three colors: Red, blue and, green. You arbitrarily decide that???
                        +
                      5. You “paint” three texture layers by using three colors: Red, blue and, green. You arbitrarily decide that…
                          -
                        1. Red is grass ??? red is layer Tex1, so put the grass texture into Tex1.
                          +
                        2. Red is grass – red is layer Tex1, so put the grass texture into Tex1.
                        3. -
                        4. Green is dirt ??? green is layer Tex2, so put the dirt texture into Tex2.
                          +
                        5. Green is dirt – green is layer Tex2, so put the dirt texture into Tex2.
                        6. -
                        7. Blue is roads ??? blue is layer Tex3, so put the roads texture into Tex3.
                          +
                        8. Blue is roads – blue is layer Tex3, so put the roads texture into Tex3.

                      - Now you start painting the texture:

                        @@ -284,9 +277,9 @@ Now you start painting the texture:
                      1. Open alphamap.png in a graphic editor and switch the image mode to color image.
                          -
                        1. Paint the black valleys red ??? this will be the grass.
                          +
                        2. Paint the black valleys red – this will be the grass.
                        3. -
                        4. Paint the white hills green ??? this will be the dirt of the mountains.
                          +
                        5. Paint the white hills green – this will be the dirt of the mountains.
                        6. Paint blue lines where you want roads to criss-cross the landscape.
                        7. @@ -297,16 +290,15 @@ Now you start painting the texture:

                        - ??? +

                      -

                      Looking at the Texturing Code

                      +

                      Looking at the Texturing Code

                      - As usual, you create a Material object. Base it on the Material Definition Terrain.j3md that is included in the jME3 framework.

                      Material mat_terrain = new Material(assetManager, "Common/MatDefs/Terrain/Terrain.j3md");
                      @@ -342,7 +334,7 @@ The three other textures are the layers that you have previously decided to pain mat_terrain.setFloat("Tex3Scale", 128f);

                      -The individual texture scales (e.g. mat_terrain.setFloat("Tex3Scale", 128f);) depend on the size of the textures you use. +The individual texture scales (e.g. mat_terrain.setFloat(“Tex3Scale”, 128f);) depend on the size of the textures you use.

                      • You can tell you picked too small a scale if, for example, your road tiles appear like tiny grains of sand.
                        @@ -352,22 +344,20 @@ The individual texture scales (e.g. mat_terrain.setFloat("Tex3Scale&q

                      - Use setWrap(WrapMode.Repeat) to make the small texture fill the wide area. If the repetition is too visible, try adjusting the respective Tex*Scale value.

                      -

                      What is a Terrain?

                      +

                      What is a Terrain?

                      - -Internally, the generated terrain mesh is broken down into tiles and blocks. This is an optimization to make culling easier. You do not need to worry about "tiles and blocks" too much, just use recommended values for now ??? 64 is a good start. +Internally, the generated terrain mesh is broken down into tiles and blocks. This is an optimization to make culling easier. You do not need to worry about “tiles and blocks” too much, just use recommended values for now – 64 is a good start.

                      -Let's assume you want to generate a 512x512 terrain. You already have created the heightmap object. Here are the steps that you perform everytime you create a new terrain. +Let's assume you want to generate a 512×512 terrain. You already have created the heightmap object. Here are the steps that you perform everytime you create a new terrain.

                      @@ -376,13 +366,13 @@ Create a TerrainQuad with the following arguments:

                      1. Specify a name: E.g. my terrain.
                      2. -
                      3. Specify tile size: You want to terrain tiles of size 64x64, so you supply 64+1 = 65.
                        +
                      4. Specify tile size: You want to terrain tiles of size 64×64, so you supply 64+1 = 65.
                        • In general, 64 is a good starting value for terrain tiles.
                      5. -
                      6. Specify block size: Since you prepared a heightmap of size 512x512, you supply 512+1 = 513.
                        +
                      7. Specify block size: Since you prepared a heightmap of size 512×512, you supply 512+1 = 513.
                        • If you supply a block size of 2x the heightmap size (1024+1=1025), you get a stretched out, wider, flatter terrain.
                        • @@ -390,19 +380,17 @@ Create a TerrainQuad with the following arguments:
                      8. -
                      9. Supply the 512x512 heightmap object that you created.
                        +
                      10. Supply the 512×512 heightmap object that you created.
                      -

                      Looking at the Terrain Code

                      +

                      Looking at the Terrain Code

                      - Here's the code: -

                      terrain = new TerrainQuad(
                         "my terrain",               // name
                      @@ -425,17 +413,15 @@ You have created the terrain object.
                       
                       
                       

                      - Tip: Terrain.j3md is an unshaded material definition, so you do not need a light source. You can also use TerrainLighting.j3md plus a light, if you want a shaded terrain.

                      -

                      What is LOD (Level of Detail)?

                      +

                      What is LOD (Level of Detail)?

                      - JME3 includes an optimization that adjusts the level of detail (LOD) of the rendered terrain depending on how close or far the camera is.

                          TerrainLodControl control = new TerrainLodControl(terrain, getCamera());
                      @@ -447,18 +433,16 @@ Close parts of the terrain are rendered in full detail. Terrain parts that are f
                       
                       
                      -

                      Exercises

                      +

                      Exercises

                      -

                      Exercise 1: Texture Layers

                      +

                      Exercise 1: Texture Layers

                      - What happens when you swap two layers, for example Tex1 and Tex2? -

                      ...
                       mat_terrain.setTexture("Tex2", grass);
                      @@ -471,11 +455,10 @@ You see it's easier to swap layers in the code, than to change the colors i
                       
                       
                      -

                      Exercise 2: Randomized Terrains

                      +

                      Exercise 2: Randomized Terrains

                      - The following three lines generate the heightmap object based on your user-defined image:

                          AbstractHeightMap heightmap = null;
                      @@ -529,32 +512,28 @@ You see the variety of hilly landscapes that can be generated using this method.
                       

                      For this exercise, you can keep using the splat Material from the sample code above. Just don't be surprised that the Material does not match the shape of the newly randomized landscape. If you want to generate real matching splat textures for randomized heightmaps, you need to write a custom method that, for example, creates an alphamap from the heightmap by replacing certain grayscales with certain RGB values.

                      -

                      -

                      Exercise 3: Solid Terrains

                      +

                      Exercise 3: Solid Terrains

                      - Can you combine what you learned here and in Hello Collision, and make the terrain solid?

                      -

                      Conclusion

                      +

                      Conclusion

                      - -You have learned how to create terrains that are more efficient than loading one giant model. You know how to generate random or create handmade heightmaps. You can add a LOD control to render large terrains faster. You are aware that you can combine what you learned about collision detection to make the terrain solid to a physical player. You are also able to texture a terrain "like a boss" using layered Materials and texture splatting. You are aware that the jMonkeyEngine SDK provides a TerrainEditor that helps with most of these manual tasks. +You have learned how to create terrains that are more efficient than loading one giant model. You know how to generate random or create handmade heightmaps. You can add a LOD control to render large terrains faster. You are aware that you can combine what you learned about collision detection to make the terrain solid to a physical player. You are also able to texture a terrain “like a boss” using layered Materials and texture splatting. You are aware that the jMonkeyEngine SDK provides a TerrainEditor that helps with most of these manual tasks.

                      -Do you want to hear your players say "ouch!" when they bump into a wall or fall off a hill? Continue with learning how to add sound to your game. - +Do you want to hear your players say “ouch!” when they bump into a wall or fall off a hill? Continue with learning how to add sound to your game.


                      @@ -565,14 +544,11 @@ See also:
                    • - + +

                      +tag_beginner_heightmap_documentation_terrain_texture +

                      -

                      view online version

                      \ No newline at end of file +

                      view online version

                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/build_from_sources.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/build_from_sources.html index e387c87b0..41baaea06 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/build_from_sources.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/build_from_sources.html @@ -1,14 +1,12 @@ -

                      Building jMonkeyEngine 3 from the Sources

                      +

                      Building jMonkeyEngine 3 from the Sources

                      - -We recommend downloading the - but of course you can also build the jMonkeyEngine yourself from the sources. In this case, you need the file version system installed (svn). - +We recommend downloading the - but of course you can also build the jMonkeyEngine yourself from the sources. In this case, you need the file version system installed (svn).

                        -
                      1. Checkout: Checkout the Subversion repository.
                        svn checkout http://jmonkeyengine.googlecode.com/svn/trunk/engine jme3
                        +
                      2. Checkout: Checkout the Subversion repository.
                        svn checkout http://jmonkeyengine.googlecode.com/svn/branches/3.0final/engine jme3
                        • You can leave login and password empty
                          @@ -42,9 +40,7 @@ We recommend downloading the this list. - +For a detailed description of the created jar files see this list.


                          @@ -57,10 +53,10 @@ Learn more about:
                        • - + +

                          +tag_documentation_install +

                          -

                          view online version

                          \ No newline at end of file +

                          view online version

                          \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/build_jme3_sources_with_netbeans.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/build_jme3_sources_with_netbeans.html index 37b9f2148..302db2849 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/build_jme3_sources_with_netbeans.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/build_jme3_sources_with_netbeans.html @@ -1,30 +1,27 @@ -

                          Setting up JME3 in Netbeans 6+

                          +

                          Setting up JME3 in Netbeans 6+

                          - You are welcome to try out the new jME3, and contribute patches and features! This document shows how to download, set up, build, and run the latest development version from the sources. These instructions work in NetBeans IDE 6 or better.

                          -Note: In the following, always replace "~" with the path to your home directory. +Note: In the following, always replace “~” with the path to your home directory.

                          -

                          Downloading the Sources

                          +

                          Downloading the Sources

                          - -Check out the sources from the repository. (The following NetBeans instructions are equivalent to executing cd ~/NetBeansProjects; svn checkout jme3 on the commandline.) - +Check out the sources from the repository. (The following NetBeans instructions are equivalent to executing cd ~/NetBeansProjects; svn checkout jme3 on the commandline.)

                          1. In NetBeans go to Team > Subversion > Checkout
                              -
                            1. Repository URL:
                              +
                            2. Repository URL:
                            3. You can leave user/pw blank for anonymous access.
                            4. @@ -32,9 +29,9 @@ Check out the sources from the repository. (The following NetBeans instructions
                            5. Click Next
                                -
                              1. Repository Folders: trunk/engine
                                +
                              2. Repository Folders: branches/3.0final/engine
                              3. -
                              4. Enable the checkbox to Skip "engine" and only checkout its contents.
                                +
                              5. Enable the checkbox to Skip “engine” and only checkout its contents.
                              6. Local Folder: ~/NetBeansProjects/jme3
                              7. @@ -45,13 +42,11 @@ Check out the sources from the repository. (The following NetBeans instructions

                              - The jme3 project opens in the Project window. It already includes a working ANT build script for building and running.

                              Look into the Libraries node and confirm that the project depends on the following libraries in the classpath: -

                              • j-ogg-oggd.jar
                                @@ -101,22 +96,21 @@ Look into the Libraries node and confirm that the project depends on the followi

                              - -For a detailed description of the separate jar files see this list. +For a detailed description of the separate jar files see this list.

                          - -

                          Build the Project and Run a Sample App

                          + +

                          Build the Project and Run a Sample App

                            -
                          1. Right-click the jme3 project node and "Clean and Build" the project.
                            +
                          2. Right-click the jme3 project node and “Clean and Build” the project.
                          3. In the Projects window, open the Test folder which contains the sample apps.
                          4. Every file with a Main class (for example jme3test.model/TestHoverTank.java or jme3test.game/CubeField.java) is an app.
                          5. -
                          6. Right-click a sample app and choose "Run File" (Shift-F6).
                            +
                          7. Right-click a sample app and choose “Run File” (Shift-F6).
                          8. Generally in sample apps:
                              @@ -129,12 +123,11 @@ For a detailed description of the separate jar files see -

                              Optional: Javadoc Popups and Source Navigation in NetBeans

                              + +

                              Optional: Javadoc Popups and Source Navigation in NetBeans

                              - If you are working on the jme3 sources:

                                @@ -147,19 +140,18 @@ If you are working on the jme3 sources:

                              - If you are working on a game project that depends on jme3:

                              1. First follow the previous tip. (In the future, we may offer jme javadoc as download instead.)
                              2. -
                              3. In your game project, right-click the Libraries node and choose "Properties".
                                +
                              4. In your game project, right-click the Libraries node and choose “Properties”.
                              5. In the Library properties, select jme3.jar and click the Edit button.
                                  -
                                1. For the Javadoc field, browse to ~/NetBeansProjects/jme3/dist/javadoc. Check "as relative path" and click select.
                                  +
                                2. For the Javadoc field, browse to ~/NetBeansProjects/jme3/dist/javadoc. Check “as relative path” and click select.
                                3. -
                                4. For the Sources field, browse to ~/NetBeansProjects/jme3/src. Check "as relative path" and click select.
                                  +
                                5. For the Sources field, browse to ~/NetBeansProjects/jme3/src. Check “as relative path” and click select.
                                6. Click OK.
                                7. @@ -170,20 +162,18 @@ If you are working on a game project that depends on jme3:

                                - This tip works for any third-party JAR library that you use. (You may have to download the javadoc/sources from their home page separately). -


                                Sources used: ,

                                - + +

                                +tag_documentation_install +

                              - -

                              view online version

                              \ No newline at end of file + +

                              view online version

                              \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/1.gif b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/1.gif index e2b02e413..73eac940d 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/1.gif and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/1.gif differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/2.gif b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/2.gif index b9ae86888..469271595 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/2.gif and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/2.gif differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/3.1.gif b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/3.1.gif index c7dd9a3e8..0ebd7f953 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/3.1.gif and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/3.1.gif differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/3.gif b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/3.gif index 2e40bea19..afe0aebc2 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/3.gif and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/3.gif differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/3dsmax.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/3dsmax.html index 9a4450b3a..b0d60c82a 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/3dsmax.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/3dsmax.html @@ -1,10 +1,10 @@ -

                              3ds Max Bone Animation to JME3 using OgreMax plugin

                              +

                              3ds Max Bone Animation to JME3 using OgreMax plugin

                              -

                              Asset Management

                              +

                              Asset Management

                              @@ -13,7 +13,7 @@ For the managing of assets in general, be sure to read the -

                              Creating models in 3dsMax

                              +

                              Creating models in 3dsMax

                              @@ -22,12 +22,12 @@ For this tutorial I used 3D Studio Max 2012 and OgreMax 2.4.3 free edition

                              -

                              Create Model and Bones

                              +

                              Create Model and Bones

                              • Create a new file
                              • -
                              • Select the ???Create??? tab > ???Geometry??? > ???Cylinder???
                                +
                              • Select the “Create” tab > “Geometry” > “Cylinder”
                              @@ -37,7 +37,7 @@ For this tutorial I used 3D Studio Max 2012 and OgreMax 2.4.3 free edition
                              • Draw a cylinder, lets say with 8 height segments (must be enough for a smooth deformation)
                              • -
                              • Also check ???Generate Mapping Coords.???
                                +
                              • Also check “Generate Mapping Coords.”
                              @@ -45,7 +45,7 @@ For this tutorial I used 3D Studio Max 2012 and OgreMax 2.4.3 free edition

                                -
                              • Click ???Create??? tab > ???Systems??? > ???Bones???
                                +
                              • Click “Create” tab > “Systems” > “Bones”
                              @@ -61,9 +61,9 @@ For this tutorial I used 3D Studio Max 2012 and OgreMax 2.4.3 free edition

                                -
                              • Select the cylinder, right click it and click ???Convert To:??? > ???Convert to Editable Mesh??? to prevent issues with OgreMax
                                +
                              • Select the cylinder, right click it and click “Convert To:” > “Convert to Editable Mesh” to prevent issues with OgreMax
                              • -
                              • Click the ???Modify??? tab > ???Modifier List??? and add the ???Skin??? modifier
                                +
                              • Click the “Modify” tab > “Modifier List” and add the “Skin” modifier
                              @@ -71,7 +71,7 @@ For this tutorial I used 3D Studio Max 2012 and OgreMax 2.4.3 free edition

                                -
                              • Beneath ???Bones:??? click ???Add??? and select all of your bones
                                +
                              • Beneath “Bones:” click “Add” and select all of your bones
                              @@ -85,12 +85,12 @@ For this tutorial I used 3D Studio Max 2012 and OgreMax 2.4.3 free edition
                              -

                              Create the animation

                              +

                              Create the animation

                                -
                              • Select the cylinder, and click ???Display??? tab > ???Freeze Selected??? so it is easier to select the bones during animation
                                +
                              • Select the cylinder, and click “Display” tab > “Freeze Selected” so it is easier to select the bones during animation
                              • -
                              • Select the two top bones and enable the ???Auto Key??? mode
                                +
                              • Select the two top bones and enable the “Auto Key” mode
                              @@ -100,7 +100,7 @@ For this tutorial I used 3D Studio Max 2012 and OgreMax 2.4.3 free edition
                              • The first key frame will be created automatically. Move the animation track slider to frame 5
                              • -
                              • Move the selected bones a bit. The cylinder mesh will be deformed. Because you are in the ???Auto Key??? mode, a key frame will be created
                                +
                              • Move the selected bones a bit. The cylinder mesh will be deformed. Because you are in the “Auto Key” mode, a key frame will be created
                              @@ -108,20 +108,20 @@ For this tutorial I used 3D Studio Max 2012 and OgreMax 2.4.3 free edition

                                -
                              • Create some additional key frames. You may also select more bones and move or rotate them. I???ve created 25 frames and the last key frame equals the first, so the animation is loopable
                                +
                              • Create some additional key frames. You may also select more bones and move or rotate them. I’ve created 25 frames and the last key frame equals the first, so the animation is loopable
                              • -
                              • After creating the animation, disable the ???Auto Key??? mode
                                +
                              • After creating the animation, disable the “Auto Key” mode
                              -

                              OgreMax settings

                              +

                              OgreMax settings

                                -
                              • Open the ???OgreMax Scene Settings??? dialog from the menu
                                +
                              • Open the “OgreMax Scene Settings” dialog from the menu
                              • -
                              • In the ???Meshes??? tab, enable ???Export XML Files??? and disable ???Export Binary Files??? as well as ???Export Vertex Colors???
                                +
                              • In the “Meshes” tab, enable “Export XML Files” and disable “Export Binary Files” as well as “Export Vertex Colors”
                              @@ -129,7 +129,7 @@ For this tutorial I used 3D Studio Max 2012 and OgreMax 2.4.3 free edition

                                -
                              • Click the ???Environment??? tab and uncheck ???Export Environment Settings???. Otherwise the JME importer will throw a NullPointerException
                                +
                              • Click the “Environment” tab and uncheck “Export Environment Settings”. Otherwise the JME importer will throw a NullPointerException
                              @@ -137,17 +137,17 @@ For this tutorial I used 3D Studio Max 2012 and OgreMax 2.4.3 free edition

                                -
                              • If you have textured your model, you may also check ???Copy Bitmaps to Export Directory??? in the ???Bitmaps??? tab
                                +
                              • If you have textured your model, you may also check “Copy Bitmaps to Export Directory” in the “Bitmaps” tab
                              • -
                              • Unfreeze the cylinder by clicking ???Display??? tab > ???Unfreeze All??? and select it
                                +
                              • Unfreeze the cylinder by clicking “Display” tab > “Unfreeze All” and select it
                              • -
                              • While having the cylinder selected, open the ???OgreMax Object Settings??? dialog from the menu
                                +
                              • While having the cylinder selected, open the “OgreMax Object Settings” dialog from the menu
                              • -
                              • Open the ???Mesh Animations??? tab and select type ???Skeleton???, ???Export Skeleton??? : ???Yes???
                                +
                              • Open the “Mesh Animations” tab and select type “Skeleton”, “Export Skeleton” : “Yes”
                              • -
                              • Below ???Mesh Animations??? hit the ???Add?????? button
                                +
                              • Below “Mesh Animations” hit the “Add…” button
                              • -
                              • Assign a name to the track, maybe ???wobble???. The track type must be ???Skin. Set the right ???Start/End Frames??? for your animation
                                +
                              • Assign a name to the track, maybe “wobble”. The track type must be “Skin. Set the right “Start/End Frames” for your animation
                              @@ -165,12 +165,12 @@ For this tutorial I used 3D Studio Max 2012 and OgreMax 2.4.3 free edition
                              -

                              Export and Import

                              +

                              Export and Import

                                -
                              • When all animations are in the list, select ???OgreMax??? > ???Export??? > ???Export Scene??? and name the file ???worm.scene???
                                +
                              • When all animations are in the list, select “OgreMax” > “Export” > “Export Scene” and name the file “worm.scene”
                              • -
                              • Create a JME test class that imports the file, get the animation controller and start the ???wobble??? animation
                                +
                              • Create a JME test class that imports the file, get the animation controller and start the “wobble” animation
                              import com.jme3.animation.AnimChannel;
                              @@ -284,28 +284,24 @@ You will see your worms strange movements. Have fun!
                               
                               

                              -

                              -

                              3ds Max Biped Animation to JME3

                              +

                              3ds Max Biped Animation to JME3

                              - You can also use the biped operator to animate models, but you have to consider a lot of things.

                              -

                              Creating a character in 3dsMax

                              +

                              Creating a character in 3dsMax

                              - I will not tell you in detail how to model a character. There I many good tutorials on the web, I used . -

                              • You may create a biped before you start modeling, so it is quite easier to fit the proportions of the biped.
                                @@ -315,22 +311,18 @@ I will not tell you in detail how to model a character. There I many good tutori

                              - -

                                -
                              • I added the "Meshmooth" modifier with 2 iterations and got this result:
                                +
                              • I added the “Meshmooth” modifier with 2 iterations and got this result:

                              - -

                                -
                              • After smoothing your mesh you could correct vertices with the "Edit Mesh" modifier. Finally you add the "Physique" modifier.
                                +
                              • After smoothing your mesh you could correct vertices with the “Edit Mesh” modifier. Finally you add the “Physique” modifier.
                              • Now you can edit your envelopes to fit your model.
                              • @@ -338,91 +330,85 @@ I will not tell you in detail how to model a character. There I many good tutori
                              -

                              Creating a simple walk animation

                              +

                              Creating a simple walk animation

                                -
                              • Select the chest of your biped, choose "Motion" (1) tab > "Foot Step Mode" (2) > "Create Multiple Footsteps" (3)
                                +
                              • Select the chest of your biped, choose “Motion” (1) tab > “Foot Step Mode” (2) > “Create Multiple Footsteps” (3)
                              • -
                              • You need to select the "In Place Mode" (4), so the character moves in place without changing its location.
                                +
                              • You need to select the “In Place Mode” (4), so the character moves in place without changing its location.

                              - -

                                -
                              • You can now play a bit with the settings, I adjusted "Actual Stride Length" and "Actual Stride Height".
                                +
                              • You can now play a bit with the settings, I adjusted “Actual Stride Length” and “Actual Stride Height”.
                              • -
                              • For the "Number of Footsteps" 6 will be sufficient because the animation is cycled later.
                                +
                              • For the “Number of Footsteps” 6 will be sufficient because the animation is cycled later.
                              • Note: You can also create or edit footsteps by hand and move or rotate them.
                              • -
                              • After all footsteps are created, hit the "Create Keys for Inactive Footsteps" button in the "Footstep Operations" panel
                                +
                              • After all footsteps are created, hit the “Create Keys for Inactive Footsteps” button in the “Footstep Operations” panel
                              • -
                              • You can now check your animation by pressing the "Play" button in the timeline.
                                +
                              • You can now check your animation by pressing the “Play” button in the timeline.
                              -

                              Preparing the export and setting up OgreMax

                              +

                              Preparing the export and setting up OgreMax

                                -
                              • The "OgreMax Scene Settings" should be the same as shown above.
                                +
                              • The “OgreMax Scene Settings” should be the same as shown above.
                              • Because you want your animation to be looped, you've got to find two key frames where the legs are nearly in the same position. For my settings I've chosen the frames 48-78 for the walk animation.
                              • -
                              • Select the character mesh and open the "OgreMax Scene Settings" dialog.
                                +
                              • Select the character mesh and open the “OgreMax Scene Settings” dialog.
                              • -
                              • Open the ???Mesh Animations??? tab and select type ???Skeleton???, ???Export Skeleton??? : ???Yes???
                                +
                              • Open the “Mesh Animations” tab and select type “Skeleton”, “Export Skeleton” : “Yes”
                              • -
                              • Below ???Mesh Animations??? hit the ???Add?????? button
                                +
                              • Below “Mesh Animations” hit the “Add…” button

                              - -

                                -
                              • Enter a name for the track, e.g. "walk".
                                +
                              • Enter a name for the track, e.g. “walk”.
                              • -
                              • Assure the track type is set to "Physique".
                                +
                              • Assure the track type is set to “Physique”.
                              • Set the start and end frames, for me it is 48-78.
                              • -
                              • Close the dialog by pushing "Ok".
                                +
                              • Close the dialog by pushing “Ok”.
                              • -
                              • Note: It could be useful to create also a track "start_run", that blends between the stand and walk animation. I would use frame 0-47 for that.
                                +
                              • Note: It could be useful to create also a track “start_run”, that blends between the stand and walk animation. I would use frame 0-47 for that.
                              • Because you have a smooth model with a lot of polygons, it may be useful to create levels of detail (LOD). When the camera is farther away, a low-poly mesh of your character will be rendered.

                              - -

                                -
                              • Open the "Mesh LOD" tab in object settings.
                                +
                              • Open the “Mesh LOD” tab in object settings.
                              • -
                              • It will suffice to select the "Automatic" setting, but if your animation starts to look weird, you can create them by hand.
                                +
                              • It will suffice to select the “Automatic” setting, but if your animation starts to look weird, you can create them by hand.
                              • I used 4 levels of LOD with a distance of 1. Don't worry about the distance setting, you can change it later in JME.
                              • For the level reduction, I used 20 percent, which produce good results. You may adjust all the settings depending on your needs.
                              • -
                              • Close the dialoque by clicking "Ok".
                                +
                              • Close the dialoque by clicking “Ok”.
                              -

                              Fixing the location

                              +

                              Fixing the location

                              • Before you export you need to do a little fix, because your model is not really located where you see it. JME will get into a lot of trouble, if you don't change that.
                                @@ -432,32 +418,29 @@ I will not tell you in detail how to model a character. There I many good tutori

                              - -

                                -
                              • Right click the "Select and Move" tool in the upper toolbar. A dialog will pop up.
                                +
                              • Right click the “Select and Move” tool in the upper toolbar. A dialog will pop up.
                              • Set the X and Y location to 0 and close the dialog.
                              • -
                              • There is another way to achieve this. If you have scaled, moved or rotated your model, just open the "Hierarchy" tab and click "Transform" and "Scale" on the "Reset" panel.
                                +
                              • There is another way to achieve this. If you have scaled, moved or rotated your model, just open the “Hierarchy” tab and click “Transform” and “Scale” on the “Reset” panel.
                              -

                              Export and Import

                              +

                              Export and Import

                                -
                              • Now you can export your scene. Select only the mesh and use "Export selected objects". You will not need the whole scene including the biped object, but the bones are created automatically during export.
                                +
                              • Now you can export your scene. Select only the mesh and use “Export selected objects”. You will not need the whole scene including the biped object, but the bones are created automatically during export.
                              • Create a JME test class for the scene import.

                              - For that, I extended the first class:

                              import com.jme3.animation.AnimChannel;
                              @@ -532,7 +515,7 @@ public class TestOgreMaxImport extends SimpleApplication {
                                   rootNode.addLight(pl);
                                
                                   // add a box as floor
                              -    final Box b = new Box(100f, 0.1f, 100f);
                              +    final Box(100f, 0.1f, 100f);
                                   final Geometry geo = new Geometry("floor", b);
                                
                                   final Material mat = new Material(assetManager,
                              @@ -609,9 +592,8 @@ As you can see, the LOD is working:
                               
                               

                              -

                              -

                              view online version

                              \ No newline at end of file +

                              view online version

                              \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/4.gif b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/4.gif index 0c91298c8..c8fc1c169 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/4.gif and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/4.gif differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/5.gif b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/5.gif index f5fb42e17..64b55e3d7 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/5.gif and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/5.gif differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/6.gif b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/6.gif index b4c61a63f..228912973 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/6.gif and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/6.gif differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/7.gif b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/7.gif index ffb534875..020905730 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/7.gif and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/7.gif differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/8.gif b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/8.gif index e9612846d..6e25fbd81 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/8.gif and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/8.gif differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender-material-1.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender-material-1.png index 5005be723..a6224accb 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender-material-1.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender-material-1.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender-material-2.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender-material-2.png index c2d69034a..e4b6b3796 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender-material-2.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender-material-2.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender-material-3.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender-material-3.png index 4f176c965..e66880f13 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender-material-3.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender-material-3.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender-material-4.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender-material-4.png index d4aea8b6a..33f8f9069 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender-material-4.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender-material-4.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender.html index abb8c1b9d..0390f44f7 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender.html @@ -1,5 +1,5 @@ -

                              Creating assets in Blender3D

                              +

                              Creating assets in Blender3D

                              @@ -8,7 +8,7 @@ This section discusses how to create and import models from Blender3D (2.62+, se

                              -

                              Asset Management

                              +

                              Asset Management

                              @@ -17,7 +17,7 @@ For the managing of assets in general, be sure to read the -

                              Creating Models

                              +

                              Creating Models

                              @@ -26,12 +26,11 @@ Game-compatible models are models that basically only consist of a mesh and UV-m

                              -

                              UV Mapped Textures

                              +

                              UV Mapped Textures

                              To successfully import a texture, the texture has to be UV-mapped to the model. Heres how to assign diffuse, normal and specular maps: -

                              • @@ -41,13 +40,12 @@ To successfully import a texture, the texture has to be UV-mapp

                              - Its important to note that each used texture will create one separate geometry. So its best to either combine the UV maps or use a premade atlas with different texture types from the start and then map the uv coords of the models to the atlas instead of painting on the texture. This works best for large models like cities and space ships.

                              -

                              Animations

                              +

                              Animations

                              @@ -60,7 +58,7 @@ To create an animation from scratch do the following:

                              • Create the model
                                  -
                                • Make sure your models location, rotation and scale is applied and zero / one (see "Model Checklist" below)
                                  +
                                • Make sure your models location, rotation and scale is applied and zero / one (see “Model Checklist” below)
                                • (Did you know? You can make any model from a box by only using extrusion, this creates very clean meshes)
                                • @@ -70,7 +68,7 @@ To create an animation from scratch do the following:
                                  • Start by placing the cursor at zero
                                  • -
                                  • Go to the Add???Armature???Single Bone menu and create the root bone
                                    +
                                  • Go to the Add→Armature→Single Bone menu and create the root bone
                                    • @@ -78,9 +76,9 @@ To create an animation from scratch do the following:
                                    • Select the bone and go to edit mode (press tab)
                                    • -
                                    • Select the root bone end and press "E" to extrude the bone, then start rigging your model this way
                                      +
                                    • Select the root bone end and press “E” to extrude the bone, then start rigging your model this way
                                    • -
                                    • Make sure your armatures location, rotation and scale is applied (see "Model Checklist" below) before continuing
                                      +
                                    • Make sure your armatures location, rotation and scale is applied (see “Model Checklist” below) before continuing
                                  • @@ -94,7 +92,7 @@ To create an animation from scratch do the following:
                                  -
                                • Set a new armature constraint in the model "Object Modifiers" settings and select the Armature
                                  +
                                • Set a new armature constraint in the model “Object Modifiers” settings and select the Armature
                                  • @@ -102,7 +100,7 @@ To create an animation from scratch do the following:
                                  • Voila, your model should move when you move the bones in pose mode
                                  • -
                                  • Go to the "Dope Sheet" window and select the "Action editor"
                                    +
                                  • Go to the “Dope Sheet” window and select the “Action editor”
                                    • @@ -118,7 +116,7 @@ To create an animation from scratch do the following:
                                    • Each action will be an animation available via the animation control in jME after the import
                                    • -
                                    • Press the "F" button next to the action so it will be saved even if theres no references
                                      +
                                    • Press the “F” button next to the action so it will be saved even if theres no references
                                      • The animation would else be deleted if its not the active animation on the armature and the file is saved
                                      • @@ -128,7 +126,7 @@ To create an animation from scratch do the following:
                              -

                              Model Checklist

                              +

                              Model Checklist

                              @@ -137,38 +135,37 @@ Sometimes you do not create the model yourself and often times models from the w

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

                              • The animation has to be a bone animation
                              • -
                              • Apply Location, Rotation and Scale 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.
                                +
                              • Apply Location, Rotation and Scale 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.
                              • -
                              • Apply Location, Rotation and Scale to the armature on Blender: On 3D View editor on Blender, select the armature in Object Mode and go to the 3D View Editor???s header ??? Object Menu ??? Apply ??? Location / Rotation / Scale.
                                +
                              • Apply Location, Rotation and Scale to the armature on Blender: On 3D View editor on Blender, select the armature in Object Mode and go to the 3D View Editor’s header → Object Menu → Apply → Location / Rotation / Scale.
                              • -
                              • Set the mesh???s origin point in the bottom of the mesh (see the image below).
                                +
                              • Set the mesh’s origin point in the bottom of the mesh (see the image below).
                              • -
                              • Set the armature???s origin point in the bottom of the armature (see the image below).
                                +
                              • Set the armature’s origin point in the bottom of the armature (see the image below).
                              • -
                              • Armature???s origin point and mesh???s origin point must be in the same location(see the image below).
                                +
                              • Armature’s origin point and mesh’s origin point must be in the same location(see the image below).
                              • -
                              • Use a root bone located in the armature???s origin. This root bone must be in vertical position (see the image below) and it is the root bone of the armature. If you rotate the root bone, the the entire armature might be rotate when you import the model into jMonkey (I???m just mentioning the result, I don???t know where is the problem (jMonkey importer or blender???s ogre exporter plugin)).
                                +
                              • Use a root bone located in the armature’s origin. This root bone must be in vertical position (see the image below) and it is the root bone of the armature. If you rotate the root bone, the the entire armature might be rotate when you import the model into jMonkey (I’m just mentioning the result, I don’t know where is the problem (jMonkey importer or blender’s ogre exporter plugin)).
                              • -
                              • Uncheck ???Bone Envelopes??? checkbox on the Armature modifier for the mesh (see the image below).
                                +
                              • Uncheck “Bone Envelopes” checkbox on the Armature modifier for the mesh (see the image below).
                              • -
                              • Uncheck ???Envelopes??? checkbox on the armature (see the image below).
                                +
                              • Uncheck “Envelopes” checkbox on the armature (see the image below).
                                • @@ -177,9 +174,7 @@ To export an animated model in Blender make sure the following conditions are me

                                - You can use SkeletonDebugger to show the skeleton on your game in order to check if the mesh and the skeleton are loaded correctly: -

                                    final Material soldier2Mat = assetManager.loadMaterial("Materials/soldier2/soldier2.j3m");
                                     final Spatial soldier2 = assetManager.loadModel("Models/soldier2/soldier2.j3o");
                                @@ -207,9 +202,7 @@ You can use SkeletonDebugger to show the skeleton on your game in order to check
                                 

                              - Also check out these videos and resources: -

                              • ()
                                @@ -222,17 +215,16 @@ Also check out these videos and resources:
                              -

                              NormalMap baking

                              +

                              NormalMap baking

                              - Models for live rendering should have a low polygon count. To increase the perceived detail of a model normal maps are commonly used in games. This tutorial will show how to create a normalmap from a highpoly version of your model that you can apply to a lowpoly version of the model in your game.

                              -

                              Blender modeling lowPoly & highPoly

                              +

                              Blender modeling lowPoly & highPoly

                              • If you use the multiresolution modifier you only need one object. Lets look at this example:
                                @@ -255,7 +247,7 @@ Models for live rendering should have a low polygon count. To increase the perce
                              -
                            1. When using Catmull-Clark with a higher "subdivide" value (more than 3) its good to have the "preview" value above 0 and less than the subdivide level. This is because Catmull-Clark smoothes the vertices, so the normalMap is not so precise.
                              +
                            2. When using Catmull-Clark with a higher “subdivide” value (more than 3) its good to have the “preview” value above 0 and less than the subdivide level. This is because Catmull-Clark smoothes the vertices, so the normalMap is not so precise.
                            3. Here is an example of Prewiew 1, it's more smooth than the original mesh:
                                @@ -263,7 +255,7 @@ Models for live rendering should have a low polygon count. To increase the perce
                            4. -
                            5. Enable "Sculpt Mode" in blender and design the highPoly version of your model like here:
                              +
                            6. Enable “Sculpt Mode” in blender and design the highPoly version of your model like here:
                              • @@ -287,7 +279,7 @@ Models for live rendering should have a low polygon count. To increase the perce
                              • -
                              • uncheck "[ ] Bake from Multires"
                                +
                              • uncheck “[ ] Bake from Multires”
                              • switch to object mode
                              • @@ -313,34 +305,30 @@ Models for live rendering should have a low polygon count. To increase the perce
                              • use Bake > Normal
                              • -
                              • check "[x] Selected to Active"
                                +
                              • check “[x] Selected to Active”
                              • -
                              • use a reasonably high value for "Margin" (4+ pixels at least for 1024x1024 maps)
                                +
                              • use a reasonably high value for “Margin” (4+ pixels at least for 1024×1024 maps)
                              • don't forget to safe the normal map image

                              -

                              Be careful: in the Outliner the camera symbol (Restrict Render) must be on!

                              -

                              -

                              Fixing the normal colors in Blender

                              +

                              Fixing the normal colors in Blender

                              - Blender has its own normal colors standard. We need to fix the colors to prepare the normalmap for using it with the JME Lighting Material.

                              To do this, go to the Blender Node Window -

                              • Here is Blender Node example. It fixes the normal colors:
                                @@ -375,17 +363,16 @@ To do this, go to the Blender Node Window
                              -

                              LightMap baking

                              +

                              LightMap baking

                              - The goal of this tutorial is to explain briefly how to bake light map in blender with a separate set of texture coordinates and then export a model using this map in jME3.

                              -

                              Blender modeling + texturing

                              +

                              Blender modeling + texturing

                              • create a mesh in blender and unwrap it to create uvs
                                @@ -406,7 +393,7 @@ The goal of this tutorial is to explain briefly how to bake light map in blender
                              • In the 3D view in edit mode select all your mesh vertice and hit 'U'/LightMap pack then ok it will unfold the mesh for light map.
                              • -
                              • Create a new image, go to the render tab an all at the end check the "Bake" section and select shadows. Then click bake.
                                +
                              • Create a new image, go to the render tab an all at the end check the “Bake” section and select shadows. Then click bake.
                              • If all went ok it will create a light map like this.
                                  @@ -434,19 +421,18 @@ The goal of this tutorial is to explain briefly how to bake light map in blender
                              -

                              Importing the model in the SDK and creating the appropriate material

                              +

                              Importing the model in the SDK and creating the appropriate material

                              -Once this is done, export your model with the ogre exporter (or import it directly via the blend importer), and turn it into J3o with the SDK. - +Once this is done, export your model with the ogre exporter (or import it directly via the blend importer), and turn it into J3o with the SDK.

                              • Create material for it using the lighting definition.
                              • Add the colorMap in the diffuse map slot and the lightMap in the light map slot.
                              • -
                              • Make sure you check "SeparateTexCoords"
                                +
                              • Make sure you check “SeparateTexCoords”
                                • @@ -461,7 +447,6 @@ Once this is done, export your model with the ogre exporter (or import it direct

                                - The blend file, the ogre xml files and the textures can be found in the download section of the google code repo

                                @@ -471,7 +456,7 @@ The blend file, the ogre xml files and the textures can be found in the download
                              -

                              Modelling racing tracks and cars

                              +

                              Modelling racing tracks and cars

                              @@ -481,7 +466,7 @@ Follow the link below to a pdf tutorial by rhymez where I guide you to modelling

                              -

                              Optimizing Models for 3D games

                              +

                              Optimizing Models for 3D games

                              @@ -491,16 +476,15 @@ Follow the link below to a pdf tutorial by rhymez where I guide you on how you c

                              -

                              SkyBox baking

                              +

                              SkyBox baking

                              -There are several ways to create static images to use for a sky in your game. This will describe the concepts used in blender and create an ugly sky :-) Check the links below for other ways and prettier skies. +There are several ways to create static images to use for a sky in your game. This will describe the concepts used in blender and create an ugly sky :-) Check the links below for other ways and prettier skies.

                              A sky box is a texture mapped cube, it can also, loosely, be called en EnvMap or a CubeMap. The camera is inside the cube and the clever thing that jME does is to draw the sky so it is always behind whatever else is in your scene. Imagine the monkey is the camera in the picture. -

                              • @@ -508,7 +492,6 @@ A sky box is a texture mapped cube, it can also, loosely, be called en EnvMap or

                              - But a real sky is not a box around our heads, it is more like a sphere. So if we put any old image in the sky it will look strange and might even look like a box. This is not what we want. The trick is to distort the image so that it will look like a sphere even if it in fact is a picture pasted on a box. Luckily blender can do that tricky distortion for us.

                              @@ -518,7 +501,6 @@ The screenshots are from Blender 2.63 but the equivalent operations have been in

                              So let's get started -

                              • Fire up blender and you'll see something like this.
                                @@ -566,13 +548,11 @@ So let's get started

                              - -

                              The SDK also contains an image editor, right-click the image and select "edit image" to open it. +

                              The SDK also contains an image editor, right-click the image and select “edit image” to open it.

                              -

                                -
                              • You will notice that Blender has taken the 6 sides of the cube and pasted together into one image (3x2). So now we need to cut it up again into 6 separate images. In gimp I usually set the guides to where I want to cut and then go into Filters???Web???Slice and let gimp cut it up for me.
                                +
                              • You will notice that Blender has taken the 6 sides of the cube and pasted together into one image (3×2). So now we need to cut it up again into 6 separate images. In gimp I usually set the guides to where I want to cut and then go into Filters→Web→Slice and let gimp cut it up for me.
                                • @@ -610,12 +590,11 @@ If you want to do it from code, here is an example:

                                  This example uses a strange normalScale, this is to flip the image on the X-axis and might not be needed in your case. Hint: the texture is applied on the outside of the cube but we are inside so what do we see?

                                  -

                              -

                              Further reading

                              +

                              Further reading

                              -

                              view online version

                              \ No newline at end of file +

                              view online version

                              \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender_apply_bones.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender_apply_bones.png index a82389228..617454726 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender_apply_bones.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender_apply_bones.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender_apply_mesh.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender_apply_mesh.png index f1de050fa..c063a8d1b 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender_apply_mesh.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender_apply_mesh.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender_envelopes.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender_envelopes.png index 4621480b4..eee1b7aaf 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender_envelopes.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender_envelopes.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender_finished.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender_finished.png index bf2f1f585..006f4cb21 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender_finished.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender_finished.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender_rootbone.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender_rootbone.png index b8bf5467f..9bb251d2a 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender_rootbone.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/external/blender_rootbone.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/faq.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/faq.html index f7f7c8768..ea1a02bf6 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/faq.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/faq.html @@ -1,173 +1,156 @@ -

                              Frequently Asked Questions

                              +

                              Frequently Asked Questions

                              -

                              I want to create and configure a jME3 Application

                              +

                              I want to create and configure a jME3 Application

                              -

                              How do I start writing a preconfigured jME game?

                              +

                              How do I start writing a preconfigured jME game?

                              Write a Java class that extends .
                              Learn more: Hello SimpleApplication, . -

                              -

                              How do I change the background color?

                              +

                              How do I change the background color?

                              viewPort.setBackgroundColor(ColorRGBA.Blue);
                              -

                              Can I customize the SimpleApplication class?

                              +

                              Can I customize the SimpleApplication class?

                              -Yes! Actually, you MUST customize it! For your own games, you always create a custom base class that extends class. From now on it's no longer a "simple application" ??? it's now your game. Configure your application settings, implement methods, and customize away! +Yes! Actually, you MUST customize it! For your own games, you always create a custom base class that extends class. From now on it's no longer a “simple application” – it's now your game. Configure your application settings, implement methods, and customize away!
                              Learn more: SimpleApplication, AppSettings. -

                              -

                              How can I switch between screens or states?

                              +

                              How can I switch between screens or states?

                              -You should break down your application logic into components by spreading it out over individual AppStates. AppStates can be attached to and detached from the game. AppStates have access to all objects (rootNode, PhysicsSpace, inputManager, etc) and methods in your main application. So each AppState can bring its own subset of input handlers, GUI nodes, spatial nodes, and even its own subset of game mechanics in the update() loop. +You should break down your application logic into components by spreading it out over individual AppStates. AppStates can be attached to and detached from the game. AppStates have access to all objects (rootNode, PhysicsSpace, inputManager, etc) and methods in your main application. So each AppState can bring its own subset of input handlers, GUI nodes, spatial nodes, and even its own subset of game mechanics in the update() loop.
                              Learn more: Application States. -

                              -

                              How do I pause/unpause a game?

                              +

                              How do I pause/unpause a game?

                              -You split up your application into several AppStates and implement the setEnabled() methods for each state. Then you create, for example, a GameRunningAppState and a GamePausedAppState. GamePausedAppState's job is to attach all your AppStates that contain the logic and GUI of the pause screen, and to detach all the AppStates that contain logic and GUI of the running game. GameRunningAppState does the opposite. By attaching one or the other to the game, you switch between the paused and unpaused states. +You split up your application into several AppStates and implement the setEnabled() methods for each state. Then you create, for example, a GameRunningAppState and a GamePausedAppState. GamePausedAppState's job is to attach all your AppStates that contain the logic and GUI of the pause screen, and to detach all the AppStates that contain logic and GUI of the running game. GameRunningAppState does the opposite. By attaching one or the other to the game, you switch between the paused and unpaused states.
                              Learn more: Application States. -

                              -

                              How do I disable logger output to the console?

                              +

                              How do I disable logger output to the console?

                              During development, you can switch the severity level of the default logger to no longer print FINE warnings, but only WARNINGs. -

                              java.util.logging.Logger.getLogger("").setLevel(Level.WARNING);

                              - For the release, switch the severity level of the default logger to print only SEVERE errors. -

                              java.util.logging.Logger.getLogger("").setLevel(Level.SEVERE);

                              - Learn more: Logging. -

                              -

                              Why does the executable crash with "Cannot locate resource"?

                              +

                              Why does the executable crash with "Cannot locate resource"?

                              Make sure to only load() models converted to .j3o binary format, not the original Ogre or Wavefront formats. If you load assets from zip files, make sure to ammend the build script to copy them to the build directory.
                              Learn more: Asset Manager -

                              -

                              What is java.lang.LinkageError: Version mismatch?

                              +

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

                              +

                              I want to load my scene

                              -

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

                              +

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

                              To make a spatial appear in the scene, you attach it to the rootNode (or to a node that is attached to the rootnode). To remove a spatial, you detach it from its parent node. -

                              rootNode.attachChild(spatial); // appear in scene
                              rootNode.detachChild(spatial); // remove from scene

                              - Learn more: The Scene Graph, Hello Node, Hello Asset, Spatial, and .

                              -

                              Why do I get AssetNotFoundException when loading X ?

                              +

                              Why do I get AssetNotFoundException when loading X ?

                              First check whether the file path of the asset is correct. By default it is relative to your project's assets directory: -

                              // To load .../jMonkeyProjects/MyGame/assets/Models/Ninja/Ninja.j3o
                               Spatial ninja = assetManager.loadModel("Models/Ninja/Ninja.j3o");

                              - If you are not using the default assets directory, verify that you have registered a locator to the AssetManager. are available. -

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

                              - Note that you should not register every single folder containing a texture as the assetmanager will not be able to discern between images with the same name anymore. Learn more: Asset Manager

                              -

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

                              +

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

                              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 example Gimp, and export them as PNG or JPG. +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 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;
                              @@ -176,27 +159,24 @@ 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?

                              +

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

                              -Use the jMonkeyEngine SDK to convert models from Ogre XML or Wavefront OBJ formats to .j3o binary format. Load the .j3o file using the AssetManager. - +Use the jMonkeyEngine SDK to convert models from Ogre XML or Wavefront OBJ formats to .j3o binary format. Load the .j3o file using the AssetManager.

                              // To load .../jMonkeyProjects/MyGame/assets/Models/Ninja/Ninja.j3o
                               Spatial ninja = assetManager.loadModel("Models/Ninja/Ninja.j3o");

                              - Learn more: Hello Asset, Asset Manager, , , jMonkeyEngine SDK j3o converter,
                              Code sample: , . -

                              -

                              How do initialize the scene?

                              +

                              How do initialize the scene?

                              @@ -207,28 +187,26 @@ Use the simpleInitApp() method in SimpleApplication (or initApp() in Application

                              -

                              I want to transform objects in the scene

                              +

                              I want to transform objects in the scene

                              -

                              How do I move or turn or resize a spatial?

                              +

                              How do I move or turn or resize a spatial?

                              To move or turn or resize a spatial you use transformations. You can concatenate transformations (e.g. perform rotations around several axes in one step using a Quaternion with slerp() or a com.jme3.math.Transform with interpolateTransforms(). -

                              spatial.setLocalTranslation(1,-3,2.5f); spatial.rotate(0,3.14f,0); spatial.scale(2,2,2);

                              - Learn more: Hello Node, Spatial, rotate, rotate_about_a_point, quaternion, math_for_dummies.

                              -

                              How do I make a spatial move by itself?

                              +

                              How do I make a spatial move by itself?

                              @@ -241,18 +219,17 @@ Change the geometry's translation (position) live in the update loop using

                              -

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

                              +

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

                              -
                              Geometry result = spatial.getName().startsWith(name);
                              +
                              Geometry submesh = (Geometry) model.getChild("door 12");

                              - Learn more: Spatial

                              - -

                              How do I make procedural or custom shapes?

                              + +

                              How do I make procedural or custom shapes?

                              @@ -262,49 +239,43 @@ You can programmatically create com.jme3.scene.Mesh'es.

                              - -

                              I want to change the surface of objects in the scene

                              + +

                              I want to change the surface of objects in the scene

                              - -

                              Why is my UV wrapping / texture appearance all wrong?

                              + +

                              Why is my UV wrapping / texture appearance all wrong?

                              The most likely reason is the flipping of textures. You may be using the following default method: -

                                material.setTexture("ColorMap", assetManager.loadTexture("myTexture.jpg"));

                              - You can set the boolean value in the constructor of TextureKey to flipped or not flipped. Toggle the boolean to see if it fixes your UV wrapping/texture problem: -

                                material.setTexture("ColorMap", this.assetManager.loadTexture(new TextureKey("myTexture.jpg", false)));
                              - -

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

                              + +

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

                              You cannot scale a texture, but you scale the texture coordinates of the mesh the texture is applied to: -

                              mesh.scaleTextureCoordinates(new Vector2f(2,2));

                              - You can choose among various com.jme3.texture.Texture.WrapModes for individual texture maps of a material: BorderClamp, EdgeClamp, Clamp; MirrorBorderClamp, MirrorEdgeClamp, MirrorClamp; Repeat, MirroredRepeat. -

                              material.getTextureParam("DiffuseMap").getTextureValue().setWrap(WrapMode.Repeat);
                              - -

                              How do I change color or shininess of an material?

                              + +

                              How do I change color or shininess of an material?

                              @@ -316,8 +287,8 @@ Use the AssetManager to load Materials, and change material settings.

                              - -

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

                              + +

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

                              @@ -329,8 +300,8 @@ Create Textures as image files. Use the AssetManager to load a Material and use

                              - -

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

                              + +

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

                              @@ -338,8 +309,8 @@ If you use a lit material (based on Lighting.j3md) then you must attach a light

                              - -

                              How do I make geometries cast a shadow?

                              + +

                              How do I make geometries cast a shadow?

                              @@ -351,74 +322,75 @@ Use com.jme3.shadow.BasicShadowRenderer together with com.jme3.light.Directional

                              - -

                              How do I make materials transparent?

                              + +

                              How do I make materials transparent?

                              Assign a texture with an alpha channel to a Material and set the Material's blend mode to alpha. Use this to create transparent or translucent materials such as glass, window panes, water, tree leaves, etc. -

                              material.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);

                              - Learn more: Hello Material, How To Use Materials,

                              - -

                              How do I force or disable culling?

                              + +

                              How do I force or disable culling?

                              While debugging custom meshes, you can switch the com.jme3.material.RenderState.FaceCullMode off to see the inside and outside of the mesh. -

                              someMaterial.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);

                              - You can also deactivate the com.jme3.scene.Spatial.CullHint of a whole spatial to force jme to calculate it even if it is behind the camera and outside of view. -

                              someNode.setCullHint(CullHint.Never);

                              - Learn more: Spatial -

                              - -

                              Can I draw only an outline of the scene?

                              + +

                              Can I draw only an outline of the scene?

                              Add a renders state to the material's and activate Wireframe. -

                              material.getAdditionalRenderState().setWireframe(true);

                              - Learn more: Debugging.

                              - -

                              I want to control the camera

                              + +

                              I want to control the camera

                              +

                              +The default camera cam is an instance of the Camera class. Learn more: +

                              +
                              - -

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

                              + +

                              How do I keep the camera from moving?

                              +
                                +
                              • SimpleApplication activates flyCam (an instance of FlyByCamera) by default. flyCam causes the camera to move with the mouse and the WASD keys. You can disable flyCam as follows:
                                flyCam.setEnabled(false);
                                +
                                +
                              • +
                              -

                              -The default camera is the cam object. Learn more: -

                              +
                              + +

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

                              +
                              • You can activate the FlyBy Cam as a first-person camera.
                                Learn more: Hello Collision.
                                @@ -434,30 +406,30 @@ chaseCam = new ChaseCamera(cam, spatial, inputManager);
                              - -

                              How do I increase camera speed?

                              + +

                              How do I increase camera speed?

                              flyCam.setMoveSpeed(50f);
                              - -

                              Actions, Interactions, Physics

                              + +

                              Actions, Interactions, Physics

                              - -

                              How do I implement game logic / game mechanics?

                              + +

                              How do I implement game logic / game mechanics?

                              -Use Controls to define the behaviour of types of Spatials. Use Application States to implement global behaviour, to group subsets of input handlers or GUI screens, etc. Use the simpleUpdate() and update() loops for tests and interactions. Use Cinematics to remote-control objects in scenes. +Use Controls to define the behaviour of types of Spatials. Use Application States to implement global behaviour, to group subsets of input handlers or GUI screens, etc. Use the simpleUpdate() and update() loops for tests and interactions. Use Cinematics to remote-control objects in scenes.
                              Learn more: Hello Loop, Update Loop, Custom Controls, Application States, Cinematics

                              - -

                              How do I let players interact via keyboard?

                              + +

                              How do I let players interact via keyboard?

                              @@ -467,12 +439,12 @@ Use com.jme3.input.KeyInput and a Input Listener.

                              - -

                              How do I let players interact by clicking?

                              + +

                              How do I let players interact by clicking?

                              -Players typically click the mouse to pick up objects, to open doors, to shoot a weapon, etc. Use an Input Listener to respond to mouse clicks, then cast a ray from the player; if it intersects with the bounding volume of a spatial, this is the selected target. The links below contain code samples for both "fixed crosshair" picking and "free mouse pointer" picking. +Players typically click the mouse to pick up objects, to open doors, to shoot a weapon, etc. Use an Input Listener to respond to mouse clicks, then cast a ray from the player; if it intersects with the bounding volume of a spatial, this is the selected target. The links below contain code samples for both “fixed crosshair” picking and “free mouse pointer” picking.
                              Learn more: Hello Picking, Mouse Picking, Collision and Intersection, Input Handling, com.jme3.bounding.*, com.jme3.math.Ray, com.jme3.collision.CollisionResults.
                              @@ -480,8 +452,8 @@ Players typically click the mouse to pick up objects, to open doors, to shoot a

                              - -

                              How do I animate characters?

                              + +

                              How do I animate characters?

                              @@ -493,8 +465,8 @@ 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?

                              + +

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

                              @@ -504,8 +476,8 @@ Use collision detection. The most common solution is to use jme's physics i

                              - -

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

                              + +

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

                              @@ -517,18 +489,18 @@ Add physics controls to Spatials and give them spherical or cylindrical bounding

                              - -

                              How do I debug weird Physics behaviour?

                              + +

                              How do I debug weird Physics behaviour?

                              -Maybe your collision shapes overlap ??? or they are not where you think they are. Make the collision shapes visible by adding the following line after the bulletAppState initialization: +Maybe your collision shapes overlap – or they are not where you think they are. Make the collision shapes visible by adding the following line after the bulletAppState initialization:

                              bulletAppState.getPhysicsSpace().enableDebug(assetManager);
                              - -

                              How do I make a walking character?

                              + +

                              How do I make a walking character?

                              @@ -540,8 +512,8 @@ Code samples: -

                              How do I steer vehicles?

                              + +

                              How do I steer vehicles?

                              @@ -553,8 +525,8 @@ Code samples: -

                              Can objects swing like a pendulums, chains, ropebridges?

                              + +

                              Can objects swing like a pendulums, chains, ropebridges?

                              @@ -565,44 +537,40 @@ Use a PhysicsControl's hinges and joints.

                              - -

                              Default GUI Display

                              + +

                              Default GUI Display

                              - -

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

                              + +

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

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

                              - -

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

                              + +

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

                              In the application's simpleInitApp() method, call: -

                              setDisplayFps(false); // to hide the FPS
                               setDisplayStatView(false); // to hide the statistics 

                              -
                              Learn more: StatsView -

                              - -

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

                              + +

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

                              @@ -614,12 +582,12 @@ Attach text and pictures to the orthogonal guiNode to create a head

                              - -

                              How do I display buttons and UI controls?

                              + +

                              How do I display buttons and UI controls?

                              -You may want to display buttons to let the player switch between the game, settings screen, and score screens. For buttons and other more advanced UI controls, jME supports the Nifty GUI library. +You may want to display buttons to let the player switch between the game, settings screen, and score screens. For buttons and other more advanced UI controls, jME supports the Nifty GUI library.
                              Learn more: Nifty GUI
                              @@ -627,8 +595,8 @@ Sample Code: -

                              How do i display a loading screen?

                              + +

                              How do i display a loading screen?

                              @@ -638,24 +606,23 @@ Instead of having a frozen frame while your games loads, you can have a loading

                              - -

                              Nifty GUI

                              + +

                              Nifty GUI

                              - -

                              I get NoSuchElementException when adding controls (buttons etc)!

                              + +

                              I get NoSuchElementException when adding controls (buttons etc)!

                              -Verify that you include a controls definition file link in your XML: This is the default: - +Verify that you include a controls definition file link in your XML: This is the default:

                              <useControls filename="nifty-default-controls.xml"/>
                              - -

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

                              + +

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

                              @@ -663,22 +630,22 @@ Verify that you include a controls definition file link in your -

                              Is there Java Doc for Nifty GUI?

                              + +

                              Is there Java Doc for Nifty GUI?

                              - -

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

                              + +

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

                              - -

                              How do I play sounds and noises?

                              + +

                              How do I play sounds and noises?

                              @@ -690,8 +657,8 @@ Use AudioRenderer, Listener, and AudioNode from com.jme3.audio.*.

                              - -

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

                              + +

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

                              @@ -703,8 +670,8 @@ For swarm like effects you use particle emitters.

                              - -

                              How do I make water, waves, reflections?

                              + +

                              How do I make water, waves, reflections?

                              @@ -716,8 +683,8 @@ Use a special post-processor renderer from com.jme3.water.*.

                              - -

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

                              + +

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

                              @@ -727,8 +694,8 @@ Use special post-processor renderers from com.jme3.post.*.

                              - -

                              How do I generate a terrain?

                              + +

                              How do I generate a terrain?

                              @@ -740,43 +707,40 @@ Use com.jme3.terrain.*. The JMonkeyEngine also provides you with a Terrain Edito

                              - -

                              How do I make a sky?

                              + +

                              How do I make a sky?

                              Code sample: -

                              rootNode.attachChild(SkyFactory.createSky( assetManager,
                                      "Textures/Sky/Bright/BrightSky.dds", false));
                               skyGeo.setQueueBucket(Bucket.Sky) 

                              - Learn more: Sky

                              - -

                              I want to access to back-end properties

                              + +

                              I want to access to back-end properties

                              - -

                              How do I read out graphic card capabilities?

                              + +

                              How do I read out graphic card capabilities?

                              If your game is heavily using features that older cards do not support, you can Read Graphic Card Capabilites in the beginning before starting the app, and then decide how to proceed. -

                              Collection<com.jme3.renderer.Caps> caps = renderer.getCaps();
                               Logger.getLogger(HelloJME3.class.getName()).log(Level.INFO, "Capabilities: {0}", caps.toString());
                              - -

                              How do I Run jMonkeyEngine 3 with OpenGL1?

                              + +

                              How do I Run jMonkeyEngine 3 with OpenGL1?

                              @@ -787,45 +751,40 @@ In your game, add

                              to the AppSettings (see details there).
                              -For the jMonkeyEngine SDK itself, choose Options > OpenGL, and check OpenGL1. - +For the jMonkeyEngine SDK itself, choose Options > OpenGL, and check OpenGL1.

                              - -

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

                              + +

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

                              You can batch all Geometries in a scene (or a subnode) that remains static. -

                              jme3tools.optimize.GeometryBatchFactory.optimize(rootNode);

                              - Batching means that all Geometries with the same Material are combined into one mesh. This optimization only has an effect if you use only few (roughly up to 32) Materials total. The pay-off is that batching takes extra time when the game is initialized. -

                              - -

                              How do I prevent users from unzipping my JAR?

                              + +

                              How do I prevent users from unzipping my JAR?

                              -Add an . The SDK comes with a basic obfuscation script that you can enable in the project settings. - +Add an . The SDK comes with a basic obfuscation script that you can enable in the project settings.

                              - -

                              I want to do maths

                              + +

                              I want to do maths

                              - -

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

                              + +

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

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

                            7. Example 2: v.mult(b).add(b); :!:
                              +
                            8. Example 2: v.mult(b).add(b); :!:
                              • Watch out: This calculates the expected result, but unless you actually use the return value, it is discarded!
                              • @@ -877,29 +836,27 @@ Many maths functions (mult(), add(), subtract(), etc) come as local and a non-lo
                            9. - -

                              What is the difference between World and Local coordinates?

                              + +

                              What is the difference between World and Local coordinates?

                              -World coordinates of a Spatial are its absolute coordinates in the 3D scene (this is like giving GPS coordinates). Local coordinates are relative to the Spatial's parent Spatial (this is like saying, "I'm ten meters left of the entrance"). - +World coordinates of a Spatial are its absolute coordinates in the 3D scene (this is like giving GPS coordinates). Local coordinates are relative to the Spatial's parent Spatial (this is like saying, “I'm ten meters left of the entrance”).

                              - -

                              How do I convert Degrees to Radians?

                              + +

                              How do I convert Degrees to Radians?

                              - Multiply degree value by FastMath.DEG_TO_RAD to convert it to radians.

                              - + +

                              +tag_documentation_faq +

                              - -

                              view online version

                              \ No newline at end of file + +

                              view online version

                              \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/appsettings.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/appsettings.html index 6ee0d853a..9816dcc60 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/appsettings.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/appsettings.html @@ -1,9 +1,8 @@ -

                              jME3 Application Display Settings

                              +

                              jME3 Application Display Settings

                              - Every class that extends jme3.app.SimpleApplication has properties that can be configured by customizing a com.jme3.system.AppSettings object.

                              @@ -18,11 +17,10 @@ Every class that extends jme3.app.SimpleApplication has properties that can be c
                              -

                              Code Samples

                              +

                              Code Samples

                              - Specify settings for a game (here called MyGame, or whatever you called your SimpleApplication instance) in the main() method before the game starts:

                              public static void main(String[] args) {
                              @@ -42,7 +40,7 @@ Set the boolean in the AppSettings contructor to true if you want to keep the de
                               This example toggles the settings to fullscreen while the game is already running. Then it restarts the game context (not the whole game) which applies the changed settings.
                               

                              public void toggleToFullscreen() {
                              -  GraphicsDevice device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
                              +  GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
                                 DisplayMode[] modes = device.getDisplayModes();
                                 int i=0; // note: there are usually several, let's pick the first
                                 settings.setResolution(modes[i].getWidth(),modes[i].getHeight());
                              @@ -55,12 +53,14 @@ This example toggles the settings to fullscreen while the game is already runnin
                               
                               
                              -

                              Properties

                              +

                              Properties

                              + + +4 bpp = 16 colors, 8 bpp = 256 colors, 24 or 32 bpp = “truecolor”. @@ -80,7 +80,7 @@ Set this to false to play the game in a normal window of its own. +setResolution(640,480)
                              Settings Property (Video)DescriptionDefault
                              setRenderer(AppSettings.LWJGL_OPENGL1)
                              setRenderer(AppSettings.LWJGL_OPENGL2)
                              @@ -69,7 +69,7 @@ setRenderer(AppSettings.LWJGL_OPENGL3)
                              Switch Video Renderer to OpenGL 1
                              setBitsPerPixel(32)Set the color depth.
                              1 bpp = black and white, 2 bpp = gray,
                              -4 bpp = 16 colors, 8 bpp = 256 colors, 24 or 32 bpp = "truecolor".
                              2424
                              setFramerate(60)How often per second the engine should try to refresh the frame. For the release, usually 60 fps. Can be lower (30) if you need to free up the CPU for other applications. No use setting it to a higher value than the screen frequency! If the framerate goes below 30 fps, viewers start to notice choppiness or flickering.-1 (unlimited)False
                              setHeight(480), setWidth(640)
                              -setResolution(640,480)
                              Two equivalent ways of setting the display resolution.640x480 pixelsTwo equivalent ways of setting the display resolution.640×480 pixels
                              setSamples(4)Set multisampling to 0 to switch antialiasing off (harder edges, faster.)
                              @@ -95,9 +95,11 @@ Set VSync to false to deactivate vertical syncing (faster, but possible page tea
                              + + @@ -112,9 +114,11 @@ Set VSync to false to deactivate vertical syncing (faster, but possible page tea
                              Settings Property (Input)DescriptionDefault
                              setUseInput(false)Respond to user input by mouse and keyboard. Can be deactivated for use cases where you only display a 3D scene on the canvas without any interaction.true
                              + + @@ -123,35 +127,38 @@ Set VSync to false to deactivate vertical syncing (faster, but possible page tea
                              Settings Property (Audio)DescriptionDefault
                              setAudioRenderer(AppSettings.LWJGL_OPENAL)Switch Audio Renderer. Currently there is only one option. OpenAL
                              + + - + +ImageIO.read(new File(“”)), …}); - +
                              Settings Property (Branding)DescriptionDefault
                              setTitle("My Game")This string will be visible in the titlebar, unless the window is fullscreen."jMonkey Engine 3.0"setTitle(“My Game”)This string will be visible in the titlebar, unless the window is fullscreen.“jMonkey Engine 3.0”
                              setIcons(new BufferedImage[]{
                              -ImageIO.read(new File("")), ???});
                              This specifies the little application icon in the titlebar of the application (unused in MacOS?). You should specify the icon in various sizes (256,128,32,16) to look good on various operating systems. Note: This is not the application icon on the desktop.nullThis specifies the little application icon in the titlebar of the application (unused in MacOS?). You should specify the icon in various sizes (256,128,32,16) to look good on various operating systems. Note: This is not the application icon on the desktop.null
                              setSettingsDialogImage("Interface/mysplashscreen.png")A custom splashscreen image in the assets/Interface directory which is displayed when the settings dialog is shown."/com/jme3/app/Monkey.png"setSettingsDialogImage(“Interface/mysplashscreen.png”)A custom splashscreen image in the assets/Interface directory which is displayed when the settings dialog is shown.“/com/jme3/app/Monkey.png”

                              - -

                              You can use app.setShowSettings(true); and setSettingsDialogImage("Interface/mysplashscreen.png") to present the user with jme3's default display settings dialog when starting the game. Use app.setShowSettings(false); to hide the default settings screen. Set this boolean before calling app.start() on the SimpleApplication. +

                              You can use app.setShowSettings(true); and setSettingsDialogImage(“Interface/mysplashscreen.png”) to present the user with jme3's default display settings dialog when starting the game. Use app.setShowSettings(false); to hide the default settings screen. Set this boolean before calling app.start() on the SimpleApplication.

                              -

                              Toggling and Activating Settings

                              +

                              Toggling and Activating Settings

                              + + @@ -168,24 +175,22 @@ ImageIO.read(new File("")), ???});
                              SimpleApplication methodDescription
                              app.setShowSettings(boolean)Activate or deactivate the default settings screen before start()ing the game. If you let users use this screen, you do not need to modify the settings object. Note: Most developers implement their own custom settings screen, but the default one is useful during the alpha stages.
                              This specifies the little a -

                              Saving and Loading Settings

                              +

                              Saving and Loading Settings

                              - -An AppSettings object also supports the following methods to save your settings under a unique key (in this example "com.foo.MyCoolGame3"): +An AppSettings object also supports the following methods to save your settings under a unique key (in this example “com.foo.MyCoolGame3”):

                                -
                              • Use settings.save("com.foo.MyCoolGame3") to save your settings via standard java.io serialization.
                                +
                              • Use settings.save(“com.foo.MyCoolGame3”) to save your settings via standard java.io serialization.
                              • -
                              • Use settings.load("com.foo.MyCoolGame3") to load your settings.
                                +
                              • Use settings.load(“com.foo.MyCoolGame3”) to load your settings.
                              • Use settings2.copyFrom(settings) to copy a settings object.

                              - Usage:

                              @@ -198,14 +203,14 @@ Provide the unique name of your jME3 application as the String argument. For exa
                            10. On Windows, the preferences are saved under the following registry key:
                              HKEY_CURRENT_USER\Software\JavaSoft\Prefs\com\foo\MyCoolGame3
                            11. -
                            12. On Linux, the preferences are saved in an XML file under:
                              +
                            13. On Linux, the preferences are saved in an XML file under:
                              $HOME/.java/.userPrefs/com/foo/MyCoolGame3
                            14. -
                            15. On Mac OS X, the preferences are saved as XML file under:
                              +
                            16. On Mac OS X, the preferences are saved as XML file under:
                              $HOME/Library/Preferences/com.foo.MyCoolGame3.plist
                            17. -

                              view online version

                              \ No newline at end of file +

                              view online version

                              \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/best_practices.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/best_practices.html index fe1b95cb3..2efa7df4a 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/best_practices.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/best_practices.html @@ -1,40 +1,37 @@ -

                              Best Practices For jME3 Developers

                              +

                              Best Practices For jME3 Developers

                              - Every milestone of a game development project is made up of phases: Planning, development, testing, and release. Every milestone involves updates to multi-media assets and to code.

                              -This "best practices" page is a collection of recommendations and expert tips. Feel free to add your own! +This “best practices” page is a collection of recommendations and expert tips. Feel free to add your own!

                              -

                              Requirements and Planning

                              +

                              Requirements and Planning

                              - If you are a beginner, you should first game development. We cannot cover all general tips here.

                              -

                              Requirements Gathering

                              +

                              Requirements Gathering

                              - As a quick overview, answer yourself the following questions:

                              • Motivation
                                • Sum up your game idea in one catchy sentence. If you can't, it's too complicated.
                                  -E.g. "Craft by day, fight by night!"
                                  +E.g. “Craft by day, fight by night!”
                            18. Who's the target group? Are you making it for your friends or are you trying to attract the masses?
                            19. @@ -48,7 +45,7 @@ E.g. "Craft by day, fight by night!"
                            20. Genre (drama, horror, adventure, mystery, comedy, educational, documentary)?
                            21. -
                            22. Setting and background story? (historic, fantasy, anime, futuristic, utopia/dystopia, pirate, zombie, vampire???)?
                              +
                            23. Setting and background story? (historic, fantasy, anime, futuristic, utopia/dystopia, pirate, zombie, vampire…)?
                            24. @@ -57,7 +54,7 @@ E.g. "Craft by day, fight by night!"
                            25. What is the start state, what is the end state? (if applicable)
                            26. What resources does the player manage? How are resources gained, transformed, spent?
                              -E.g. "points", health, speed, gold, xp, mana.
                              +E.g. “points”, health, speed, gold, xp, mana.
                            27. How does the player interact? Define rules, challenges, game mechanics.
                            28. @@ -86,11 +83,10 @@ E.g. models, terrains; materials, textures; noises, music, voices; video, cutsce -

                              Planning Development Milestones

                              +

                              Planning Development Milestones

                              - Use an to outline what features you want and what components are needed.

                                @@ -101,7 +97,7 @@ Use an
                                Lay out the overall application flow, i.e. switching between intro / options / game screen, etc.
                              1. Get one typical level working before you can announce the Alpha Release.
                                -E.g. if the game is a "Jump'n'Run", jumping and running must work.
                                +E.g. if the game is a “Jump'n'Run”, jumping and running must work.
                              2. @@ -111,7 +107,7 @@ E.g. if the game is a "Jump'n'Run", jumping and running must
                                • Artwork: Replace all mock-ups with first drafts of real media and level maps.
                                • -
                                • Have your team members review and "alpha test" it on various systems, track bugs, debug, optimize.
                                  +
                                • Have your team members review and “alpha test” it on various systems, track bugs, debug, optimize.
                                • Declare before you announce the Beta Release to prevent a bottomless pit of new bugs.
                                • @@ -123,13 +119,13 @@ E.g. if the game is a "Jump'n'Run", jumping and running must
                                  • Artwork: Fill in the final media and level maps.
                                  • -
                                  • Have external people review and "beta test" it, make it easy to report bugs.
                                    +
                                  • Have external people review and “beta test” it, make it easy to report bugs.
                                  • Fix high-priority bugs, even out the kinks in code and gameplay, don't add new features for now!
                                  -
                                • Gamma Release, Delta Release??? = Release Candidates
                                  +
                                • Gamma Release, Delta Release… = Release Candidates
                                  • Think you're done? Make test runs incl. packaging and distribution. (Order form? download?)
                                  • @@ -142,37 +138,37 @@ E.g. if the game is a "Jump'n'Run", jumping and running must

                                    - -How you name or number these stages is fully up to your team. Development teams use numbered milestones (m1, m2, m3), Greek letters (e.g. alpha, beta, gamma, delta), numbering (e.g. "2.7.23-1328"), or combinations thereof. +How you name or number these stages is fully up to your team. Development teams use numbered milestones (m1, m2, m3), Greek letters (e.g. alpha, beta, gamma, delta), numbering (e.g. “2.7.23-1328”), or combinations thereof.

                                    -

                                    Use File Version Control

                                    +

                                    Use File Version Control

                                    - Whether you work in a team or alone, keeping a version controlled repository of your code will help you roll-back buggy changes, or recover old code that someone deleted and that is now needed again.

                                      -
                                    • Treat commit messages as messages to your future self. "Made some changes" is not a commit message.
                                      +
                                    • Treat commit messages as messages to your future self. “Made some changes” is not a commit message.
                                    • -
                                    • The jMonkeyEngine SDK supports Subversion, Mercurial, and Git.
                                      +
                                    • The jMonkeyEngine SDK supports Subversion, Mercurial, and Git.
                                      If you don't know which to choose, Subversion is a good choice for starters.
                                    • -
                                    • Set up your own local server, or get free remote hosting space from various open-source dev portals like , , (supports private projects), , ???
                                      +
                                    • Set up your own local server, or get free remote hosting space from various open-source dev portals like , , (supports private projects), ,
                                    -

                                    Multi-Media Asset Pipeline

                                    +

                                    Multi-Media Asset Pipeline

                                    + + @@ -194,34 +190,31 @@ If you don't know which to choose, Subversion is a good choice for starters
                                    DODON'T
                                    Save original models+textures into assets/Textures. Don't reference textures or models outside your JME project.

                                    - Learn details about the Multi-Media Asset Pipeline here.

                                    -

                                    Development Phase

                                    +

                                    Development Phase

                                    - -

                                    Many game developers dream of creating their very own "MMORPG with full-physics, AI, post-rendering effects, multi-player networking, procedurally generated maps, and customizable characters". So why aren't there tons of MMORPGs out there?
                                    -Even for large experienced game producers, the creation of such a complex game is time-intensive and failure-prone. How familiar are you with multi-threading, persistence, optimization, client-server synchonization, ???? Unless your answer is "very!", then start with a single-player desktop game, and work your way up ??? just as the pros did when they started. +

                                    Many game developers dream of creating their very own “MMORPG with full-physics, AI, post-rendering effects, multi-player networking, procedurally generated maps, and customizable characters”. So why aren't there tons of MMORPGs out there?
                                    +Even for large experienced game producers, the creation of such a complex game is time-intensive and failure-prone. How familiar are you with multi-threading, persistence, optimization, client-server synchonization, …? Unless your answer is “very!”, then start with a single-player desktop game, and work your way up – just as the pros did when they started.

                                    -

                                    Extend SimpleApplication

                                    +

                                    Extend SimpleApplication

                                    - Every jME3 game is centered around one main class that (directly or indirectly) extends com.jme3.app.SimpleApplication.

                                    -

                                    Note that although the "SimpleApplication" name might be misleading, all jME3 applications, including very large projects, are based on this class. The name only implies that this class itself is a simple application already. You make it "non-simple" by extending it! +

                                    Note that although the “SimpleApplication” name might be misleading, all jME3 applications, including very large projects, are based on this class. The name only implies that this class itself is a simple application already. You make it “non-simple” by extending it!

                                    @@ -237,19 +230,18 @@ Also, your own framework gives all your games a common look and feel.
                                    -

                                    Where to Start?

                                    +

                                    Where to Start?

                                    - You have a list of features that you want in game, but which one do you implement first? You will keep adding features to a project that grows more and more complex, how can you minimize the amount of rewriting required?

                                    1. Make sure the game's high-level frame (screen switching, network sync, loading/saving) is sound and solid.
                                    2. -
                                    3. Start with implementing the most complex game feature first ??? the one that imposes most constraints on the structure of your project (for example: multi-player networking, or physics.)
                                      +
                                    4. Start with implementing the most complex game feature first – the one that imposes most constraints on the structure of your project (for example: multi-player networking, or physics.)
                                    5. -
                                    6. Add only one larger feature at a time. If there are complex interactions (such as "networking + physics"), start with a small test case ("one shared cube") and work your way up. Starting with a whole scene introduces too many extra sources of error.
                                      +
                                    7. Add only one larger feature at a time. If there are complex interactions (such as “networking + physics”), start with a small test case (“one shared cube”) and work your way up. Starting with a whole scene introduces too many extra sources of error.
                                    8. Implement low-complexity decorations (audio and visual effects) last.
                                    9. @@ -258,21 +250,19 @@ You have a list of features that you want in game, but which one do you implemen

                                    - -

                                    Acknowledge whether you want a feature because it is necessary for gameplay, or simply because "everyone else has it". Your goal should be to bring out the essence of your game idea. Don't water down gameplay by attempting to make it "do everything, but better". Successful high-performance games are the ones where someone made smart decisions what to keep and what to drop. +

                                    Acknowledge whether you want a feature because it is necessary for gameplay, or simply because “everyone else has it”. Your goal should be to bring out the essence of your game idea. Don't water down gameplay by attempting to make it “do everything, but better”. Successful high-performance games are the ones where someone made smart decisions what to keep and what to drop.

                                    -

                                    The Smart Way to Add Custom Methods and Fields

                                    +

                                    The Smart Way to Add Custom Methods and Fields

                                    -

                                    Avoid the Anti-Pattern: Don't design complex role-based classes using Java inheritance, it will result in an unmaintainable mess.
                                    -Example: You start extending Node ???> MyMobileNode ???> MyNPC. Then you extend MyFighterNPC (defends, attacks) and MyShopKeeperNPC (trades) from MyNPC. What if you need an NPC that trades and defends itself, but doesn't attack? Do you extend MyShopKeeperNPC and copy and paste the defensive methods from MyFighterNPC? Or do you extend MyFighterNPC and override the attacking methods of its parent? Neither is a clean solution.
                                    -Wouldn't it be better if behaviours were a separate "system", and attributes were separate "components" that you add to the "entity" that needs them? +Example: You start extending Node –> MyMobileNode –> MyNPC. Then you extend MyFighterNPC (defends, attacks) and MyShopKeeperNPC (trades) from MyNPC. What if you need an NPC that trades and defends itself, but doesn't attack? Do you extend MyShopKeeperNPC and copy and paste the defensive methods from MyFighterNPC? Or do you extend MyFighterNPC and override the attacking methods of its parent? Neither is a clean solution.
                                    +Wouldn't it be better if behaviours were a separate “system”, and attributes were separate “components” that you add to the “entity” that needs them?

                                    @@ -280,17 +270,16 @@ Wouldn't it be better if behaviours were a separate "system", and You write Java classes named Controls to implement your Game Entities, and define an Entity's visuals, attributes, and behaviours. In jME, Spatials (Nodes or Geometrys) are the visual representation of the game entity in the scene graph.

                                      -
                                    • Game entities have attributes ??? All Entities are neutral things, only their attributes define what an entity actually is (a person or a brick). In jME, we call these class fields of Spatials "user data".
                                      +
                                    • Game entities have attributes – All Entities are neutral things, only their attributes define what an entity actually is (a person or a brick). In jME, we call these class fields of Spatials “user data”.
                                      Example: Players have class fields for id, health, coins, inventory, equipment, profession.
                                    • -
                                    • Game entities have behaviours ??? Behaviour systems communicate about the game state and modify attributes. In jME, these game mechanics are implemented in modular update() methods that all hook into the main update loop.
                                      +
                                    • Game entities have behaviours – Behaviour systems communicate about the game state and modify attributes. In jME, these game mechanics are implemented in modular update() methods that all hook into the main update loop.
                                      Example: Players have methods such as walk(), addGold(), getHealth(), pickUpItem(), dropItem(), useItem(), attack().

                                    - -

                                    Follow the Best Practice: In general, use composition over inheritance and keep "what an entity does" (behaviour system) separate from "what this entity is" (attributes). +

                                    Follow the Best Practice: In general, use composition over inheritance and keep “what an entity does” (behaviour system) separate from “what this entity is” (attributes).

                                    • Use setUserData() to add custom attributes to Spatials.
                                      @@ -305,7 +294,7 @@ Example: Players have methods such as walk(), addGold(),

                                      -If your game is even more complex, you may want to learn about "real" Entity Systems, which form a quite different programming paradigm from object oriented coding but are scalable to very large proportions. Note however that this topic is very unintuitive to handle for an OOP programmer and you should really decide on a case basis if you really need this or not and gather some experiences before diving head first into a MMO project :-) +If your game is even more complex, you may want to learn about “real” Entity Systems, which form a quite different programming paradigm from object oriented coding but are scalable to very large proportions. Note however that this topic is very unintuitive to handle for an OOP programmer and you should really decide on a case basis if you really need this or not and gather some experiences before diving head first into a MMO project :-)

                                      • @@ -324,17 +313,15 @@ If your game is even more complex, you may want to learn about "real"
                                    -

                                    The Smart Way to Access Game Features

                                    +

                                    The Smart Way to Access Game Features

                                    - SimpleApplication gives you access to game features such as a the rootNode, assetManager, guiNode, inputManager, audioManager, physicsSpace, viewPort, and the camera. But what if you need this access also from another class? Don't extend SimpleApplication a second time, and don't pass around tons of object references in constructors! Needing access to application level objects is a sign that this class should be designed as an AppState (read details there).

                                    An AppState has access to all game features in the SimpleApplication via the this.app and this.stateManager objects. Examples: -

                                    Spatial sky = SkyFactory.createSky(this.app.getAssetManager(), "sky.dds", false);
                                     ...
                                    @@ -342,13 +329,11 @@ this.app.getRootNode().attachChild( sky );
                                    -

                                    The Smart Way to Implement Game Logic

                                    +

                                    The Smart Way to Implement Game Logic

                                    - As your SimpleApplication-based game grows more advanced, you find yourself putting more and more interactions in the simpleUpdate() loop, and your simpleInitApp() methods grows longer and longer. It's a best practice to move blocks of game mechanics into reusable component classes of their own. In jME3, these resuable classes are called Controls and AppStates. -

                                    • Use AppStates to implement global game mechanics.
                                      @@ -384,7 +369,6 @@ As your SimpleApplication-based game grows more advanced, you find yourself putt

                                    -

                                    A game contains algorithms that do not directly affect spatials (for example, AI pathfinding code that calculates and chooses paths, but does not actually move spatials). You do not need to put such non-spatial code in controls, you can run thse things in a new thread. Only the tranformation code that actually modifies the spatial must be called from a control, or must be enqueue()ed.

                                    @@ -404,24 +388,23 @@ Read all about C
                                    -

                                    Optimize Application Performance

                                    +

                                    Optimize Application Performance

                                      -
                                    • Optimization ??? How to avoid wasting cycles
                                      +
                                    • Optimization – How to avoid wasting cycles
                                    • -
                                    • Multithreading ??? Use concurrency for long-running background tasks, but don't manipulate the scene graph from outside the main thread (update loop)!
                                      +
                                    • Multithreading – Use concurrency for long-running background tasks, but don't manipulate the scene graph from outside the main thread (update loop)!
                                    • -
                                    • You can add a Java Profiler to the jMonkeyEngine SDK via Tools ??? Plugins ??? Available. The profiler presents statistics on the lifecycle of methods and objects. Performance problems may be caused by just a few methods that take long, or are called too often (try to cache values to avoid this). If object creation and garbage collection counts keep increasing, you are looking at a memory leak.
                                      +
                                    • You can add a Java Profiler to the jMonkeyEngine SDK via Tools → Plugins → Available. The profiler presents statistics on the lifecycle of methods and objects. Performance problems may be caused by just a few methods that take long, or are called too often (try to cache values to avoid this). If object creation and garbage collection counts keep increasing, you are looking at a memory leak.
                                    -

                                    Don't Mess With Geometric State

                                    +

                                    Don't Mess With Geometric State

                                    - These tips are especially important for users who already know jME2. Automatic handling of the Geometric State has improved in jME3, and it is now a best practice to not mess with it.

                                      @@ -435,11 +418,10 @@ Read all about C
                                    -

                                    Maintain Internal Documentation

                                    +

                                    Maintain Internal Documentation

                                    - It's unlikely you will fully document every class you write, we hear you. However, you should at least write meaningful javadoc to provide context for your most crucial methods/parameters.

                                      @@ -452,18 +434,16 @@ It's unlikely you will fully document every class you write, we he

                                    - -Treat javadoc as messages to your future self. "genNextVal() generates the next value" and "@param float factor A factor influencing the result" do not count as documentation. +Treat javadoc as messages to your future self. “genNextVal() generates the next value” and “@param float factor A factor influencing the result” do not count as documentation.

                                    -

                                    Debugging and Test Phase

                                    +

                                    Debugging and Test Phase

                                    - -A Java Debugger is included in the jMonkeyEngine SDK. It allows you to set a break point in your code near the line of code where an exception happens. Then you step through the execution line by line and watch object and variable states live, to detect where the bug starts. +A Java Debugger is included in the jMonkeyEngine SDK. It allows you to set a break point in your code near the line of code where an exception happens. Then you step through the execution line by line and watch object and variable states live, to detect where the bug starts.

                                    @@ -471,25 +451,25 @@ Treat javadoc as messages to your future self. "genNextVal() generates the

                                    -Unit Testing () has a different status in 3D graphics development than in other types of software. You cannot write assertions that automatically test whether the rendered image looks correct, or whether interactions are intuitive. Still you should create simple test cases for individual game features such as loaders, content generators, effects. Run the test cases now and then to see whether they still work as intended ??? or whether they are suffering from regressions or side-effects. Keep the test classes in the test directory of your project, don't include them in the distribution. +Unit Testing () has a different status in 3D graphics development than in other types of software. You cannot write assertions that automatically test whether the rendered image looks correct, or whether interactions are intuitive. Still you should create simple test cases for individual game features such as loaders, content generators, effects. Run the test cases now and then to see whether they still work as intended – or whether they are suffering from regressions or side-effects. Keep the test classes in the test directory of your project, don't include them in the distribution.

                                    -Quality Assurance (QA) means repeatedly checking a certain set of features that must work, but that might be unexpectedly broken as a side-effect. Every game has some crazy bugs somewhere ??? but basic tasks must work, no excuse. This includes installing and de-installing; saving and loading; changing options; starting, pausing, quitting; basic actions such as walking, fighting, etc. After every milestone, you go through your QA list again and systematically look for regressions or newly introduced bugs. Check the application on every supported operating system and hardware (!) because not all graphic cards support the same features. If you don't find the obvious bugs, your users will, and carelessness will put them off. +Quality Assurance (QA) means repeatedly checking a certain set of features that must work, but that might be unexpectedly broken as a side-effect. Every game has some crazy bugs somewhere – but basic tasks must work, no excuse. This includes installing and de-installing; saving and loading; changing options; starting, pausing, quitting; basic actions such as walking, fighting, etc. After every milestone, you go through your QA list again and systematically look for regressions or newly introduced bugs. Check the application on every supported operating system and hardware (!) because not all graphic cards support the same features. If you don't find the obvious bugs, your users will, and carelessness will put them off.

                                    -Alpha and Beta Testing means that you ask someone to try to install and run your game. It should be a real user situation, where they are left to figure out the installation and gameplay by themselves???you only can include the usual read-me and help docs. Provide the testers with an easy method to report back what problems they encountered, what they liked best, or why they gave up. Evaluate whether reported problems are one-off glitches, or whether they must be fixed for the game to be playable for everyone. +Alpha and Beta Testing means that you ask someone to try to install and run your game. It should be a real user situation, where they are left to figure out the installation and gameplay by themselves–you only can include the usual read-me and help docs. Provide the testers with an easy method to report back what problems they encountered, what they liked best, or why they gave up. Evaluate whether reported problems are one-off glitches, or whether they must be fixed for the game to be playable for everyone.

                                    -

                                    Release Phase

                                    +

                                    Release Phase

                                    -

                                    Pre-Release To-Do List

                                    +

                                    Pre-Release To-Do List

                                    • Prepare a web page, a cool slogan, advertisements, etc
                                      @@ -498,13 +478,13 @@ Treat javadoc as messages to your future self. "genNextVal() generates the
                                    • Verify that your code loads the optimized .j3o files, and not the original model formats.
                                    • -
                                    • Prepare licenses of assets that you use for inclusion. (You did obtain permission to use them, right????)
                                      +
                                    • Prepare licenses of assets that you use for inclusion. (You did obtain permission to use them, right…?)
                                    • Switch off fine logging output.
                                    • Prepare promotional art: The most awesome screenshots (in thumbnail, square, vertical, horizontal, and fullscreen formats) and video clips. Include name, contact info, slogan, etc., so future customers can find you.
                                    • -
                                    • Prepare a readme.txt file, or installation guide, or handbook ??? if applicable.
                                      +
                                    • Prepare a readme.txt file, or installation guide, or handbook – if applicable.
                                    • Get a certificate if one is required for your distribution method (see below).
                                    • @@ -514,25 +494,25 @@ Treat javadoc as messages to your future self. "genNextVal() generates the
                                    -

                                    Distributing the Executables

                                    +

                                    Distributing the Executables

                                    - The jMonkeyEngine SDK helps you with deployment: You specify your branding and deployment options in the Project Properties dialog, and then choose Clean and Build from the context menu. If you use another IDE, consult this IDE's documentation.

                                    -Decide whether you want to release your game as WebStart, desktop JAR, mobile APK, or browser Applet ??? Each has its pros and cons. - +Decide whether you want to release your game as WebStart, desktop JAR, mobile APK, or browser Applet – Each has its pros and cons.

                                    + + +(.EXE, .app, .jar+.sh) +(.JNLP) +(.HTML+.JAR)
                                    DistributionProsCons
                                    Desktop Launcher
                                    -(.EXE, .app, .jar+.sh)
                                    This is the standard way of distributing desktop applications. The jMonkeyEngine SDK can be configured to automatically create zipped launchers for each operating system. You need to offer three separate, platform-dependent downloads.This is the standard way of distributing desktop applications. The jMonkeyEngine SDK can be configured to automatically create zipped launchers for each operating system. You need to offer three separate, platform-dependent downloads.
                                    Desktop Application
                                    @@ -540,11 +520,11 @@ Decide whether you want to release your game as WebStart, desktop JAR, mobile AP
                                    Web Start
                                    -(.JNLP)
                                    The user accesses a URL, saves the game as one executable file. Easy process, no installer required. You can allow the game to be played offline.Users need network connection to install the game. Downloading bigger games takes a while as opposed to running them from a CD. The user accesses a URL, saves the game as one executable file. Easy process, no installer required. You can allow the game to be played offline.Users need network connection to install the game. Downloading bigger games takes a while as opposed to running them from a CD.
                                    Browser Applet
                                    -(.HTML+.JAR)
                                    Easy to access and play game via most web browsers. Userfriendly solution for quick small games.Game only runs in the browser. Game or settings cannot be saved to disk. Some restrictions in default camera navigation (jME cannot capture mouse.)Easy to access and play game via most web browsers. Userfriendly solution for quick small games.Game only runs in the browser. Game or settings cannot be saved to disk. Some restrictions in default camera navigation (jME cannot capture mouse.)
                                    Android
                                    @@ -553,13 +533,11 @@ Decide whether you want to release your game as WebStart, desktop JAR, mobile AP

                                    - -Which ever method you choose, a Java-Application works on the main operating systems: Windows, Mac OS, Linux, Android. +Which ever method you choose, a Java-Application works on the main operating systems: Windows, Mac OS, Linux, Android.

                                    The distribution appears in a newly generated dist directory inside your project directory. These are the files that you upload or burn to CD to distribute to your customers. -


                                    @@ -573,4 +551,4 @@ See also:
                                    -

                                    view online version

                                    \ No newline at end of file +

                                    view online version

                                    \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/coordinate-system.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/coordinate-system.png index 86a1ec8ae..c008416fc 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/coordinate-system.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/coordinate-system.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/file_types.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/file_types.html index c16629ddf..fff18f32d 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/file_types.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/file_types.html @@ -1,15 +1,17 @@ -

                                    jMonkeyEngine3 Supported File Types

                                    +

                                    jMonkeyEngine3 Supported File Types

                                    -

                                    jMonkeyEngine3 File Formats

                                    +

                                    jMonkeyEngine3 File Formats

                                    + + @@ -30,14 +32,16 @@ Each custom .j3m Material is based on a material definition. Advanced users can -

                                    Supported External File Types

                                    +

                                    Supported External File Types

                                    SuffixUsageLearn more
                                    .j3oBinary 3D model or scene. At the latest from the Beta release of your game on, you should convert all models to .j3o format.
                                    During alpha and earlier development phases (when models still change a lot) you can alternatively load OgreXML/OBJ models directly.
                                    Model Loader and Viewer
                                    + + - + @@ -49,15 +53,15 @@ Each custom .j3m Material is based on a material definition. Advanced users can - + - +
                                    File SuffixTypeDescription
                                    .mesh.xml, .meshxml3D modelOgre Mesh XML .mesh.xml, .meshxml3D modelOgre Mesh XML
                                    .scene3D sceneOgre DotScene .blend3D modelBlender version 2.49 onwards (tested up to 2.65)
                                    COLLADA 3D modelImported via Blender bundled with the SDKCOLLADA 3D modelImported via Blender bundled with the SDK
                                    3DS3D modelImported via Blender bundled with the SDK3DS3D modelImported via Blender bundled with the SDK
                                    - + @@ -72,7 +76,7 @@ Each custom .j3m Material is based on a material definition. Advanced users can - + @@ -84,4 +88,4 @@ Each custom .j3m Material is based on a material definition. Advanced users can -

                                    view online version

                                    \ No newline at end of file +

                                    view online version

                                    \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/how_to_use_materials.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/how_to_use_materials.html index d13cdda5a..22b0d6751 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/how_to_use_materials.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/how_to_use_materials.html @@ -1,11 +1,9 @@ -

                                    How to Use Materials

                                    +

                                    How to Use Materials

                                    - A Geometry (mesh) is just the shape of the object. jMonkeyEngine cannot render a shape without knowing anything about its surface properties. You need to apply a color or texture to the surface of your Geometries to make them visible. In jMonkeyEngine, colors and textures are represented as Material objects. (An alternative would also be to load a model that includes materials generated by a mesh editor, such as Blender.) -

                                    • All Geometries must have Materials that defines color or texture.
                                      @@ -16,12 +14,11 @@ Examples of included Material Definitions: Lighting.j3md, Unshaded.j3md

                                    - -You want to make the most of your 3D models by specifying good looking material parameters. The developers must be in contact with the graphic designers regarding which of the Material properties they intend to use in their 3D models. You must have an understanding what texture maps are, to be able to use texture-mapped materials. +You want to make the most of your 3D models by specifying good looking material parameters. The developers must be in contact with the graphic designers regarding which of the Material properties they intend to use in their 3D models. You must have an understanding what texture maps are, to be able to use texture-mapped materials.

                                    -

                                    Don't forget to add a Light Source to the scene! All Materials (except "Unshaded" ones) are invisible without a light source. +

                                    Don't forget to add a Light Source to the scene! All Materials (except “Unshaded” ones) are invisible without a light source.

                                    @@ -31,16 +28,15 @@ If you want more advanced background info: You can learn more about -

                                    Code Sample

                                    +

                                    Code Sample

                                    - The following samples assume that you loaded a Geometry called myGeometry, and want to assign a material to it.

                                    -This example creates a simple unshaded blue material: Use it for abstract objects that need no illumination/shading, e.g. sky, GUI and billboard nodes, tiles/cards, or toons. +This example creates a simple unshaded blue material: Use it for abstract objects that need no illumination/shading, e.g. sky, GUI and billboard nodes, tiles/cards, or toons.

                                    Spatial myGeometry = assetManager.loadModel("Models/Teapot/Teapot.j3o");
                                     Material mat = new Material(assetManager,  // Create new material and...
                                    @@ -71,21 +67,19 @@ myGeometry.setMaterial(mat);               // Use new material on this G
                                     
                                     
                                    -

                                    Colored or Textured

                                    +

                                    Colored or Textured

                                    - Every Material must have at least Material Colors or Textures. Some optional material features also require a combination of both.

                                    -

                                    Colored

                                    +

                                    Colored

                                    - To give an unshaded material a color:

                                      @@ -95,7 +89,6 @@ To give an unshaded material a color:

                                    - To give an Phong-illuminated material a color:

                                      @@ -110,11 +103,10 @@ mat.setColor("Ambient", ColorRGBA.Blue ); // with Lighting.j3m
                                    -

                                    Textured

                                    +

                                    Textured

                                    - To give an unshaded material a texture:

                                      @@ -124,7 +116,6 @@ To give an unshaded material a texture:

                                    - To give a Phong-illuminated material a texture:

                                      @@ -134,7 +125,6 @@ To give a Phong-illuminated material a texture:

                                    -

                                    It can happen that you load textures at different scales, for example, your blades of grass may look as big as twigs, or your spaceship's heat tiles may look like small bathroom tiles. Then you need to adjust the texture scale, either bigger (< 1.0f) or smaller (< 1.0f).

                                    geometry.scaleTextureCoordinates(new Vector2f(0.5f, 0.5f));
                                    @@ -150,11 +140,10 @@ All other Texture Maps or Material settings are optional. If used skillfully, th
                                    -

                                    (Optional) Bumpy

                                    +

                                    (Optional) Bumpy

                                    - A NormalMap (also called BumpMap) is an extra colored texture that describes the fine bumpy details of the Material surface. E.g. fine cracks, pores, creases, notches. Using a BumpMap is more efficient than trying to shape the mesh to be bumpy.

                                    @@ -171,17 +160,15 @@ To add a BumpMap (this only makes sense for illuminated Materials):

                                    -

                                    -

                                    (Optional) Shiny

                                    +

                                    (Optional) Shiny

                                    - To activate Shininess (this only makes sense for illuminated Materials):

                                      @@ -204,7 +191,6 @@ You optionally hand-draw this grayscale texture to outline in detail where the s

                                    - To deactivate shininess

                                      @@ -215,11 +201,10 @@ To deactivate shininess
                                    -

                                    (Optional) Glow

                                    +

                                    (Optional) Glow

                                    - To activate glow:

                                      @@ -240,7 +225,6 @@ This texture outlines in detail where the DiffuseMap texture glows. If you don&#

                                    - To deactivate glow:

                                      @@ -250,17 +234,15 @@ To deactivate glow:

                                    - Learn more about Bloom and Glow.

                                    -

                                    (Optional) Transparent

                                    +

                                    (Optional) Transparent

                                    - Most Material Definitions support an alpha channel to make a model opaque, translucent, or transparent.

                                      @@ -273,7 +255,6 @@ Most Material Definitions support an alpha channel to make a model opaque, trans

                                    - To make a Geometry transparent or translucent:

                                      @@ -308,14 +289,16 @@ Objects in the translucent bucket (e.g. particles) are not affected by SceneProc
                                    .JPG, .PNG, .GIFimageTextures, icons.JPG, .PNG, .GIFimageTextures, icons
                                    .DDSimageDirect Draw Surface texture.PFMimagePortable Float Map texture
                                    .fntbitmap fontAngelCode font for GUI and HUD.fntbitmap fontAngelCode font for GUI and HUD
                                    .WAVaudioWave music and sounds
                                    + + - + - + @@ -328,43 +311,38 @@ Deactivate Alpha Testing for gradually translucent objects, suc
                                    Standard Material TransparencyDescriptionExample
                                    getAdditionalRenderState().setBlendMode(BlendMode.Off);This is the default, no transparency.Use for all opaque objects like walls, floors, people???getAdditionalRenderState().setBlendMode(BlendMode.Off);This is the default, no transparency.Use for all opaque objects like walls, floors, people…
                                    getAdditionalRenderState().setBlendMode(BlendMode.Alpha);Interpolates the background pixel with the current pixel by using the current pixel's alpha.This is the most commonly used BlendMode for transparency and translucency: Frosted window panes, ice, glass, alpha-blended vegetation textures??? getAdditionalRenderState().setBlendMode(BlendMode.Alpha);Interpolates the background pixel with the current pixel by using the current pixel's alpha.This is the most commonly used BlendMode for transparency and translucency: Frosted window panes, ice, glass, alpha-blended vegetation textures…
                                    getAdditionalRenderState().setDepthWrite(false);Disables writing of the pixel's depth value to the depth buffer.Deactivate this on Materials if you expect two or more transparent/translucent objects to be obscuring one another, but you want to see through both.

                                    -

                                    It is possible to load a DiffuseMap texture that has an Alpha channel, and combine it with an underlying Material Color.

                                    mat.setBoolean("UseAlpha",true);

                                    - The Material Color bleeds through the transparent areas of the top-layer DiffuseMap texture. In this case you do not need BlendMode Alpha ??? because it's not the whole Material that is transparent, but only one of the texture layers. You use this bleed-through effect, for example, to generate differently colored uniforms, animals, or plants, where each Material uses the same "template" DiffuseMap texture but combines it with a different color. + The Material Color bleeds through the transparent areas of the top-layer DiffuseMap texture. In this case you do not need BlendMode Alpha – because it's not the whole Material that is transparent, but only one of the texture layers. You use this bleed-through effect, for example, to generate differently colored uniforms, animals, or plants, where each Material uses the same “template” DiffuseMap texture but combines it with a different color.

                                    -

                                    (Optional) Wireframe

                                    +

                                    (Optional) Wireframe

                                    - Additionally to the above settings, you can switch off and on a wireframe rendering of the mesh. Since a wireframe has no faces, this temporarily disables the other Texture Maps. -

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

                                    +tag_material_texture_effect_wireframe_light_documentation +

                                    -

                                    view online version

                                    \ No newline at end of file +

                                    view online version

                                    \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/math.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/math.html index f788b083d..e9f8c576a 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/math.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/math.html @@ -1,19 +1,21 @@ -

                                    Math Cheat Sheet

                                    +

                                    Math Cheat Sheet

                                    -

                                    Formulas

                                    +

                                    Formulas

                                    Note: Typically you have to string these formulas together. Look in the table for what you want, and what you have. If the two are not the same line, than you need conversion steps inbetween. E.g. if you have an angle in degrees, but the formula expects radians: 1) convert degrees to radians, 2) use the radians formula on the result.

                                    + - + + @@ -60,9 +62,11 @@ q.lookAt(v,up)
                                    I have???I want???FormulaI have…I want…Formula
                                    normalized direction and length
                                    n1,d1
                                    a vector that goes that far in that direction
                                    @@ -49,7 +51,7 @@ new direction vector v0
                                    v0 = p1.substract(p2)
                                    two points, a fraction
                                    -p1, p2, h=0.5f
                                    the point "halfway" (h=0.5f) between the two points
                                    +p1, p2, h=0.5f
                                    the point “halfway” (h=0.5f) between the two points
                                    new interpolated point p0
                                    p0 = FastMath.interpolateLinear(h,p1,p2)
                                    + - + + -

                                    Local vs Non-local methods?

                                    +

                                    Local vs Non-local methods?

                                    • Non-local method creates new object as return value, v remains unchanged.
                                      @@ -123,4 +127,4 @@ float z = FastMath.sin(phi)*r;
                                      -

                                      view online version

                                      \ No newline at end of file +

                                      view online version

                                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/multi-media_asset_pipeline.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/multi-media_asset_pipeline.html index 38830a730..8783ee9d3 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/multi-media_asset_pipeline.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/multi-media_asset_pipeline.html @@ -1,24 +1,24 @@ -

                                      Multi-Media Asset Pipeline

                                      +

                                      Multi-Media Asset Pipeline

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

                                        -
                                      • You create textures in a graphic editor, for example , and export them as PNG or JPG.
                                        +
                                      • You create textures in a graphic editor, for example , and export them as PNG or JPG.
                                      • -
                                      • You create models in a 3D mesh editor, for example , and export them in Ogre Mesh XML or Wavefront OBJ format.
                                        +
                                      • You create models in a 3D mesh editor, for example , and export them in Ogre Mesh XML or Wavefront OBJ format.
                                      • You create sounds in an audio editor, for example , and export them as WAVE or OGG.
                                    I have???I want???FormulaI have…I want…Formula
                                    angle in degrees
                                    a
                                    to convert angle a from degrees to radians
                                    @@ -110,7 +114,7 @@ float z = FastMath.sin(phi)*r;
                                    + + @@ -43,17 +43,15 @@ Assets are files that are not code. Your multi-media assets includes, for exampl
                                    DODON'T
                                    Import original models plus textures into assets/Textures. Don't leave textures or models in a folder outside your JME project: The game cannot load or reference them from there.

                                    - Read on for details.

                                    -

                                    Use The Assets Folder

                                    +

                                    Use The Assets Folder

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

                                    jMonkeyProjects/MyGame/assets/Interface/ # .font, .jpg, .png, .xml
                                    @@ -67,7 +65,6 @@ jMonkeyProjects/MyGame/assets/Textures/  # .jpg, .png; also .mesh.xml+.material,
                                     
                                     

                                    Prepare the asset folder structure for your individual project: -

                                    1. Agree on a directory structure with the graphic designers.
                                      @@ -90,7 +87,6 @@ Example: For car models, create Textures/vehicles/car1/, Mate

                                    -

                                    @@ -106,13 +102,11 @@ See also:
                                    -

                                    Create Textures and Materials

                                    +

                                    Create Textures and Materials

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

                                    1. Create textures in a graphic editor.
                                      @@ -121,7 +115,7 @@ Install a graphic editor such as Gimp or Photoshop. Consult the graphic
                                • -
                                • (Optional) If you plan to use JME materials that you set programmatically from the code, create .j3m materials in the SDK.
                                  +
                                • (Optional) If you plan to use JME materials that you set programmatically from the code, create .j3m materials in the SDK.
                                  • Save these .j3m files into the assets/Materials directory.
                                  • @@ -130,7 +124,6 @@ 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, and compile class files, and distribute the application, all paths and files need to be available in their final, absolute form.

                                    @@ -141,25 +134,23 @@ Storing the textures inside your project directory is necessary for the paths in -

                                    Create 3D Models

                                    +

                                    Create 3D Models

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

                                    Note that UV coords are part of the mesh and not part of the material, so if you import your mesh successfully, you can later apply the texture again and it will map correctly.

                                    -

                                    1. Create 3D models in a mesh editor.
                                      1. Create efficient low-polygon models. High-polygon models may look pretty in static 3D art contests, but they slow down dynamic games!
                                      2. -
                                      3. Create materials for your models either in the 3D editor, or in the jME3 SDK. Only use the following material features: Diffuse Map or Diffuse Color (minimum); plus optionally Normal Map, Glow Map, Specular Map.
                                        +
                                      4. Create materials for your models either in the 3D editor, or in the jME3 SDK. Only use the following material features: Diffuse Map or Diffuse Color (minimum); plus optionally Normal Map, Glow Map, Specular Map.
                                        Every material feature not listed in the Materials Overview is unsupported and ignored by JME3's renderer.
                                      5. 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).
                                        @@ -178,7 +169,6 @@ Don't use multiple separate texture files with one model, it will break the

                                      - See also:

                                      @@ -190,19 +180,17 @@ See also: -

                                      Convert 3D Models to .j3o Format

                                      +

                                      Convert 3D Models to .j3o Format

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

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

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

                                      -

                                      Must I convert to .j3o? Yes!

                                      +

                                      Must I convert to .j3o? Yes!

                                      -

                                      See Also

                                      +

                                      See Also

                                      -
                                      - spatial, - node, - mesh, - geometry, - scenegraph, - sdk -
                                      + +

                                      +tag_spatial_node_mesh_geometry_scenegraph_sdk +

                                      -

                                      view online version

                                      \ No newline at end of file +

                                      view online version

                                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/optimization.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/optimization.html index 54c573de9..84dd0601c 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/optimization.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/optimization.html @@ -1,15 +1,14 @@ -

                                      Optimization reference

                                      +

                                      Optimization reference

                                      This page is intended as a reference collection of optimization tricks that can be used to speed up JME3 applications. -

                                      -

                                      Maintain low Geometry count

                                      +

                                      Maintain low Geometry count

                                      @@ -22,7 +21,7 @@ The reason for this is that a render command must be done for every object, pote

                                      • Use GeometryBatchFactory.optimize(node) to merge the meshes of the geometries contained in the given node into fewer batches, each based on common Materials used.
                                        -You can optimize nodes using the SceneComposer in the SDK as well: Right-click a node and select "Optimize Geometry".
                                        +You can optimize nodes using the SceneComposer in the SDK as well: Right-click a node and select “Optimize Geometry”.
                                      @@ -40,11 +39,10 @@ You can optimize nodes using the SceneComposer in the -

                                      Avoid creating new objects

                                      +

                                      Avoid creating new objects

                                      - Different Java implementations use different garbage collection algorithms, so depending on the platforms you target, different advice applies.

                                      @@ -75,50 +73,47 @@ E.g. when you use math operations like vectorA.mult(vectorB);, they

                                      Check your math operations for opportunities to use the local version of the math operations, e.g. vectorA.multLocal(vectorB). Local methods store the result in vectorA and do not create a new object. -

                                      -

                                      Avoid large objects in physics

                                      +

                                      Avoid large objects in physics

                                      - To offload much computation to the less CPU intense physics broadphase collision check, avoid having large meshes that cover e.g. the whole map of your level. Instead, separate the collision shapes into multiple smaller chunks. Obviously, don't exaggerate the chunking, because having excessive amounts of physics objects similarly cause performance problems.

                                      -

                                      Check the Statistics

                                      +

                                      Check the Statistics

                                      - SimpleApplication displays a HUD with statistics. Use app.setDisplayStatView(true); to activate it, and false to deactivate it. The StatsView counts Objects,Uniforms,Triangles,Vertices are in the scene, and it counts how many FrameBuffers, Textures, or Shaders:

                                        -
                                      • ??? were switched in the last frame (S)
                                        +
                                      • … were switched in the last frame (S)
                                      • -
                                      • ??? were used during the last frame (F)
                                        +
                                      • … were used during the last frame (F)
                                      • -
                                      • ??? exist in OpenGL memory (M)
                                        +
                                      • … exist in OpenGL memory (M)

                                      - For example, Textures (M) tells you how many textures are currently in OpenGL memory.

                                      Generally jME3 is well optimized and optimizes these things correctly. Read statsview to learn the details about how to interpret the statistics, how to tell whether your values are off, or whether they point out a problem.

                                      - + +

                                      +tag_performance +

                                      -

                                      view online version

                                      \ No newline at end of file +

                                      view online version

                                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/simpleapplication.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/simpleapplication.html index 61087b02c..5a64a7bdd 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/simpleapplication.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/intermediate/simpleapplication.html @@ -1,9 +1,8 @@ -

                                      SimpleApplication

                                      +

                                      SimpleApplication

                                      - The base class of the jMonkeyEngine3 is com.jme3.app.SimpleApplication. Your first game's Main class extends SimpleApplication directly. When you feel confident you understand the features, you will typically extend SimpleApplication to create a custom base class for the type of games that you want to develop.

                                      @@ -45,34 +44,34 @@ public class MyBaseGame extends SimpleApplication { }

                                      -Let's have a look at the API of the base class. +Let's have a look at the API of the base class.

                                      -

                                      Application Class

                                      +

                                      Application Class

                                      - Internally, com.jme3.app.SimpleApplication extends com.jme3.app.Application. The Application class represents a generic real-time 3D rendering jME3 application (i.e., not necessarily a game). Typically, you do not extend com.jme3.app.Application directly to create a game. -

                                      + + +setSettings() +getCamera()
                                      Application class fieldsPurpose
                                      viewPort
                                      getViewPort()
                                      The view object for the default camera. You can register advanced post-processor filters here.
                                      settings
                                      -setSettings()
                                      Use this AppSettings object to specify the display width and height (by default 640x480), color bit depth, z-buffer bits, anti-aliasing samples, and update frequency, video and audio renderer, asset manager. See: AppSettings.Use this AppSettings object to specify the display width and height (by default 640×480), color bit depth, z-buffer bits, anti-aliasing samples, and update frequency, video and audio renderer, asset manager. See: AppSettings.
                                      cam
                                      -getCamera()
                                      The default camera provides perspective projection, 45?? field of view, near plane = 1 wu, far plane = 1000 wu.The default camera provides perspective projection, 45° field of view, near plane = 1 wu, far plane = 1000 wu.
                                      assetManager
                                      @@ -96,9 +95,11 @@ getStateManager()
                                      You use the Application's state manager to activa
                                      + + @@ -112,17 +113,19 @@ getStateManager() - +
                                      Application methodsPurpose
                                      setPauseOnLostFocus(true)Set this boolean whether the game loop should stop running when ever the window loses focus (typical for single-player game). Set this to false for real-time and multi-player games that keep running.
                                      You use the Application's state manager to activa stop()Stops the running jME3 game and closes the jME3 window.
                                      start(Type.Headless) etcSwitch Context com.???jme3.???system.???JmeContext.Type when starting the application:
                                      -Type.Display ??? jME application runs in a window of its own. (This is the default.)
                                      -Type.Canvas ??? jME application is embedded in a Swing Canvas.
                                      -Type.Headless ??? jME application runs its event loop without calculating any view and without opening any window. Can be used for a Headless Server application.
                                      -Type.OffscreenSurface ??? jME application view is not shown and no window opens, but everything calculated and cached as bitmap (back buffer) for use by other applications.
                                      start(Type.Headless) etcSwitch Context com.​jme3.​system.​JmeContext.Type when starting the application:
                                      +Type.Display – jME application runs in a window of its own. (This is the default.)
                                      +Type.Canvas – jME application is embedded in a Swing Canvas.
                                      +Type.Headless – jME application runs its event loop without calculating any view and without opening any window. Can be used for a Headless Server application.
                                      +Type.OffscreenSurface – jME application view is not shown and no window opens, but everything calculated and cached as bitmap (back buffer) for use by other applications.
                                      + + @@ -142,7 +145,7 @@ getRenderer(); +getGuiViewPort() @@ -154,11 +157,10 @@ getGuiViewPort()
                                      Internal class field/methodPurpose
                                      context
                                      getContext()
                                      The application context contains the renderer, AppSettings, timer, etc. Typically, you do not directly access the context object.Low-level and high-level rendering interface. Mostly used
                                      guiViewPort
                                      -getGuiViewPort()
                                      The view object for the orthogonal GUI view. Only used internally for HUDs. The view object for the orthogonal GUI view. Only used internally for HUDs.
                                      timerAn internal update loop timer, don't use. See tpf in simpleUpdate() below to learn about timers.The view object for the orthogonal -

                                      SimpleApplication Class

                                      +

                                      SimpleApplication Class

                                      - The com.jme3.app.SimpleApplication class extends the generic com.jme3.app.Application class. SimpleApplication makes it easy to start writing a game because it adds typical functionality:

                                        @@ -171,21 +173,21 @@ The com.jme3.app.SimpleApplication class extends the generic com.jme3.app.Applic

                                      - Additional to the functionality that Application brings, SimpleApplication offers the following methods and fields that can be used, for example, inside the simpleInitApp() method: -

                                      + + +getGuiNode()
                                      SimpleApplication Class FieldPurpose
                                      rootNode
                                      getRootNode()
                                      The root node of the scene graph. Attach a Spatial to the rootNode and it appears in the 3D scene.
                                      guiNode
                                      -getGuiNode()
                                      Attach flat GUI elements (such as HUD images and text) to this orthogonal GUI node to make them appear on the screen.Attach flat GUI elements (such as HUD images and text) to this orthogonal GUI node to make them appear on the screen.
                                      flyCam
                                      @@ -193,9 +195,11 @@ getFlyByCamera()
                                      The default first-person fly-by camera control. This de
                                      + + @@ -210,9 +214,11 @@ getFlyByCamera()
                                      SimpleApplication MethodPurpose
                                      loadStatsView();Call this method to print live statistic information to the screen, such as current frames-per-second and triangles/vertices counts. You use this info typically only during development or debugging.
                                      The default first-person fly-by camera control. This de
                                      + + @@ -226,25 +232,24 @@ For more info on how to hook into the AppSettings.

                                      -

                                      Default Input Mappings

                                      +

                                      Default Input Mappings

                                      - The following default navigational input actions are mapped by the default flyCam control in a SimpleApplication: You can use these mappings for debugging and testing until you implement custom input handling. -

                                      SimpleApplication InterfacePurpose
                                      public void simpleInitApp()Override this method to initialize the game scene. Here you load and create objects, attach Spatials to the rootNode, and bring everything in its starts position. See also Application States for best practices.
                                      + + @@ -260,14 +265,14 @@ The following default navigational input actions are mapped by the default

                                      - -As long as the flyCam is enabled, the following so-called "WASD" inputs, including MouseLook, are available: - +As long as the flyCam is enabled, the following so-called “WASD” inputs, including MouseLook, are available:

                                      KeyAction
                                      KEY_ESCAPEQuits the game by calling app.stop()
                                      + + @@ -311,17 +316,15 @@ As long as the flyCam is enabled, the following so-called "WAS -

                                      Defaults and Customization

                                      +

                                      Defaults and Customization

                                      - By default, a SimpleApplication displays Statistics (new StatsAppState()), has debug output keys configured (new DebugKeysAppState()), and enables the flyCam (new FlyCamAppState()). You can customize which you want to reuse in your SimpleApplication.

                                      The following example shows how you can remove one of the default AppStates, in this case, the FlyCamAppState: -

                                      • Either, in your application's contructor, you create the SimpleApplication with only the AppStates you want to keep:
                                        public MyAppliction() {
                                        @@ -335,21 +338,11 @@ The following example shows how you can remove one of the default AppStates, in
                                         
                                      - + +

                                      +tag_display_basegame_documentation_intro_intermediate_init_input_game_loop_rootnode_application_simpleapplication +

                                      -

                                      view online version

                                      \ No newline at end of file +

                                      view online version

                                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/ios.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/ios.html index 169d5e89b..fb4a38372 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/ios.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/ios.html @@ -1,5 +1,5 @@ -

                                      iOS Deployment

                                      +

                                      iOS Deployment

                                      @@ -16,18 +16,17 @@ iOS deployment works via cross-compilation to native iOS ARM code, there is no v

                                      -

                                      To install the iOS deployment plugin, go to Tools???Plugins and under "Available plugins" select the "iOS Support" plugin. +

                                      To install the iOS deployment plugin, go to Tools→Plugins and under “Available plugins” select the “iOS Support” plugin.

                                      -

                                      -

                                      Enabling iOS deployment

                                      +

                                      Enabling iOS deployment

                                      -To enable iOS deployment, go to the project settings and under "Application???iOS" select the "Enable iOS deployment" checkbox, adapt the application ID and then press OK. +To enable iOS deployment, go to the project settings and under “Application→iOS” select the “Enable iOS deployment” checkbox, adapt the application ID and then press OK.

                                      @@ -39,14 +38,13 @@ After enabling deployment, a new ios directory is created in the pr

                                      -

                                      When you enable iOS deployment for the first time or any time that the Avian library and OpenJDK is updated, they will be extracted to your SDK settings folder, wait until it has been extracted before building an iOS-enabled project. +

                                      When you enable iOS deployment for the first time or any time that the Avian library and OpenJDK is updated, they will be extracted to your SDK settings folder, wait until it has been extracted before building an iOS-enabled project.

                                      -

                                      -

                                      Building the iOS binaries

                                      +

                                      Building the iOS binaries

                                      @@ -63,19 +61,18 @@ After the iOS classpath has been created the avian compiler is used to create a

                                      -

                                      Running and deploying the application

                                      +

                                      Running and deploying the application

                                      To run the application, open the Xcode project under ios/project in Xcode and press the run button. You can make changes to the UI and native invocation classes in the Xcode project as well. From here you can also deploy the application to your devices or the App Store.

                                      Note that you should also adapt the project settings like application name and registration package in Xcode before deploying the final application.

                                      -

                                      -

                                      Creating native and java code for iOS

                                      +

                                      Creating native and java code for iOS

                                      @@ -91,17 +88,13 @@ Effectively native code can reside in both the Xcode project and in the io

                                      -Java code for iOS should be in the ios/src folder as well for clean separation, its also the only place where they will be compiled with a reference to the iOS specific jME classes. For information on how to connect your application code and device specific code, see the notes in the android deployment documentation. +Java code for iOS should be in the ios/src folder as well for clean separation, its also the only place where they will be compiled with a reference to the iOS specific jME classes. For information on how to connect your application code and device specific code, see the notes in the android deployment documentation. +

                                      + +

                                      +tag_documentation_ios_mac_macos_deployment_platform

                                      -
                                      -

                                      view online version

                                      \ No newline at end of file +

                                      view online version

                                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/math.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/math.html index 414cd9af1..5158820a6 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/math.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/math.html @@ -1,9 +1,8 @@ -

                                      Introduction to Mathematical Functionality

                                      +

                                      Introduction to Mathematical Functionality

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

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

                                      Coordinate System

                                      +

                                      Coordinate System

                                      -

                                      Definition

                                      +

                                      Definition

                                      - A coordinate system consists of an origin (single point in space) and three coordinate axes that are each unit length and mutually perpendicular. The axes can be written as the column of a Matrix, R = [U1|U2|U3]. In fact, this is exactly how CameraNode works. The coordinate system defined by Camera is stored in a Matrix.

                                      @@ -44,11 +42,10 @@ The definition of a coordinate system is defined in jME by the properties sent t
                                      -

                                      Homogenous coordinates

                                      +

                                      Homogenous coordinates

                                      - Homogenous coordinates have an additional W value tacked on to the end. The XYZ values are to be divided by W to give the true coordinates.

                                      @@ -63,60 +60,55 @@ It also simplifies some formulae, in particular anything that is related to rota

                                      For application programmers, this means you can express infinitely long vectors that still have a direction - these tend to be used in lighting. Just use a W value of 0.0. -

                                      -

                                      Transformations

                                      +

                                      Transformations

                                      - Transformations define an operation that converts points from one coordinate system to another. This includes translation, rotation and scaling. In jME, local transforms are used to represent the positioning of objects relative to a parent coordinate system. While, world transforms are used to represent the positioning of objects in a global coordinate system.

                                      -

                                      Visibility Determination

                                      +

                                      Visibility Determination

                                      - Visibility Determination concerns itself with minimizing the amount of data that is sent to the graphics card for rendering. Specifically, we do not want to send data that will not be seen. Data not sent to the graphics card is said to be culled. The primary focus of this section is Frustum Culling based on the Camera's view frustum. In essence, this frustum creates six standard view planes. The BoundingVolume of an object is tested against the frustum planes to determine if it is contained in the frustum. If at any point the object's bounding is outside of the plane, it is tossed out and no longer processed for rendering. This also includes any children that it managed, allowing fast culling of large sections of the scene.

                                      -

                                      Fundamental Types

                                      +

                                      Fundamental Types

                                      -

                                      ColorRGBA

                                      +

                                      ColorRGBA

                                      -

                                      Definition

                                      +

                                      Definition

                                      - ColorRGBA defines a color value in the jME library. The color value is made of three components, red, green and blue. A fourth component defines the alpha value (transparent) of the color. Every value is set between [0, 1]. Anything less than 0 will be clamped to 0 and anything greater than 1 will be clamped to 1.

                                      -Note: If you would like to "convert" an ordinary RGB value (0-255) to the format used here (0-1), simply multiply it with: 1/255. +Note: If you would like to “convert” an ordinary RGB value (0-255) to the format used here (0-1), simply multiply it with: 1/255.

                                      -

                                      jME Class

                                      +

                                      jME Class

                                      - ColorRGBA defines a few static color values for ease of use. That is, rather than:

                                      ColorRGBA red = new ColorRGBA(1,0,0,1);
                                      @@ -124,7 +116,6 @@ object.setSomeColor(red);

                                      you can simply say: -

                                      object.setSomeColor(ColorRGBA.red)
                                      @@ -134,11 +125,10 @@ ColorRGBA will also handle interpolation between two colors. Given a second colo
                                      -

                                      Matrix

                                      +

                                      Matrix

                                      - See
                                      and @@ -146,11 +136,10 @@ and -

                                      Definition

                                      +

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

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

                                      -zero matrix is the Matrix with all zero entries. +zero matrix is the Matrix with all zero entries.

                                      Camera MotionKey or Mouse Input
                                      Move ForwardKEY_W
                                      @@ -172,10 +161,9 @@ 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. +The Identity Matrix is the matrix with 1 on the diagonal entries and 0 for all other entries.

                                      @@ -188,14 +176,12 @@ 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.

                                      - The transpose of a matrix M = [mij] is MT = [mji]. This causes the rows of M to become the columns of MT.

                                      @@ -203,7 +189,7 @@ The transpose of a matrix M = [mij] is MT< - + @@ -211,8 +197,7 @@ The transpose of a matrix M = [mij] is MT<
                                      111 123
                                      222 ??? 123222123
                                      333 123

                                      - -A Matrix is symmetric if M = MT. +A Matrix is symmetric if M = MT.

                                      @@ -225,44 +210,40 @@ A Matrix is symmetric if M = MT.
                                      BCX
                                      - +

                                      Where X, A, B, and C equal numbers

                                      -jME includes two types of Matrix classes: Matrix3f and Matrix4f. Matrix3f is a 3x3 matrix and is the most commonly used (able to handle scaling and rotating), while Matrix4f is a 4x4 matrix that can also handle translation. +jME includes two types of Matrix classes: Matrix3f and Matrix4f. Matrix3f is a 3×3 matrix and is the most commonly used (able to handle scaling and rotating), while Matrix4f is a 4×4 matrix that can also handle translation.

                                      -

                                      Transformations

                                      +

                                      Transformations

                                      - Multiplying a vector with a Matrix allows the vector to be transformed. Either rotating, scaling or translating that vector.

                                      -

                                      Scaling

                                      +

                                      Scaling

                                      - If a diagonal Matrix, defined by D = [dij] and dij = 0 for i != j, has all positive entries it is a scaling matrix. If di is greater than 1 then the resulting vector will grow, while if di is less than 1 it will shrink.

                                      -

                                      Rotation

                                      +

                                      Rotation

                                      - A rotation matrix requires that the transpose and inverse are the same matrix (R-1 = RT). The rotation matrix R can then be calculated as: R = I + (sin(angle)) S + (1 - cos(angle)S2 where S is: -

                                      @@ -278,13 +259,11 @@ A rotation matrix requires that the transpose and inverse are the same -

                                      Translation

                                      +

                                      Translation

                                      - -Translation requires a 4x4 matrix, where the vector (x,y,z) is mapped to (x,y,z,1) for multiplication. The Translation Matrix is then defined as: - +Translation requires a 4×4 matrix, where the vector (x,y,z) is mapped to (x,y,z,1) for multiplication. The Translation Matrix is then defined as:

                                      @@ -296,18 +275,16 @@ Translation requires a 4x4 matrix, where the vector (x,y,z) is mapped to (x,y,z,

                                      - -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. +where M is the 3×3 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

                                      +

                                      jME Class

                                      - -Both Matrix3f and Matrix4f store their values as floats and are publicly available as (m00, m01, m02, ???, mNN) where N is either 2 or 3. +Both Matrix3f and Matrix4f store their values as floats and are publicly available as (m00, m01, m02, …, mNN) where N is either 2 or 3.

                                      @@ -316,11 +293,10 @@ Most methods are straight forward, and I will leave documentation to the Javadoc

                                      -

                                      Vector

                                      +

                                      Vector

                                      - See
                                      and @@ -328,16 +304,15 @@ and -

                                      Definition

                                      +

                                      Definition

                                      - Vectors are used to represent a multitude of things in jME, points in space, vertices in a triangle mesh, normals, etc. These classes (Vector3f in particular) are probably the most used class in jME.

                                      -A Vector is defined by an n-tuple of real numbers. V = <V1, V2,???, Vn>. +A Vector is defined by an n-tuple of real numbers. V = <V1, V2,…, Vn>.

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

                                      -

                                      Operations

                                      +

                                      Operations

                                      -

                                      Multiplication by Scalar

                                      +

                                      Multiplication by Scalar

                                      - -A Vector can be multiplied by a scalar value to produce a second Vector with the same proportions as the first. aV = Va = <aV1, aV2,???,aVn> +A Vector can be multiplied by a scalar value to produce a second Vector with the same proportions as the first. aV = Va = <aV1, aV2,…,aVn>

                                      -

                                      Addition and Subtraction

                                      +

                                      Addition and Subtraction

                                      - Adding or subtracting two Vectors occurs component-wise. That is the first component is added (subtracted) with the first component of the second Vector and so on.

                                      -P + Q = <P1+Q1, P2+Q2, ???, Pn+Qn> +P + Q = <P1+Q1, P2+Q2, …, Pn+Qn>

                                      -

                                      Magnitude

                                      +

                                      Magnitude

                                      - The magnitude defines the length of a Vector. A Vector of magnitude 1 is unit length.

                                      @@ -393,11 +365,10 @@ A Vector can be normalized or made unit length by multiplying
                                      -

                                      Dot Products

                                      +

                                      Dot Products

                                      - The dot product of two vectors is defined as: P dot Q = PxQx + PyQy + PzQz

                                      @@ -412,11 +383,10 @@ If the dot product is 0 then the two Vectors are orthogonal or 90 degre
                                      -

                                      Cross Product

                                      +

                                      Cross Product

                                      - The Cross Product of two Vectors returns a third Vector that is prependicular to the two Vectors. This is very useful for calculating surface normals.

                                      @@ -426,31 +396,28 @@ The Cross Product of two Vectors returns a third Vector that is prependicular to
                                      -

                                      jME Class

                                      +

                                      jME Class

                                      - Vector3f and Vector2f store their values (x, y, z) and (x, y) respectively as floats. Most methods are straight forward, and I will leave documentation to the Javadoc.

                                      -

                                      Quaternion

                                      +

                                      Quaternion

                                      - See

                                      -

                                      Definition

                                      +

                                      Definition

                                      - Quaternions define a subset of a hypercomplex number system. Quaternions are defined by (i2 = j2 = k2 = ijk = -1). jME makes use of Quaternions because they allow for compact representations of rotations, or correspondingly, orientations, in 3D space. With only four float values, we can represent an object's orientation, where a rotation matrix would require nine. They also require fewer arithmetic operations for concatenation.

                                      @@ -510,17 +477,16 @@ These basic operations allow us to convert various rotation representations to Q
                                      -

                                      Angle Axis

                                      +

                                      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.

                                      -

                                      Example - Rotate a Spatial Using fromAngleAxis

                                      +

                                      Example - Rotate a Spatial Using fromAngleAxis

                                      //rotate about the Y-Axis by approximately 1 pi
                                       Vector3f axis = Vector3f.UNIT_Y; 
                                      @@ -530,17 +496,16 @@ s.getLocalRotation().fromAngleAxis(angle, axis);
                                      -

                                      Three Angles

                                      +

                                      Three Angles

                                      - You can also represent a rotation by defining three angles. The angles represent the rotation about the individual axes. Passing in a three-element array of floats defines the angles where the first element is X, second Y and third is Z. The method provided by Quaternion is fromAngles and can also fill an array using toAngles

                                      -

                                      Example - Rotate a Spatial Using fromAngles

                                      +

                                      Example - Rotate a Spatial Using fromAngles

                                      //rotate 1 radian on the x, 3 on the y and 0 on z
                                       float[] angles = {1, 3, 0};
                                      @@ -548,17 +513,16 @@ s.getLocalRotation().fromAngles(angles);
                                      -

                                      Three Axes

                                      +

                                      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.

                                      -

                                      Example - Rotate a Spatial Using fromAxes

                                      +

                                      Example - Rotate a Spatial Using fromAxes

                                      //rotate a spatial to face up ~45 degrees
                                       Vector3f[] axes = new Vector3f[3];
                                      @@ -570,17 +534,16 @@ s.getLocalRotation().fromAxes(axes);
                                      -

                                      Rotation Matrix

                                      +

                                      Rotation Matrix

                                      - Commonly you might find yourself with a Matrix defining a rotation. In fact, it's very common to contain a rotation in a Matrix create a Quaternion, rotate the Quaternion, and then get the Matrix back. Quaternion contains a fromRotationMatrix method that will create the appropriate Quaternion based on the give Matrix. The toRotationMatrix will populate a given Matrix.

                                      -

                                      Example - Rotate a Spatial Using a Rotation Matrix

                                      +

                                      Example - Rotate a Spatial Using a Rotation Matrix

                                      Matrix3f mat = new Matrix3f();
                                       mat.setColumn(0, new Vector3f(1,0,0));
                                      @@ -595,31 +558,39 @@ As you can see there are many ways to build a Quaternion. This allows you to wor
                                       
                                       
                                      -

                                      Slerp

                                      +

                                      Slerp

                                      - One of the biggest advantages to using Quaternions is allowing interpolation between two rotations. That is, if you have an initial Quaternion representing the original orientation of an object, and you have a final Quaternion representing the orientation you want the object to face, you can do this very smoothly with slerp. Simply supply the time, where time is [0, 1] and 0 is the initial rotation and 1 is the final rotation.

                                      -

                                      Example - Use Slerp to Rotate Between two Quaternions

                                      +

                                      Example - Use Slerp to Rotate Between two Quaternions

                                      -
                                      Quaternion q1;
                                      -Quaternion q2;
                                      +
                                      /*
                                      +You can interpolate rotations between two quaternions using spherical linear
                                      +interpolation (slerp).
                                      +*/
                                      +Quaternion Xroll45 = new Quaternion();
                                      +Xroll45.fromAngleAxis(45 * FastMath.DEG_TO_RAD, Vector3f.UNIT_X);
                                      +//
                                      +Quaternion Yroll45 = new Quaternion();
                                      +Yroll45.fromAngleAxis(45 * FastMath.DEG_TO_RAD, Vector3f.UNIT_Y);
                                        
                                      -//the rotation half-way between these two
                                      -Quaternion q3 = q1.slerp(q2, 0.5f);
                                      +//the rotation half - way between these two +  +Quaternion halfBetweenXroll45Yroll45 = new Quaternion(); +halfBetweenXroll45Yroll45.slerp(Xroll45, Yroll45, 0.5f); +geom2.setLocalRotation(halfBetweenXroll45Yroll45);
                                      - -

                                      Multiplication

                                      + +

                                      Multiplication

                                      - You can concatenate (add) rotations: This means you turn the object first around one axis, then around the other, in one step.

                                      Quaternion myRotation = pitch90.mult(roll45); /* pitch and roll */
                                      @@ -632,42 +603,38 @@ Vector3f myVector = new Vector3f(0,0,-1); myRotation.multLocal(myVector);
                                      - -

                                      Utility Classes

                                      + +

                                      Utility Classes

                                      - Along with the base Math classes, jME provides a number of Math classes to make development easier (and, hopefully, faster). Most of these classes find uses throughout the jME system internally. They can also prove beneficial to users as well.

                                      - -

                                      Fast Math

                                      + +

                                      Fast Math

                                      - See

                                      - -

                                      Definition

                                      + +

                                      Definition

                                      - FastMath provides a number of convience methods, and where possible faster versions (although this can be at the sake of accuracy).

                                      - -

                                      Usage

                                      + +

                                      Usage

                                      - FastMath provides a number of constants that can help with general math equations. One important attribute is USE_FAST_TRIG if you set this to true, a look-up table will be used for trig functions rather than Java's standard Math library. This provides significant speed increases, but might suffer from accuracy so care should be taken.

                                      @@ -677,7 +644,7 @@ There are five major categories of functions that FastMath provides.
                                      -

                                      Trig Functions

                                      +

                                      Trig Functions

                                      • cos and acos - provide and values (make use of the look-up table if USE_FAST_TRIG is true)
                                        @@ -690,7 +657,7 @@ There are five major categories of functions that FastMath provides.
                                      -

                                      Numerical Methods

                                      +

                                      Numerical Methods

                                      • ceil - provides the ceiling (smallest value that is greater than or equal to a given value and an integer)of a value.
                                        @@ -719,18 +686,18 @@ There are five major categories of functions that FastMath provides.
                                      -

                                      Linear Algebra

                                      +

                                      Linear Algebra

                                      • LERP - calculate the of two points given a time between 0 and 1.
                                      • -
                                      • determinant - calculates the of a 4x4 matrix.
                                        +
                                      • determinant - calculates the of a 4×4 matrix.
                                      -

                                      Geometric Functions

                                      +

                                      Geometric Functions

                                      • counterClockwise - given three points (defining a triangle), the winding is determined. 1 if counter-clockwise, -1 if clockwise and 0 if the points define a line.
                                        @@ -745,7 +712,7 @@ There are five major categories of functions that FastMath provides.
                                      -

                                      Misc.

                                      +

                                      Misc.

                                      • newRandomFloat - obtains a random float.
                                        @@ -753,32 +720,29 @@ There are five major categories of functions that FastMath provides.
                                      - -

                                      Line

                                      + +

                                      Line

                                      - See

                                      - -

                                      Definition

                                      + +

                                      Definition

                                      - A line is a straight one-dimensional figure having no thickness and extending infinitely in both directions. A line is defined by two points A and B with the line passing through both.

                                      - -

                                      Usage

                                      + +

                                      Usage

                                      - jME defines a Line class that is defined by an origin and direction. In reality, this Line class is typically used as a line segment. Where the line is finite and contained between these two points.

                                      @@ -787,29 +751,27 @@ jME defines a Line class that is defined by an origin and direction. In reality,

                                      - -

                                      Example 1 - Find a Random Point on a Line

                                      + +

                                      Example 1 - Find a Random Point on a Line

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

                                      Plane

                                      + +

                                      Plane

                                      - See

                                      - -

                                      Definition

                                      + +

                                      Definition

                                      - A plane is defined by the equation N . (X - X0) = 0 where N = (a, b, c) and passes through the point X0 = (x0, y0, z0). X defines another point on this plane (x, y, z).

                                      @@ -838,12 +800,11 @@ This gives us the general equation: (ax + by + cz + d = 0)

                                      - -

                                      Usage in jME

                                      + +

                                      Usage in jME

                                      - jME defines the Plane as ax + by + cz = -d. Therefore, during creation of the plane, the normal of the plane (a,b,c) and the constant d is supplied.

                                      @@ -853,7 +814,6 @@ The most common usage of Plane is -

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

                                      + +

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

                                      Vector3f normal = new Vector3f(0,1,0);
                                       float constant = new Vector3f(1,1,1).dot(normal);
                                      @@ -884,12 +843,11 @@ if(side == Plane.NO_SIDE) {
                                       }
                                      - -

                                      Example 2 - For the Layperson

                                      + +

                                      Example 2 - For the Layperson

                                      - Using the standard constructor Plane(Vector3f normal, float constant), here is what you need to do to create a plane, and then use it to check which side of the plane a point is on.

                                      package test;
                                      @@ -906,7 +864,7 @@ public class TestPlanes
                                       {
                                         public static final Logger logger = Logger.getLogger(LevelGraphBuilder.class.getName());
                                        
                                      -  public static void main(String[] args) throws Exception
                                      +  public static void main(Exception
                                         {
                                           //***Outline.
                                           //This example shows how to construct a plane representation using
                                      @@ -956,22 +914,20 @@ public class TestPlanes
                                       }
                                      - -

                                      Ray

                                      + +

                                      Ray

                                      - See

                                      - -

                                      Definition

                                      + +

                                      Definition

                                      - Ray defines a line that starts at a point A and continues in a direction through B into infinity.

                                      @@ -980,84 +936,78 @@ This Ray is used extensively in jME for -

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

                                      + +

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

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

                                      Rectangle

                                      + +

                                      Rectangle

                                      - See

                                      - -

                                      Definition

                                      + +

                                      Definition

                                      - Rectangle defines a finite plane within three dimensional space that is specified via three points (A, B, C). These three points define a triangle with the forth point defining the rectangle ( (B + C) - A ).

                                      - -

                                      jME Usage

                                      + +

                                      jME Usage

                                      - Rectangle is a straight forward data class that simply maintains values that defines a Rectangle in 3D space. One interesting use is the random method that will create a random point on the Rectangle. The Particle System makes use of this to define an area that generates Particles.

                                      - -

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

                                      + +

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

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

                                      Triangle

                                      + +

                                      Triangle

                                      - See

                                      - -

                                      Definition

                                      + +

                                      Definition

                                      - A triangle is a 3-sided polygon. Every triangle has three sides and three angles, some of which may be the same. If the triangle is a right triangle (one angle being 90 degrees), the side opposite the 90 degree angle is the hypotenuse, while the other two sides are the legs. All triangles are and .

                                      - -

                                      Usage

                                      + +

                                      Usage

                                      - jME's Triangle class is a simple data class. It contains three Vector3f objects that represent the three points of the triangle. These can be retrieved via the get method. The get method, obtains the point based on the index provided. Similarly, the values can be set via the set method.

                                      - -

                                      Example 1 - Creating a Triangle

                                      + +

                                      Example 1 - Creating a Triangle

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

                                      Tips and Tricks

                                      + +

                                      Tips and Tricks

                                      - -

                                      How do I get height/width of a spatial?

                                      + +

                                      How do I get height/width of a spatial?

                                      - Cast the spatial to com.jme3.bounding.BoundingBox to be able to use getExtent(). -

                                      Vector3f extent = ((BoundingBox) spatial.getWorldBound()).getExtent(new Vector3f());
                                       float x = ( (BoundingBox)spatial.getWorldBound()).getXExtent();
                                      @@ -1086,14 +1034,14 @@ float y = ( (BoundingBox)spatial.getWorldBound()).getYEx
                                       float z = ( (BoundingBox)spatial.getWorldBound()).getZExtent();
                                      - -

                                      How do I position the center of a Geomtry?

                                      + +

                                      How do I position the center of a Geomtry?

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

                                      See Also

                                      + +

                                      See Also

                                      • @@ -1103,5 +1051,5 @@ float z = ( (BoundingBox)spatial.getWorldBound()).getZEx
                                      - -

                                      view online version

                                      \ No newline at end of file + +

                                      view online version

                                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/simpleapplication_from_the_commandline.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/simpleapplication_from_the_commandline.html index d15b9298a..3495e5480 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/simpleapplication_from_the_commandline.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/simpleapplication_from_the_commandline.html @@ -1,10 +1,9 @@ -

                                      Starting a JME3 application from the Commandline

                                      +

                                      Starting a JME3 application from the Commandline

                                      - -Although we recommend the jMonkeyEngine SDK for developing JME3 games, you can use any IDE (integrated development environment) such as NetBeans or Eclipse, and even work freely from the commandline. Here is a generic IDE-independent "getting started" tutorial. +Although we recommend the jMonkeyEngine SDK for developing JME3 games, you can use any IDE (integrated development environment) such as NetBeans or Eclipse, and even work freely from the commandline. Here is a generic IDE-independent “getting started” tutorial.

                                      @@ -13,7 +12,6 @@ This example shows how to set up and run a simple application (HelloJME3) that d

                                      The directory structure will look as follows: -

                                      jme3/
                                       jme3/lib
                                      @@ -27,12 +25,11 @@ HelloJME3/src
                                       
                                       
                                      -

                                      Installing the JME3 Framework

                                      +

                                      Installing the JME3 Framework

                                      - -To install the development version of jme3, , unzip the folder into a directory named jme3. The filenames here are just an example, but they will always be something like jME3_xx-xx-2011. +To install the development version of jme3, , unzip the folder into a directory named jme3. The filenames here are just an example, but they will always be something like jME3_xx-xx-2011.

                                      mkdir jme3
                                       cd jme3
                                      @@ -41,7 +38,7 @@ unzip jME3_01-18-2011.zip

                                      Alternatively, you can build JME3 from the sources. (Recommended for JME3 developers.)

                                      -
                                      svn checkout https://jmonkeyengine.googlecode.com/svn/trunk/engine jme3
                                      +
                                      svn checkout https://jmonkeyengine.googlecode.com/svn/branches/3.0final/engine jme3
                                       cd jme3
                                       ant run
                                       cd ..
                                      @@ -51,12 +48,11 @@ If you see a Test Chooser application open now, the build was successful.
                                      - -

                                      Sample Project Directory Structure

                                      + +

                                      Sample Project Directory Structure

                                      - First we set up the directory and source package structure for your game project. Note that the game project directory HelloJME3 is on the same level as your jme3 checkout. In this example, we create a Java package that we call hello in the source directory.

                                      mkdir HelloJME3
                                      @@ -64,13 +60,12 @@ mkdir HelloJME3/src
                                       mkdir HelloJME3/src/hello
                                      - -

                                      Libraries

                                      + +

                                      Libraries

                                      - -Next you copy the necessary JAR libraries from the download to your project. You only have to do this set of steps once every time you download a new JME3 build. For a detailed description of the separate jar files see this list. +Next you copy the necessary JAR libraries from the download to your project. You only have to do this set of steps once every time you download a new JME3 build. For a detailed description of the separate jar files see this list.

                                      mkdir HelloJME3/build 
                                       mkdir HelloJME3/lib
                                      @@ -84,12 +79,11 @@ mkdir HelloJME3/lib
                                       cp jme3/dist/*.* HelloJME3/lib
                                      - -

                                      Sample Code

                                      + +

                                      Sample Code

                                      - To test your setup, create the file HelloJME3/src/hello/HelloJME3.java with any text editor, paste the following sample code, and save.

                                      package hello;
                                      @@ -110,7 +104,7 @@ public class HelloJME3 extends SimpleApplication {
                                        
                                           @Override
                                           public void simpleInitApp() {
                                      -        Box b = new Box(Vector3f.ZERO, 1, 1, 1);
                                      +        Box(Vector3f.ZERO, 1, 1, 1);
                                               Geometry geom = new Geometry("Box", b);
                                               Material mat = new Material(assetManager, 
                                                 "Common/MatDefs/Misc/Unshaded.j3md");
                                      @@ -121,25 +115,24 @@ public class HelloJME3 extends SimpleApplication {
                                       }
                                      - -

                                      Build and Run

                                      + +

                                      Build and Run

                                      - -We build the sample application into the build directory??? +We build the sample application into the build directory…

                                      cd HelloJME3
                                       javac -d build -cp "lib/eventbus-1.4.jar:lib/j-ogg-oggd.jar:lib/j-ogg-vorbisd.jar:lib/jME3-lwjgl-natives.jar:lib/jbullet.jar:lib/jinput.jar:lib/lwjgl.jar:lib/stack-alloc.jar:lib/vecmath.jar:lib/xmlpull-xpp3-1.1.4c.jar:lib/jME3-blender.jar:lib/jME3-core.jar:lib/jME3-desktop.jar:lib/jME3-jogg.jar:lib/jME3-plugins.jar:lib/jME3-terrain.jar:lib/jME3-testdata.jar:lib/jME3-niftygui.jar:lib/nifty-default-controls.jar:lib/nifty-examples.jar:lib/nifty-style-black.jar:lib/nifty.jar:." src/hello/HelloJME3.java 

                                      -??? and run it. +… and run it.

                                      cd build
                                       java -cp "../lib/eventbus-1.4.jar:../lib/j-ogg-oggd.jar:../lib/j-ogg-vorbisd.jar:../lib/jME3-lwjgl-natives.jar:../lib/jbullet.jar:../lib/jinput.jar:../lib/lwjgl.jar:../lib/stack-alloc.jar:../lib/vecmath.jar:../lib/xmlpull-xpp3-1.1.4c.jar:../lib/jME3-blender.jar:../lib/jME3-core.jar:../lib/jME3-desktop.jar:../lib/jME3-jogg.jar:../lib/jME3-plugins.jar:../lib/jME3-terrain.jar:../lib/jME3-testdata.jar:../lib/jME3-niftygui.jar:../lib/nifty-default-controls.jar:../lib/nifty-examples.jar:../lib/nifty-style-black.jar:../lib/nifty.jar:." hello/HelloJME3

                                      -Note: If you use Windows, the classpath separator is ";" instead of ":". +Note: If you use Windows, the classpath separator is “;” instead of “:”.

                                      @@ -147,12 +140,11 @@ If a settings dialog pops up, confirm the default settings. You should now see a

                                      - -

                                      Recommended Asset Directory Structure

                                      + +

                                      Recommended Asset Directory Structure

                                      - For multi-media files, models, and other assets, we recommend creating the following project structure:

                                      cd HelloJME3
                                      @@ -180,19 +172,18 @@ You will learn more about the asset manager and how to customize it later. For n
                                       

                                      - -

                                      Next Steps

                                      + +

                                      Next Steps

                                      - Now follow the tutorials and write your first jMonkeyEngine game.

                                      - + +

                                      +tag_documentation_install +

                                      - -

                                      view online version

                                      \ No newline at end of file + +

                                      view online version

                                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/terminology.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/terminology.html index 20b48a131..7a84d32ac 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/terminology.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/terminology.html @@ -1,39 +1,36 @@ -

                                      3D Game Development Terminology

                                      +

                                      3D Game Development Terminology

                                      - Before you start, make certain you are familiar with the following concepts and terminology.

                                      -

                                      3D Graphics and Audio

                                      +

                                      3D Graphics and Audio

                                      - OpenGL is the Open Graphics Library, a platform-independent specification for rendering 2D/3D computer graphics. For Java, there are two implementations of OpenGL-based renderers:

                                        -
                                      1. Lightweight Java Game Library (LWJGL) ??? jme3 uses lwjgl.
                                        +
                                      2. Lightweight Java Game Library (LWJGL).
                                      3. Java OpenGL (JOGL)

                                      -OpenAL is the Open Audio Library, a platform-independent 3D audio API. +OpenAL is the Open Audio Library, a platform-independent 3D audio API.

                                      - -

                                      Context, Display, Renderer

                                      + +

                                      Context, Display, Renderer

                                      - The jME Context makes settings, renderer, timer, input and event listeners, display system, accessible to a JME game.

                                        @@ -50,22 +47,21 @@ The jME Context makes settings, renderer, timer, input and even
                                      - -

                                      Geometry

                                      + +

                                      Geometry

                                      - -

                                      Polygon, Mesh, Vertex

                                      + +

                                      Polygon, Mesh, Vertex

                                      -

                                      -Most visible objects in a 3D scene are made up of polygon meshes ??? characters, terrains, buildings, etc. A mesh is a grid-like structure that represents a complex shape. The advantage of a mesh is that it is mathematically simple enough to render in real time, and detailed enough to be recognizable. +Most visible objects in a 3D scene are made up of polygon meshes – characters, terrains, buildings, etc. A mesh is a grid-like structure that represents a complex shape. The advantage of a mesh is that it is mathematically simple enough to render in real time, and detailed enough to be recognizable.

                                      @@ -77,26 +73,25 @@ You create 3D meshes in tools called mesh editors, e.g in Blender. The jMonkeyEn

                                      - -

                                      Materials: Color, Lighting/Shading

                                      + +

                                      Materials: Color, Lighting/Shading

                                      - -What we call "color" is merely part of an object's light reflection. The onlooker's brain uses shading and reflecting properties to infer an object's shape and material. Factors like these make all the difference between chalk vs milk, skin vs paper, water vs plastic, etc! () +What we call “color” is merely part of an object's light reflection. The onlooker's brain uses shading and reflecting properties to infer an object's shape and material. Factors like these make all the difference between chalk vs milk, skin vs paper, water vs plastic, etc! ()

                                      - -

                                      Color

                                      + +

                                      Color

                                      - -

                                      Ambient color

                                      + +

                                      Ambient color

                                        -
                                      • The uniform base color of the mesh ??? what it looks like when not influenced by any light source.
                                        +
                                      • The uniform base color of the mesh – what it looks like when not influenced by any light source.
                                      • Usually similar to the Diffuse color.
                                      • @@ -105,8 +100,8 @@ What we call "color" is merely part of an object's light reflecti
                                      - -

                                      Diffuse color

                                      + +

                                      Diffuse color

                                      • The base color of the mesh plus shattered light and shadows that are caused by a light source.
                                        @@ -116,13 +111,13 @@ What we call "color" is merely part of an object's light reflecti
                                      - -

                                      Light Sources

                                      + +

                                      Light Sources

                                      - -

                                      Emissive color

                                      + +

                                      Emissive color

                                      • The color of light emitted by a light source or glowing material.
                                        @@ -134,13 +129,13 @@ What we call "color" is merely part of an object's light reflecti
                                      - -

                                      Reflections

                                      + +

                                      Reflections

                                      - -

                                      Shininess

                                      + +

                                      Shininess

                                      • Degree of shininess of a surface (1-128).
                                        @@ -155,8 +150,8 @@ Set the Specular color to ColorRGBA.Black to switch off shininess.
                                      - -

                                      Specular Color

                                      + +

                                      Specular Color

                                      • If the material is shiny, then the Specular Color is the color of the reflected highlights.
                                        @@ -170,21 +165,20 @@ Set the Specular color to ColorRGBA.Black to switch off shininess.

                                      - +

                                      - -

                                      Materials: Textures

                                      + +

                                      Materials: Textures

                                      - Textures are part of Materials. In the simplest case, an object could have just one texture, the Color Map, loaded from one image file. When you think back of old computer games you'll remember this looks quite plain.

                                      -The more information you (the game designer) provide additionally to the Color Map, the higher the degree of detail and realism. Whether you want photo-realistic rendering or "toon" rendering (Cel Shading), everything depends on the quality of your materials and textures. Modern 3D graphics use several layers of information to describe one material, each mapped layer is a texture. +The more information you (the game designer) provide additionally to the Color Map, the higher the degree of detail and realism. Whether you want photo-realistic rendering or “toon” rendering (Cel Shading), everything depends on the quality of your materials and textures. Modern 3D graphics use several layers of information to describe one material, each mapped layer is a texture.

                                      @@ -193,18 +187,17 @@ The more information you (the game designer) provide additionally to the Color M

                                      - -

                                      Texture Mapping

                                      + +

                                      Texture Mapping

                                      - -

                                      Color Map / Diffuse Map

                                      + +

                                      Color Map / Diffuse Map

                                      - - +

                                      • A plain image file or a procedural texture that describes an object's visible surface.
                                        @@ -218,12 +211,11 @@ The more information you (the game designer) provide additionally to the Color M
                                      - -

                                      Bump Map

                                      + +

                                      Bump Map

                                      - Bump maps are used to describe detailed shapes that would be too hard or simply too inefficient to sculpt in a mesh editor. There are two types:

                                        @@ -234,12 +226,12 @@ Bump maps are used to describe detailed shapes that would be too hard or simply

                                      - +

                                      -

                                      Height Map

                                      +

                                      Height Map

                                      • A height map is a grayscale image looking similar to a terrain map used in topography. Brighter grays represent higher areas and darker grays lower areas.
                                        @@ -252,15 +244,14 @@ Bump maps are used to describe detailed shapes that would be too hard or simply
                                      -

                                      Normal Map

                                      +

                                      Normal Map

                                      - - +

                                        -
                                      • A well-done Normal Map makes a shape more detailed ??? without the need to add costly polygons to the mesh. It contains shading information that makes the object appear smoother and more fine-grained.
                                        +
                                      • A well-done Normal Map makes a shape more detailed – without the need to add costly polygons to the mesh. It contains shading information that makes the object appear smoother and more fine-grained.
                                      • When you open a Normal Map in an image editor, it looks like a false-color version of the Color Map. Normal maps however are never used for coloring, instead, each the color values encode displacement data of bumps and cracks on the surface. Displacement data is represented by the Surface Normals of the slopes, hence the name.
                                      • @@ -269,13 +260,12 @@ Bump maps are used to describe detailed shapes that would be too hard or simply
                                      - -

                                      Specular Map

                                      + +

                                      Specular Map

                                      - - +

                                      • A Specular Map further improves the realism of an object's surface: It contains extra information about shininess and makes the shape appear more realistically illumated.
                                        @@ -287,14 +277,13 @@ Bump maps are used to describe detailed shapes that would be too hard or simply
                                      - -

                                      Seamless Tiled Textures

                                      + +

                                      Seamless Tiled Textures

                                      - - -Tiles are a very simple, commonly used type of texture. When texturing a wide area (e.g. walls, floors), you don't create one huge texture ??? instead you tile a small texture repeatedly to fill the area. + +Tiles are a very simple, commonly used type of texture. When texturing a wide area (e.g. walls, floors), you don't create one huge texture – instead you tile a small texture repeatedly to fill the area.

                                      @@ -306,17 +295,16 @@ See also this tutorial on -

                                      UV Maps / Texture Atlas

                                      + +

                                      UV Maps / Texture Atlas

                                      - - +

                                      -Creating a texture for a cube is easy ??? but what about a character with a face and extremities? For more complex objects, you design the texture in the same ways as a flat sewing pattern: One image file contains the outline of the front, back, and side of the object, next to one another. Specific areas of the flat texture (UV coordinates) map onto certain areas of your 3D model (XYZ coordinates), hence the name UV map. Using UV Maps (also known as Texture Atlas), one model can have different textures on each side. You create one corresponding UV map for each texture. +Creating a texture for a cube is easy – but what about a character with a face and extremities? For more complex objects, you design the texture in the same ways as a flat sewing pattern: One image file contains the outline of the front, back, and side of the object, next to one another. Specific areas of the flat texture (UV coordinates) map onto certain areas of your 3D model (XYZ coordinates), hence the name UV map. Using UV Maps (also known as Texture Atlas), one model can have different textures on each side. You create one corresponding UV map for each texture.

                                      @@ -324,13 +312,12 @@ Getting the seams and mappings right is crucial: You must use a graphic tool lik

                                      - -

                                      Environment Mapping

                                      + +

                                      Environment Mapping

                                      - - +

                                      @@ -338,7 +325,7 @@ Environment Mapping or Reflection Mapping is used to create the impression of re

                                      -You create a Cube Map to represent your environment; Sphere Maps are also possible, but often look distorted. Basically you give the environment map a set of images showing a "360?? view" of the background scene ??? very similar to a skybox. The renderer maps the environment on the texture of the reflective surface, which results in an acceptable "glass/mirror/water" effect. Just like a skybox, the reflection map is static, so dynamic things (such as the player walking) are not part of the reflection. (!) +You create a Cube Map to represent your environment; Sphere Maps are also possible, but often look distorted. Basically you give the environment map a set of images showing a “360° view” of the background scene – very similar to a skybox. The renderer maps the environment on the texture of the reflective surface, which results in an acceptable “glass/mirror/water” effect. Just like a skybox, the reflection map is static, so dynamic things (such as the player walking) are not part of the reflection. (!)

                                      @@ -346,27 +333,25 @@ See also: Water.

                                      - -

                                      MIP Map Texture

                                      + +

                                      MIP Map Texture

                                      - -MIP Map means that you provide one texture in two or three resolutions in one file (MIP = "multum in parvo" = "many in one"). Depending on how close (or far) the camera is, the engine automatically renders a more (or less) detailed texture for the object. Thus objects look detailed at close up, but also look good when viewed from far away. Good for everything, but requires more time to create and more space to store textures. If you don't provide custom ones, the jMonkeyEngine creates basic MIP maps automatically as an optimization. +MIP Map means that you provide one texture in two or three resolutions in one file (MIP = “multum in parvo” = “many in one”). Depending on how close (or far) the camera is, the engine automatically renders a more (or less) detailed texture for the object. Thus objects look detailed at close up, but also look good when viewed from far away. Good for everything, but requires more time to create and more space to store textures. If you don't provide custom ones, the jMonkeyEngine creates basic MIP maps automatically as an optimization.

                                      - -

                                      Procedural Textures

                                      + +

                                      Procedural Textures

                                      - A procedural texture is generated from repeating one small image, plus some pseudo-random, gradient variations (called Perlin noise). Procedural textures look more natural than static rectangular textures, and they look less distorted on spheres. On big meshes, their repetitiveness is much less noticable than with tiled seamless textures. Procedural textures are ideal for irregular large-area textures like grass, soil, rock, rust, and walls. Use the to create them.

                                      - +

                                      @@ -374,12 +359,11 @@ See also:

                                      - -

                                      Animation

                                      + +

                                      Animation

                                      - In 3D games, Skeletal Animation is used for animated characters, but in principle the skeleton approach can be extended to any 3D mesh (for example, an opening crate's hinge can be considered a primitive joint).

                                      @@ -388,13 +372,12 @@ Unless you animate a 3D cartoon, realism of animated characters is generally a p

                                      - -

                                      Rigging and Skinning

                                      + +

                                      Rigging and Skinning

                                      - - +

                                      @@ -433,7 +416,7 @@ E.g. when the thigh bone moves, the leg is fully affected, the hips joints less

                                      • A series of keyframes makes up one animation.
                                      • -
                                      • Each model can have several animations. Each animation has a name to identify it (e.g. "walk", "attack", "jump").
                                        +
                                      • Each model can have several animations. Each animation has a name to identify it (e.g. “walk”, “attack”, “jump”).
                                      • You specify in your game code which keyframe animation to load, and when to play it.
                                      • @@ -442,13 +425,12 @@ E.g. when the thigh bone moves, the leg is fully affected, the hips joints less

                                        - -

                                        What is the difference between animation (rigging, skinning, keyframes) and transformation (rotation, scaling, moving, "slerp")? +

                                        What is the difference between animation (rigging, skinning, keyframes) and transformation (rotation, scaling, moving, “slerp”)?

                                        • Transformation is simpler than animation. Sometimes, transforming a geometry already makes it look like it is animated: For example, a spinning windmill, a pulsating alien ball of energy, moving rods of a machine. Transformations can be easily done with JME3 methods.
                                        • -
                                        • Animations however are more complex and are encoded in a special format (keyframes). They distort the skin of the mesh, and complex series of motions be "recorded" (in external tools) and played (in JME3).
                                          +
                                        • Animations however are more complex and are encoded in a special format (keyframes). They distort the skin of the mesh, and complex series of motions be “recorded” (in external tools) and played (in JME3).
                                        @@ -458,19 +440,19 @@ E.g. when the thigh bone moves, the leg is fully affected, the hips joints less

                                        - -

                                        Kinematics

                                        + +

                                        Kinematics

                                          -
                                        • Forward kinematics: "Given the angles of all the character's joints, what is the position of the character's hand?"
                                          +
                                        • Forward kinematics: “Given the angles of all the character's joints, what is the position of the character's hand?”
                                        • -
                                        • Inverse kinematics: "Given the position of the character's hand, what are the angles of all the character's joints?"
                                          +
                                        • Inverse kinematics: “Given the position of the character's hand, what are the angles of all the character's joints?”
                                        - -

                                        Controller and Channel

                                        + +

                                        Controller and Channel

                                        @@ -478,35 +460,34 @@ In the JME3 application, you register animated models to the Animation Controlle

                                        - -

                                        Artificial Intelligence (AI)

                                        + +

                                        Artificial Intelligence (AI)

                                        -Non-player (computer-controlled) characters (NPCs) are only fun in a game if they do not stupidly bump into walls, or blindly run into the line of fire. You want to make NPCs "aware" of their surroundings and let them make decisions based on the game state ??? otherwise the player can just ignore them. The most common use case is that you want to make enemies interact in a way so they offer a more interesting challenge for the player. +Non-player (computer-controlled) characters (NPCs) are only fun in a game if they do not stupidly bump into walls, or blindly run into the line of fire. You want to make NPCs “aware” of their surroundings and let them make decisions based on the game state – otherwise the player can just ignore them. The most common use case is that you want to make enemies interact in a way so they offer a more interesting challenge for the player.

                                        -"Smart" game elements are called artificially intelligent agents (AI agents). An AI agent can be used to implement enemy NPCs as well as trained pets; you also use them to create automatic alarm systems that lock doors and "call the guards" after the player triggers an intruder alert. +“Smart” game elements are called artificially intelligent agents (AI agents). An AI agent can be used to implement enemy NPCs as well as trained pets; you also use them to create automatic alarm systems that lock doors and “call the guards” after the player triggers an intruder alert.

                                        The domain of artificial intelligence deals, among other things, with:

                                          -
                                        • Knowledge ??? Knowledge is the data to which the AI agent has access, and on which the AI bases its decisions. Realistic agents only "know" what they "see and hear". This implies that information can be hidden from the AI to keep the game fair. You can have an all-knowing AI, or you can let only some AI agents share information, or you let only AI agents who are close know the current state.
                                          +
                                        • Knowledge – Knowledge is the data to which the AI agent has access, and on which the AI bases its decisions. Realistic agents only “know” what they “see and hear”. This implies that information can be hidden from the AI to keep the game fair. You can have an all-knowing AI, or you can let only some AI agents share information, or you let only AI agents who are close know the current state.
                                          Example: After the player trips the wire, only a few AI guards with two-way radios start moving towards the player's position, while many other guards don't suspect anything yet.
                                        • -
                                        • Goal Planning ??? Planning is about how an AI agent takes action. Each agent has the priority to achieve a specific goal, to reach a future state. When programming, you split the agent's goal into several subgoals. The agent consults its knowledge about the current state, chooses from available tactics and strategies, and prioritizes them. The agent repeatedly tests whether the current state is closer to its goal. If unsuccessful, the agent must discard the current tactics/strategy and try another one.
                                          +
                                        • Goal Planning – Planning is about how an AI agent takes action. Each agent has the priority to achieve a specific goal, to reach a future state. When programming, you split the agent's goal into several subgoals. The agent consults its knowledge about the current state, chooses from available tactics and strategies, and prioritizes them. The agent repeatedly tests whether the current state is closer to its goal. If unsuccessful, the agent must discard the current tactics/strategy and try another one.
                                          Example: An agent searches the best path to reach the player base in a changing environment, avoiding traps. An agent chases the player with the goal of eliminating him. An agent hides from the player with the goal of murdering a VIP.
                                        • -
                                        • Problem Solving ??? Problem solving is about how the agent reacts to interruptions, obstacles that stand between it and its goal. The agent uses a given set of facts and rules to deduct what state it is in ??? triggered by perceptions similar to pain, agony, boredom, or being trapped. In each state, only a specific subset of reactions makes sense. The actual reaction also depends on the agent's, goal since the agent's reaction must not block its own goal!
                                          +
                                        • Problem Solving – Problem solving is about how the agent reacts to interruptions, obstacles that stand between it and its goal. The agent uses a given set of facts and rules to deduct what state it is in – triggered by perceptions similar to pain, agony, boredom, or being trapped. In each state, only a specific subset of reactions makes sense. The actual reaction also depends on the agent's, goal since the agent's reaction must not block its own goal!
                                          Examples: If player approaches, does the agent attack or conceal himself or raise alarm? While agent is idle, does he lay traps or heal self or recharge magic runes? If danger to own life, does the agent try to escape or kamikaze?

                                        - More advanced AIs can also learn, for example using neural networks.

                                        @@ -524,13 +505,13 @@ There are lots of resources explaining interesting AI algorithms:
                                      • -
                                      • ???
                                        +
                                      - -

                                      Math

                                      + +

                                      Math

                                      @@ -538,23 +519,21 @@ There are lots of resources explaining interesting AI algorithms:

                                      - -

                                      Coordinates

                                      + +

                                      Coordinates

                                      - Coordinates represent a location in a coordinate system. Coordinates are relative to the origin at (0,0,0). In 3D space, you need to specify three coordinate values to locate a point: X (right), Y (up), Z (towards you). Similarly, -X (left), -Y (down), -Z (away from you). In contrast to a vector (which looks similar), a coordinate is a location, not a direction.

                                      - -

                                      The Origin

                                      + +

                                      The Origin

                                      - The origin is the central point in the 3D world, where the three axes meet. It's always at the coordinates (0,0,0).

                                      @@ -563,12 +542,11 @@ The origin is the central point in the 3D world, where the three axes meet. It&#

                                      - -

                                      Vectors

                                      + +

                                      Vectors

                                      - A vector has a length and a direction, like an arrow in 3D space. A vector starts at a coordinate (x1,y1,z1) or at the origin, and ends at the target coordinate (x2,y2,z2). Backwards directions are expressed with negative values.

                                      @@ -579,12 +557,11 @@ A vector has a length and a direction, like an arrow in 3D space. A vector start Vector3f v = new Vector3f( 8f , 0f , 33f ).add(new Vector3f( 0f , -2f , -2f )); // starts at (8,-2,31)
                                      - -

                                      Unit Vectors

                                      + +

                                      Unit Vectors

                                      - A unit vector is a basic vector with a length of 1 world unit. Since its length is fixed (and it thus can only point at one location anyway), the only interesting thing about this vector is its direction.

                                        @@ -599,16 +576,15 @@ A unit vector is a basic vector with a length of 1 world unit. Since it

                                      -Negate the vegator to change its direction, e.g. (-1, 0, 0) = left. +Negate the components of the vector to turn its direction, e.g. negating right (1,0,0) results in left (-1,0,0).

                                      - -

                                      Normalized Vectors

                                      + +

                                      Normalized Vectors

                                      - A normalized vector is a custom unit vector. A normalized vector is not the same as a (surface) normal vector. When you normalize a vector, it still has the same direction, but you lose the information where the vector originally pointed.

                                      @@ -618,26 +594,24 @@ When you normalize a vector, it still has the same direction, but you lose the i

                                      - -

                                      Surface Normal Vectors

                                      + +

                                      Surface Normal Vectors

                                      - A surface normal is a vector that is perpendicular (orthogonal) to a plane. You calculate the Surface Normal by calculating the cross product.

                                      - -

                                      Cross Product

                                      + +

                                      Cross Product

                                      - -The cross product is a calculation that you use to find a perpendicular vector (an orthogonal, a "right angle" at 90??). -In 3D space, speaking of an orthogonal only makes sense with respect to a plane. You need two vectors to uniquely define a plane. The cross product of the two vectors, v1 ?? v2, is a new vector that is perpendicular to this plane. A vector perpendicular to a plane is a called Surface Normal. +The cross product is a calculation that you use to find a perpendicular vector (an orthogonal, a “right angle” at 90°). +In 3D space, speaking of an orthogonal only makes sense with respect to a plane. You need two vectors to uniquely define a plane. The cross product of the two vectors, v1 × v2, is a new vector that is perpendicular to this plane. A vector perpendicular to a plane is a called Surface Normal.

                                      @@ -647,12 +621,11 @@ In 3D space, speaking of an orthogonal only makes sense with respect to a plane.

                                      - -

                                      Transformation

                                      + +

                                      Transformation

                                      - Transformation means rotating (turning), scaling (resizing), or translating (moving) objects in 3D scenes. 3D engines offer simple methods so you can write code that transforms nodes.

                                      @@ -661,17 +634,16 @@ Examples: Falling and rotating bricks in 3D Tetris.

                                      - -

                                      Slerp

                                      + +

                                      Slerp

                                      - -Slerp is how we pronounce spherical linear interpolation when we are in a hurry. A slerp is an interpolated transformation that is used as a simple "animation" in 3D engines. You define a start and end state, and the slerp interpolates a constant-speed transition from one state to the other. You can play the motion, pause it at various percentages (values between 0.0 and 1.0), and play it backwards and forwards. +Slerp is how we pronounce spherical linear interpolation when we are in a hurry. A slerp is an interpolated transformation that is used as a simple “animation” in 3D engines. You define a start and end state, and the slerp interpolates a constant-speed transition from one state to the other. You can play the motion, pause it at various percentages (values between 0.0 and 1.0), and play it backwards and forwards.

                                      -Example: A burning meteorite Geometry slerps from "position p1, rotation r1, scale s1" in the sky down to "p2, r2, s2" into a crater. +Example: A burning meteorite Geometry slerps from “position p1, rotation r1, scale s1” in the sky down to “p2, r2, s2” into a crater.

                                      @@ -679,8 +651,8 @@ Example: A burning meteorite Geometry slerps from "position p1, rotation r1

                                      - -

                                      Game Developer Jargon

                                      + +

                                      Game Developer Jargon

                                      • @@ -688,8 +660,8 @@ Example: A burning meteorite Geometry slerps from "position p1, rotation r1
                                      - -

                                      3D graphics Terminology Wiki book

                                      + +

                                      3D graphics Terminology Wiki book

                                      • @@ -697,5 +669,5 @@ Example: A burning meteorite Geometry slerps from "position p1, rotation r1
                                      - -

                                      view online version

                                      \ No newline at end of file + +

                                      view online version

                                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/the_scene_graph.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/the_scene_graph.html index f5bd67daf..80ecd163c 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/the_scene_graph.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/the_scene_graph.html @@ -1,9 +1,8 @@ -

                                      The Scene Graph and Other jME3 Terminology

                                      +

                                      The Scene Graph and Other jME3 Terminology

                                      - Before you start making games, make sure you understand general 3D Gaming terminology.

                                      @@ -17,11 +16,10 @@ Then continue learning about jME3 concepts here.
                                      -

                                      Coordinate System

                                      +

                                      Coordinate System

                                      -

                                      @@ -31,7 +29,6 @@ The jMonkeyEngine uses a right-handed coordinate system, just as OpenGL does.

                                      The coordinate system consists of: -

                                      • The origin, a single central point in space.
                                        @@ -53,13 +50,12 @@ The coordinate system consists of:

                                      - -Every point in 3D space is uniquely defined by its X,Y,Z coordinates. The three numeric coordinates express how many "steps" from each of the three axes a point is. The data type for all vectors in jME3 is com.jme3.math.Vector3f. All vectors are relative to the described coordinate system.
                                      +Every point in 3D space is uniquely defined by its X,Y,Z coordinates. The three numeric coordinates express how many “steps” from each of the three axes a point is. The data type for all vectors in jME3 is com.jme3.math.Vector3f. All vectors are relative to the described coordinate system.
                                      Example: The point new Vector3f(3,-5,1) is 3 steps to the right, 5 steps down, and 1 towards you.

                                      -

                                      The unit of meassurement ("one step") in jME3 is the world unit, short: wu. Typically, 1 wu is considered to be one meter. As long as you are consistant throughout your game, 1 wu can be any distance you like. +

                                      The unit of meassurement (“one step”) in jME3 is the world unit, short: wu. Typically, 1 wu is considered to be one meter. As long as you are consistant throughout your game, 1 wu can be any distance you like.

                                      @@ -79,22 +75,22 @@ This means the player's point of view is on the positive side of the Z axis
                                      -

                                      How to move yourself through the 3D scene

                                      +

                                      How to move yourself through the 3D scene

                                      - When you play a 3D game, you typically want to navigate the 3D scene. Note that by default, the mouse pointer is invisible, and the mouse is set up to control the camera rotation!

                                      By default, jME3 uses the following common navigation inputs -

                                      + + @@ -113,23 +109,20 @@ By default, jME3 uses the following common navigation inputs
                                      Game Inputs Camera Motion Player POV
                                      Press the W and S keysmove the camera forward, and backwardyou walk back and forth

                                      - -These default settings are called "WASD keys" and "Mouse Look". You can customize input handling for your game. Sorry, but these settings work best on a QWERTY/QWERTZ keyboard. +These default settings are called “WASD keys” and “Mouse Look”. You can customize input handling for your game. Sorry, but these settings work best on a QWERTY/QWERTZ keyboard.

                                      -

                                      Scene Graph and RootNode

                                      +

                                      Scene Graph and RootNode

                                      - The scene graph represents your 3D world. Objects in the jME3 scene graph are called Spatials. Everything attached to the parent rootNode is part of your scene. Your game inherits the rootNode object from the SimpleApplication class.

                                      -

                                      • Attaching a Spatial to the rootNode (or its child nodes) adds it to the scene;
                                        @@ -139,30 +132,28 @@ The scene graph represents your 3D world. Objects in the jME3 scene gra

                                      - All objects in the scene graph are in a parent-child relationship. When you transform (move, rotate, scale) one parent, all its children follow.

                                      The scene graph only manages the parent-child relationship of spatials. The actual location, rotation, or scale of an object is stored inside each Spatial.

                                      -

                                      -

                                      Spatials: Node vs Geometry

                                      +

                                      Spatials: Node vs Geometry

                                      - A Spatial can be transformed (in other words, it has a location, a rotation, and a scale). A Spatial can be loaded and saved as a .3jo file. There are two types of Spatials, Nodes and Geometries: -

                                      + + @@ -170,26 +161,25 @@ A Spatial can be transformed (in other words, it has a location, a rotation, and - + - + - +
                                      Spatial
                                      Purpose: A Spatial is an abstract data structure that stores transformations (translation, rotation, scale).
                                      Geometry Node
                                      Visibility: A visible 3-D object. An invisible "handle" for a group of objects. Visibility: A visible 3-D object. An invisible “handle” for a group of objects.
                                      Purpose: A Geometry represents the "look" of an object: Shape, color, texture, opacity/transparency. A Node groups Geometries and other Nodes together: You transform a Node to affect all attached Nodes (parent-child relationship). Purpose: A Geometry represents the “look” of an object: Shape, color, texture, opacity/transparency. A Node groups Geometries and other Nodes together: You transform a Node to affect all attached Nodes (parent-child relationship).
                                      Content: Transformations, mesh, material. Transformations. No mesh, no material.
                                      Examples: A box, a sphere, player, a building, a piece of terrain, a vehicle, missiles, NPCs, etc??? The rootNode, the guiNode, an audioNode, a custom grouping node for a vehicle plus its passengers, etc. Examples: A box, a sphere, player, a building, a piece of terrain, a vehicle, missiles, NPCs, etc… The rootNode, the guiNode, an audioNode, a custom grouping node for a vehicle plus its passengers, etc.
                                      -

                                      How to Use This Knowledge?

                                      +

                                      How to Use This Knowledge?

                                      - Before you start creating your game, you should plan your scene graph: Which Nodes and Geometries will you need? Complete the Hello World tutorial series to learn how to load and create Spatials, how to lay out a scene by attaching, detaching, and transforming Spatials, and how to add interaction and effects to a game.

                                      @@ -199,25 +189,21 @@ The intermediate and advanced documentati
                                      -

                                      See also

                                      +

                                      See also

                                        -
                                      • Spatial ??? More details about working with Nodes and Geometries
                                        +
                                      • Spatial – More details about working with Nodes and Geometries
                                      • -
                                      • Traverse SceneGraph ??? Find any Node or Geometry in the scenegraph.
                                        +
                                      • Traverse SceneGraph – Find any Node or Geometry in the scenegraph.
                                      • -
                                      • Camera ??? Learn more about the Camera in the scene.
                                        +
                                      • Camera – Learn more about the Camera in the scene.
                                      - + +

                                      +tag_spatial_node_mesh_geometry_scenegraph_rootnode +

                                      -

                                      view online version

                                      \ No newline at end of file +

                                      view online version

                                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/webstart.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/webstart.html index a36246437..248606d10 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/webstart.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/jme3/webstart.html @@ -1,19 +1,17 @@ -

                                      WebStart (JNLP) Deployment

                                      +

                                      WebStart (JNLP) Deployment

                                      - When you use the jMonkeyEngine SDK to deploy your application, you can configure the project to build files required for WebStart automatically. If you use another IDE, or work on the command line, use the following tips to set up WebStart correctly:

                                      -

                                      Problem Statement

                                      +

                                      Problem Statement

                                      - Problem:

                                      @@ -31,27 +29,25 @@ You can instruct WebStart to load the native libraries itself using the JNLP fil
                                      -

                                      Simple way

                                      +

                                      Simple way

                                      - You can import the LWJGL JNLP extension directly into your extension, however be aware that your application will break whenever they update their jars. Simply add this line to your JNLP:

                                      <extension name="lwjgl" href="http://lwjgl.org/webstart/2.7.1/extension.jnlp" />
                                      -

                                      Reliable way

                                      +

                                      Reliable way

                                      -

                                      Native jars

                                      +

                                      Native jars

                                      - You can download the LWJGL native jars from their site, or to ensure you're using the exact same version as bundled with your jME3 release, make your own:

                                      mkdir tmp
                                      @@ -85,11 +81,10 @@ Remember to sign all the jar files and move them into the right place from the t
                                       
                                       
                                      -

                                      JNLP file

                                      +

                                      JNLP file

                                      - Add the following to your JNLP file:

                                        <resources os="Windows">
                                      @@ -111,11 +106,10 @@ Add the following to your JNLP file:
                                       
                                       
                                      -

                                      Set low-permissions mode

                                      +

                                      Set low-permissions mode

                                      - In your main() method, if running under WebStart, tell jME3 it is running in a low-permission environment so that it doesn't try to load the natives itself:

                                        public static void main(String[] args)
                                      @@ -126,4 +120,4 @@ In your main() method, if running under WebStart, tell jME3 it is running in a l
                                       
                                       
                                      -

                                      view online version

                                      \ No newline at end of file +

                                      view online version

                                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/3ds_to_blender_to_jmp.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/3ds_to_blender_to_jmp.html index 5bab98051..4d167af74 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/3ds_to_blender_to_jmp.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/3ds_to_blender_to_jmp.html @@ -1,70 +1,65 @@ -

                                      Using Blender as a Intermediator Between 3dMax and the jMonkeyEngine SDK

                                      +

                                      Using Blender as a Intermediator Between 3dMax and the jMonkeyEngine SDK

                                      - -The jMonkeyEngine SDK supports .blend files and can convert them to jMonkeyEngine's .j3o format. This means you can use Blender to convert, for example, a 3dMax file to .j3o format. +The jMonkeyEngine SDK supports .blend files and can convert them to jMonkeyEngine's .j3o format. This means you can use Blender to convert, for example, a 3dMax file to .j3o format.

                                      -

                                      Importing the .3ds file to Blender

                                      +

                                      Importing the .3ds file to Blender

                                      - I'm using the blender 2.59 at this tutorial, but if you blender 2.49b, no problem ;). After you saved your .3ds file in 3dmax, open the blender, delete the default cube, -and import your .3ds file via File??????Import??????>3D Studio. +and import your .3ds file via File—→Import—–>3D Studio.

                                      - +

                                      -

                                      Saving the .blend file

                                      +

                                      Saving the .blend file

                                      - -Now save your .blend file so you can load it into the jMonkeyEngine SDK. +Now save your .blend file so you can load it into the jMonkeyEngine SDK.

                                      - +

                                      -

                                      Importing the .blend file to the SDK by using the ModelImporter and BlenderSupport plugins

                                      +

                                      Importing the .blend file to the SDK by using the ModelImporter and BlenderSupport plugins

                                      - Click on Import Model button and then click on Open Model button to open the .blend file. Click next, select the checkbox to import a copy from .blend file, and click finish.

                                      - +

                                      -

                                      Edit your model in SceneComposer and "VOILA"

                                      +

                                      Edit your model in SceneComposer and "VOILA"

                                      - As you can see, the .blend model was automatically converted to .j3o binary format. Now, you are able to edit it in SceneComposer ;D.

                                      - +

                                      -

                                      view online version

                                      \ No newline at end of file +

                                      view online version

                                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/application_deployment.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/application_deployment.html index caa515174..310b8f3d2 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/application_deployment.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/application_deployment.html @@ -1,15 +1,14 @@ -

                                      jMonkeyEngine SDK: Application Deployment

                                      +

                                      jMonkeyEngine SDK: Application Deployment

                                      - -After you have written and tested your game, you want to brand it and distribute it to your users. If you use the build script provided by the jMonkeyEngine SDK's BaseGame, you have the following deployment options: +After you have written and tested your game, you want to brand it and distribute it to your users. If you use the build script provided by the jMonkeyEngine SDK's BaseGame, you have the following deployment options:

                                      • Desktop application (.JAR)
                                      • -
                                      • WebStart from URL (.JNLP + .JAR)
                                        +
                                      • WebStart from URL (.JNLP + .JAR)
                                      • Applet in web browser (.JNLP + .JAR)
                                      • @@ -21,38 +20,36 @@ After you have written and tested your game, you want to brand it and distribute
                                      -

                                      Requirements

                                      +

                                      Requirements

                                      - -Since JAR files are platform independent, your customers can play your jMonkeyEngine application on Windows, Mac OS, or Linux. The only requirement is that the user has the free Java 5 or 6 Runtime (or browser plugin) installed. For more information see . +Since JAR files are platform independent, your customers can play your jMonkeyEngine application on Windows, Mac OS, or Linux. The only requirement is that the user has the free Java 5 or 6 Runtime (or browser plugin) installed. For more information see .

                                      -

                                      Branding

                                      +

                                      Branding

                                      - Make your game unique and recognizable:

                                        -
                                      1. Open your game project in the SDK's Projects window.
                                        +
                                      2. Open your game project in the SDK's Projects window.
                                      3. Right-click the project and open the Properties
                                      4. -
                                      5. Open the Properties ??? Application section. Here you configure your branding:
                                        +
                                      6. Open the Properties → Application section. Here you configure your branding:
                                        1. Title: Enter the game's name
                                        2. Vendor: Enter your name (the development team)
                                        3. -
                                        4. Description: Write one line why your game is the coolest ever ;-)
                                          +
                                        5. Description: Write one line why your game is the coolest ever ;-)
                                        6. -
                                        7. Homepage: Enter your web URL, so your fans can find you
                                          +
                                        8. Homepage: Enter your web URL, so your fans can find you
                                        9. Splashscreen: Browse to a cool screenshot that will be displayed while the game loads.
                                        10. @@ -65,7 +62,6 @@ Make your game unique and recognizable:

                                        - Your executables are now branded.

                                        @@ -75,12 +71,12 @@ TODO: where does this info actually show up?
                                      -

                                      Creating the Distributable

                                      +

                                      Creating the Distributable

                                      -When you run the build script provided by the jMonkeyEngine SDK, it automatically compiles your classes, libraries, and assets. It creates a dist directory in your project directory which contains the executable JAR and a directory with libraries. +When you run the build script provided by the jMonkeyEngine SDK, it automatically compiles your classes, libraries, and assets. It creates a dist directory in your project directory which contains the executable JAR and a directory with libraries.

                                      @@ -93,17 +89,16 @@ Here are your deployment options in detail:

                                      -

                                      Desktop Application (JAR)

                                      +

                                      Desktop Application (JAR)

                                      - The JAR file is the most common deployment method for Java desktop applications. The user downloads the executable JAR file to his machine and runs it to start the game.

                                      1. Right-click your project and open the Project Properties.
                                      2. -
                                      3. In the Application>Web Start category, make sure the box "Enable Web Start" is not checked. Click OK.
                                        +
                                      4. In the Application>Web Start category, make sure the box “Enable Web Start” is not checked. Click OK.
                                      5. Right-click your project and Clean and Build.
                                      6. @@ -121,12 +116,11 @@ Most operating systems execute a JAR when users double-click on it, but you can
                                      -

                                      Desktop Executables (.EXE, .APP, .JAR)

                                      +

                                      Desktop Executables (.EXE, .APP, .JAR)

                                      - -jMonkeyEngine SDK allows you to create launchers for different desktop platforms, like an .exe file for Windows systems, an Application for MaxOSX and a launcher for Linux systems. +jMonkeyEngine SDK allows you to create launchers for different desktop platforms, like an .exe file for Windows systems, an Application for MaxOSX and a launcher for Linux systems.

                                      1. Right-click your project and open the Project Properties.
                                        @@ -147,11 +141,10 @@ When you build your project, zip files for each selected platform will be create
                                      -

                                      Web Start (.JNLP)

                                      +

                                      Web Start (.JNLP)

                                      - Web Start allows your users to start your application by simply clicking a link that you provide, for example in a button on your web page. The browser downloads the JAR file and then automatically runs your game in an extra window. The only requirement is that the user's browser has the Java plugin installed. This is a very user-friendly way for your customers to play your game without any extra steps to install it. Optionally, you can set it up so the file is saved to their desktop and can be restarted later, so they do not need to be online to play.

                                        @@ -159,7 +152,7 @@ Web Start allows your users to start your application by simply clicking a link
                                        1. In the Application>Web Start category, check the box to Enable Web Start.
                                        2. -
                                        3. Check the box to make the application self-signed. :!:
                                          +
                                        4. Check the box to make the application self-signed. :!:
                                        5. Optionally, check the box to allow offline use.
                                        6. @@ -178,28 +171,26 @@ Web Start allows your users to start your application by simply clicking a link

                                        -Look at the sample launch.html, you can have any custom content around the link. Keep a copy of your launcher file because the jMonkeyEngine SDK will always regenerate its default launch.html. +Look at the sample launch.html, you can have any custom content around the link. Keep a copy of your launcher file because the jMonkeyEngine SDK will always regenerate its default launch.html. Also, see this on creating WebStarts.

                                      -

                                      Browser Applet

                                      +

                                      Browser Applet

                                      - A browser Applet is a Java application that runs in the web browser while the user is visiting your web page. The only requirement is that the user's browser has the Java plugin installed. There is no installation step, the user can play right away in the browser. The user will not be able to save the game to his harddrive, nor can he play offline.

                                      -These instructions assume that you have already written a game that you want to turn into an Applet. As opposed to other jME3 games, Applets cannot capture the mouse for navigation, so the camera will be switched to dragToRotate mode. The jMonkeyEngine SDK and the included build script already contain what you need. - +These instructions assume that you have already written a game that you want to turn into an Applet. As opposed to other jME3 games, Applets cannot capture the mouse for navigation, so the camera will be switched to dragToRotate mode. The jMonkeyEngine SDK and the included build script already contain what you need.

                                      -

                                      To Turn a Project Into an Applet

                                      +

                                      To Turn a Project Into an Applet

                                      1. Right-click your project and open the Project Properties.
                                        @@ -217,13 +208,12 @@ These instructions assume that you have already written a game that you want to

                                      -The dist/Applet directory now contains all the files necessary for the game to run as Applet. To test the Applet-based game, run the project in the jMonkeyEngine SDK. - +The dist/Applet directory now contains all the files necessary for the game to run as Applet. To test the Applet-based game, run the project in the jMonkeyEngine SDK.

                                      -

                                      To Deploy the Game as Applet

                                      +

                                      To Deploy the Game as Applet

                                      1. Edit the dist/Applet/run-applet.html file in anyway you like. Just keep the Applet code.
                                        @@ -238,7 +228,7 @@ The dist/Applet directory now contains all the files necessary for
                                      -

                                      To Troubleshoot Applets

                                      +

                                      To Troubleshoot Applets

                                      • Open the Java console for error messages.
                                        @@ -249,12 +239,11 @@ The dist/Applet directory now contains all the files necessary for
                                      -

                                      Android Mobile Device

                                      +

                                      Android Mobile Device

                                      - -You can set the jMonkeyEngine SDK to build an executable for Android mobile platforms. +You can set the jMonkeyEngine SDK to build an executable for Android mobile platforms.

                                      @@ -263,12 +252,11 @@ Learn more about Android Support<

                                      -

                                      iOS Device

                                      +

                                      iOS Device

                                      - -You can set the jMonkeyEngine SDK to build an executable for iOS platforms. A Mac with XCode installed is needed. +You can set the jMonkeyEngine SDK to build an executable for iOS platforms. A Mac with XCode installed is needed.

                                      @@ -277,18 +265,18 @@ Learn more about iOS Support here

                                      -

                                      Tip: Switching Build Configurations

                                      +

                                      Tip: Switching Build Configurations

                                      -The jMonkeyEngine SDK has a Run Configuration menu in the toolbar. Use it to save your various sets of Project Property configuations, and switch between them. +The jMonkeyEngine SDK has a Run Configuration menu in the toolbar. Use it to save your various sets of Project Property configuations, and switch between them.

                                      1. Click the Set Project Configuration popup in the toolbar and choose Customize.
                                      2. The Project Properties Run section opens. Under Configuration, click New.
                                      3. -
                                      4. Name the saved configuration, for instance "my webstart" vs "my desktop app", or "development" vs "deployment". Click OK.
                                        +
                                      5. Name the saved configuration, for instance “my webstart” vs “my desktop app”, or “development” vs “deployment”. Click OK.
                                      6. Make sure the new config is selected in the Set Project Configuration popup above the editor.
                                      7. @@ -302,11 +290,10 @@ Now you can use the Set Project Configuration popup menu to switch
                                      -

                                      Tip: Reduce Distribution File Size

                                      +

                                      Tip: Reduce Distribution File Size

                                      - There may be several parts of the full jMonkeyEngine library that you do not even use in your application. You should leave out the corresponding libraries from your distribution.

                                      @@ -314,16 +301,16 @@ There may be several parts of the full jMonkeyEngine library that you do not eve To remove unused libraries:

                                        -
                                      1. Right-click your project and select "Properties"
                                        +
                                      2. Right-click your project and select “Properties”
                                      3. -
                                      4. Select "Libraries" on the left
                                        +
                                      5. Select “Libraries” on the left
                                      6. -
                                      7. Select the "jme3-libraries" entry and press "remove".
                                        +
                                      8. Select the “jme3-libraries” entry and press “remove”.
                                        This library package contains all libraries for jME3 and is quite large.
                                      9. -
                                      10. Press the "Add Library" button
                                        +
                                      11. Press the “Add Library” button
                                      12. -
                                      13. Select the "jme3-libraries-lwjgl-minimum" library
                                        +
                                      14. Select the “jme3-libraries-lwjgl-minimum” library
                                      15. Add other jME3 libraries in the same way depending which features you use:
                                        jme3-libraries-gui, jme3-libraries-physics, jme3-libraries-video, etc.
                                        @@ -333,16 +320,11 @@ jme3-libraries-gui, jme3-libraries-physics, jme3-libraries-video, etc.
                                    2. Clean, Build and Run the project and make sure you have not missed anything.
                                    3. - + +

                                      +tag_documentation_sdk_deployment_android_applet_webstart_desktop +

                                      -

                                      view online version

                                      \ No newline at end of file +

                                      view online version

                                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/applymaterial.jpg b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/applymaterial.jpg index eedf04a64..7825466f1 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/applymaterial.jpg and b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/applymaterial.jpg differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/asset_packs.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/asset_packs.html index c56d09b97..ec2caedfd 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/asset_packs.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/asset_packs.html @@ -1,15 +1,14 @@ -

                                      jMonkeyEngine SDK: AssetPacks and AssetPack Browser

                                      +

                                      jMonkeyEngine SDK: AssetPacks and AssetPack Browser

                                      - -AssetPacks are a way to package jME3 compatible assets (like models, textures, sounds and whole scenes!) into a package that contains publisher info, license info, descriptions etc. for all of the assets. An AssetPack basically consists of an assetpack.xml file that describes the content and an assets folder that contains the content. The integrated browser in the jMonkeyEngine SDK allows you to add the assets from installed AssetPacks to any jme3 project scene you are working on. +AssetPacks are a way to package jME3 compatible assets (like models, textures, sounds and whole scenes!) into a package that contains publisher info, license info, descriptions etc. for all of the assets. An AssetPack basically consists of an assetpack.xml file that describes the content and an assets folder that contains the content. The integrated browser in the jMonkeyEngine SDK allows you to add the assets from installed AssetPacks to any jme3 project scene you are working on.

                                      -

                                      The AssetPack Browser

                                      +

                                      The AssetPack Browser

                                      @@ -18,31 +17,29 @@ AssetPacks are a way to package jME3 compatible assets (like models, textures, s

                                      -

                                      Browsing Assets

                                      +

                                      Browsing Assets

                                      - -The AssetPack browser in jMonkeyEngine SDK makes browsing the installed AssetPacks easy. Browse categories, search for tags and find the right asset for your project. When you have found it, you can add it with one click to your current scene. The AssetPack manager will automagically copy all needed textures, sounds etc. to your projects assets folder. +The AssetPack browser in jMonkeyEngine SDK makes browsing the installed AssetPacks easy. Browse categories, search for tags and find the right asset for your project. When you have found it, you can add it with one click to your current scene. The AssetPack manager will automagically copy all needed textures, sounds etc. to your projects assets folder.

                                      -

                                      You can also browse a selection of online assetpacks that are available on jMonkeyEngine.org for download and install them to your jMonkeyEngine SDK's AssetPack browser. +

                                      You can also browse a selection of online assetpacks that are available on jMonkeyEngine.org for download and install them to your jMonkeyEngine SDK's AssetPack browser.

                                      -The AssetPack browser uses a predefined directory to store the AssetPacks which is also used for new AssetPack projects. You can see and change the folder path in the AssetPack preferences (jMonkeyEngine SDK???Settings). +The AssetPack browser uses a predefined directory to store the AssetPacks which is also used for new AssetPack projects. You can see and change the folder path in the AssetPack preferences (jMonkeyEngine SDK→Settings).

                                      -

                                      Adding Assets to Your Scene

                                      +

                                      Adding Assets to Your Scene

                                      - -To preview a model from the browser, right-click it and select "Preview Asset" +To preview a model from the browser, right-click it and select “Preview Asset”

                                      @@ -51,11 +48,11 @@ To add a model from the AssetPack browser to a scene do the following:

                                      1. Create a new scene (j3o) file or use an existing one
                                      2. -
                                      3. Open it in the SceneComposer by right-clicking it and selecting "Edit in SceneComposer"
                                        +
                                      4. Open it in the SceneComposer by right-clicking it and selecting “Edit in SceneComposer”
                                      5. Select the root node of the scene (or another node you want to add the model to)
                                      6. -
                                      7. Right-click a model in the AssetBrowser and select "Add to SceneComposer"
                                        +
                                      8. Right-click a model in the AssetBrowser and select “Add to SceneComposer”
                                      @@ -65,32 +62,29 @@ The model will be added to your scene and all needed texture files will be copie
                                      -

                                      Create Your Own AssetPack Project

                                      +

                                      Create Your Own AssetPack Project

                                      - -AssetPack projects are a way to create your own AssetPacks, either for personal use or for publishing. With this project type in jMonkeyEngine SDK you can create a library of assets on your computer that you can use in any of your projects via the AssetPack browser. +AssetPack projects are a way to create your own AssetPacks, either for personal use or for publishing. With this project type in jMonkeyEngine SDK you can create a library of assets on your computer that you can use in any of your projects via the AssetPack browser. Editing of asset and project info, adding of new assets and setting their properties, everything you need to create and publish your AssetPacks is there. -

                                        -
                                      1. Choose "File ??? New Project" from the menu
                                        +
                                      2. Choose “File → New Project” from the menu
                                      3. -
                                      4. Choose "AssetPack Project"
                                        +
                                      5. Choose “AssetPack Project”
                                      6. -
                                      7. Fill in the project info and press "finish"
                                        +
                                      8. Fill in the project info and press “finish”

                                      - -You can access and change the project properties by right-clicking the project and selecting "Properties". +You can access and change the project properties by right-clicking the project and selecting “Properties”.

                                      -

                                      Add Your Own Assets

                                      +

                                      Add Your Own Assets

                                      @@ -101,35 +95,34 @@ You can access and change the project properties by right-clicking the project a To add new assets to your AssetPack do the following:

                                        -
                                      1. Right-Click the "Assets" node of the AssetPack project
                                        +
                                      2. Right-Click the “Assets” node of the AssetPack project
                                      3. -
                                      4. Select "Add Asset.."
                                        +
                                      5. Select “Add Asset..”
                                      6. Specify the info about your asset and press Next
                                      7. -
                                      8. Press the "add files" button and select all files belonging to your asset
                                        +
                                      9. Press the “add files” button and select all files belonging to your asset
                                      10. -
                                      11. Select the "main" checkbox for the main model file if your asset is a model file
                                        +
                                      12. Select the “main” checkbox for the main model file if your asset is a model file
                                      13. -
                                      14. Change the asset paths and types if needed and press "finish"
                                        +
                                      15. Change the asset paths and types if needed and press “finish”

                                      - -The global asset type can be "model", "scene", "texture", "sound", "shader" or "other" +The global asset type can be “model”, “scene”, “texture”, “sound”, “shader” or “other”

                                      -With the "model" or "scene" types, the AssetPack browser will try to load and add a model file from the selected assets when the user selects "Add to SceneComposer". Specify the "load this model with material" flag for the model file that should be loaded via the AssetManager, you can also specify multiple mesh or scene files to be loaded. All texture and other needed files will be copied to the users project folder. +With the “model” or “scene” types, the AssetPack browser will try to load and add a model file from the selected assets when the user selects “Add to SceneComposer”. Specify the “load this model with material” flag for the model file that should be loaded via the AssetManager, you can also specify multiple mesh or scene files to be loaded. All texture and other needed files will be copied to the users project folder.

                                      -On the "Add Files" page you define the path of the files in the AssetPack. The importer tries to generate a proper path from the info entered on the first page. Note that for j3o binary models, the texture paths have to be exactly like they were during conversion. The given paths will also be used when copying the data to the users "assets" folder. +On the “Add Files” page you define the path of the files in the AssetPack. The importer tries to generate a proper path from the info entered on the first page. Note that for j3o binary models, the texture paths have to be exactly like they were during conversion. The given paths will also be used when copying the data to the users “assets” folder.

                                      -With the "add files" button you can open a file browser to select files from your harddisk that will be copied into the assets/ folder of the AssetPack project. With the "add existing" button you can add a file thats already in your AssetPack assets folder to a new asset item. This way you can reuse e.g. textures for asset items or make items for an existing collection of asset files that you copied to the projects assets folder. +With the “add files” button you can open a file browser to select files from your harddisk that will be copied into the assets/ folder of the AssetPack project. With the “add existing” button you can add a file thats already in your AssetPack assets folder to a new asset item. This way you can reuse e.g. textures for asset items or make items for an existing collection of asset files that you copied to the projects assets folder.

                                      @@ -145,12 +138,12 @@ If the material file is an Ogre material file (.material) it will be used for lo

                                      -

                                      In your AssetPack Project, right-click each asset and select "preview asset" to see your model. Verify hat it looks correctly, because then it should work for other users as well. +

                                      In your AssetPack Project, right-click each asset and select “preview asset” to see your model. Verify hat it looks correctly, because then it should work for other users as well.

                                      -You can change the single assets properties in the properties window after you have added them. Just select an asset and open the properties window (Windows???Properties). +You can change the single assets properties in the properties window after you have added them. Just select an asset and open the properties window (Windows→Properties).

                                      @@ -169,7 +162,7 @@ Supported formats for models (main files) are:

                                      -

                                      AssetPack Publishing

                                      +

                                      AssetPack Publishing

                                      @@ -177,28 +170,26 @@ Supported formats for models (main files) are:

                                      -You can publish your AssetPacks either as a zip file or directly to jmonkeyengine.org, using your website user name and login. This means other jMonkeyEngine SDK users can download your AssetPacks and install them to their local database right off the AssetPack online packages browser. +You can publish your AssetPacks either as a zip file or directly to jmonkeyengine.org, using your website user name and login. This means other jMonkeyEngine SDK users can download your AssetPacks and install them to their local database right off the AssetPack online packages browser.

                                      -

                                      To make sure you can upload, you have to be registered on jmonkeyengine.org, and have to enter your login info in the AssetPack preferences: jMonkeyEngine SDK???Options???Asset Packs first. +

                                      To make sure you can upload, you have to be registered on jmonkeyengine.org, and have to enter your login info in the AssetPack preferences: jMonkeyEngine SDK→Options→Asset Packs first.

                                      -

                                        -
                                      1. Right-Click your AssetPack project in the SDK and select "Publish AssetPack???"
                                        +
                                      2. Right-Click your AssetPack project in the SDK and select “Publish AssetPack…”
                                      3. -
                                      4. Check the description etc. settings, and press "Next".
                                        +
                                      5. Check the description etc. settings, and press “Next”.
                                      6. -
                                      7. Select the checkbox for online and/or local publishing and press "finish".
                                        +
                                      8. Select the checkbox for online and/or local publishing and press “finish”.
                                      - + +

                                      +tag_documentation_sdk_asset +

                                      -

                                      view online version

                                      \ No newline at end of file +

                                      view online version

                                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/blender.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/blender.html index c8503d79e..4e7236702 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/blender.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/blender.html @@ -1,14 +1,13 @@ -

                                      Blender importer for jMonkeyEngine 3

                                      +

                                      Blender importer for jMonkeyEngine 3

                                      -

                                      Introduction

                                      +

                                      Introduction

                                      - Importing models to any game engine is as important as using them. The quality of the models depends on the abilities of the people who create it and on the tools they use. Blender is one of the best free tools for creating 3D enviroments. Its high amount of features attract many model designers. So far jMonkeyEngine used Ogre mesh files to import 3D data. These files were created by the python script that exported data from blender. @@ -23,17 +22,17 @@ Now we have an opportunity to simplify the import process by loading data direct

                                      -

                                      Usage

                                      +

                                      Usage

                                      -To use it in your game or the SDK you should follow the standard asset loading instructions. +To use it in your game or the SDK you should follow the standard asset loading instructions. By default a BlenderModelLoader is registered with your assetManager to load blend files. This means you can load and convert .blend model files to .j3o format, just like any other supported model format.

                                      -

                                      Currently supported features

                                      +

                                      Currently supported features

                                      1. Loading scene (only the current scene is loaded and imported as a node)
                                        @@ -88,7 +87,7 @@ By default a BlenderModelLoader is registered with your assetManager to load ble
                                        • Materials are loaded and attached to geometries.
                                        • -
                                        • Because jMonkeyEngine supports only one material for each Mesh, if you apply several materials to one object ??? it will be split into several meshes (but still in one node).
                                          +
                                        • Because jMonkeyEngine supports only one material for each Mesh, if you apply several materials to one object – it will be split into several meshes (but still in one node).
                                        • Several kinds of input mapping is supported: UV maps, Orco and Nor; all projection types for 2D textures, XYZ coordinates mapping.
                                        • @@ -172,7 +171,7 @@ By default a BlenderModelLoader is registered with your assetManager to load ble
                                      -

                                      Planned features.

                                      +

                                      Planned features.

                                      1. Full support for scale and offset in texture input mapping.
                                        @@ -189,7 +188,7 @@ By default a BlenderModelLoader is registered with your assetManager to load ble
                                      -

                                      Known bugs/problems.

                                      +

                                      Known bugs/problems.

                                      1. RGB10 and RGB9E5 texture types are not supported in texture merging operations (which means that you can use this as a single texture on the model, but you should not combine it with other images or generated textures).
                                        @@ -200,12 +199,11 @@ By default a BlenderModelLoader is registered with your assetManager to load ble
                                      -

                                      Using BlenderLoader instead of BlenderModelLoader

                                      +

                                      Using BlenderLoader instead of BlenderModelLoader

                                      You have two loaders available. -

                                      • BlenderLoader that loads the whole scene. It returns an instance of LoadingResults that contains all the data loaded from the scene.
                                        @@ -237,14 +235,11 @@ You have two loaders available.

                                        To register the model do the following: -

                                        assetManager.registerLoader(BlenderLoader.class, "blend");

                                        - or -

                                        assetManager.registerLoader(BlenderModelLoader.class, "blend");
                                          @@ -261,7 +256,7 @@ You can use ModelKey as well. This will give the same result as using default Bl
                                      -

                                      How does it work?

                                      +

                                      How does it work?

                                      @@ -275,9 +270,11 @@ If you define animations in your BlenderKey the animations will as well be impor Here is the list of how blender features are mapped into jme.

                                      + + @@ -308,7 +305,6 @@ Here is the list of how blender features are mapped into jme.
                                      BlenderjMonkeyEngine3Note
                                      Scene Node

                                      - Using BlenderLoader can allow you to use blend file as your local assets repository. You can store your textures, materials or meshes there and simply import it when needed. Currently blender 2.49 and 2.5+ are supported (only the stable versions). @@ -317,11 +313,11 @@ Probably versions before 2.49 will work pretty well too, but I never checked tha

                                      -

                                      Notes

                                      +

                                      Notes

                                      -I know that the current version of loader is not yet fully functional, but belive me ??? Blender is a very large issue ;) +I know that the current version of loader is not yet fully functional, but belive me – Blender is a very large issue ;) Hope I will meet your expectations.

                                      @@ -346,25 +342,21 @@ Marcin Roguski (Kaelthas)

                                      P.S. This text might be edited in a meantime if I forgot about something ;) -


                                      See also: -

                                      -
                                      - documentation, - sdk, - tool, - asset -
                                      + +

                                      +tag_documentation_sdk_tool_asset +

                                      -

                                      view online version

                                      \ No newline at end of file +

                                      view online version

                                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/code_editor.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/code_editor.html index 7efac7e92..282a020a7 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/code_editor.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/code_editor.html @@ -1,23 +1,21 @@ -

                                      jMonkeyEngine SDK: Code Editor and Palette

                                      +

                                      jMonkeyEngine SDK: Code Editor and Palette

                                      - -The Source Code Editor is the central part of the jMonkeyEngine SDK. This documentation shows you how to make the most of the jMonkeyEngine SDK's assistive features. +The Source Code Editor is the central part of the jMonkeyEngine SDK. This documentation shows you how to make the most of the jMonkeyEngine SDK's assistive features.

                                      -Note: Since the jMonkeyEngine SDK is based on the NetBeans Platform framework, you can learn about certain jMonkeyEngine SDK features by reading the corresponding NetBeans IDE tutorials (in the "see also links"). +Note: Since the jMonkeyEngine SDK is based on the NetBeans Platform framework, you can learn about certain jMonkeyEngine SDK features by reading the corresponding NetBeans IDE tutorials (in the “see also links”).

                                      -

                                      Code Completion and Code Generation

                                      +

                                      Code Completion and Code Generation

                                      - While typing Java code in the source code editor, you will see popups that help you to write more quickly by completing keywords, and generating code snippets. Additionally, they will let you see the javadoc for the classes you are working with.

                                      @@ -43,7 +41,6 @@ Alternatively you can also use Ctrl-\.

                                      - Code Generation

                                        @@ -67,11 +64,10 @@ Alternatively you can also use Ctrl-\.
                                      -

                                      Semantic and Syntactic Coloring

                                      +

                                      Semantic and Syntactic Coloring

                                      -

                                      @@ -93,12 +89,11 @@ Examples:
                                    4. Place the caret in a method's return type to highlight all exit points
                                    5. -
                                    6. and many more???
                                      +
                                    7. and many more…
                                    8. - To customize Colors and indentation:

                                        @@ -110,13 +105,11 @@ To customize Colors and indentation:
                                      -

                                      Editor Hints and Quick Fixes (a.k.a. Lightbulbs)

                                      +

                                      Editor Hints and Quick Fixes (a.k.a. Lightbulbs)

                                      - Editor hints and quick fixes show as lightbulbs along the left edge of the editor. They point out warnings and errors, and often propose useful solutions! -

                                      • Execute a quick fix: Place the caret in the line next to the lightbulb and press Alt-Enter (or click the lightbulb)
                                        @@ -129,7 +122,7 @@ Editor hints and quick fixes show as lightbulbs along the left edge of the edito
                                      -

                                      Javadoc

                                      +

                                      Javadoc

                                      • Place the caret above a method or a class that has no Javadoc, type /** and press Enter: The editor generates skeleton code for a Javadoc comment.
                                        @@ -141,14 +134,12 @@ Editor hints and quick fixes show as lightbulbs along the left edge of the edito

                                      - To display a javadoc popup in the editor, place the caret in a line and press Ctrl-Space (Alternatively use Ctrl-\). -

                                      • If the javadoc popup doesn't work, make certain that
                                          -
                                        • You have the Java JDK documentation installed and set up: Tools > Java Platforms
                                          +
                                        • You have the Java JDK documentation installed and set up: Tools > Java Platforms
                                        • You downloaded and set up javadoc for third-party libraries: Project properties > Libraries > Edit
                                        • @@ -158,26 +149,24 @@ To display a javadoc popup in the editor, place the caret in a line and press -

                                          Navigating the jME3 Source

                                          +

                                          Navigating the jME3 Source

                                          - -When the JavaDoc does not deliver enough information, you can have a look at the source of every method or object of jME3 that you use. Just right-click the variable or method, select "Navigate > Go to source.." and an editor will open showing you the source file of jME3. +When the JavaDoc does not deliver enough information, you can have a look at the source of every method or object of jME3 that you use. Just right-click the variable or method, select “Navigate > Go to source..” and an editor will open showing you the source file of jME3.

                                          -

                                          Palette

                                          +

                                          Palette

                                          -

                                          -Choose Windows > Palette to open the context-sensitive Palette. The jMonkeyEngine SDK provides you with jme3 code snippets here that you can drag and drop into your source files. +Choose Windows > Palette to open the context-sensitive Palette. The jMonkeyEngine SDK provides you with jme3 code snippets here that you can drag and drop into your source files.

                                          • Examples: Node and Model creation code snippets.
                                            @@ -185,17 +174,15 @@ Choose Windows > Palette to open the context-sensitive Palette. The jMonkeyEn

                                          - -Tip: Choose Tools > Add to Palette??? from the menu to add your own code snippets to the Palette. (not available yet in beta build) +Tip: Choose Tools > Add to Palette… from the menu to add your own code snippets to the Palette. (not available yet in beta build)

                                          -

                                          Keyboard Shortcuts

                                          +

                                          Keyboard Shortcuts

                                          - Keyboard Shortcuts save you time when when you need to repeat common actions such as Build&Run or navigation to files.

                                            @@ -216,7 +203,6 @@ Keyboard Shortcuts save you time when when you need to repeat common actions suc

                                          - By default, jMonkeyEngine uses the same as the NetBeans IDE, but you can also switch to an Eclipse Keymap, or create your own set.

                                            @@ -226,7 +212,7 @@ By default, jMonkeyEngine uses the same -

                                            Tips and Tricks

                                            +

                                            Tips and Tricks

                                            • To browse the physical file structure of your project, use the Files window: Ctrl-2
                                              @@ -244,18 +230,16 @@ By default, jMonkeyEngine uses the same
                                            - + +

                                            +tag_documentation_sdk_editor +

                                            -

                                            view online version

                                            \ No newline at end of file +

                                            view online version

                                            \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/debugging_profiling_testing.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/debugging_profiling_testing.html index 334a7f490..e2eb0bc60 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/debugging_profiling_testing.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/debugging_profiling_testing.html @@ -1,56 +1,53 @@ -

                                            jMonkeyEngine SDK: Debugging, Profiling, Testing

                                            +

                                            jMonkeyEngine SDK: Debugging, Profiling, Testing

                                            - -Debugging, testing and profiling are important parts of the development cycle. This documentation shows you how to make the most of the jMonkeyEngine SDK's assistive features. +Debugging, testing and profiling are important parts of the development cycle. This documentation shows you how to make the most of the jMonkeyEngine SDK's assistive features.

                                            -

                                            Since the jMonkeyEngine SDK is based on the NetBeans IDE and the NetBeans Platform, you can learn about certain jMonkeyEngine SDK features by reading the corresponding NetBeans IDE tutorials (in the "see also links"). +

                                            Since the jMonkeyEngine SDK is based on the NetBeans IDE and the NetBeans Platform, you can learn about certain jMonkeyEngine SDK features by reading the corresponding NetBeans IDE tutorials (in the “see also links”).

                                            -

                                            Testing

                                            +

                                            Testing

                                            - -The jMonkeyEngine SDK supports the JUnit testing framework. It is a good practice to write tests (assertions) for each of your classes. Each test makes certain this "unit" (e.g. method) meets its design and behaves as intended. Run your tests after each major change and you immediately see if you broke something. +The jMonkeyEngine SDK supports the JUnit testing framework. It is a good practice to write tests (assertions) for each of your classes. Each test makes certain this “unit” (e.g. method) meets its design and behaves as intended. Run your tests after each major change and you immediately see if you broke something.

                                            -

                                            Creating Tests

                                            +

                                            Creating Tests

                                            1. Right-click a Java file in the Projects window and choose Tools > Create JUnit Tests.
                                            2. -
                                            3. Click OK. The jMonkeyEngine SDK creates a JUnit test skeleton in the Test Package directory.
                                              +
                                            4. Click OK. The jMonkeyEngine SDK creates a JUnit test skeleton in the Test Package directory.
                                            5. The body of each generated test method is provided solely as a guide. In their place, you need to write your actual test cases!
                                            6. You can use tests such as assertTrue(), assertFalse(), assertEquals(), or assert().
                                                -
                                              • The following example assertions test an addition method: assert( add(1, 1) == 2); assertTrue( add(7,-5) == add(-5,7) )???
                                                +
                                              • The following example assertions test an addition method: assert( add(1, 1) == 2); assertTrue( add(7,-5) == add(-5,7) )…
                                            7. -
                                            8. "Ideally", you write a test case for every method (100% coverage).
                                              +
                                            9. “Ideally”, you write a test case for every method (100% coverage).

                                            - Tip: Use the Navigate menu to jump from a test to its tested class, and back!

                                            -

                                            Running Tests

                                            +

                                            Running Tests

                                            1. Run one or all tests:
                                              @@ -68,7 +65,6 @@ The jMonkeyEngine SDK suppor

                                            - Using unit tests regularly allows you to detect side-effects on classes that you thought were unaffected by a code change.

                                            @@ -86,13 +82,11 @@ See also:
                                            -

                                            Debugging

                                            +

                                            Debugging

                                            - -In the jMonkeyEngine SDK, you have access to a debugger to examine your application for errors such as deadlocks and NullPointerExeptions. You can set breakpoints, watch variables, and execute your code line-by-line to identify the source of a problem. - +In the jMonkeyEngine SDK, you have access to a debugger to examine your application for errors such as deadlocks and NullPointerExeptions. You can set breakpoints, watch variables, and execute your code line-by-line to identify the source of a problem.

                                            1. First, you set breakpoints and/or watches before the problematic lines of code where you suspect the bug.
                                              @@ -103,7 +97,7 @@ In the jMonkeyEngine SDK, yo
                                            2. -
                                            3. Choose "Debug > Debug Main Project" to start a debugger session for the whole project. Or, right-click a file and select Debug File to debug only one file.
                                              +
                                            4. Choose “Debug > Debug Main Project” to start a debugger session for the whole project. Or, right-click a file and select Debug File to debug only one file.
                                            5. The application starts running normally. If you have set a breakpoint, the execution stops in this line. Debugger windows open and print debugger output.
                                            6. @@ -119,9 +113,9 @@ In the jMonkeyEngine SDK, yo
                                            7. Move the mouse pointer over a variable to inspect its value in a tooltip.
                                            8. -
                                            9. Inspect the classes loaded on the heap and the percentage and number of object instances. Right-click a class in the Loaded Classes window and choose Show in Instances view (JDK 6 only).
                                              +
                                            10. Inspect the classes loaded on the heap and the percentage and number of object instances. Right-click a class in the Loaded Classes window and choose Show in Instances view (JDK 6 only).
                                            11. -
                                            12. And more???
                                              +
                                            13. And more…
                                            14. @@ -131,48 +125,46 @@ In the jMonkeyEngine SDK, yo
                                            -

                                            Profiling

                                            +

                                            Profiling

                                            - The profiler tool is used to monitor thread states, CPU performance, and memory usage of your jme3 application. It helps you detect memory leaks and bottlenecks in your game while it's running.

                                            -

                                            Installing the Profiler

                                            +

                                            Installing the Profiler

                                            - -If you do not see a Profiler menu in the jMonkeyEngine SDK, you need to download the Profiler plugin first. +If you do not see a Profiler menu in the jMonkeyEngine SDK, you need to download the Profiler plugin first.

                                              -
                                            1. Open the Tools > Plugins menu, and got to the "Available plugins" tab
                                              +
                                            2. Open the Tools > Plugins menu, and got to the “Available plugins” tab
                                            3. -
                                            4. Find the "Java Profiler" plugin ("Java SE" category) and check the Install box.
                                              +
                                            5. Find the “Java Profiler” plugin (“Java SE” category) and check the Install box.
                                            6. Click the install button and follow the instructions.
                                            7. -
                                            8. When you start the profiler for the first time, you are prompted to run a calibration once. Click OK in the "Profiler integration" dialog to complete the installation process.
                                              +
                                            9. When you start the profiler for the first time, you are prompted to run a calibration once. Click OK in the “Profiler integration” dialog to complete the installation process.
                                            -

                                            Monitoring and Analyzing

                                            +

                                            Monitoring and Analyzing

                                            1. Choose Profile Project from the Profile menu.
                                            2. Select one of three tasks:
                                                -
                                              • Monitor Application ??? Collect high-level information about properties of the target JVM, including thread activity and memory allocations.
                                                +
                                              • Monitor Application – Collect high-level information about properties of the target JVM, including thread activity and memory allocations.
                                              • -
                                              • Analyze CPU Performance ??? Collect detailed data on application performance, including the time to execute methods and the number of times the method is invoked.
                                                +
                                              • Analyze CPU Performance – Collect detailed data on application performance, including the time to execute methods and the number of times the method is invoked.
                                              • -
                                              • Analyze Memory Usage ??? Collect detailed data on object allocation and garbage collection.
                                                +
                                              • Analyze Memory Usage – Collect detailed data on object allocation and garbage collection.
                                            3. @@ -184,11 +176,10 @@ If you do not see a Profiler menu in the jMonkeyEngine
                                        - + +

                                        +tag_documentation_sdk_tool +

                                      -

                                      view online version

                                      \ No newline at end of file +

                                      view online version

                                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/default_build_script.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/default_build_script.html index fd403826a..1e67ad863 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/default_build_script.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/default_build_script.html @@ -1,62 +1,56 @@ -

                                      Default Build Script

                                      +

                                      Default Build Script

                                      - -If you use jMonkeyEngine libraries together with the jMonkeyEngine SDK (recommended) then you benefit from the provided build script. Every new project comes with a default Ant script. The toolbar buttons and clean/build/run actions in the jMonkeyEngine SDK are already pre-configured. +If you use jMonkeyEngine libraries together with the jMonkeyEngine SDK (recommended) then you benefit from the provided build script. Every new project comes with a default Ant script. The toolbar buttons and clean/build/run actions in the jMonkeyEngine SDK are already pre-configured.

                                      -

                                      Default Targets

                                      +

                                      Default Targets

                                      - The build script includes targets for the following tasks: -

                                        -
                                      • clean ??? deletes the built classes and executables in the dist directory.
                                        +
                                      • clean – deletes the built classes and executables in the dist directory.
                                      • -
                                      • jar ??? compiles the classes, bundles the assets, builds the executable JAR in the dist directory, copies libraries.
                                        +
                                      • jar – compiles the classes, bundles the assets, builds the executable JAR in the dist directory, copies libraries.
                                      • -
                                      • run ??? builds and runs the executable JAR (e.g. for the developers to test it).
                                        +
                                      • run – builds and runs the executable JAR (e.g. for the developers to test it).
                                      • -
                                      • javadoc ??? compiles javadoc from your java files into html files.
                                        +
                                      • javadoc – compiles javadoc from your java files into html files.
                                      • -
                                      • debug ??? used by the jMonkeyEngine SDK Debugger plugin.
                                        +
                                      • debug – used by the jMonkeyEngine SDK Debugger plugin.
                                      • -
                                      • test ??? Used by the jMonkeyEngine SDK JUnit Test plugin.
                                        +
                                      • test – Used by the jMonkeyEngine SDK JUnit Test plugin.

                                      - You can call these targets on the command line using default Ant commands: -

                                      ant clean
                                       ant jar
                                       ant run

                                      -

                                      We recommended to use the user-friendly menu items, F-keys, or toolbar buttons in the jMonkeyEngine SDK to trigger clean, build, and run actions. +

                                      We recommended to use the user-friendly menu items, F-keys, or toolbar buttons in the jMonkeyEngine SDK to trigger clean, build, and run actions.

                                      -

                                      Browsing the Build Script

                                      +

                                      Browsing the Build Script

                                      - To see the build script and the predefined tasks

                                        -
                                      1. Open your project in the jMonkeyEngine SDK if it isn't already open (File > Open Project???)
                                        +
                                      2. Open your project in the jMonkeyEngine SDK if it isn't already open (File > Open Project…)
                                      3. Open the Files window (Window > Files)
                                      4. @@ -77,7 +71,7 @@ You will notice that the file nbproject/build-impl.xml opens. It co
                                      -

                                      Adding Custom Targets

                                      +

                                      Adding Custom Targets

                                      @@ -108,16 +102,13 @@ Simply copy&paste a target from these files into the main build.xml and that

                                      -Don't edit the base *-impl.xml files directly, if you deactivate and reactivate a deployment setting, the SDK resets these files, so you have to copy the whole target and its dependencies, else your build script will become invalid when you disable the deployment option. +Don't edit the base *-impl.xml files directly, if you deactivate and reactivate a deployment setting, the SDK resets these files, so you have to copy the whole target and its dependencies, else your build script will become invalid when you disable the deployment option. +

                                      + +

                                      +tag_documentation_sdk_builds_project_deployment

                                      -
                                      -

                                      view online version

                                      \ No newline at end of file +

                                      view online version

                                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/deploy_android.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/deploy_android.png index 9258b45f2..d2d5bc35f 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/deploy_android.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/deploy_android.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development.html index ff5463bd0..01f4bdd3b 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development.html @@ -1,22 +1,22 @@ -

                                      Developing for jMonkeyEngine SDK

                                      +

                                      Developing for jMonkeyEngine SDK

                                      -Note that all info is subject to change while jMonkeyEngine SDK is still in beta! +Note that all info is subject to change while jMonkeyEngine SDK is still in beta!

                                      -In general, developing plugins for jMonkeyEngine SDK is not much different than creating plugins for the NetBeans Platform which in turn is not much different than creating Swing applications. You can use jMonkeyEngine SDK to develop plugins, be it for personal use or to contribute to the community. +In general, developing plugins for jMonkeyEngine SDK is not much different than creating plugins for the NetBeans Platform which in turn is not much different than creating Swing applications. You can use jMonkeyEngine SDK to develop plugins, be it for personal use or to contribute to the community.

                                      -If you feel like you want to make an addition to jMonkeyEngine SDK, don't hesitate to contact the jme team regardless of your knowledge in NetBeans platform development. For new plugins, the basic project creation and layout of the plugin can always be handled by a core developer and you can go on from there fleshing out the plugin. By using the Platform functions, your plugin feels more like a Platform application (global save button, file type support etc.). +If you feel like you want to make an addition to jMonkeyEngine SDK, don't hesitate to contact the jme team regardless of your knowledge in NetBeans platform development. For new plugins, the basic project creation and layout of the plugin can always be handled by a core developer and you can go on from there fleshing out the plugin. By using the Platform functions, your plugin feels more like a Platform application (global save button, file type support etc.).

                                      -

                                      Creating plugins and components

                                      +

                                      Creating plugins and components

                                      • @@ -29,7 +29,7 @@ If you feel like you want to make an addition to jMonkeyEngine The Main Scene
                                      @@ -42,7 +42,7 @@ If you feel like you want to make an addition to jMonkeyEngine Create a library plugin from a jar file
                                      @@ -53,22 +53,22 @@ If you feel like you want to make an addition to jMonkeyEngine SDK to start the name of methods that execute directly on the OpenGL thread with "do" e.g "doMoveSpatial", this makes identifying threading issues easier.
                                      +
                                    9. It became a standard in jMonkeyEngine SDK to start the name of methods that execute directly on the OpenGL thread with “do” e.g “doMoveSpatial”, this makes identifying threading issues easier.
                                    10. The AssetManager of jme3 is threadsafe and can be used from any thread to load assets
                                    11. You can get access to the ProjectAssetManager via the Lookup of a JmeSpatial and other objects
                                    12. -
                                    13. Use org.openide.filesystems.FileObject instead of java.io.File for file access, it always uses system-independent "/" path separators and has some more advanced functions that make file handling easier.
                                      +
                                    14. Use org.openide.filesystems.FileObject instead of java.io.File for file access, it always uses system-independent “/” path separators and has some more advanced functions that make file handling easier.
                                    15. -
                                    16. You can get a file from a string using Repository.getDefault().getDefaultFileSystem().getRoot().getFileObject("aaa/bbb/ccc/whatever");
                                      +
                                    17. You can get a file from a string using Repository.getDefault().getDefaultFileSystem().getRoot().getFileObject(“aaa/bbb/ccc/whatever”);
                                    18. You can convert a regular java File to a FileObject and vice versa using org.openide.filesystems.FileUtil
                                    19. @@ -78,64 +78,61 @@ If you feel like you want to make an addition to jMonkeyEngine SDK. It can contain editors, simple ???Java SE Libraries??? that you can add to your projects as jar files and other things like project templates etc. +
                                    20. A “plugin” is anything you can tick in the plugin manager of the SDK. It can contain editors, simple “Java SE Libraries” that you can add to your projects as jar files and other things like project templates etc.
                                    21. -
                                    22. A ???module??? is the project type that allows you to create plugins, strictly speaking all plugins are modules but there can be modules that are never shown in the plugin list and only exist as dependencies of other modules.
                                      +
                                    23. A “module” is the project type that allows you to create plugins, strictly speaking all plugins are modules but there can be modules that are never shown in the plugin list and only exist as dependencies of other modules.
                                    24. -
                                    25. A ???library??? is an entry for a jar file (and optionally sources and javadocs) which can be added to a SDK project to be used and distributed with it
                                      +
                                    26. A “library” is an entry for a jar file (and optionally sources and javadocs) which can be added to a SDK project to be used and distributed with it
                                    27. -
                                    28. An ???extension??? is a generic name for stuff that extends the jME engine, like pathfinding algorithms or anything that can be used at the game runtime..
                                      +
                                    29. An “extension” is a generic name for stuff that extends the jME engine, like pathfinding algorithms or anything that can be used at the game runtime..
                                    30. - So if you have some cool code that others can use in their games too, you would make your extension a library by creating a module that the users can download as a plugin :)

                                      -

                                      Handy things in jMonkeyEngine SDK Core

                                      +

                                      Handy things in jMonkeyEngine SDK Core

                                      • com.jme3.gde.core.scene.controller
                                          -
                                        • AbstractCameraController ??? A basic camera control for plugins, used by SimpleSceneComposer and "View Model"
                                          +
                                        • AbstractCameraController → A basic camera control for plugins, used by SimpleSceneComposer and “View Model”
                                        • -
                                        • SceneToolController ??? A basic controller for having selection, cursor etc. displayed in the scene, used by SimpleSceneComposer
                                          +
                                        • SceneToolController → A basic controller for having selection, cursor etc. displayed in the scene, used by SimpleSceneComposer
                                      • com.jme3.gde.core.scene
                                          -
                                        • OffViewPanel ??? A panel that renders a 3d scene in a preview and displays it in a lightweight swing panel
                                          +
                                        • OffViewPanel → A panel that renders a 3d scene in a preview and displays it in a lightweight swing panel
                                      • com.jme3.gde.core.util
                                          -
                                        • DataObjectSaveNode ??? Allows enabling the save all button by using any file and implementing the SvaeCookie yourself.
                                          +
                                        • DataObjectSaveNode → Allows enabling the save all button by using any file and implementing the SvaeCookie yourself.

                                      - Learn more about NetBeans Plugin Development at

                                      Also check out this Essential NetBeans Platform Refcard:

                                      - + +

                                      +tag_documentation_sdk_contribute +

                                      -

                                      view online version

                                      \ No newline at end of file +

                                      view online version

                                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/extension_library.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/extension_library.html index 6029e81f0..56a8049ff 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/extension_library.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/extension_library.html @@ -1,59 +1,58 @@ -

                                      Creating an extension library plugin

                                      +

                                      Creating an extension library plugin

                                      -This page describes how you can wrap any jar library into a plugin that a jMonkeyEngine SDK user can download, install and then use the contained library in his own game projects. +This page describes how you can wrap any jar library into a plugin that a jMonkeyEngine SDK user can download, install and then use the contained library in his own game projects.

                                      -Make sure you have your SDK set up for plugin development as described here. +Make sure you have your SDK set up for plugin development as described here.

                                      -Creating the plugin project (in jMonkeyEngine SDK): +Creating the plugin project (in jMonkeyEngine SDK):

                                      • Create a new Module Suite (or use an existing one)
                                      • -
                                      • Open the suite, right-click the "Modules" folder and select "Add new.."
                                        +
                                      • Open the suite, right-click the “Modules” folder and select “Add new..”
                                      • -
                                      • For "Project Name" enter an all-lowercase name without spaces like my-library
                                        +
                                      • For “Project Name” enter an all-lowercase name without spaces like my-library
                                      • -
                                      • Make sure the "Project Location" is inside the module suite folder and press "Next"
                                        +
                                      • Make sure the “Project Location” is inside the module suite folder and press “Next”
                                      • -
                                      • Enter the base java package for your plugin in "Code Name Base" like com.mycompany.plugins.mylibrary
                                        +
                                      • Enter the base java package for your plugin in “Code Name Base” like com.mycompany.plugins.mylibrary
                                      • -
                                      • Enter a "Module Display Name" for your plugin like "My Library"
                                        +
                                      • Enter a “Module Display Name” for your plugin like “My Library”
                                      • Press Finish

                                      - Adding the library:

                                        -
                                      • Right click the Module Project and select "New???Other"
                                        +
                                      • Right click the Module Project and select “New→Other”
                                      • -
                                      • Under "Module Development" select the "Java SE Library Descriptor" template and press "Next"
                                        +
                                      • Under “Module Development” select the “Java SE Library Descriptor” template and press “Next”
                                      • -
                                      • If you dont have the external library registered in the jMonkeyEngine SDK yet, click "Manage Libraries" and do the following:
                                        +
                                      • If you dont have the external library registered in the jMonkeyEngine SDK yet, click “Manage Libraries” and do the following:
                                          -
                                        • Click "New Library", enter a name for the library and press OK
                                          +
                                        • Click “New Library”, enter a name for the library and press OK
                                        • -
                                        • In the "Classpath" tab, press "Add JAR/Folder" and select the jar file(s) needed for the library
                                          +
                                        • In the “Classpath” tab, press “Add JAR/Folder” and select the jar file(s) needed for the library
                                        • -
                                        • In the "JavaDoc" tab, press "Add ZIP/Folder" and add the javadoc for the library (zipped or folder)
                                          +
                                        • In the “JavaDoc” tab, press “Add ZIP/Folder” and add the javadoc for the library (zipped or folder)
                                        • -
                                        • In the "Sources" tab you can add a folder or jar file containing the source files of the library if available
                                          +
                                        • In the “Sources” tab you can add a folder or jar file containing the source files of the library if available
                                        • Press OK
                                      • -
                                      • Select the external library from the list and press "Next"
                                        +
                                      • Select the external library from the list and press “Next”
                                      • Enter a name for the Library (used as filename for the description file)
                                      • @@ -64,8 +63,7 @@ Adding the library:

                                      - -You will notice a new file "MyLibrary.xml" is created in the plugins base package and linked to in the layer.xml file. Additionally the jar file and sources /javadoc are copied into a "release" folder in the project root. This is basically it, you can configure a version number, license file (should be placed in Module root folder) and more via the Module Properties. +You will notice a new file “MyLibrary.xml” is created in the plugins base package and linked to in the layer.xml file. Additionally the jar file and sources /javadoc are copied into a “release” folder in the project root. This is basically it, you can configure a version number, license file (should be placed in Module root folder) and more via the Module Properties.

                                      @@ -73,8 +71,8 @@ Note that the files in the release folder are not automatically

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

                                      -

                                      view online version

                                      \ No newline at end of file +

                                      view online version

                                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/general.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/general.html index e2eb638f4..f0be4235e 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/general.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/general.html @@ -1,22 +1,20 @@ -

                                      Creating plugin components

                                      +

                                      Creating plugin components

                                      For the most common extensions like Windows, File Types, Libraries etc. there exist templates that you can add to your plugin. -

                                        -
                                      1. Right-click your Module Project and select New???Other
                                        +
                                      2. Right-click your Module Project and select New→Other
                                      3. -
                                      4. Select "Module Development" to the left
                                        +
                                      5. Select “Module Development” to the left

                                      - You will see a list of components you can add to your project. A wizard will guide you through the creation of the component.

                                      -

                                      view online version

                                      \ No newline at end of file +

                                      view online version

                                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/model_loader.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/model_loader.html index ca41bb236..aad7ff077 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/model_loader.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/model_loader.html @@ -1,11 +1,9 @@ -

                                      jMonkeyEngine SDK: Creating a model importer

                                      +

                                      jMonkeyEngine SDK: Creating a model importer

                                      - -You can create custom model importers for the jMonkeyEngine SDK. The SDK supports NBM plugins. - +You can create custom model importers for the jMonkeyEngine SDK. The SDK supports NBM plugins.

                                      1. @@ -25,7 +23,6 @@ You can create custom model importers for the jMonkeyEngine

                                      - + +

                                      +tag_documentation_sdk_tool +

                                      -

                                      view online version

                                      \ No newline at end of file +

                                      view online version

                                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/projects_assets.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/projects_assets.html index 4ddd78098..803149961 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/projects_assets.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/projects_assets.html @@ -1,25 +1,22 @@ -

                                      Projects and Assets

                                      +

                                      Projects and Assets

                                      -The SDK heavily uses the systems provided by the base platform for the handling of assets and projects and extends the system with jME3 specific features. - +The SDK heavily uses the systems provided by the base platform for the handling of assets and projects and extends the system with jME3 specific features.

                                      -

                                      ProjectAssetManager

                                      +

                                      ProjectAssetManager

                                      All AssetDataObjects and SceneExplorerNodes allow access to the ProjectAssetManager of the project they were loaded from. -

                                      ProjectAssetManager pm = node.getLookup().lookup(ProjectAssetManager.class)

                                      - The ProjectAssetManager is basically a normal DesktopAssetManager for each project with some added functionality:

                                        @@ -35,23 +32,21 @@ The ProjectAssetManager is basically a normal DesktopAssetManager for each proje
                                      -

                                      AssetDataObject

                                      +

                                      AssetDataObject

                                      -Most "files" that you encounter in the SDK come in the form of AssetDataObjects. All Nodes that you encounter contain the AssetDataObject they were loaded from. It provides not just access to the FileObject of the specific file but also an AssetData object that allows access to jME specific properties and data. The AssetData object also allows loading the object via the jME3 assetManager. It is accessible via the lookup of the Node or AssetDataObject: - +Most “files” that you encounter in the SDK come in the form of AssetDataObjects. All Nodes that you encounter contain the AssetDataObject they were loaded from. It provides not just access to the FileObject of the specific file but also an AssetData object that allows access to jME specific properties and data. The AssetData object also allows loading the object via the jME3 assetManager. It is accessible via the lookup of the Node or AssetDataObject:

                                      assetDataObject.getLookup().lookup(AssetData.class)
                                      -

                                      New Asset File Types

                                      +

                                      New Asset File Types

                                      -When you add a new file type for a model format or other asset file that can be loaded in jME3 you can start by using new file type template (New File???Module Development???File Type). Change the DataObject to extend AssetDataObject (general), SpatialAssetDataObject (some type of model) or BinaryModelDataObject (basically a j3o savable file). And possibly override the loadAsset and saveAsset methods which are used by the AssetData object to return the correct AssetKey type (needed for import properties to work). - +When you add a new file type for a model format or other asset file that can be loaded in jME3 you can start by using new file type template (New File→Module Development→File Type). Change the DataObject to extend AssetDataObject (general), SpatialAssetDataObject (some type of model) or BinaryModelDataObject (basically a j3o savable file). And possibly override the loadAsset and saveAsset methods which are used by the AssetData object to return the correct AssetKey type (needed for import properties to work).

                                      public class BlenderDataObject extends SpatialAssetDataObject {
                                           public BlenderDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException {
                                      @@ -60,9 +55,7 @@ When you add a new file type for a model format or other asset file that can be
                                       }

                                      - An AssetManagerConfigurator class can be created to configure the assetManager of the projects and model importer to use the new asset type: -

                                      @org.openide.util.lookup.ServiceProvider(service = AssetManagerConfigurator.class)
                                       public class BlenderAssetManagerConfigurator implements AssetManagerConfigurator {
                                      @@ -73,4 +66,4 @@ public class BlenderAssetManagerConfigurator implements AssetManagerConfigurator
                                       
                                       
                                      -

                                      view online version

                                      \ No newline at end of file +

                                      view online version

                                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/scene.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/scene.html index 04eace75d..4ae36895f 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/scene.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/scene.html @@ -1,19 +1,17 @@ -

                                      jMonkeyEngine SDK -- The Scene

                                      +

                                      jMonkeyEngine SDK -- The Scene

                                      - -To reduce system overhead the jMonkeyEngine SDK Core supplies one scene/jme3 application that is shared between plugins. Furthermore there's the "SceneExplorer" that shows a visual representation of the scenegraph and its objects properties across plugins. +To reduce system overhead the jMonkeyEngine SDK Core supplies one scene/jme3 application that is shared between plugins. Furthermore there's the “SceneExplorer” that shows a visual representation of the scenegraph and its objects properties across plugins.

                                      -

                                      How to access the Scene

                                      +

                                      How to access the Scene

                                      - There are several ways for your plugin to interact with the Scene:

                                        @@ -25,12 +23,11 @@ There are several ways for your plugin to interact with the Scene:
                                      -

                                      Listening for Node selection

                                      +

                                      Listening for Node selection

                                      - -In the jMonkeyEngine SDK, all objects are wrapped into NetBeans "Nodes" (different thing than jme Nodes!). Such nodes can have properties and icons and can be displayed and selected in the jMonkeyEngine SDK UI. The SceneExplorer shows a tree of Nodes that wrap the Spatials of the current scene and allows manipulating their properties on selection. A jME "Spatial" is wrapped by a "JmeSpatial" node, for example. One advantage of these Nodes is that one can manipulate properties of Spatials directly from the AWT thread. +In the jMonkeyEngine SDK, all objects are wrapped into NetBeans “Nodes” (different thing than jme Nodes!). Such nodes can have properties and icons and can be displayed and selected in the jMonkeyEngine SDK UI. The SceneExplorer shows a tree of Nodes that wrap the Spatials of the current scene and allows manipulating their properties on selection. A jME “Spatial” is wrapped by a “JmeSpatial” node, for example. One advantage of these Nodes is that one can manipulate properties of Spatials directly from the AWT thread.

                                      @@ -55,7 +52,7 @@ public void resultChanged(LookupEvent ev) { }

                                      -You can also access the "real" spatial but since its part of the scenegraph you will have to modify it on that thread: +You can also access the “real” spatial but since its part of the scenegraph you will have to modify it on that thread:

                                      //retrieve the "real" spatial class from the JmeNode
                                       for (JmeSpatial jmeSpatial : items) {
                                      @@ -63,7 +60,7 @@ for (JmeSpatial jmeSpatial : items) {
                                           final Spatial realSpatial = jmeSpatial.getLookup().lookup(Spatial.class);
                                           //use a Callable to execute on the render thread:
                                           SceneApplication.getApplication().enqueue(new Callable() {
                                      -        public Object call() throws Exception {
                                      +        public Exception {
                                                   realSpatial.setLocalTranslation(Vector3f.ZERO);
                                                   return null;
                                               }
                                      @@ -73,18 +70,17 @@ for (JmeSpatial jmeSpatial : items) {
                                       
                                       
                                      -

                                      Requesting the Scene

                                      +

                                      Requesting the Scene

                                      - If your plugin wants to use the scene by itself, it first has to implement SceneListener and register at the scene and then send a SceneRequest to the SceneApplication. When the SceneRequest has been approved and the current Scene has been closed, the SceneListener (your class) is called with its own SceneRequest as a parameter. When another plugin sends a SceneRequest it is also reported to you and its a hint that your RootNode has been removed from the Scene and you are no longer in control of it. You could also hook into the SceneRequests of other plugins to see if/when they are activated to display add-on plugins for that plugin.


                                      -The SceneRequest object has to contain several things. A thing that you must supply is a jme "Node" wrapped into a "JmeNode" object. This is your rootNode that you use to display and build your scene. As soon as you control the scene, you will have to control the camera etc. yourself. +The SceneRequest object has to contain several things. A thing that you must supply is a jme “Node” wrapped into a “JmeNode” object. This is your rootNode that you use to display and build your scene. As soon as you control the scene, you will have to control the camera etc. yourself.

                                      com.jme3.scene.Node rootNode = new com.jme3.scene.Node("MyRootNode");
                                        
                                      @@ -117,12 +113,11 @@ public void sceneClosed(SceneRequest request) {
                                       
                                       
                                      -

                                      Undo/Redo support

                                      +

                                      Undo/Redo support

                                      -The jMonkeyEngine SDK has a global undo/redo queue that activates the undo/redo buttons. To use it in your TopComponent, add the following method: - +The jMonkeyEngine SDK has a global undo/redo queue that activates the undo/redo buttons. To use it in your TopComponent, add the following method:

                                      @Override 
                                       public UndoRedo getUndoRedo() { 
                                      @@ -131,7 +126,6 @@ return Lookup.getDefault().lookup(SceneUndoRedoManager.class);
                                       
                                       

                                      To add a undo/redo event that modifies objects on the Scenegraph, theres a special version of AbstractUndoableEdit which executes the undo/redo calls on the scene thread. Simply implement that class and add it to the queue like this: -

                                      Lookup.getDefault().lookup(SceneUndoRedoManager.class).addEdit(this, new AbstractUndoableSceneEdit() { 
                                        
                                      @@ -158,9 +152,8 @@ public void awtRedo() {
                                       
                                       

                                      Note: Its important that you use the method addEdit(Object source, UndoableEdit edit); -

                                      -

                                      view online version

                                      \ No newline at end of file +

                                      view online version

                                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/sceneexplorer.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/sceneexplorer.html index 32156e28c..7223e99c7 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/sceneexplorer.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/sceneexplorer.html @@ -1,24 +1,23 @@ -

                                      The SceneExplorer

                                      +

                                      The SceneExplorer

                                      -

                                      Adding Node types to SceneExplorer

                                      +

                                      Adding Node types to SceneExplorer

                                      - If your plugin brings in its own SceneGraph objects you can still have them work like any other SceneExplorer item, including its special properties.

                                      -If you want to support special properties of your objects that are not exposed by the SDK automatically, you will have to create your own class that extends org.openide.nodes.Node and implement the interface com.jme3.gde.core.sceneexplorer.nodes.AbstractSceneExplorerNode. Then you register that class by adding +If you want to support special properties of your objects that are not exposed by the SDK automatically, you will have to create your own class that extends org.openide.nodes.Node and implement the interface com.jme3.gde.core.sceneexplorer.nodes.AbstractSceneExplorerNode. Then you register that class by adding

                                      @org.openide.util.lookup.ServiceProvider(service=SceneExplorerNode.class)

                                      - above the body of your class. Thats all, your Spatial type will automatically be used and displayed in the SceneExplorer. Make sure you register a jar with the used classes in the plugin preferences under "wrapped libraries", otherwise the IDE cannot access those classes. + above the body of your class. Thats all, your Spatial type will automatically be used and displayed in the SceneExplorer. Make sure you register a jar with the used classes in the plugin preferences under “wrapped libraries”, otherwise the IDE cannot access those classes.

                                      @@ -27,16 +26,15 @@ AbstractSceneExplorerNode brings some other useful features you might want to in

                                      The SceneExplorerNode can be used for Spatial and Control type objects. -

                                        -
                                      • Add the "Nodes API" and "Lookup API" libraries to your project when you want to use this
                                        +
                                      • Add the “Nodes API” and “Lookup API” libraries to your project when you want to use this
                                      -

                                      Spatial Example

                                      +

                                      Spatial Example

                                      @org.openide.util.lookup.ServiceProvider(service=SceneExplorerNode.class)
                                       public class JmeGeometry extends JmeSpatial {
                                      @@ -93,7 +91,7 @@ public class JmeGeometry extends JmeSpatial {
                                               return JmeGeometry.class;
                                           }
                                        
                                      -    public org.openide.nodes.Node[] createNodes(Object key, Object key2, boolean readOnly) {
                                      +    public org.openide.nodes.Node[] createNodes(Object key2, boolean readOnly) {
                                               SceneExplorerChildren children=new SceneExplorerChildren((com.jme3.scene.Spatial)key);
                                               children.setReadOnly(readOnly);
                                               return new org.openide.nodes.Node[]{new JmeGeometry((Geometry) key, children).setReadOnly(readOnly)};
                                      @@ -102,7 +100,7 @@ public class JmeGeometry extends JmeSpatial {
                                       
                                       
                                      -

                                      Control Example

                                      +

                                      Control Example

                                      @org.openide.util.lookup.ServiceProvider(service=SceneExplorerNode.class)
                                       public class JmeGhostControl extends AbstractSceneExplorerNode {
                                      @@ -153,7 +151,7 @@ public class JmeGhostControl extends AbstractSceneExplorerNode {
                                               try {
                                                   SceneApplication.getApplication().enqueue(new Callable<Void>() {
                                        
                                      -                public Void call() throws Exception {
                                      +                public Exception {
                                                           spat.removeControl(control);
                                                           return null;
                                                       }
                                      @@ -204,7 +202,7 @@ public class JmeGhostControl extends AbstractSceneExplorerNode {
                                       
                                       
                                      -

                                      Adding items to the add and tools menus

                                      +

                                      Adding items to the add and tools menus

                                      @@ -296,16 +294,15 @@ public class NewRigidBodyAction extends AbstractNewControlAction {

                                      -

                                      Adding using a Wizard

                                      +

                                      Adding using a Wizard

                                      -You can create a new wizard using the wizard template in the SDK (New File???Module Development???Wizard). The Action that the template creates can easily be changed to one for adding a Control or Spatial or for applying a Tool. Note that we extend AbstractNewSpatialWizardAction here. +You can create a new wizard using the wizard template in the SDK (New File→Module Development→Wizard). The Action that the template creates can easily be changed to one for adding a Control or Spatial or for applying a Tool. Note that we extend AbstractNewSpatialWizardAction here.

                                      -A good example is the "Add SkyBox" Wizard: - +A good example is the “Add SkyBox” Wizard:

                                      @org.openide.util.lookup.ServiceProvider(service = NewSpatialAction.class)
                                       public class AddSkyboxAction extends AbstractNewSpatialWizardAction {
                                      @@ -367,7 +364,7 @@ public class AddSkyboxAction extends AbstractNewSpatialWizardAction {
                                                               new SkyboxWizardPanel1(),
                                                               new SkyboxWizardPanel2()
                                                           };
                                      -            String[] steps = new String[panels.length];
                                      +            String[panels.length];
                                                   for (int i = 0; i < panels.length; i++) {
                                                       Component c = panels[i].getComponent();
                                                       // Default step name to component name of panel. Mainly useful
                                      @@ -375,7 +372,7 @@ public class AddSkyboxAction extends AbstractNewSpatialWizardAction {
                                                       // list of steps.
                                                       steps[i] = c.getName();
                                                       if (c instanceof JComponent) { // assume Swing components
                                      -                    JComponent jc = (JComponent) c;
                                      +                    JComponent) c;
                                                           // Sets step number of a component
                                                           // TODO if using org.openide.dialogs >= 7.8, can use WizardDescriptor.PROP_*:
                                                           jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
                                      @@ -395,11 +392,10 @@ public class AddSkyboxAction extends AbstractNewSpatialWizardAction {
                                       }

                                      -

                                      The abstract spatial and control actions implement undo/redo automatically, for the ToolActions you have to implement it yourself.

                                      -

                                      view online version

                                      \ No newline at end of file +

                                      view online version

                                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/setup.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/setup.html index 6798f935b..9c625b6ba 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/setup.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/development/setup.html @@ -1,40 +1,39 @@ -

                                      Creating a jMonkeyEngine SDK plugin

                                      +

                                      Creating a jMonkeyEngine SDK plugin

                                      Note that the creation of a Module Suite is only necessary if you want to upload your plugin to the contribution update center. -

                                      -

                                      Using jMonkeyEngine SDK for development

                                      +

                                      Using jMonkeyEngine SDK for development

                                        -
                                      • Install the "Netbeans Plugin Development" and "NetBeans API Documentation" plugins via Tools???Plugins
                                        +
                                      • Install the “Netbeans Plugin Development” and “NetBeans API Documentation” plugins via Tools→Plugins
                                      • -
                                      • Create a new "Module Suite" project (can be any name, this will be your local "collection" of plugins that you create)
                                        +
                                      • Create a new “Module Suite” project (can be any name, this will be your local “collection” of plugins that you create)
                                      • -
                                      • If no platform is listed, add one by selecting the SDK application folder
                                        +
                                      • If no platform is listed, add one by selecting the SDK application folder
                                          -
                                        • Mac users have to right-click the jmonkeyplatform application and select "show contents" and then select the jmonkeyplatform folder under Contents/Resources/
                                          +
                                        • Mac users have to right-click the jmonkeyplatform application and select “show contents” and then select the jmonkeyplatform folder under Contents/Resources/
                                      • -
                                      • Open the suite, right-click the "Modules" folder and select "Add new.."
                                        +
                                      • Open the suite, right-click the “Modules” folder and select “Add new..”
                                      • -
                                      • For "Project Name" enter an all-lowercase name without spaces like my-library
                                        +
                                      • For “Project Name” enter an all-lowercase name without spaces like my-library
                                      • -
                                      • Make sure the "Project Location" is inside the module suite folder and press "Next"
                                        +
                                      • Make sure the “Project Location” is inside the module suite folder and press “Next”
                                      • -
                                      • Enter the base java package for your plugin in "Code Name Base" like com.mycompany.plugins.mylibrary
                                        +
                                      • Enter the base java package for your plugin in “Code Name Base” like com.mycompany.plugins.mylibrary
                                      • -
                                      • Enter a "Module Display Name" for your plugin like "My Library"
                                        +
                                      • Enter a “Module Display Name” for your plugin like “My Library”
                                      • Press Finish
                                      • -
                                      • To use core SDK or jME3 functions, add "SDK Core" and "SDK Engine" via "Module Properties???Library???Add Dependency"
                                        +
                                      • To use core SDK or jME3 functions, add “SDK Core” and “SDK Engine” via “Module Properties→Library→Add Dependency”
                                      • Write your plugin (e.g. create a new editor or wrap a jar library)
                                      • @@ -42,11 +41,11 @@ Note that the creation of a Module Suite is only necessary if you want to upload
                                      -

                                      jMonkeyEngine SDK Contributions Update Center

                                      +

                                      jMonkeyEngine SDK Contributions Update Center

                                      -If you want your plugin to appear in the "jMonkeyEngine SDK Contributions Update Center" so users can download, install and update it easily via the plugin manager, you can host your plugin in the contributions update center svn repository. The contributions update center is based on a googlecode project for contributed plugins which will be automatically compiled, version-labeled and added to the contributions update center like the core jMonkeyEngine SDK plugins. +If you want your plugin to appear in the “jMonkeyEngine SDK Contributions Update Center” so users can download, install and update it easily via the plugin manager, you can host your plugin in the contributions update center svn repository. The contributions update center is based on a googlecode project for contributed plugins which will be automatically compiled, version-labeled and added to the contributions update center like the core jMonkeyEngine SDK plugins.

                                      @@ -55,44 +54,44 @@ Effectively its one large module suite with multiple modules which each represen

                                      -

                                      Adding your plugin to the repository

                                      +

                                      Adding your plugin to the repository

                                      To add your plugin to the repository, do the following:

                                        -
                                      • Make sure the plugin is part of a "Module Suite" and that its located in the folder of the suite (this saves you from problems with the svn and local version not being configured the same)
                                        +
                                      • Make sure the plugin is part of a “Module Suite” and that its located in the folder of the suite (this saves you from problems with the svn and local version not being configured the same)
                                      • -
                                      • In "Module Properties???Sources"
                                        +
                                      • In “Module Properties→Sources”
                                          -
                                        • Set the "Source Level" to 1.5 if possible (jMonkeyEngine SDK is compatible to Java 1.5)
                                          +
                                        • Set the “Source Level” to 1.5 if possible (jMonkeyEngine SDK is compatible to Java 1.5)
                                      • -
                                      • In "Module Properties???API Versioning"
                                        +
                                      • In “Module Properties→API Versioning”
                                        • Set a specification version for your plugin (like 0.8.1)
                                        • -
                                        • Set the "implementation version" to "0" and select "append implementation versions automatically"
                                          +
                                        • Set the “implementation version” to “0” and select “append implementation versions automatically”
                                      • -
                                      • In "Module Properties???Display"
                                        +
                                      • In “Module Properties→Display”
                                        • Enter a purposeful description of your plugin and one of the following categories:
                                            -
                                          • For a library plugin: "jME3 - Library"
                                            +
                                          • For a library plugin: “jME3 - Library”
                                          • -
                                          • For a SDK plugin: "jME3 - SDK Plugin"
                                            +
                                          • For a SDK plugin: “jME3 - SDK Plugin”
                                          • -
                                          • For a model loader plugin: "jME3 - Loader"
                                            +
                                          • For a model loader plugin: “jME3 - Loader”
                                      • -
                                      • In "Module Properties???Build???Packaging"
                                        +
                                      • In “Module Properties→Build→Packaging”
                                        • Add your name
                                        • @@ -106,28 +105,27 @@ To add your plugin to the repository, do the following:
                                        • Commit only the module project to trunk:
                                            -
                                          • Right click the Module Project and select "Versioning ??? Import into Subversion Repository"
                                            +
                                          • Right click the Module Project and select “Versioning → Import into Subversion Repository”
                                          • -
                                          • Enter in the URL field
                                            +
                                          • Enter in the URL field
                                          • -
                                          • Enter your googlecode username and commit password (different than login pass, you can find your password !) and press "Next"
                                            +
                                          • Enter your googlecode username and commit password (different than login pass, you can find your password !) and press “Next”
                                          • -
                                          • Check that the "Repository Folder" is trunk/mypluginfolder and enter an import message
                                            +
                                          • Check that the “Repository Folder” is trunk/mypluginfolder and enter an import message
                                          • -
                                          • Press "Finish"
                                            +
                                          • Press “Finish”

                                        - And thats it, from now on each time you commit changes to your module it will be built and added to the contributions center automatically and the version number will be extended by the svn revision number (e.g. 0.8.1.1234)

                                      -

                                      Building wrapped library jar files on the server

                                      +

                                      Building wrapped library jar files on the server

                                      @@ -135,8 +133,7 @@ You can just build your library locally and update and commit the jar file and j

                                      -As normally only the module project is being built on the server, any projects that create the actual jar files for library plugins ("normal" projects from the SDK/NetBeans) have to be built from the module build file. To do that simply add the following ant targets to the module build file (adapt to your project file and folder names): - +As normally only the module project is being built on the server, any projects that create the actual jar files for library plugins (“normal” projects from the SDK/NetBeans) have to be built from the module build file. To do that simply add the following ant targets to the module build file (adapt to your project file and folder names):

                                      <target name="init" depends="basic-init,files-init,build-init,-javac-init,-build-subproject"/>
                                       <target name="-build-subproject">
                                      @@ -149,11 +146,9 @@ As normally only the module project is being built on the server, any projects t
                                       </target>

                                      - Note that for the module version number to increase automatically on a commit to the library project, the library project has to be a subfolder of the main module project. -

                                      -

                                      view online version

                                      \ No newline at end of file +

                                      view online version

                                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/filters.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/filters.html index 35d3a7c52..b72a18aa6 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/filters.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/filters.html @@ -1,15 +1,14 @@ -

                                      jMonkeyEngine SDK: Post-Processor Filters

                                      +

                                      jMonkeyEngine SDK: Post-Processor Filters

                                      - -Filters are used for scene-wide effects such as glow, fog, blur. The SDK lets you create a file storing combinations of filters. You can preview the filter settings on a loaded scene in the SDK. You can load them into your application (add them to the viewPort) to activate your preconfigured set of several filters in one step. +Filters are used for scene-wide effects such as glow, fog, blur. The SDK lets you create a file storing combinations of filters. You can preview the filter settings on a loaded scene in the SDK. You can load them into your application (add them to the viewPort) to activate your preconfigured set of several filters in one step.

                                      -

                                      Creating Filters

                                      +

                                      Creating Filters

                                      @@ -17,12 +16,12 @@ Filters are used for scene-wide effects such as glow, fog, blur. The

                                        -
                                      • In the Projects window, right-click Assets???Effects.
                                        +
                                      • In the Projects window, right-click Assets→Effects.
                                      • -
                                      • Select File???New File???
                                        +
                                      • Select File→New File…
                                      • -
                                      • Select Filter???Empty FilterPostProcessor File in the New File Wizard.
                                        -An empty filter file appears in the Assets???Effects directory.
                                        +
                                      • Select Filter→Empty FilterPostProcessor File in the New File Wizard.
                                        +An empty filter file appears in the Assets→Effects directory.
                                      • Double-click the created file.
                                        The file opens in the FilterExplorer window.
                                        @@ -31,11 +30,10 @@ The file opens in the FilterExplorer window.
                                      -

                                      Editing Filters

                                      +

                                      Editing Filters

                                      - To add filters or modify existing filters

                                        @@ -49,17 +47,15 @@ Added filters are listed under the filter's root node.

                                      - View the filter in the SceneComposer to see what you are doing:

                                      -

                                      Viewing Filters

                                      +

                                      Viewing Filters

                                      -

                                      @@ -71,28 +67,25 @@ To see a loaded filter
                                    31. Double-click a j3f file to open it in the FilterExplorer window.
                                    32. -
                                    33. Press the "show filter" button in the OpenGL window.
                                      +
                                    34. Press the “show filter” button in the OpenGL window.
                                    35. -

                                      Loading filters in a game

                                      +

                                      Loading filters in a game

                                      - To load a filter in a game (that is, to add it to your game's viewport), add the following lines to your game's simpleInit() method (or some other place):

                                      FilterPostProcessor processor = (FilterPostProcessor) assetManager.loadAsset("Filters/MyFilter.j3f");
                                       viewPort.addProcessor(processor);
                                      - + +

                                      +tag_documentation_sdk_effect_file +

                                      -

                                      view online version

                                      \ No newline at end of file +

                                      view online version

                                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/jmonkey-branding.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/jmonkey-branding.png index 60c16b4b8..28ba17e62 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/jmonkey-branding.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/jmonkey-branding.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/jmonkeyplatform-docu-2.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/jmonkeyplatform-docu-2.png index a30fd2f68..f1313ab0b 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/jmonkeyplatform-docu-2.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/jmonkeyplatform-docu-2.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/jmonkeyplatform-docu-3.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/jmonkeyplatform-docu-3.png index 5accbc2ce..51e6c389e 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/jmonkeyplatform-docu-3.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/jmonkeyplatform-docu-3.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/jmonkeyplatform-docu-4.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/jmonkeyplatform-docu-4.png index dfb9e4dd7..13aa854a9 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/jmonkeyplatform-docu-4.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/jmonkeyplatform-docu-4.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/jmonkeyplatform-docu-5.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/jmonkeyplatform-docu-5.png index b53a41eab..76e9a2467 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/jmonkeyplatform-docu-5.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/jmonkeyplatform-docu-5.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/log_files.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/log_files.html index 2b7ea1f5e..a7d71a9b3 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/log_files.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/log_files.html @@ -1,29 +1,26 @@ -

                                      jMonkeyEngine SDK: Log Files

                                      +

                                      jMonkeyEngine SDK: Log Files

                                      - -You find the jMonkeyEngine SDK log file in /dev/var/log/messages.log in the jMonkeyEngine SDK preferences folder. You can learn the location of the preferences folder in the ???About??? screen of the jMonkeyEngine SDK under the label Userdir. - +You find the jMonkeyEngine SDK log file in /dev/var/log/messages.log in the jMonkeyEngine SDK preferences folder. You can learn the location of the preferences folder in the “About” screen of the jMonkeyEngine SDK under the label Userdir.

                                      • Windows: C:\Documents and Settings\YOUR_NAME\.jmonkeyplatform\
                                      • Linux: /home/YOUR_NAME/.jmonkeyplatform/
                                      • -
                                      • Mac OS: /Users/YOUR_NAME/Library/Application Support/jmonkeyplatform/
                                        +
                                      • Mac OS: /Users/YOUR_NAME/Library/Application Support/jmonkeyplatform/

                                      - The message log contains all paths and capabilities used in your development system, and also warnings, e.g. if a plugin crashed.

                                      -

                                      Example Log

                                      +

                                      Example Log

                                      >Log Session: Saturday, September 24, 2011 10:45:30 AM CEST
                                       >System Info: 
                                      @@ -38,12 +35,11 @@ The message log contains all paths and documentation,
                                      -	sdk,
                                      -	file
                                      -
                                      + +

                                      +tag_documentation_sdk_file +

                                      -

                                      view online version

                                      \ No newline at end of file +

                                      view online version

                                      \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/material-editor.png b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/material-editor.png index d0bdab4b8..a094d335f 100644 Binary files a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/material-editor.png and b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/material-editor.png differ diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/material_editing.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/material_editing.html index be7f4b7ab..e149e076f 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/material_editing.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/material_editing.html @@ -1,38 +1,35 @@ -

                                      jMonkeyEngine SDK: Material Editor

                                      +

                                      jMonkeyEngine SDK: Material Editor

                                      - If you are looking for background information, read about Material Definitions and j3M Material Files. You can write .j3m files in a text editor, or use the jMonkeyEngine SDK to generate them for you as described in this article.

                                      -

                                      Materials

                                      +

                                      Materials

                                      - The jMonkeyEngine uses a special Material format, which comes in .j3m files. You use .j3m files to store sets of material properties that you use repeatedly. This enables you write one short line of code that simply loads the presets from a custom .j3m file. Without a .j3m file you need to write several lines of material property setters every time when you want to use a non-default material.

                                      -

                                      Creating .j3m Materials

                                      +

                                      Creating .j3m Materials

                                      -

                                      -To create new .j3m files in the jMonkeyEngine SDK, +To create new .j3m files in the jMonkeyEngine SDK,

                                        -
                                      1. Right-click the assets/Materials directory and choose New??? > Other.
                                        +
                                      2. Right-click the assets/Materials directory and choose New… > Other.
                                      3. In the New File Wizard, choose Material > Empty Material File, and click Next.
                                      4. @@ -43,9 +40,7 @@ To create new .j3m files in the jMonkeyEngine -

                                        Using .j3m Materials

                                        +

                                        Using .j3m Materials

                                        -

                                        @@ -87,10 +79,10 @@ When the material is ready and saved into your projects assets directory, you ca

                                        -In the jMonkeyEngine SDK +In the jMonkeyEngine SDK

                                          -
                                        1. Right-click the j3o file and select "Edit in SceneComposer"
                                          +
                                        2. Right-click the j3o file and select “Edit in SceneComposer”
                                        3. Open the SceneExplorer window
                                        4. @@ -105,7 +97,6 @@ In the jMonkeyEngine SDK

                                        - Or in your Java code

                                        -

                                        view online version

                                        \ No newline at end of file +

                                        view online version

                                        \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/model_loader_and_viewer.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/model_loader_and_viewer.html index a074f3f43..8eba4d48b 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/model_loader_and_viewer.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/model_loader_and_viewer.html @@ -1,14 +1,13 @@ -

                                        jMonkeyEngine SDK: Importing and Viewing Models

                                        +

                                        jMonkeyEngine SDK: Importing and Viewing Models

                                        - -The jMonkeyEngine SDK imports models from your project and stores them in the assets folder. The imported models are converted to a jME3 compatible binary format called .j3o. Double-click .j3o files in the jMonkeyEngine SDK to display them in the SceneViewer, or load them in-game using the AssetManager. +The jMonkeyEngine SDK imports models from your project and stores them in the assets folder. The imported models are converted to a jME3 compatible binary format called .j3o. Double-click .j3o files in the jMonkeyEngine SDK to display them in the SceneViewer, or load them in-game using the AssetManager.

                                        -Presently, is the preferred modelling tool for jME3 as it is also Open-Source Software and an exporter for OgreXML files exists. There is a direct .blend file importer available in the SDK and you can directly import or store blend files in your project to convert them. If for some reason your version of blender is not compatible, you can use the default OgreXML format. Note that the OgreXML exporter is not compatible with Blender 2.49 or before! +Presently, is the preferred modelling tool for jME3 as it is also Open-Source Software and an exporter for OgreXML files exists. There is a direct .blend file importer available in the SDK and you can directly import or store blend files in your project to convert them. If for some reason your version of blender is not compatible, you can use the default OgreXML format. Note that the OgreXML exporter is not compatible with Blender 2.49 or before!

                                        @@ -17,78 +16,71 @@ Also, see this -

                                        Installing the OgreXML Exporter in Blender

                                        +

                                        Installing the OgreXML Exporter in Blender

                                        - -The jMonkeyEngine SDK includes a tool to install the correct exporter tools in Blender to export OgreXML files. To install the exporter, do the following: - +The jMonkeyEngine SDK includes a tool to install the correct exporter tools in Blender to export OgreXML files. To install the exporter, do the following:

                                          -
                                        1. Select "Tools"???"OgreXML"???"Install Blender OgreXML" in the jMonkeyEngine SDK Menu
                                          +
                                        2. Select “Tools”→“OgreXML”→“Install Blender OgreXML” in the jMonkeyEngine SDK Menu
                                        3. If you are presented a filechooser, select the folder where your blender scripts reside
                                        4. -
                                        5. Press "Install" in the window that opens
                                          +
                                        6. Press “Install” in the window that opens

                                        - Also check out how to create compatible models in blender and how to organize your assets. -

                                        -

                                        Importing and Viewing a Model

                                        +

                                        Importing and Viewing a Model

                                        -

                                        Using the Model Importer Tool

                                        +

                                        Using the Model Importer Tool

                                        -jMonkeyEngine SDK includes a model importer tool that allows you to preview and import supported models into your jMonkeyEngine3 project. +jMonkeyEngine SDK includes a model importer tool that allows you to preview and import supported models into your jMonkeyEngine3 project.

                                        -

                                        1. Select the project you want to import your model to
                                        2. -
                                        3. Click the "Import Model" button in the toolbar
                                          +
                                        4. Click the “Import Model” button in the toolbar
                                        5. -
                                        6. Click "open model.." and select the main model file
                                          +
                                        7. Click “open model..” and select the main model file
                                        8. -
                                        9. Check the preview and file list and press "Next"
                                          +
                                        10. Check the preview and file list and press “Next”
                                        11. Check and change the import path if necessary
                                        12. If you want to copy the original model files as well, check the checkbox
                                        13. -
                                        14. Press "finish"
                                          +
                                        15. Press “finish”

                                        - The model is converted to j3o and all necessary files are copied to the project assets folder. If you have specified the corresponding option, all original model files will also be copied to your assets folder.

                                        -

                                        Using the model files directly

                                        +

                                        Using the model files directly

                                        -

                                        1. Create a separate folder for each model in the assets folder of your project.
                                          @@ -101,7 +93,7 @@ The model is converted to j3o and all necessary files are copied to the project
                                        2. In the Projects Explorer Assets node, select the model that you want to import.
                                        3. -
                                        4. Double-click the model or right-click and select "Convert to JME binary" from the context-menu.
                                          +
                                        5. Double-click the model or right-click and select “Convert to JME binary” from the context-menu.
                                        6. In the Projects Explorer Assets node you should see your model j3o file.
                                        7. @@ -112,18 +104,16 @@ The model is converted to j3o and all necessary files are copied to the project

                                        - Note: It is important that you copy the model file and its textures to the correct assets folder before creating the j3o file because the paths for textures (and possibly other things) will be stored as absolute (to the assets folder root) when you convert that model. This means the texture location should not change after the import.

                                        Note: If the SceneViewer doesn't work refer to Troubleshooting jMonkeyEngine3 SDK. -

                                        -

                                        Working With a Model

                                        +

                                        Working With a Model

                                        • Open Windows>SceneExplorer to view sub-nodes of the model
                                          @@ -138,21 +128,19 @@ Note: If the SceneViewer doesn't work refer to -

                                          Notes About Model Assets

                                          +

                                          Notes About Model Assets

                                          - The original OgreXML .mesh.xml, .scene, .material, .skeleton.xml and .blend model files will not be included in the distribution assets.jar file of your distributed game, they are only available in the assets folder so you are able to recreate the .j3o file from the original if you ever come to change it in blender and have to export it again.

                                          -

                                          About the SceneViewer and SceneExplorer window

                                          +

                                          About the SceneViewer and SceneExplorer window

                                          - The SceneViewer and SceneExplorer windows are shared among plugins to save system resources. This means that you will have to keep an eye on what plugin is using the scene right now and what you are actually modifying in these windows.

                                          @@ -162,28 +150,25 @@ Most plugins will deliver their own UI elements to modify the scene so the Scene
                                          -

                                          About the projects AssetManager

                                          +

                                          About the projects AssetManager

                                          -Each jMonkeyEngine SDK project has its own internal AssetManager that has the projects assets folder registered as a FileLocator. When the project is run, the assets folder is compressed into a jar file and added to the projects main jar classpath. This way the editors in jMonkeyEngine SDK and the running game have the same asset folder structure. +Each jMonkeyEngine SDK project has its own internal AssetManager that has the projects assets folder registered as a FileLocator. When the project is run, the assets folder is compressed into a jar file and added to the projects main jar classpath. This way the editors in jMonkeyEngine SDK and the running game have the same asset folder structure.

                                          -You might wonder why jMonkeyEngine SDK requires you to copy the model that is to be converted to j3o into the assets folder before. The Model Import Tool also copies the model and associated files to the project directory before converting. To load the model it needs to be in a folder (or jar etc..) that belongs to the projects AssetManager root. To load a model from some other folder of the filesystem, that folder would have to be added to the AssetManager root. If every folder that contains a model was in the root of the AssetManager, all textures named "hull.jpg" for example would be the same for the AssetManager and it would only deliver the texture of the first model folder that was added. +You might wonder why jMonkeyEngine SDK requires you to copy the model that is to be converted to j3o into the assets folder before. The Model Import Tool also copies the model and associated files to the project directory before converting. To load the model it needs to be in a folder (or jar etc..) that belongs to the projects AssetManager root. To load a model from some other folder of the filesystem, that folder would have to be added to the AssetManager root. If every folder that contains a model was in the root of the AssetManager, all textures named “hull.jpg” for example would be the same for the AssetManager and it would only deliver the texture of the first model folder that was added.

                                          To have a valid jME3 object, the paths to textures and other assets belonging to the model have to be read with the correct, final path that can then be stored in the j3o object. The j3o object will use those paths when it is loaded with the AssetManager and it requires the AssetManager to deliver the assets on those paths, this is why the folder structure while converting has to be the same as when loading.

                                          -
                                          - documentation, - sdk, - tool, - asset, - scene -
                                          + +

                                          +tag_documentation_sdk_tool_asset_scene +

                                          -

                                          view online version

                                          \ No newline at end of file +

                                          view online version

                                          \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/project_creation.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/project_creation.html index 4ba1ce9e1..26c2388f7 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/project_creation.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/project_creation.html @@ -1,15 +1,14 @@ -

                                          jMonkeyEngine SDK: Creating Projects

                                          +

                                          jMonkeyEngine SDK: Creating Projects

                                          - -The jMonkeyEngine SDK makes it easy to get started with developing 3-D games based on the jMonkeyEngine. +The jMonkeyEngine SDK makes it easy to get started with developing 3-D games based on the jMonkeyEngine.

                                          -

                                          Creating a New jMonkeyEngine Project

                                          +

                                          Creating a New jMonkeyEngine Project

                                          1. Choose File > New Project from the main menu.
                                            @@ -30,39 +29,35 @@ The jMonkeyEngine SDK makes
                                          -

                                          Project Structure

                                          +

                                          Project Structure

                                          -

                                          Let's have a look at the abstract project structure in the Project Explorer (ctrl-1). -

                                          • Project Assets node: These directories have been created for you to store your games assets, such as fonts, materials, models, shaders, sounds, and textures. For a newly created project, these directories are empty.
                                          • Source Packages node: This is where you manage your packages and classes. For a newly created project, it contains one package and one class, Main.java. Double click Main.java to open it in the editor.
                                          • -
                                          • Libraries node: An overview of all libraies on your game's classpath. The classpath is already set-up for the jme3 framework (including LWJGL, Bullet, Nifty GUI, etc).
                                            +
                                          • Libraries node: An overview of all libraies on your game's classpath. The classpath is already set-up for the jme3 framework (including LWJGL, Bullet, Nifty GUI, etc).
                                          -

                                          Directory Structure

                                          +

                                          Directory Structure

                                          - Now let's have a look at the project's file structure in the File Explorer (ctrl-2). This explorer shows the physical directory structure on your hard drive. -

                                            -
                                          • assets ??? This directory corresponds to the Project Assets node. It is needed for the assetManager. This is the recommended internal structure:
                                            +
                                          • assets – This directory corresponds to the Project Assets node. It is needed for the assetManager. This is the recommended internal structure:
                                            • assets/Interface
                                            • @@ -82,22 +77,21 @@ Now let's have a look at the project's file structure in the File Expl
                                          • -
                                          • src ??? This directory corresponds to the Source Packages node. Your sources code goes here.
                                            +
                                          • src – This directory corresponds to the Source Packages node. Your sources code goes here.
                                          • -
                                          • nbproject ??? This is meta data used by the jMonkeyEngine SDK (don't edit).
                                            +
                                          • nbproject – This is meta data used by the jMonkeyEngine SDK (don't edit).
                                          • -
                                          • build.xml ??? This is an Ant build script that is hooked up to the clean/build/run/test actions in the jMonkeyEngine SDK. It loads a default build script, and allows you to further customize the build process. The Ant script also assures that you are able to clean/build/run/test your application outside of the jMonkeyEngine SDK ??? e.g. from the command line.
                                            +
                                          • build.xml – This is an Ant build script that is hooked up to the clean/build/run/test actions in the jMonkeyEngine SDK. It loads a default build script, and allows you to further customize the build process. The Ant script also assures that you are able to clean/build/run/test your application outside of the jMonkeyEngine SDK – e.g. from the command line.
                                          • -
                                          • build ??? This directory contains the compiled classes. (Will be generated by the jMonkeyEngine SDK when you build the project.)
                                            +
                                          • build – This directory contains the compiled classes. (Will be generated by the jMonkeyEngine SDK when you build the project.)
                                          • -
                                          • dist ??? This directory contains the executable JAR files. (Will be generated by the jMonkeyEngine SDK when you build the project.)
                                            +
                                          • dist – This directory contains the executable JAR files. (Will be generated by the jMonkeyEngine SDK when you build the project.)
                                          • -
                                          • test ??? The jMonkeyEngine SDK will store JUnit tests here if you create any. (Optional.)
                                            +
                                          • test – The jMonkeyEngine SDK will store JUnit tests here if you create any. (Optional.)

                                          - Project Configuration

                                          @@ -110,16 +104,14 @@ In the Run section, specify the main class of your project. (Pressing F6 runs th In the Run section, you can optionally configure JVM options and command line parameters (in most cases set the-Xms VMOption [NUMBER] m for the memory usage. for example (-Xms500m). see ). In the Application section, specify the game title (by default the game will be named BasicGame). In the Application section, specify the vendor name (your name), a short description, your project's homepage, and a splash screen. -

                                          -

                                          Project Configuration

                                          +

                                          Project Configuration

                                          - Right-Click the project to open the Project properties.

                                            @@ -135,11 +127,10 @@ Right-Click the project to open the Project properties.
                                          -

                                          Clean, Build and Run Cycle

                                          +

                                          Clean, Build and Run Cycle

                                          -

                                          @@ -147,7 +138,6 @@ Right-Click the project to open the Project properties.

                                          Pressing F6 builds & runs the main class of the main project. If there are several classes, or several projects, you have to specify which one you want F6 to run. Right-click a project and choose Set As Main Project, then right-click the project again and choose Properties > Run and choose a Main Class.
                                          To build and run the main() of any file that is open in the editor, press Shift-F6 !

                                          -

                                          • Right-Click the project and use the context-menu to clean all generated classes and JARs.
                                            @@ -159,21 +149,20 @@ To build and run the main() of any file that is open in the editor, pre

                                          - More than one project open? The toolbar buttons and the F-keys are bound to the main project, which is shown in bold in the Project Explorer. Right-click a project and select Set As Main Project to make it respond to the toolbar buttons and F-keys.

                                          -Worried About Proprietary Lock-in? You are never locked into the jMonkeyEngine SDK: At any time, you can change into your project directory on the command line, and clean, build, and run your project, using non-proprietary Apache Ant commands: +Worried About Proprietary Lock-in? You are never locked into the jMonkeyEngine SDK: At any time, you can change into your project directory on the command line, and clean, build, and run your project, using non-proprietary Apache Ant commands:

                                          ant clean; ant jar; ant run;
                                          -

                                          Development Process

                                          +

                                          Development Process

                                            -
                                          • Creating new files and packages: Select the Source Packages node (or any of its subnodes), and press ctrl-N (File???New File): Use the New File wizard to create new Java classes, Java packages, Java beans, Swing forms, JUnit files, j3m Materials, j3o scenes, j3f filters, and many more.
                                            +
                                          • Creating new files and packages: Select the Source Packages node (or any of its subnodes), and press ctrl-N (File→New File): Use the New File wizard to create new Java classes, Java packages, Java beans, Swing forms, JUnit files, j3m Materials, j3o scenes, j3f filters, and many more.
                                          • Editing files: Open the Projects Explorer and double-click a Java file from the Source Packages to open it in the Editor. The jMonkeyEngine SDK Code Editor assists you in many ways, including syntactic and semantic code coloring, code completion, and javadoc. (More...)
                                          • @@ -193,11 +182,10 @@ To build and run the main() of any file that is open in the editor, pre
                                          -

                                          Adding external jar libraries

                                          +

                                          Adding external jar libraries

                                          - You may want to use external Java libraries in your jME project, for example content generators or artificial intelligence implementations.

                                          @@ -205,41 +193,39 @@ You may want to use external Java libraries in your jME project, for example con Add the library to the global library list:

                                            -
                                          • Select Tools???Libraries in the main menu.
                                            +
                                          • Select Tools→Libraries in the main menu.
                                          • -
                                          • Click "New Library", enter a name for the library, and press OK
                                            +
                                          • Click “New Library”, enter a name for the library, and press OK
                                          • -
                                          • In the "Classpath" tab, press "Add JAR/Folder" and select the jar file(s) needed for the library
                                            +
                                          • In the “Classpath” tab, press “Add JAR/Folder” and select the jar file(s) needed for the library
                                          • -
                                          • (Optional) In the "JavaDoc" tab, press "Add ZIP/Folder" and select the javadoc for the library, as zip file or folder.
                                            +
                                          • (Optional) In the “JavaDoc” tab, press “Add ZIP/Folder” and select the javadoc for the library, as zip file or folder.
                                          • -
                                          • (Optional) In the "Sources" tab you can select a folder or jar file containing the source files of the library.
                                            +
                                          • (Optional) In the “Sources” tab you can select a folder or jar file containing the source files of the library.
                                          • Press OK

                                          - Add the library to a project:

                                            -
                                          • Right-Click your project and select "Properties"
                                            +
                                          • Right-Click your project and select “Properties”
                                          • -
                                          • Select "Libaries" on the left and then press "Add Library"
                                            +
                                          • Select “Libaries” on the left and then press “Add Library”
                                          • Select the library from the list and press OK

                                          - -That's it, your project can now use the external library. If you also linked the javadoc and sources, the SDK will assist you with javadoc popups, code completion (ctrl-space) and source navigation (ctrl-click). +That's it, your project can now use the external library. If you also linked the javadoc and sources, the SDK will assist you with javadoc popups, code completion (ctrl-space) and source navigation (ctrl-click).

                                          -

                                          Application Deployment

                                          +

                                          Application Deployment

                                          • You can deploy your game as desktop application (JAR), browser applet, WebStart (JNLP), or on the Android platform. (More...)
                                            @@ -248,12 +234,11 @@ That's it, your project can now use the external library. If you also linke
                                          -

                                          Running Sample Projects

                                          +

                                          Running Sample Projects

                                          - -The SDK contains Sample Code (read more). +The SDK contains Sample Code (read more).

                                          @@ -263,18 +248,16 @@ Open the Source Packages node of the JmeTests project.

                                        • Right-click the JME3Tests project and choose Run.
                                          Choose samples from the TestChooser and try out the included demos.
                                        • -
                                        • Browse a demo's source code in the SDK's Project window to learn how a feature is implemented and used.
                                          +
                                        • Browse a demo's source code in the SDK's Project window to learn how a feature is implemented and used.
                                        • Feel free to modify the code samples and experiment! If you break something, you can always recreate the packaged samples from the JME3 Tests template.
                                        - + +

                                        +tag_documentation_project_deployment_sdk +

                                        -

                                        view online version

                                        \ No newline at end of file +

                                        view online version

                                        \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/scene_composer.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/scene_composer.html index 704bf7ec3..3493c4b6e 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/scene_composer.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/scene_composer.html @@ -1,10 +1,9 @@ -

                                        jMonkeyEngine SDK: Scene Composer

                                        +

                                        jMonkeyEngine SDK: Scene Composer

                                        - -SceneComposer allows you to edit scenes stored in j3o files and add content or modify existing content. Please note that the Scene Composer and Explorer are a work in progress and will provide more powerful functions in the future. Also other plugins will allow creation of more specific game type scenes in jMonkeyEngine SDK. +SceneComposer allows you to edit scenes stored in j3o files and add content or modify existing content. Please note that the Scene Composer and Explorer are a work in progress and will provide more powerful functions in the future. Also other plugins will allow creation of more specific game type scenes in jMonkeyEngine SDK.

                                        @@ -13,7 +12,7 @@ Most buttons in the SceneComposer have tooltips that appear when you hover the m

                                        -

                                        Mouse/Cursor Controls

                                        +

                                        Mouse/Cursor Controls

                                        • Left-click and drag to rotate the camera around the cam center
                                          @@ -29,39 +28,36 @@ Most buttons in the SceneComposer have tooltips that appear when you hover the m

                                        - In the SceneComposer toolbar are buttons to snap the camera to the cursor, snap the cursor to the selection and etc.

                                        -

                                        Creating a scene file

                                        +

                                        Creating a scene file

                                        - -The jMonkeyEngine SDK stores the scene in a j3o file, this binary file contains the whole scenegraph including all settings for spatials, materials, physics, effects etc. Textures are not stored in the j3o file but as absolute locators to the textures. +The jMonkeyEngine SDK stores the scene in a j3o file, this binary file contains the whole scenegraph including all settings for spatials, materials, physics, effects etc. Textures are not stored in the j3o file but as absolute locators to the textures.

                                        To create a blank scene file do the following:

                                          -
                                        1. Right click the "Scenes" folder in your Project Assets and select "New???Other"
                                          +
                                        2. Right click the “Scenes” folder in your Project Assets and select “New→Other”
                                        3. -
                                        4. Select "Scene" to the left then select "Empty jME3 Scene" and press "Next"
                                          +
                                        5. Select “Scene” to the left then select “Empty jME3 Scene” and press “Next”
                                        6. -
                                        7. Enter a file name for your scene like "MyScene" and press "OK"
                                          +
                                        8. Enter a file name for your scene like “MyScene” and press “OK”
                                        -

                                        Loading the scene

                                        +

                                        Loading the scene

                                        -

                                        @@ -71,12 +67,11 @@ To open a scene
                                        1. In the Project Explorer, right-click the *.j3o file of the scene
                                        2. -
                                        3. Choose "Open in SceneComposer"
                                          +
                                        4. Choose “Open in SceneComposer”

                                        - Now the SceneComposer window opens at the bottom and displays the scene in the SceneViewer. The SceneExplorer displays the contained scene graph as a tree and when selecting a node, you can edit the properties of the corresponding scene graph object in the Properties window.

                                        @@ -86,54 +81,49 @@ For now, you only see the cursor in the SceneViewer and a single node (the root
                                        -

                                        Adding light to the scene

                                        +

                                        Adding light to the scene

                                        1. Select the root node in the SceneExplorer
                                        2. -
                                        3. Select "Directional Light" in the SceneComposer window
                                          +
                                        4. Select “Directional Light” in the SceneComposer window
                                        5. -
                                        6. Press the "+" button in the SceneComposer window
                                          +
                                        7. Press the “+” button in the SceneComposer window

                                        - A directional light has been added to your scene, you can see it in the SceneExplorer.

                                        -

                                        Adding effects etc. to the scene

                                        +

                                        Adding effects etc. to the scene

                                        - You can add a variety of special objects with the SceneComposer, including lights, effects, audio etc. -

                                        1. Select root Node in the SceneExplorer
                                        2. Select the object type in the list displayed in the SceneComposer window
                                        3. -
                                        4. Press the "+ cursor" button in the SceneComposer window
                                          +
                                        5. Press the “+ cursor” button in the SceneComposer window
                                        -

                                        Adding Models to the scene

                                        +

                                        Adding Models to the scene

                                        -

                                        You can directly import 3d models to your scene so that they will be part of your scene file. To be able to import for example an OgreXML file, first export it from your 3D editor to a separate folder in the assets folder of your project (e.g. assets/Models/MyModel/). -

                                        1. Place the SceneComposer cursor where you want the model to be
                                          @@ -142,12 +132,11 @@ You can directly import 3d models to your scene so that they will be part of you
                                        2. In the Project Explorer right-click the model file you want to import
                                        3. -
                                        4. Choose "Add to SceneComposer"
                                          +
                                        5. Choose “Add to SceneComposer”

                                        - Note that when importing a model the texture paths are stored absolute, so the folder you import the model from will later only be a textures folder because the original model file is not included in the release.

                                        @@ -157,13 +146,11 @@ Also note that when adding models this way, changes in the original model file w
                                        -

                                        Linking Models to the scene

                                        +

                                        Linking Models to the scene

                                        - You can also link models/objects into your scene, this way they are reloaded dynamically from the other/original file. -

                                        1. Place the SceneComposer cursor where you want the model to be
                                          @@ -172,37 +159,31 @@ You can also link models/objects into your scene, this way they are reloaded dyn
                                        2. In the Project Explorer right-click the model file you want to link
                                        3. -
                                        4. Choose "Link in SceneComposer"
                                          +
                                        5. Choose “Link in SceneComposer”

                                        - Note that when linking objects this way, you cannot edit them as part of the scene. To change the model you have to change the original j3o file.

                                        -Also note that although it its possible to directly link external model files (OgreXML, OBJ etc.), this is not recommended. Convert the original file to a j3o file by right-clicking it and selecting "Convert to jME Binary" before linking it. This is required because the original model files are not included in the release version of the application. +Also note that although it its possible to directly link external model files (OgreXML, OBJ etc.), this is not recommended. Convert the original file to a j3o file by right-clicking it and selecting “Convert to jME Binary” before linking it. This is required because the original model files are not included in the release version of the application.

                                        -

                                        Saving the Scene

                                        +

                                        Saving the Scene

                                          -
                                        1. When a scene has been changed, press the "save" button in the main toolbar or press [Ctrl-S] / [Apple-S] to save it.
                                          +
                                        2. When a scene has been changed, press the “save” button in the main toolbar or press [Ctrl-S] / [Apple-S] to save it.
                                        -
                                        - documentation, - sdk, - scene, - node, - asset, - light, - effect -
                                        + +

                                        +tag_documentation_sdk_scene_node_asset_light_effect +

                                        -

                                        view online version

                                        \ No newline at end of file +

                                        view online version

                                        \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/scene_explorer.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/scene_explorer.html index 0761cae9e..9f00f95f4 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/scene_explorer.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/scene_explorer.html @@ -1,5 +1,5 @@ -

                                        jMonkeyEngine SDK: Scene Explorer

                                        +

                                        jMonkeyEngine SDK: Scene Explorer

                                        @@ -8,7 +8,7 @@

                                        -

                                        About the SceneExplorer window

                                        +

                                        About the SceneExplorer window

                                        @@ -21,26 +21,25 @@ Most plugins will deliver their own UI elements to modify the scene so the Scene

                                        -

                                        Using the SceneExplorer

                                        +

                                        Using the SceneExplorer

                                        - The SceneExplorer displays Nodes in a tree that represents the tree of Spatials in your scene. Spatial controls, lights and geometry meshes are also displayed in the tree.

                                        -SceneExplorer works in conjunction with SceneComposer, the default editor for J3O files in the jMonkeyEngine IDE. If SceneExplorer doesn't appear when you select "Edit in SceneComposer", choose Window ??? SceneExplorer from the menu bar to reveal the window. +SceneExplorer works in conjunction with SceneComposer, the default editor for J3O files in the jMonkeyEngine IDE. If SceneExplorer doesn't appear when you select “Edit in SceneComposer”, choose Window → SceneExplorer from the menu bar to reveal the window.

                                        -

                                        Editing Objects in the scene

                                        +

                                        Editing Objects in the scene

                                          -
                                        1. Select a node in the SceneExplorer window (Open via Window???SceneExplorer if not open)
                                          +
                                        2. Select a node in the SceneExplorer window (Open via Window→SceneExplorer if not open)
                                        3. -
                                        4. Edit the node in the Properties window (Open via Window???Properties if not open)
                                          +
                                        5. Edit the node in the Properties window (Open via Window→Properties if not open)
                                        6. You can rename a Spatial by right clicking it or by slowly double-clicking the node
                                        7. @@ -48,7 +47,7 @@ SceneExplorer works in conjunction with SceneComposer, the default editor for J3
                                        -

                                        Reorganizing Objects in the scene

                                        +

                                        Reorganizing Objects in the scene

                                        1. You can cut, copy and paste Nodes in the SceneExplorer with the normal keyboard commands or the right-click menu of the Nodes
                                          @@ -59,21 +58,17 @@ SceneExplorer works in conjunction with SceneComposer, the default editor for J3
                                        -

                                        Adding Objects to the scene

                                        +

                                        Adding Objects to the scene

                                        - Right-click a Spatial or Node in the SceneExplorer to add other Spatials like ParticleEmitters or Lights, you can also add UserData to a Spatial that can be read during runtime.

                                        -
                                        - documentation, - sdk, - tool, - scene, - node -
                                        + +

                                        +tag_documentation_sdk_tool_scene_node +

                                        -

                                        view online version

                                        \ No newline at end of file +

                                        view online version

                                        \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/terrain_editor.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/terrain_editor.html index 7b5a3543e..6457f647a 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/terrain_editor.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/terrain_editor.html @@ -1,5 +1,5 @@ -

                                        jMonkeyEngine SDK: Terrain Editor

                                        +

                                        jMonkeyEngine SDK: Terrain Editor

                                        @@ -9,7 +9,7 @@ The terrain editor lets you create, modify, and paint terrain.

                                        -

                                        Controls

                                        +

                                        Controls

                                        @@ -18,7 +18,7 @@ Terrain controls are the same as the Scene Composer, you rotate the camera with

                                        -

                                        Creating Terrain

                                        +

                                        Creating Terrain

                                        @@ -34,12 +34,12 @@ This will pop up the Create Terrain wizard that will walk you through the steps

                                        -In order to see the terrain, you will need to add light to your scene. To do this, right-click the root node in the SceneExplorer window and select "Add Light???Directional Light" +In order to see the terrain, you will need to add light to your scene. To do this, right-click the root node in the SceneExplorer window and select “Add Light→Directional Light”

                                        -

                                        Step 1: Terrain Size

                                        +

                                        Step 1: Terrain Size

                                        @@ -48,7 +48,7 @@ Here you determine the size of your terrain, the total size and the patch size.

                                        -

                                        Step 2: Heightmap

                                        +

                                        Step 2: Heightmap

                                        @@ -58,7 +58,7 @@ By default, it will give you a flat terrain.

                                        -

                                        Step 3: Alpha Image Detail

                                        +

                                        Step 3: Alpha Image Detail

                                        @@ -67,7 +67,7 @@ This step determines how large the alpha blend images are for your terrain. The

                                        -

                                        Modifying Terrain

                                        +

                                        Modifying Terrain

                                        @@ -90,11 +90,10 @@ Once a tool is selected, you will see the tool marker (now an ugly wire sphere)

                                        -

                                        Painting Terrain

                                        +

                                        Painting Terrain

                                        - Your terrain comes with one diffuse default texture, and you can have up to 12 total diffuse textures. It also allows you to add normal maps to each texture layer. There can be a maximum of 13 textures, including Diffuse and Normal (3 textures are taken up by alpha maps).

                                        @@ -111,11 +110,10 @@ There are two sliders that affect how the paint tool operates:
                                        -

                                        Adding a new texture layer

                                        +

                                        Adding a new texture layer

                                        - Adds a new texture layer to the terrain. The will be drawn over top of the other texture layers listed above it in the list.

                                        @@ -125,11 +123,10 @@ Adds a new texture layer to the terrain. The will be drawn over top of the other
                                        -

                                        Changing the diffuse texture

                                        +

                                        Changing the diffuse texture

                                        - Click on the diffuse texture image in the texture table. This will pop up a window with the available textures in your assets directory.

                                        @@ -139,7 +136,7 @@ Click on the diffuse texture image in the texture table. This will pop up a wind
                                        -

                                        Adding a normal map to the texture layer

                                        +

                                        Adding a normal map to the texture layer

                                        @@ -150,7 +147,7 @@ When you add a texture layer, by default it does not add a normal map for you. T

                                        -

                                        Removing a normal map from the texture layer

                                        +

                                        Removing a normal map from the texture layer

                                        @@ -159,7 +156,7 @@ To remove a normal map from the texture layer, hit the normal map button for tha

                                        -

                                        Changing the texture scale

                                        +

                                        Changing the texture scale

                                        @@ -173,11 +170,10 @@ Essentially if your scale in normal texture coordinates is 16, then for tri-plan

                                        -

                                        Tri-planar texture mapping

                                        +

                                        Tri-planar texture mapping

                                        - Tri-planar texture mapping is recommended if you have lots of near-vertical terrain. With normal texture mapping the textures can look stretched because it is rendered on the one plane: X-Z. Tri-planar mapping renders the textures on three planes: X-Z, X-Y, Z-Y; and blends them together based on what plane the normal of the triangle is facing most on. This makes the terrain look much better, but it does have a performance hit! Here is an article on tri-planar mapping: @@ -185,7 +181,7 @@ Here is an article on tri-planar mapping: -

                                        Total texture count

                                        +

                                        Total texture count

                                        @@ -195,7 +191,7 @@ Most video cards are limited to 16 texture units (textures), and 3 are used behi

                                        -

                                        Generating Terrain Entropies for LOD

                                        +

                                        Generating Terrain Entropies for LOD

                                        @@ -206,7 +202,7 @@ Note that whenever you modify the height of the terrain, you should re-generate

                                        -

                                        Loading Terrain Into Your Game

                                        +

                                        Loading Terrain Into Your Game

                                        @@ -223,15 +219,11 @@ There are a few things your code needs to do to load the terrain.

                                        TerrainLodControl lodControl = ((Node)terrain).getControl(TerrainLodControl.class);
                                                     if (lodControl != null)
                                                         lodControl.setCamera(getCamera());
                                        - + +

                                        +tag_documentation_sdk_tool_terrain_asset_texture +

                                        -

                                        view online version

                                        \ No newline at end of file +

                                        view online version

                                        \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/troubleshooting.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/troubleshooting.html index 1dc4e395b..1e1844bb5 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/troubleshooting.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/troubleshooting.html @@ -1,76 +1,92 @@ -

                                        Troubleshooting jMonkeyEngine3 SDK

                                        +

                                        Troubleshooting jMonkeyEngine3 SDK

                                        -

                                        Graphics Card Driver

                                        +

                                        Graphics Card Driver

                                        -On Windows and Linux make sure you have the latest driver installed. Make sure its the one supplied by the card manufacturer and not just the OS-default one. On OSX, make sure you have the latest update for your MacOS. - +On Windows and Linux make sure you have the latest driver installed. Make sure its the one supplied by the card manufacturer and not just the OS-default one. On OSX, make sure you have the latest update for your MacOS.

                                        -

                                        Stability / Graphics issues

                                        +

                                        Stability / Graphics issues

                                        -On some Linux and Windows systems, the SDK might perform unstable and quit with native VM crashes or "x errors". There are a few things one can try to remedy those issues. +On some Linux and Windows systems, the SDK might perform unstable and quit with native VM crashes or “x errors”. There are a few things one can try to remedy those issues.

                                        -

                                        Heavyweight Canvas

                                        +

                                        Heavyweight Canvas

                                        -First of all theres the new ???OpenGL??? settings page in the SDK global settings where you can enable the "heavyweight" canvas, which solved some issues for some people. The settings panel can be found under Tools???Options on Windows and Linux and in the main menu (or by pressing Apple-Comma) for MacOSX. +First of all theres the new “OpenGL” settings page in the SDK global settings where you can enable the “heavyweight” canvas, which solved some issues for some people. The settings panel can be found under Tools→Options on Windows and Linux and in the main menu (or by pressing Apple-Comma) for MacOSX.

                                        -If you cannot start the SDK, edit the file config/Preferences/com/jme3/gde/core.properties in the SDK settings folder (see above). If it doesn't exist, create the file including all folders. Add the line use_lwjgl_canvas=true. To try OpenGL1 compatibility mode (works for both canvas settings) add use_opengl_1=true. +If you cannot start the SDK, edit the file config/Preferences/com/jme3/gde/core.properties in the SDK settings folder (see above). If it doesn't exist, create the file including all folders. Add the line use_lwjgl_canvas=true. To try OpenGL1 compatibility mode (works for both canvas settings) add use_opengl_1=true.

                                        -

                                        Look and Feel

                                        +

                                        Look and Feel

                                        -The OS-built-in look and feel might cause issues, you can change the LAF by using the appropriate command line switch (or add it to the [app folder]/etc/jmonkeyplatform.conf file, without the "- -" prefix). +The OS-built-in look and feel might cause issues, you can change the LAF by using the appropriate command line switch (or add it to the [app folder]/etc/jmonkeyplatform.conf file, without the “- -” prefix). +

                                        +
                                        --laf javax.swing.plaf.nimbus.NimbusLookAndFeel
                                        +

                                        +or alternatively

                                        --laf javax.swing.plaf.metal.MetalLookAndFeel
                                        -

                                        Compiz

                                        +

                                        Compiz

                                        -Compiz on Linux might cause issues, if you set its rendering quality to "medium" these should go away. -* Appearance???Set Special effects to ??? ???Medium??? +Compiz on Linux might cause issues, if you set its rendering quality to “medium” these should go away. +* Appearance→Set Special effects to → “Medium”

                                        - -

                                        Updating problems

                                        + +

                                        Updating problems

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

                                        + +

                                        +If you are on Linux, check if the user you run the SDK with has access to the files in jmonkeyplatform/jdk/bin and that they are executable.

                                        - -

                                        Preferences and Settings

                                        + +

                                        Freezing / Performance problems

                                        -To completely remove and/or reinstall the SDK it is vital that the settings folder is deleted too. The location can be seen through the "about" menu and is as following for the different OS's: +If the SDK starts to become sluggish and / or slow or you get unexpected freezes of the application, you can try deleting the cache folder at var/cache in the settings folder (see below for the location of the settings folder). Do this while the SDK is not running, then restart the SDK. +

                                        + +
                                        + +

                                        Preferences and Settings

                                        +
                                        + +

                                        +To completely remove and/or reinstall the SDK it is vital that the settings folder is deleted too. The location can be seen through the “about” menu and is as following for the different OS's:

                                        • Windows: C:\Users\<username>\AppData\Roaming\.jmonkeyplatform
                                          @@ -84,63 +100,76 @@ To completely remove and/or reinstall the -

                                          Log

                                          + +

                                          Log

                                          -To see or post the error output of the SDK in the forum, you can find the log of the application in the settings folder above too, the file is called var/log/messages.log +To see or post the error output of the SDK in the forum, you can find the log of the application in the settings folder above too, the file is called var/log/messages.log

                                          - -

                                          Getting error messages and reporting issues

                                          + +

                                          Getting error messages and reporting issues

                                          -When an exception happens in the SDK, a small warning sign appears in the lower right corner of the main window. Double-click it to open a window that allows you to see the exception stack trace. When posting about issues in the forum, always post the stack trace along with a description of what happens and how it can be reproduced. +When an exception happens in the SDK, a small warning sign appears in the lower right corner of the main window. Double-click it to open a window that allows you to see the exception stack trace. When posting about issues in the forum, always post the stack trace along with a description of what happens and how it can be reproduced.

                                          - -

                                          Specifying the JDK location

                                          + +

                                          Specifying the JDK location

                                          - -You can install another JDK for use with the jMonkey SDK. You then have to specify the location manually. - +You can install another JDK for use with the jMonkey SDK. You then have to specify the location manually.

                                            -
                                          1. Go to your jMonkeyEngine SDK installation directory.
                                            -Mac users right-click jMonkeyApplication.app (which actually is a directory) in the Finder and select "Show package contents".
                                            +
                                          2. Go to your jMonkeyEngine SDK installation directory.
                                            +Mac users right-click jMonkeyApplication.app (which actually is a directory) in the Finder and select “Show package contents”.
                                          3. Navigate to the etc directory.
                                            Mac users navigate to Contents/Resources/jmonkeyplatform/etc/.
                                          4. Open the file jmonkeyplatform.conf in a text editor.
                                          5. -
                                          6. Uncomment the following line and enter the path to the JDK:
                                            jdkhome="/path/to/jdk"
                                            +
                                          7. Uncomment the following line and enter the path to the JDK:
                                            jdkhome="/path/to/jdk"
                                          - -

                                          Known Issues

                                          + +

                                          Freezing at startup

                                          +
                                          + +

                                          +If you're behind a proxy or special network settings, try : +

                                          +
                                          1. disable your network connection
                                          +2. launch jme sdk (may wait 30s/1min for timeout)
                                          +3. go into tools->options->general
                                          +4. setup “manual proxy settings” (for some reason the “Use System Proxy Settings” option doesn't work on some Linux distributions)
                                          + +

                                          + +

                                          + +
                                          + +

                                          Known Issues

                                          For a list of known issues and possible workarounds see the following link:

                                          -
                                          - documentation, - tool, - sdk, - faq -
                                          + +

                                          +tag_documentation_tool_sdk_faq +

                                          - -

                                          view online version

                                          \ No newline at end of file + +

                                          view online version

                                          \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/use_own_jme.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/use_own_jme.html index ee739e17f..c979ba5f3 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/use_own_jme.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/use_own_jme.html @@ -1,5 +1,5 @@ -

                                          How to integrate your own jME3 compile in jMonkeyEngine SDK projects

                                          +

                                          How to integrate your own jME3 compile in jMonkeyEngine SDK projects

                                          1. @@ -8,37 +8,35 @@
                                          2. Compile jme3 project
                                          3. -
                                          4. Go to Tools ??? Libraries
                                            +
                                          5. Go to Tools → Libraries
                                          6. -
                                          7. Press "New Library"
                                            +
                                          8. Press “New Library”
                                          9. -
                                          10. Name it "jme3-modified"
                                            +
                                          11. Name it “jme3-modified”
                                          12. -
                                          13. Press "Add Jar/Folder"
                                            +
                                          14. Press “Add Jar/Folder”
                                          15. Select all JAR files from the dist dir of the compiled jme3 version
                                          16. -
                                          17. Add the src folder of the jme3 project in the "sources" tab
                                            +
                                          18. Add the src folder of the jme3 project in the “sources” tab
                                          19. -
                                          20. Optionally javadoc in the "javadoc" tab
                                            +
                                          21. Optionally javadoc in the “javadoc” tab
                                          22. -
                                          23. Press "OK"
                                            +
                                          24. Press “OK”
                                          25. -
                                          26. Right-click your project and select "Properties"
                                            +
                                          27. Right-click your project and select “Properties”
                                          28. -
                                          29. Select "Libraries" to the left
                                            +
                                          30. Select “Libraries” to the left
                                          31. -
                                          32. Remove the "jme3" library
                                            +
                                          33. Remove the “jme3” library
                                          34. -
                                          35. Press "Add Library" and select the "jme3-modified" library
                                            +
                                          36. Press “Add Library” and select the “jme3-modified” library
                                          - + +

                                          +tag_documentation_sdk_project_builds +

                                          -

                                          view online version

                                          \ No newline at end of file +

                                          view online version

                                          \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/vehicle_creator.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/vehicle_creator.html index b1b78f4b7..a69e9aac4 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/vehicle_creator.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/vehicle_creator.html @@ -1,41 +1,39 @@ -

                                          jMonkeyEngine SDK: Vehicle Creator

                                          +

                                          jMonkeyEngine SDK: Vehicle Creator

                                          - Best results when car is facing in z direction (towards you).

                                          -

                                          Usage

                                          +

                                          Usage

                                            -
                                          1. Select a j3o that contains a vehicle model and press the vehicle button (or right-click ??? edit vehicle)
                                            +
                                          2. Select a j3o that contains a vehicle model and press the vehicle button (or right-click → edit vehicle)
                                          3. The VehicleCreator automatically adds a PhysicsVehicleControl to the rootNode of the model if there is none
                                          4. -
                                          5. Select the Geometry or Node that contains the chassis in the SceneExplorer and press "create hull shape from selected"
                                            +
                                          6. Select the Geometry or Node that contains the chassis in the SceneExplorer and press “create hull shape from selected”
                                          7. -
                                          8. Select a Geometry that contains a wheel and press "make selected spatial wheel", select the "front wheel" checkboxes for front wheels
                                            +
                                          9. Select a Geometry that contains a wheel and press “make selected spatial wheel”, select the “front wheel” checkboxes for front wheels
                                          10. Do so for all wheels

                                          - New wheels will get the current suspension settings, you can edit single wheels via the SceneExplorer (update VehicleControl if wheels dont show up) or apply settings created with the settings generator to wheel groups.

                                          -Press the "test vehicle" button to drive the vehicle, use WASD to control, Enter to reset. +Press the “test vehicle” button to drive the vehicle, use WASD to control, Enter to reset.

                                          -

                                          Known Issues

                                          +

                                          Known Issues

                                          @@ -44,32 +42,26 @@ Don't save while testing the vehicle, you will save the location and accele

                                          -

                                          Code Sample

                                          +

                                          Code Sample

                                          - Code Example to load vehicle: -

                                          //load vehicle and access VehicleControl
                                           Spatial car=assetManager.loadModel("Models/MyCar.j3o");
                                           VehicleControl control=car.getControl(VehicleControl.class);
                                           rootNode.attachChild(car);
                                           physicsSpace.add(control);
                                          -??
                                          + 
                                           //then use the control to control the vehicle:
                                           control.setPhysicsLocation(new Vector3f(10,2,10));
                                           control.accelerate(100);
                                          - + +

                                          +tag_documentation_sdk_tool_asset_editor_physics +

                                          -

                                          view online version

                                          \ No newline at end of file +

                                          view online version

                                          \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/version_control.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/version_control.html index 8ac499545..b0c0bbb70 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/version_control.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/version_control.html @@ -1,37 +1,34 @@ -

                                          jMonkeyEngine SDK: Version Control

                                          +

                                          jMonkeyEngine SDK: Version Control

                                          - -Whether you work in a development team or alone: File versioning is a handy method to keep your code consistent, compare files line-by-line, and even roll back unwanted changes. This documentation shows you how to make the most of the SDK's integrated version control features for Subversion, Mercurial, and Git. +Whether you work in a development team or alone: File versioning is a handy method to keep your code consistent, compare files line-by-line, and even roll back unwanted changes. This documentation shows you how to make the most of the SDK's integrated version control features for Subversion, Mercurial, and Git.

                                          For every team member, the file versioning workflow is as follows:

                                            -
                                          1. Once: Download a working copy of the project from the repository ("checkout").
                                            +
                                          2. Once: Download a working copy of the project from the repository (“checkout”).
                                          3. -
                                          4. Regularly: Upload your own changes to the repository ("commit").
                                            +
                                          5. Regularly: Upload your own changes to the repository (“commit”).
                                          6. -
                                          7. Regularly: Download updates by others from the repository ("update").
                                            +
                                          8. Regularly: Download updates by others from the repository (“update”).

                                          - -Note: Since the jMonkeyEngine SDK is based on the NetBeans Platform framework, you can learn about certain jMonkeyEngine SDK features by reading the corresponding NetBeans IDE tutorials (in the "see also links"). +Note: Since the jMonkeyEngine SDK is based on the NetBeans Platform framework, you can learn about certain jMonkeyEngine SDK features by reading the corresponding NetBeans IDE tutorials (in the “see also links”).

                                          -

                                          Version Control Systems

                                          +

                                          Version Control Systems

                                          - -The jMonkeyEngine SDK supports various Version Control Systems such as Subversion, Mercurial, and Git. No matter which of them you use, they all share a common user interface. +The jMonkeyEngine SDK supports various Version Control Systems such as Subversion, Mercurial, and Git. No matter which of them you use, they all share a common user interface.

                                          @@ -40,11 +37,10 @@ You can use file versioning alone or in a team. The advantages are that you can

                                          -

                                          Creating a Repository (Upload)

                                          +

                                          Creating a Repository (Upload)

                                          - Requirements:

                                            @@ -65,12 +61,10 @@ Requirements:

                                          - Now you create a repository to store your project's files. -

                                            -
                                          1. In the jMonkeyEngine SDK, right-click the project in the Projects window and choose Versioning > Import Into Subversion Repository (or initialize Mercurial Project, etc, respectively).
                                            +
                                          2. In the jMonkeyEngine SDK, right-click the project in the Projects window and choose Versioning > Import Into Subversion Repository (or initialize Mercurial Project, etc, respectively).
                                            • Tip: If you haven't evaluated yet which system to choose, start with Subversion for now.
                                            • @@ -82,20 +76,18 @@ Now you create a repository to store your project's files.
                                          -

                                          Checking Out a Repository (Download)

                                          +

                                          Checking Out a Repository (Download)

                                          - You and your team mates check out (download) the repository to their individual workstations. -

                                          1. Go to the Team menu and choose Subversion > Checkout (or Git or Mercurial respectively)
                                          2. Fill in your repo data into the wizard and click Finish.
                                              -
                                            • A typical repository URL looks like this example:
                                              +
                                            • A typical repository URL looks like this example:
                                            • If you want to be able to submit changes, you must have a username and password to this repository. Otherwise leave these fields blank.
                                            • @@ -112,19 +104,16 @@ You and your team mates check out (download) the repository to their individual

                                          - Of course you can also check out existing repositories and access code from other open-source projects (e.g. SourceForge, GoogleCode, dev.java.net).

                                          -

                                          Updating and Committing Changes (Send and Receive)

                                          +

                                          Updating and Committing Changes (Send and Receive)

                                          - Receiving the latest changes from the team's repository is referred to as updating. Sending your changes to the team's repository is refered to as commiting. -

                                          1. Before making changes, right-click the project and select Subversion > Update to make sure you have the latest revision.
                                            @@ -139,7 +128,7 @@ Receiving the latest changes from the team's repository is referred to as <
                                          2. Look at the red/green/blue marks in the editor to review what you have deleted/added/changed. Click the marks to review all differences in a file.
                                          3. -
                                          4. Choose Subversion > Show Changes to see all files that were recently changed ??? by you and other team members.
                                            +
                                          5. Choose Subversion > Show Changes to see all files that were recently changed – by you and other team members.
                                          6. Update again in case your team mates made changes while you were reviewing.
                                          7. @@ -149,7 +138,7 @@ Receiving the latest changes from the team's repository is referred to as <
                                          8. Write a commit message describing what you changed.
                                              -
                                            • Remember, you are writing "a message to your future self". Never write redundant stuff like "I changed something".
                                              +
                                            • Remember, you are writing “a message to your future self”. Never write redundant stuff like “I changed something”.
                                          9. @@ -157,10 +146,10 @@ Receiving the latest changes from the team's repository is referred to as <
                                          -

                                          Comparing and Reverting Changes

                                          +

                                          Comparing and Reverting Changes

                                            -
                                          • If you and another committer edited the same line, there is a conflict, and the jMonkeyEngine SDK will show an error message.
                                            +
                                          • If you and another committer edited the same line, there is a conflict, and the jMonkeyEngine SDK will show an error message.
                                            • Right-click a file Choose Subversion > Resolve Conflict
                                                @@ -188,38 +177,33 @@ Receiving the latest changes from the team's repository is referred to as <
                                          -

                                          No Version Control? Local History!

                                          +

                                          No Version Control? Local History!

                                          - If you do not use any version control, you can still track changes in projects to a certain degree. -

                                          • Right-click a file or directory and choose Local History to show or revert changes, or undelete files.
                                          • You can also select any two files in the Project window and choose Tools > Diff to compare them.
                                          • -
                                          • Local History only works for files edited in jMonkeyEngine SDK Projects (It does not work for other files, e.g. in the Favorites window.)
                                            +
                                          • Local History only works for files edited in jMonkeyEngine SDK Projects (It does not work for other files, e.g. in the Favorites window.)

                                          See also: -

                                          - + +

                                          +tag_documentation_sdk_editor_tool +

                                          -

                                          view online version

                                          \ No newline at end of file +

                                          view online version

                                          \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/welcome/3_0rc3.html b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/welcome/3_0rc3.html index 549e56239..c420356ac 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/welcome/3_0rc3.html +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/sdk/welcome/3_0rc3.html @@ -1,22 +1,22 @@ -

                                          Welcome to the jMonkeyEngine SDK

                                          +

                                          Welcome to the jMonkeyEngine SDK

                                          -You are running an experimental build or nightly version of the SDK (jMonkeyEngine SDK 3.0RC3-pre-svn) +You are running an experimental build or nightly version of the SDK (jMonkeyEngine SDK 3.0RC3-pre-svn)

                                          -This place will be updated with the latest news about the SDK, see below how you can check for incremental updates. +This place will be updated with the latest news about the SDK, see below how you can check for incremental updates.

                                          -

                                          Getting Started

                                          +

                                          Getting Started

                                          -Press the "New Project" button to create a new Project. Press the "New File" button to create new java files, materials, scenes, fonts and other files. +Press the “New Project” button to create a new Project. Press the “New File” button to create new java files, materials, scenes, fonts and other files.

                                          @@ -25,11 +25,11 @@ Press the "New Project" button to create a new Project. Press the &quo

                                          -

                                          Tutorials / Manual

                                          +

                                          Tutorials / Manual

                                          -By pressing "F1" you can open the manual which contains up to date tutorials, documentation and more to help you get started. You can search the manual contents via the search field up right. +By pressing “F1” you can open the manual which contains up to date tutorials, documentation and more to help you get started. You can search the manual contents via the search field up right.

                                          @@ -38,7 +38,7 @@ By pressing "F1" you can open the manual which contains up to date tut

                                          -

                                          Updates

                                          +

                                          Updates

                                          @@ -51,13 +51,13 @@ You can check for incremental updates to the application via the Help menu:

                                          -

                                          Troubleshooting

                                          +

                                          Troubleshooting

                                          -If you experience problems or instability issues with the SDK, click here to see common troubleshooting tips. +If you experience problems or instability issues with the SDK, click here to see common troubleshooting tips.

                                          -

                                          view online version

                                          \ No newline at end of file +

                                          view online version

                                          \ No newline at end of file diff --git a/sdk/jme3-documentation/src/com/jme3/gde/docs/wiki-download-index.properties b/sdk/jme3-documentation/src/com/jme3/gde/docs/wiki-download-index.properties index 1838dbf47..b1034ba6e 100644 --- a/sdk/jme3-documentation/src/com/jme3/gde/docs/wiki-download-index.properties +++ b/sdk/jme3-documentation/src/com/jme3/gde/docs/wiki-download-index.properties @@ -1,5 +1,5 @@ javahelp_path = com/jme3/gde/docs -wiki_url = http://hub.jmonkeyengine.org/wiki/doku.php/ +wiki_url = http://wiki.jmonkeyengine.org/doku.php/ wiki_pages = sdk:project_creation,\ sdk:3ds_to_blender_to_jmp,\ sdk:application_deployment,\ diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/dialog/AddAttributeDialog.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/dialog/AddAttributeDialog.java index 9135e73b2..972f7e2e7 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/dialog/AddAttributeDialog.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/dialog/AddAttributeDialog.java @@ -13,6 +13,7 @@ import javax.swing.DefaultComboBoxModel; * * @author Nehon */ +@SuppressWarnings({"unchecked", "rawtypes"}) public class AddAttributeDialog extends javax.swing.JDialog { private Diagram diagram; diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/dialog/AddMaterialParameterDialog.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/dialog/AddMaterialParameterDialog.java index c97ef8585..be1242009 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/dialog/AddMaterialParameterDialog.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/dialog/AddMaterialParameterDialog.java @@ -14,6 +14,7 @@ import javax.swing.DefaultComboBoxModel; * * @author Nehon */ +@SuppressWarnings({"unchecked", "rawtypes"}) public class AddMaterialParameterDialog extends javax.swing.JDialog { private Diagram diagram; diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/dialog/AddNodeDialog.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/dialog/AddNodeDialog.java index cb9602553..ca185eb4a 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/dialog/AddNodeDialog.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/dialog/AddNodeDialog.java @@ -28,7 +28,7 @@ import javax.swing.tree.TreeSelectionModel; /** * - * @author m327836 + * @author Nehon */ public class AddNodeDialog extends javax.swing.JDialog { diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/dialog/AddWorldParameterDialog.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/dialog/AddWorldParameterDialog.java index c77499773..277f04d1b 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/dialog/AddWorldParameterDialog.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/dialog/AddWorldParameterDialog.java @@ -13,6 +13,7 @@ import javax.swing.DefaultComboBoxModel; * * @author Nehon */ +@SuppressWarnings({"unchecked", "rawtypes"}) public class AddWorldParameterDialog extends javax.swing.JDialog { private Diagram diagram; diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/Bundle.properties b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/Bundle.properties new file mode 100644 index 000000000..64e6fb8b9 --- /dev/null +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/Bundle.properties @@ -0,0 +1,5 @@ +ShaderEditPanel.closeButton.text= +ShaderEditPanel.shaderEditorPane.text= +ShaderEditPanel.closeButton.toolTipText=Close this panel +ShaderEditPanel.jToggleButton1.text=jToggleButton1 +ShaderEditPanel.headerText.text=jLabel1 diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/Diagram.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/Diagram.java index 4befb01c6..fcd851ed6 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/Diagram.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/Diagram.java @@ -134,7 +134,11 @@ public class Diagram extends JPanel implements MouseListener, MouseMotionListene } repaint(); } - + + protected void showEdit(NodePanel node) { + parent.showShaderEditor(node.getName(),node.getType(),node.filePaths); + } + public void notifyMappingCreation(Connection conn) { parent.makeMapping(conn); } diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/DraggablePanel.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/DraggablePanel.java index 73568963b..5ba949c9a 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/DraggablePanel.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/DraggablePanel.java @@ -11,7 +11,7 @@ import javax.swing.JPanel; /** * - * @author m327836 + * @author Nehon */ public class DraggablePanel extends JPanel implements MouseListener, MouseMotionListener { @@ -44,7 +44,7 @@ public class DraggablePanel extends JPanel implements MouseListener, MouseMotion svdey = e.getYOnScreen(); e.consume(); } - + @Override public void mouseReleased(MouseEvent e) { } diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorlElement.form b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorlElement.form index 9c82d4931..2cca23230 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorlElement.form +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorlElement.form @@ -1,6 +1,6 @@ -
                                          + @@ -16,39 +16,72 @@ - + - + - + + + + + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorlElement.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorlElement.java index d7d2229ba..fe2f9b605 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorlElement.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/MatDefEditorlElement.java @@ -56,6 +56,7 @@ import java.awt.Point; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.beans.PropertyVetoException; +import java.io.File; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -69,6 +70,8 @@ import org.netbeans.core.spi.multiview.CloseOperationState; import org.netbeans.core.spi.multiview.MultiViewElement; import org.netbeans.core.spi.multiview.MultiViewElementCallback; import org.openide.awt.UndoRedo; +import org.openide.filesystems.FileObject; +import org.openide.filesystems.FileUtil; import org.openide.nodes.Children; import org.openide.nodes.Node; import org.openide.util.Exceptions; @@ -76,6 +79,7 @@ import org.openide.util.Lookup; import org.openide.util.LookupEvent; import org.openide.util.LookupListener; import org.openide.util.NbBundle.Messages; +import org.openide.util.WeakListeners; import org.openide.util.lookup.InstanceContent; import org.openide.windows.TopComponent; @@ -102,13 +106,16 @@ public final class MatDefEditorlElement extends JPanel implements MultiViewEleme metaData = lkp.lookup(MatDefMetaData.class); assert obj != null; final EditableMatDefFile file = obj.getEditableFile(); - reload(file, lkp); + shaderEditPanel1.setVisible(false); + shaderEditPanel1.setParent(this); + reload(file, lkp); } private void initDiagram(Lookup lkp) throws NumberFormatException { + diagram1.clear(); diagram1.setParent(this); - + Material mat = lkp.lookup(Material.class); ProjectAssetManager manager = obj.getLookup().lookup(ProjectAssetManager.class); @@ -259,6 +266,45 @@ public final class MatDefEditorlElement extends JPanel implements MultiViewEleme Exceptions.printStackTrace(ex); } } + + public void refresh() { + + Lookup.Result resMat = obj.getLookup().lookupResult(Material.class); + Collection col = (Collection) resMat.allInstances(); + if (!col.isEmpty()) { + Material material = col.iterator().next(); + diagram1.refreshPreviews(material); + } + + } + + public void setModified(){ + obj.setModified(true); + } + + public ProjectAssetManager getAssetManager(){ + return obj.getLookup().lookup(ProjectAssetManager.class); + } + + public void showShaderEditor(String nodeName,NodePanel.NodeType type,ListpathList){ + + List fos = new ArrayList(); + for (String path : pathList) { + FileObject text = FileUtil.toFileObject(new File(getAssetManager().getAbsoluteAssetPath(path))); + fos.add(text); + } + shaderEditPanel1.setFiles(nodeName, type, fos); + shaderEditPanel1.revalidate(); + if(!shaderEditPanel1.isVisible() || jSplitPane.getDividerLocation() == jSplitPane.getMinimumDividerLocation()){ + shaderEditPanel1.setVisible(true); + jSplitPane.setDividerLocation(650); + } + + } + + public ShaderEditPanel getShaderEditor(){ + return shaderEditPanel1; + } private Node findNode(Node root, String key) { if (root instanceof Selectable) { @@ -288,38 +334,53 @@ public final class MatDefEditorlElement extends JPanel implements MultiViewEleme // //GEN-BEGIN:initComponents private void initComponents() { + jSplitPane = new javax.swing.JSplitPane(); + shaderEditPanel1 = new com.jme3.gde.materialdefinition.editor.ShaderEditPanel(); jScrollPane1 = new javax.swing.JScrollPane(); diagram1 = new com.jme3.gde.materialdefinition.editor.Diagram(); + jSplitPane.setDividerLocation(1); + jSplitPane.setDividerSize(6); + + shaderEditPanel1.setMinimumSize(new java.awt.Dimension(0, 0)); + jSplitPane.setLeftComponent(shaderEditPanel1); + + jScrollPane1.setMinimumSize(new java.awt.Dimension(0, 0)); + jScrollPane1.setName(""); // NOI18N + diagram1.setBackground(new java.awt.Color(153, 153, 153)); javax.swing.GroupLayout diagram1Layout = new javax.swing.GroupLayout(diagram1); diagram1.setLayout(diagram1Layout); diagram1Layout.setHorizontalGroup( diagram1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 398, Short.MAX_VALUE) + .addGap(0, 1591, Short.MAX_VALUE) ); diagram1Layout.setVerticalGroup( diagram1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 298, Short.MAX_VALUE) + .addGap(0, 782, Short.MAX_VALUE) ); jScrollPane1.setViewportView(diagram1); + jSplitPane.setRightComponent(jScrollPane1); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jScrollPane1) + .addComponent(jSplitPane, javax.swing.GroupLayout.DEFAULT_SIZE, 470, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jScrollPane1) + .addComponent(jSplitPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 333, Short.MAX_VALUE) ); }// //GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables private com.jme3.gde.materialdefinition.editor.Diagram diagram1; private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JSplitPane jSplitPane; + private com.jme3.gde.materialdefinition.editor.ShaderEditPanel shaderEditPanel1; // End of variables declaration//GEN-END:variables @Override @@ -434,15 +495,13 @@ public final class MatDefEditorlElement extends JPanel implements MultiViewEleme } public void notifyAddMapParam(String type, String name) { - MatDefBlock matDef = obj.getLookup().lookup(MatDefBlock.class); - //FIXME add a way to set fixed pipeline function and default value + MatDefBlock matDef = obj.getLookup().lookup(MatDefBlock.class); MatParamBlock param = new MatParamBlock(type, name, null, null); matDef.addMatParam(param); } public void notifyAddWorldParam(String name) { - MatDefBlock matDef = obj.getLookup().lookup(MatDefBlock.class); - //FIXME add a way to set fixed pipeline function and default value + MatDefBlock matDef = obj.getLookup().lookup(MatDefBlock.class); WorldParamBlock param = new WorldParamBlock(name); getTechnique(matDef).addWorldParam(param); } @@ -486,7 +545,7 @@ public final class MatDefEditorlElement extends JPanel implements MultiViewEleme Dot leftDot = findConnectPoint(mapping.getLeftNameSpace(), mapping.getLeftVar(), true); Dot rightDot = findConnectPoint(mapping.getRightNameSpace(), mapping.getRightVar(), false); Connection conn = diagram1.connect(leftDot, rightDot); - mapping.addPropertyChangeListener(conn); + mapping.addPropertyChangeListener(WeakListeners.propertyChange(conn, mapping)); conn.makeKey(mapping, diagram1.getCurrentTechniqueName()); } @@ -573,6 +632,10 @@ public final class MatDefEditorlElement extends JPanel implements MultiViewEleme metaData.setProperty(diagram1.getCurrentTechniqueName() + "/" + key, x + "," + y); } + + public void reload(){ + reload(obj.getEditableFile(), obj.getLookup()); + } private void reload(final EditableMatDefFile file, final Lookup lkp) throws NumberFormatException { if (file.isLoaded()) { diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/NodePanel.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/NodePanel.java index 58e2a7b2d..49f94fe7d 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/NodePanel.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/NodePanel.java @@ -5,6 +5,7 @@ package com.jme3.gde.materialdefinition.editor; import com.jme3.gde.materialdefinition.fileStructure.ShaderNodeBlock; +import com.jme3.gde.materialdefinition.fileStructure.leaves.DefinitionBlock; import com.jme3.gde.materialdefinition.fileStructure.leaves.InputMappingBlock; import com.jme3.gde.materialdefinition.fileStructure.leaves.OutputMappingBlock; import com.jme3.gde.materialdefinition.icons.Icons; @@ -51,6 +52,7 @@ public class NodePanel extends DraggablePanel implements Selectable, PropertyCha private Color color; private String name; private String techName; + protected List filePaths= new ArrayList(); // private List listeners = Collections.synchronizedList(new LinkedList()); // @@ -106,6 +108,9 @@ public class NodePanel extends DraggablePanel implements Selectable, PropertyCha this.addPropertyChangeListener(WeakListeners.propertyChange(node, this)); refresh(node); addKeyListener(this); + this.filePaths.addAll(def.getShadersPath()); + String defPath = ((DefinitionBlock)node.getContents().get(0)).getPath(); + this.filePaths.add(defPath); } /** @@ -311,6 +316,19 @@ public class NodePanel extends DraggablePanel implements Selectable, PropertyCha header.addMouseMotionListener(labelMouseMotionListener); header.setHorizontalAlignment(SwingConstants.LEFT); header.setFont(new Font("Tahoma", Font.BOLD, 11)); + header.addMouseListener(new MouseAdapter() { + + @Override + public void mouseClicked(MouseEvent e) { + //if(e.getClickCount()==2){ + if (type==NodeType.Fragment || type == NodeType.Vertex) { + diagram.showEdit(NodePanel.this); + } + //} + } + + }); + content = new JPanel(); content.setOpaque(false); GroupLayout contentLayout = new GroupLayout(content); diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/OutBusPanel.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/OutBusPanel.java index 2070f0d10..8863b9fd6 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/OutBusPanel.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/OutBusPanel.java @@ -25,7 +25,7 @@ import javax.swing.SwingUtilities; /** * - * @author m327836 + * @author Nehon */ public class OutBusPanel extends DraggablePanel implements ComponentListener, Selectable, InOut { diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/Selectable.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/Selectable.java index 201e30d81..e00746546 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/Selectable.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/Selectable.java @@ -6,7 +6,7 @@ package com.jme3.gde.materialdefinition.editor; /** * - * @author m327836 + * @author Nehon */ public interface Selectable { diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/ShaderEditPanel.form b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/ShaderEditPanel.form new file mode 100644 index 000000000..79d9bbe40 --- /dev/null +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/ShaderEditPanel.form @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/ShaderEditPanel.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/ShaderEditPanel.java new file mode 100644 index 000000000..44b511583 --- /dev/null +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/editor/ShaderEditPanel.java @@ -0,0 +1,244 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.jme3.gde.materialdefinition.editor; + +import com.jme3.gde.materialdefinition.icons.Icons; +import com.jme3.shader.Shader; +import java.awt.Component; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.util.List; +import javax.swing.JPanel; +import javax.swing.JToggleButton; +import javax.swing.text.EditorKit; +import org.openide.filesystems.FileObject; +import org.openide.loaders.DataObject; +import org.openide.loaders.DataObjectNotFoundException; +import org.openide.text.CloneableEditorSupport; +import org.openide.util.Exceptions; + +/** + * + * @author Nehon + */ +public class ShaderEditPanel extends JPanel { + + private DataObject currentDataObject = null; + private MatDefEditorlElement parent = null; + + /** + * Creates new form ShaderEditPanel + */ + public ShaderEditPanel() { + initComponents(); + String mime = "text/x-glsl"; + EditorKit ek = CloneableEditorSupport.getEditorKit(mime); + shaderEditorPane.setEditorKit(ek); + shaderEditorPane.setContentType(mime); + shaderEditorPane.addKeyListener(new KeyListener() { + + public void keyTyped(KeyEvent e) { + currentDataObject.setModified(true); + } + + public void keyPressed(KeyEvent e) { + if ((e.getKeyCode() == KeyEvent.VK_S) && ((e.getModifiers() & KeyEvent.CTRL_MASK) != 0)) { + saveCurrent(); + } + } + + public void keyReleased(KeyEvent e) { + } + }); + } + + public void setParent(MatDefEditorlElement parent) { + this.parent = parent; + } + + public void setFiles(String title, NodePanel.NodeType type, List fos) { + + headerText.setText(title); + headerText.setIcon(Icons.getIconForShaderType(type)); + boolean firstItem = true; + for (Component component : buttonPanel.getComponents()) { + buttonGroup1.remove((JToggleButton) component); + } + buttonPanel.removeAll(); + buttonPanel.repaint(); + + for (FileObject fo : fos) { + final Tab b = new Tab(); + b.setText(fo.getNameExt()); + buttonGroup1.add(b); + try { + b.dataObject = DataObject.find(fo); + b.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + saveCurrent(); + try { + shaderEditorPane.setText(b.dataObject.getPrimaryFile().asText()); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + currentDataObject = b.dataObject; + } + + }); + if (firstItem) { + shaderEditorPane.setText(fo.asText()); + currentDataObject = b.dataObject; + b.setSelected(true); + firstItem = false; + } + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + + buttonPanel.add(b); + } + + } + + public void saveCurrent() { + if (currentDataObject != null && currentDataObject.isModified()) { + try { + OutputStreamWriter out = new OutputStreamWriter(currentDataObject.getPrimaryFile().getOutputStream()); + out.write(shaderEditorPane.getText(), 0, shaderEditorPane.getText().length()); + out.close(); + currentDataObject.setModified(false); + if(currentDataObject.getPrimaryFile().getExt().equalsIgnoreCase("j3sn")){ + parent.reload(); + } + parent.refresh(); + } catch (DataObjectNotFoundException ex) { + Exceptions.printStackTrace(ex); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + } + } + + private class Tab extends JToggleButton { + + DataObject dataObject; + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + buttonGroup1 = new javax.swing.ButtonGroup(); + jScrollPane1 = new javax.swing.JScrollPane(); + shaderEditorPane = new javax.swing.JEditorPane(); + header = new javax.swing.JPanel(); + headerText = new javax.swing.JLabel(); + closeButton = new javax.swing.JButton(); + buttonPanel = new javax.swing.JPanel(); + jToggleButton1 = new javax.swing.JToggleButton(); + + jScrollPane1.setMinimumSize(new java.awt.Dimension(0, 0)); + + shaderEditorPane.setBorder(null); + shaderEditorPane.setText(org.openide.util.NbBundle.getMessage(ShaderEditPanel.class, "ShaderEditPanel.shaderEditorPane.text")); // NOI18N + jScrollPane1.setViewportView(shaderEditorPane); + + header.setBackground(java.awt.SystemColor.activeCaption); + header.setBorder(javax.swing.BorderFactory.createEtchedBorder()); + + headerText.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N + headerText.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + headerText.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/materialdefinition/icons/fragment.png"))); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(headerText, org.openide.util.NbBundle.getMessage(ShaderEditPanel.class, "ShaderEditPanel.headerText.text")); // NOI18N + + closeButton.setBackground(java.awt.SystemColor.activeCaption); + closeButton.setFont(new java.awt.Font("Tahoma", 1, 8)); // NOI18N + closeButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/jme3/gde/materialdefinition/icons/out.png"))); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(closeButton, org.openide.util.NbBundle.getMessage(ShaderEditPanel.class, "ShaderEditPanel.closeButton.text")); // NOI18N + closeButton.setToolTipText(org.openide.util.NbBundle.getMessage(ShaderEditPanel.class, "ShaderEditPanel.closeButton.toolTipText")); // NOI18N + closeButton.setMargin(new java.awt.Insets(0, 0, 0, 0)); + closeButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + closeButtonActionPerformed(evt); + } + }); + + javax.swing.GroupLayout headerLayout = new javax.swing.GroupLayout(header); + header.setLayout(headerLayout); + headerLayout.setHorizontalGroup( + headerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(headerLayout.createSequentialGroup() + .addComponent(headerText, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(closeButton)) + ); + headerLayout.setVerticalGroup( + headerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(headerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(headerText, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(closeButton, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)) + ); + + buttonPanel.setAlignmentX(0.0F); + buttonPanel.setAlignmentY(0.0F); + buttonPanel.setPreferredSize(new java.awt.Dimension(73, 29)); + buttonPanel.setLayout(new javax.swing.BoxLayout(buttonPanel, javax.swing.BoxLayout.LINE_AXIS)); + + org.openide.awt.Mnemonics.setLocalizedText(jToggleButton1, org.openide.util.NbBundle.getMessage(ShaderEditPanel.class, "ShaderEditPanel.jToggleButton1.text")); // NOI18N + buttonPanel.add(jToggleButton1); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(header, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 645, Short.MAX_VALUE) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addComponent(buttonPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addComponent(header, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(buttonPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 492, Short.MAX_VALUE)) + ); + }// //GEN-END:initComponents + + private void closeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_closeButtonActionPerformed + setVisible(false); + + saveCurrent(); + + + }//GEN-LAST:event_closeButtonActionPerformed + + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.ButtonGroup buttonGroup1; + private javax.swing.JPanel buttonPanel; + private javax.swing.JButton closeButton; + private javax.swing.JPanel header; + private javax.swing.JLabel headerText; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JToggleButton jToggleButton1; + private javax.swing.JEditorPane shaderEditorPane; + // End of variables declaration//GEN-END:variables +} diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/fileStructure/UberStatement.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/fileStructure/UberStatement.java index a86231da1..a8348efe3 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/fileStructure/UberStatement.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/fileStructure/UberStatement.java @@ -16,6 +16,7 @@ import java.util.List; * * @author Nehon */ +@SuppressWarnings({"unchecked", "rawtypes"}) public class UberStatement extends Statement { private List listeners = Collections.synchronizedList(new LinkedList()); diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/fileStructure/leaves/LeafStatement.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/fileStructure/leaves/LeafStatement.java index 3fb98fb2b..c58bdc831 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/fileStructure/leaves/LeafStatement.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/fileStructure/leaves/LeafStatement.java @@ -15,6 +15,7 @@ import java.util.List; * * @author Nehon */ +@SuppressWarnings({"unchecked", "rawtypes"}) public class LeafStatement extends Statement { private List listeners = Collections.synchronizedList(new LinkedList()); diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/icons/Icons.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/icons/Icons.java index 7e746346e..e06cb7546 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/icons/Icons.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/icons/Icons.java @@ -4,6 +4,7 @@ */ package com.jme3.gde.materialdefinition.icons; +import com.jme3.gde.materialdefinition.editor.NodePanel; import javax.swing.ImageIcon; /** @@ -27,4 +28,13 @@ public class Icons { public final static ImageIcon tech = new ImageIcon(Icons.class.getResource("tech.png")); public final static ImageIcon in = new ImageIcon(Icons.class.getResource("in.png")); public final static ImageIcon out = new ImageIcon(Icons.class.getResource("out.png")); + public final static ImageIcon error = new ImageIcon(Icons.class.getResource("error.png")); + + public static ImageIcon getIconForShaderType(NodePanel.NodeType type) { + if (type == NodePanel.NodeType.Fragment) { + return frag; + } else { + return vert; + } + } } diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/icons/error.png b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/icons/error.png new file mode 100644 index 000000000..3e9047cea Binary files /dev/null and b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/icons/error.png differ diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/navigator/MatDefNavigatorPanel.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/navigator/MatDefNavigatorPanel.java index a13845353..3b5427aa8 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/navigator/MatDefNavigatorPanel.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/navigator/MatDefNavigatorPanel.java @@ -22,6 +22,7 @@ import org.openide.util.LookupListener; * @author Nehon */ @NavigatorPanel.Registration(mimeType = "text/jme-materialdefinition", displayName = "Material Def") +@SuppressWarnings({"unchecked", "rawtypes"}) public class MatDefNavigatorPanel extends JPanel implements NavigatorPanel, ExplorerManager.Provider { /** diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/navigator/node/properties/MatParamProperty.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/navigator/node/properties/MatParamProperty.java index 8b09e7b3f..2dde6e780 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/navigator/node/properties/MatParamProperty.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/navigator/node/properties/MatParamProperty.java @@ -36,6 +36,7 @@ import org.openide.util.Lookup; * * @author Nehon */ +@SuppressWarnings({"unchecked", "rawtypes"}) public class MatParamProperty extends Node.Property { private Lookup lookup; diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/shadervisual/ShaderVisualToolBar.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/shadervisual/ShaderVisualToolBar.java index 0e25b0e85..e2ca619b3 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/shadervisual/ShaderVisualToolBar.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/shadervisual/ShaderVisualToolBar.java @@ -11,6 +11,7 @@ import com.jme3.shader.Shader; * * @author Nehon */ +@SuppressWarnings({"unchecked", "rawtypes"}) public class ShaderVisualToolBar extends javax.swing.JPanel { private MatDefShaderElement parent; diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/utils/DocFormatter.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/utils/DocFormatter.java index aaa66fde3..f28778cb0 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/utils/DocFormatter.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materialdefinition/utils/DocFormatter.java @@ -17,7 +17,7 @@ import javax.swing.text.StyledDocument; /** * - * @author m327836 + * @author Nehon */ public class DocFormatter { diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/JMEMaterialDataObject.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/JMEMaterialDataObject.java index 5b09cc9fc..7f6b46ad3 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/JMEMaterialDataObject.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/JMEMaterialDataObject.java @@ -32,6 +32,7 @@ package com.jme3.gde.materials; import com.jme3.gde.core.assets.AssetDataObject; +import com.jme3.gde.core.assets.ProjectAssetManager; import com.jme3.gde.materials.multiview.MaterialOpenSupport; import java.io.IOException; import org.openide.filesystems.FileObject; @@ -53,8 +54,9 @@ public class JMEMaterialDataObject extends AssetDataObject { public JMEMaterialDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException { super(pf, loader); CookieSet cookies = getCookieSet(); -// cookies.add((Node.Cookie) DataEditorSupport.create(this, getPrimaryEntry(), cookies)); - cookies.add((Node.Cookie) new MaterialOpenSupport(getPrimaryEntry())); + if (getLookup().lookup(ProjectAssetManager.class) != null) { + cookies.add((Node.Cookie) new MaterialOpenSupport(getPrimaryEntry())); + } } } diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/MaterialPreviewRenderer.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/MaterialPreviewRenderer.java index 11f4b7b1c..e49409e69 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/MaterialPreviewRenderer.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/MaterialPreviewRenderer.java @@ -11,6 +11,7 @@ import com.jme3.gde.core.scene.PreviewRequest; import com.jme3.gde.core.scene.SceneApplication; import com.jme3.gde.core.scene.SceneListener; import com.jme3.gde.core.scene.SceneRequest; +import com.jme3.gde.materialdefinition.icons.Icons; import com.jme3.material.MatParam; import com.jme3.material.Material; import com.jme3.math.FastMath; @@ -94,11 +95,10 @@ public class MaterialPreviewRenderer implements SceneListener { if (!init) { init(); } - final DesktopAssetManager assetManager = (DesktopAssetManager) SceneApplication.getApplication().getAssetManager(); SceneApplication.getApplication().enqueue(new Callable() { public Material call() throws Exception { - final Material mat = reloadMaterial(m, assetManager); + final Material mat = reloadMaterial(m); if (mat != null) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { @@ -112,7 +112,12 @@ public class MaterialPreviewRenderer implements SceneListener { SceneApplication.getApplication().createPreview(request); } } catch (Exception e) { - Logger.getLogger(MaterialPreviewRenderer.class.getName()).log(Level.SEVERE, "Error rendering material" + e.getMessage()); + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + label.setIcon(Icons.error); + } + }); + Logger.getLogger(MaterialPreviewRenderer.class.getName()).log(Level.SEVERE, "Error rendering material{0}", e.getMessage()); } } }); @@ -124,10 +129,9 @@ public class MaterialPreviewRenderer implements SceneListener { } - public Material reloadMaterial(Material mat, DesktopAssetManager assetManager) { - - MaterialKey key = new MaterialKey(mat.getMaterialDef().getAssetName()); - assetManager.deleteFromCache(key); + public Material reloadMaterial(Material mat) { + + ((ProjectAssetManager)mat.getMaterialDef().getAssetManager()).clearCache(); //creating a dummy mat with the mat def of the mat to reload Material dummy = new Material(mat.getMaterialDef()); @@ -150,6 +154,12 @@ public class MaterialPreviewRenderer implements SceneListener { //the following code will output the error //System.err.println(e.getMessage()); Logger.getLogger(MaterialDebugAppState.class.getName()).log(Level.SEVERE, e.getMessage()); + + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + label.setIcon(Icons.error); + } + }); return null; } diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/MaterialPropertyEditor.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/MaterialPropertyEditor.java index c84ce22c9..5c0a337bb 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/MaterialPropertyEditor.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/MaterialPropertyEditor.java @@ -64,7 +64,7 @@ import org.openide.util.Exceptions; * @author normenhansen */ @org.openide.util.lookup.ServiceProvider(service = SceneExplorerPropertyEditor.class) -@SuppressWarnings("unchecked") +@SuppressWarnings({"unchecked", "rawtypes"}) public class MaterialPropertyEditor implements PropertyEditor, SceneExplorerPropertyEditor { private LinkedList listeners = new LinkedList(); diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/MaterialEditorTopComponent.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/MaterialEditorTopComponent.java index bc0f41175..9897adeec 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/MaterialEditorTopComponent.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/MaterialEditorTopComponent.java @@ -54,6 +54,7 @@ import org.openide.windows.Mode; */ @ConvertAsProperties(dtd = "-//com.jme3.gde.materials.multiview//MaterialEditor//EN", autostore = false) +@SuppressWarnings({"unchecked", "rawtypes"}) public final class MaterialEditorTopComponent extends CloneableTopComponent implements MaterialWidgetListener, MaterialChangeProvider { private static MaterialEditorTopComponent instance; diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/SelectionPanel.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/SelectionPanel.java index f9f794ede..25c046e1c 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/SelectionPanel.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/widgets/SelectionPanel.java @@ -17,6 +17,7 @@ import com.jme3.gde.materials.MaterialProperty; * * @author normenhansen */ +@SuppressWarnings({"unchecked", "rawtypes"}) public class SelectionPanel extends MaterialPropertyWidget { /** Creates new form SelectionPanel */ diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/nvcompress/NVCompress.java b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/nvcompress/NVCompress.java index 2ee27269d..46e2be144 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/materials/nvcompress/NVCompress.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/materials/nvcompress/NVCompress.java @@ -55,6 +55,7 @@ import jme3tools.converters.ImageToAwt; import jme3tools.converters.MipMapGenerator; import org.openide.util.NbPreferences; +@SuppressWarnings({"unchecked", "rawtypes"}) public class NVCompress extends javax.swing.JFrame { private File texToolsPath; diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/SNDefVisualPanel1.java b/sdk/jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/SNDefVisualPanel1.java index 2134e0e83..a015b5398 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/SNDefVisualPanel1.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/SNDefVisualPanel1.java @@ -9,6 +9,7 @@ import com.jme3.shader.Shader; import javax.swing.DefaultComboBoxModel; import javax.swing.JPanel; +@SuppressWarnings({"unchecked", "rawtypes"}) public final class SNDefVisualPanel1 extends JPanel { diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/SNDefVisualPanel2.java b/sdk/jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/SNDefVisualPanel2.java index c058612d6..c46b595c0 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/SNDefVisualPanel2.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/SNDefVisualPanel2.java @@ -12,6 +12,7 @@ import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.table.DefaultTableModel; +@SuppressWarnings({"unchecked", "rawtypes"}) public final class SNDefVisualPanel2 extends JPanel { private final Object[] emptyObj = {"", "", ""}; diff --git a/sdk/jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/SNDefWizardIterator.java b/sdk/jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/SNDefWizardIterator.java index ceae8fc04..8bbcc4a3a 100644 --- a/sdk/jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/SNDefWizardIterator.java +++ b/sdk/jme3-materialeditor/src/com/jme3/gde/shadernodedefinition/wizard/SNDefWizardIterator.java @@ -36,6 +36,7 @@ import org.openide.util.NbBundle.Messages; @TemplateRegistration(folder = "Material", content = "../ShaderNodeSource", scriptEngine = "freemarker") }) @Messages("SNDefWizardIterator_displayName=Shader Node Definition") +@SuppressWarnings({"unchecked", "rawtypes"}) public final class SNDefWizardIterator implements WizardDescriptor.InstantiatingIterator { private int index; diff --git a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-android-native.xml b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-android-native.xml index 82c882b46..266e87ff8 100644 --- a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-android-native.xml +++ b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-android-native.xml @@ -14,5 +14,6 @@ javadoc + jar:nbinst://com.jme3.gde.project.baselibs/libs/jme3-android-native-3.1.0-snapshot-github-javadoc.jar!/ \ No newline at end of file diff --git a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-android.xml b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-android.xml index 62956b3ca..801e5bb3b 100644 --- a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-android.xml +++ b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-android.xml @@ -15,5 +15,6 @@ javadoc + jar:nbinst://com.jme3.gde.project.baselibs/libs/jme3-android-3.1.0-snapshot-github-javadoc.jar!/ \ No newline at end of file diff --git a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-blender.xml b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-blender.xml index 62edb828d..ee4b1a935 100644 --- a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-blender.xml +++ b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-blender.xml @@ -14,5 +14,6 @@ javadoc + jar:nbinst://com.jme3.gde.project.baselibs/libs/jme3-blender-3.1.0-snapshot-github-javadoc.jar!/ \ No newline at end of file diff --git a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-bullet-native.xml b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-bullet-native.xml index ce23fd960..11911a144 100644 --- a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-bullet-native.xml +++ b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-bullet-native.xml @@ -14,5 +14,6 @@ javadoc + jar:nbinst://com.jme3.gde.project.baselibs/libs/jme3-bullet-native-3.1.0-snapshot-github-javadoc.jar!/ \ No newline at end of file diff --git a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-bullet.xml b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-bullet.xml index ff358f8d9..fcfe3bd49 100644 --- a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-bullet.xml +++ b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-bullet.xml @@ -14,5 +14,6 @@ javadoc + jar:nbinst://com.jme3.gde.project.baselibs/libs/jme3-bullet-3.1.0-snapshot-github-javadoc.jar!/ \ No newline at end of file diff --git a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-core.xml b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-core.xml index 940562391..a01e2b213 100644 --- a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-core.xml +++ b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-core.xml @@ -14,5 +14,6 @@ javadoc + jar:nbinst://com.jme3.gde.project.baselibs/libs/jme3-core-3.1.0-snapshot-github-javadoc.jar!/ \ No newline at end of file diff --git a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-desktop.xml b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-desktop.xml index 872368df2..845355e5f 100644 --- a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-desktop.xml +++ b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-desktop.xml @@ -14,5 +14,6 @@ javadoc + jar:nbinst://com.jme3.gde.project.baselibs/libs/jme3-desktop-3.1.0-snapshot-github-javadoc.jar!/ \ No newline at end of file diff --git a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-effects.xml b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-effects.xml index bf10f80c4..abf892bfd 100644 --- a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-effects.xml +++ b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-effects.xml @@ -14,5 +14,6 @@ javadoc + jar:nbinst://com.jme3.gde.project.baselibs/libs/jme3-effects-3.1.0-snapshot-github-javadoc.jar!/ \ No newline at end of file diff --git a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-ios.xml b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-ios.xml index cac2de777..a9d8308d9 100644 --- a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-ios.xml +++ b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-ios.xml @@ -14,5 +14,6 @@ javadoc + jar:nbinst://com.jme3.gde.project.baselibs/libs/jme3-ios-3.1.0-snapshot-github-javadoc.jar!/ \ No newline at end of file diff --git a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-jbullet.xml b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-jbullet.xml index 623e3abdd..0eb10462a 100644 --- a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-jbullet.xml +++ b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-jbullet.xml @@ -17,5 +17,6 @@ javadoc + jar:nbinst://com.jme3.gde.project.baselibs/libs/jme3-jbullet-3.1.0-snapshot-github-javadoc.jar!/ \ No newline at end of file diff --git a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-jogg.xml b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-jogg.xml index 24b67ca13..f0bcff496 100644 --- a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-jogg.xml +++ b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-jogg.xml @@ -15,5 +15,6 @@ javadoc + jar:nbinst://com.jme3.gde.project.baselibs/libs/jme3-jogg-3.1.0-snapshot-github-javadoc.jar!/ \ No newline at end of file diff --git a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-jogl.xml b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-jogl.xml index 5b01b173c..c7eb5a14b 100644 --- a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-jogl.xml +++ b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-jogl.xml @@ -50,5 +50,6 @@ javadoc + jar:nbinst://com.jme3.gde.project.baselibs/libs/jme3-jogl-3.1.0-snapshot-github-javadoc.jar!/ \ No newline at end of file diff --git a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-lwjgl.xml b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-lwjgl.xml index 36a6d9f91..940cb7d1b 100644 --- a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-lwjgl.xml +++ b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-lwjgl.xml @@ -23,5 +23,6 @@ javadoc + jar:nbinst://com.jme3.gde.project.baselibs/libs/jme3-lwjgl-3.1.0-snapshot-github-javadoc.jar!/ \ No newline at end of file diff --git a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-networking.xml b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-networking.xml index b61c4bd9d..6764e20b0 100644 --- a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-networking.xml +++ b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-networking.xml @@ -14,5 +14,6 @@ javadoc + jar:nbinst://com.jme3.gde.project.baselibs/libs/jme3-networking-3.1.0-snapshot-github-javadoc.jar!/ \ No newline at end of file diff --git a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-niftygui.xml b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-niftygui.xml index ed5eb570c..f26db7438 100644 --- a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-niftygui.xml +++ b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-niftygui.xml @@ -20,5 +20,6 @@ javadoc + jar:nbinst://com.jme3.gde.project.baselibs/libs/jme3-niftygui-3.1.0-snapshot-github-javadoc.jar!/ \ No newline at end of file diff --git a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-plugins.xml b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-plugins.xml index 854b8d5c3..a50efeca7 100644 --- a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-plugins.xml +++ b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-plugins.xml @@ -14,5 +14,6 @@ javadoc + jar:nbinst://com.jme3.gde.project.baselibs/libs/jme3-plugins-3.1.0-snapshot-github-javadoc.jar!/ \ No newline at end of file diff --git a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-terrain.xml b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-terrain.xml index 7c10d009c..aa474ee93 100644 --- a/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-terrain.xml +++ b/sdk/jme3-project-baselibs/src/com/jme3/gde/project/baselibs/jme3-terrain.xml @@ -14,5 +14,6 @@ javadoc + jar:nbinst://com.jme3.gde.project.baselibs/libs/jme3-terrain-3.1.0-snapshot-github-javadoc.jar!/ \ No newline at end of file