@ -8,11 +8,12 @@ There are two ways to handle audio data: Short audio files are to be stored enti
</p>
<p>
Place audio files in the <code>assets/Sound/</code> directory of your project. jME3 supports Ogg Vorbis (.ogg) and Wave (.wav) formats.
Place audio files in the <code>assets/Sound/</code> directory of your project. jME3 supports Ogg Vorbis (.ogg) and Wave (.wav) formats. You can use for example <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://audacity.sourceforge.net/"><paramname="text"value="<html><u>Audacity</u></html>"><paramname="textColor"value="blue"></object> to convert from other formats.
</p>
</div>
<!-- EDIT1 SECTION "Audio in jME3" [1-334] -->
<!-- EDIT1 SECTION "Audio in jME3" [1-434] -->
<h2><a>Creating Audio Nodes: Streamed or Buffered</a></h2>
<div>
@ -31,7 +32,7 @@ The main class to look at is <code>com.jme3.audio.AudioNode</code>.
@ -69,7 +70,7 @@ There are other obvious getters to poll the status of corresponding setters belo
<td>setPitch(1)</td><td>Makes the sound play in a higher or lower pitch. Default is 1. 2 is twice as high, .5f is half as high. </td>
</tr>
</table></div>
<!-- EDIT6 TABLE [1368-1617] --><div><table>
<!-- EDIT6 TABLE [1468-1717] --><div><table>
<tr>
<th>AudioNode Method</th><th>Usage</th>
</tr>
@ -85,13 +86,13 @@ Does not work for streamed sounds! </td>
setDirectional(false)</td><td>All 3D effects switched off. This sound is global and comes from everywhere. Good for environmental ambient sounds and background music.</td>
</tr>
<tr>
<td>setTimeOffset(0.5f)</td><td>Start playing the sound after waiting the given amount of seconds. Default is 0.</td>
<td>setTimeOffset(0.5f)</td><td>Play the sound starting at a 0.5 second offset from the beginning. Default is 0.</td>
</tr>
<tr>
<td>setMaxDistance(100f)</td><td>Maximum distance the sound can be heard, in world units. Default is 20.</td>
</tr>
</table></div>
<!-- EDIT7 TABLE [1619-2353] --><div><table>
<!-- EDIT7 TABLE [1719-2453] --><div><table>
<tr>
<th>AudioNode Method</th><th>Usage</th>
</tr>
@ -103,7 +104,7 @@ setLocalTranslation(…)</td><td>Activates 3D audio: The sound appears to come f
<td>setReverbEnabled(true)</td><td>A 3D echo effect that only makes sense to use with positional AudioNodes. The reverb effect is influenced by the environment that the audio renderer is in. See "Setting Environment Properties" below. </td>
</tr>
</table></div>
<!-- EDIT8 TABLE [2355-2827] --><div><table>
<!-- EDIT8 TABLE [2455-2927] --><div><table>
<tr>
<th>AudioNode Method</th><th>Usage</th>
</tr>
@ -116,9 +117,9 @@ setDirection(…) </td><td>Activates 3D audio: This sound can only be heard from
setOuterAngle()</td><td>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!</td>
In your IDE, use code completion to quickly look up Trigger literals. In the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> for example, press ctrl-space or ctrl-/ after <code>KeyInput.|</code> to choose from the list of all keys.
@ -153,9 +164,9 @@ In your IDE, use code completion to quickly look up Trigger literals. In the jMo
<td>INPUT_MAPPING_EXIT</td><td>KEY_ESCAPE</td><td>Closes the application by calling <code>stop();</code>. Typically you do not remove this, unless you replace it by another way of quitting gracefully.</td>
@ -325,7 +325,7 @@ MonkeyZone is hosted at GoogleCode, where you can check out the jMonkeyEngine <a
<h2><a>Troubleshooting</a></h2>
<div>
<ol>
<li><div> After download error coud appear that in 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 </div>
<li><div> 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 </div>
@ -501,7 +501,7 @@ In the <code>hud</code> screen's <code>foreground</code> layer, add the fol
}});</pre>
<p>
Note that the width and height do not scale the bitmap font, but the make indirectly certain it is centered. If you want a different size for the font, you need to provide an extra bitmap font (they come with fixes sizes and don't scale well).
Note that the width and height do not scale the bitmap font, but make indirectly certain it is centered. If you want a different size for the font, you need to provide an extra bitmap font (they come with fixes sizes and don't scale well).
</p>
</div>
@ -562,7 +562,7 @@ Nifty additionally offers many customizable controls such as check boxes, text f
@ -260,7 +260,7 @@ You can name the method (here <code>clicked</code>) what ever you like, as long
<p>
The basic Nifty <acronymtitle="Graphical User Interface">GUI</acronym> example showed how to use the <code>nifty.fromXML()</code> method to load one <acronymtitle="Extensible Markup Language">XML</acronym> file containing all Nifty <acronymtitle="Graphical User Interface">GUI</acronym> screens.
The following code sample shows how you can load several <acronymtitle="Extensible Markup Language">XML</acronym> files into one nifty object. Loading several files with <code>nifty.addXml()</code> allows you to split up each screen into one <acronymtitle="Extensible Markup Language">XML</acronym> file, insetad of all into one hard-to-read <acronymtitle="Extensible Markup Language">XML</acronym> file.
The following code sample shows how you can load several <acronymtitle="Extensible Markup Language">XML</acronym> files into one nifty object. Loading several files with <code>nifty.addXml()</code> allows you to split up each screen into one <acronymtitle="Extensible Markup Language">XML</acronym> file, instead of all into one hard-to-read <acronymtitle="Extensible Markup Language">XML</acronym> file.
</p>
<pre>NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager, inputManager, audioRenderer, viewPort);
@ -310,7 +310,7 @@ In the <code>hud</code> screen's <code>foreground</code> layer, add the fol
<span><span></panel></span></span></pre>
<p>
Note that the width and height do not scale the bitmap font, but the make indirectly certain it is centered. If you want a different size for the font, you need to provide an extra bitmap font (they come with fixes sizes and don't scale well).
Note that the width and height do not scale the bitmap font, but indirectly make certain it is centered. If you want a different size for the font, you need to provide an extra bitmap font (they come with fixed sizes and don't scale well).
</p>
</div>
@ -346,7 +346,7 @@ Nifty additionally offers many customizable controls such as check boxes, text f
@ -223,7 +223,7 @@ The following effect textures are available by default from <code>test-data.jar<
<p>
Browse the full source code of all <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://code.google.com/p/jmonkeyengine/source/browse/#svn/branches/jme3/src/test/jme3test/effect"><paramname="text"value="<html><u>effect examples</u></html>"><paramname="textColor"value="blue"></object> here.
Browse the full source code of all <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://code.google.com/p/jmonkeyengine/source/browse/#svn%2Ftrunk%2Fengine%2Fsrc%2Ftest%2Fjme3test%2Feffect"><paramname="text"value="<html><u>effect examples</u></html>"><paramname="textColor"value="blue"></object> here.
@ -77,8 +77,15 @@ In the SwingCanvasTest's main() method, create a queued runnable(). It will
});
}</pre>
<p>
<p><div>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.).
</div></p>
</p>
</div>
<!-- EDIT3 SECTION "Main() and Runnable()" [2175-2792] -->
<!-- EDIT3 SECTION "Main() and Runnable()" [2175-3260] -->
<h3><a>Creating the Canvas</a></h3>
<div>
@ -113,7 +120,7 @@ Note that we have not called start() on the application, as we would usually do
</p>
</div>
<!-- EDIT4 SECTION "Creating the Canvas" [2793-4077] -->
<!-- EDIT4 SECTION "Creating the Canvas" [3261-4545] -->
<h3><a>Creating the Swing Frame</a></h3>
<div>
@ -163,7 +170,7 @@ Clean, build, and run!
</p>
</div>
<!-- EDIT5 SECTION "Creating the Swing Frame" [4078-5551] -->
<!-- EDIT5 SECTION "Creating the Swing Frame" [4546-6019] -->
<h2><a>Navigation</a></h2>
<div>
@ -177,5 +184,5 @@ Remember, to navigate in the scene, click and drag (!) the mouse, or press the W
@ -276,8 +276,13 @@ audio_nature = new AudioNode(assetManager, "Sound/Environment/Nature.og
Typically, you stream long sounds, and buffer short sounds.
</p>
<p>
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.
</p>
</div>
<!-- EDIT7 SECTION "Buffered or Streaming?" [9287-9709] -->
<!-- EDIT7 SECTION "Buffered or Streaming?" [9287-9868] -->
<h2><a>Play() or PlayInstance()?</a></h2>
<div>
<div><table>
@ -294,9 +299,9 @@ Typically, you stream long sounds, and buffer short sounds.
<td>The same sound cannot play twice at the same time.</td><td>The same sounds can play multiple times and overlap.</td>
</tr>
</table></div>
<!-- EDIT9 TABLE [9749-9993] -->
<!-- EDIT9 TABLE [9908-10152] -->
</div>
<!-- EDIT8 SECTION "Play() or PlayInstance()?" [9710-9994] -->
<!-- EDIT8 SECTION "Play() or PlayInstance()?" [9869-10153] -->
<h2><a>Your Ear in the Scene</a></h2>
<div>
@ -318,7 +323,7 @@ If you don't do that, the results of 3D audio will be quite random.
</p>
</div>
<!-- EDIT10 SECTION "Your Ear in the Scene" [9995-10697] -->
<!-- EDIT10 SECTION "Your Ear in the Scene" [10154-10856] -->
<h2><a>Global, Directional, Positional?</a></h2>
<div>
@ -345,7 +350,7 @@ In short, you must choose in every situation whether it makes sense for a sound
<span>/** Sample 2 - How to use nodes as handles to manipulate objects in the scene.
* You can rotate, translate, and scale objects by manipulating their parent nodes.
* The Root Node is special: Only what is attached to the Root Node appears in the scene. */</span>
public class HelloNode extends SimpleApplication {
public static void main(String[] args){
@ -96,7 +97,7 @@ Build and run the code sample. You should see two colored boxes tilted at the sa
</p>
</div>
<!-- EDIT2 SECTION "Code Sample" [997-3000] -->
<!-- EDIT2 SECTION "Code Sample" [997-3001] -->
<h2><a>Understanding the Terminology</a></h2>
<div>
@ -125,7 +126,7 @@ In this tutorial, you learn some new terms:
<td>Position/move, turn, or resize an object</td><td>Translate, rotate, scale an object. Transform an object.</td>
</tr>
</table></div>
<!-- EDIT4 TABLE [3089-3506] -->
<!-- EDIT4 TABLE [3090-3507] -->
<p>
Every JME3 application has a rootNode: Your game automatically inherits the <code>rootNode</code> object from SimpleApplication. Everything attached to the rootNode is part of the scene graph. The elements of the scene graph are Spatials.
@ -152,9 +153,9 @@ Every JME3 application has a rootNode: Your game automatically inherits the <cod
<th> Examples: </th><td> A box, a sphere, a player, a building, a piece of terrain, a vehicle, missiles, NPCs, etc… </td><td> The <code>rootNode</code>, a floor node grouping several terrains, a custom vehicle-with-passengers node, a player-with-weapon node, an audio node, etc… </td>
</tr>
</table></div>
<!-- EDIT5 TABLE [3922-4415] -->
<!-- EDIT5 TABLE [3923-4416] -->
</div>
<!-- EDIT3 SECTION "Understanding the Terminology" [3001-4416] -->
<!-- EDIT3 SECTION "Understanding the Terminology" [3002-4417] -->
<h2><a>Understanding the Code</a></h2>
<div>
@ -240,7 +241,7 @@ If you run the app with only the code up to here, you see two cubes: A red cube
</ol>
</div>
<!-- EDIT6 SECTION "Understanding the Code" [4417-6683] -->
<!-- EDIT6 SECTION "Understanding the Code" [4418-6684] -->
<h3><a>What is a Pivot Node?</a></h3>
<div>
@ -259,7 +260,7 @@ You can transform (e.g. rotate) Geometries around their own center, or around a
</ul>
</div>
<!-- EDIT7 SECTION "What is a Pivot Node?" [6684-8004] -->
<!-- EDIT7 SECTION "What is a Pivot Node?" [6685-8005] -->
<td> Specify what should be loaded at the start </td><td> Everything you initialize and attach to the <code>rootNode</code> in the <code>simpleInitApp()</code> method is part of the scene at the start of the game. </td>
</tr>
</table></div>
<!-- EDIT9 TABLE [8052-9314] -->
<!-- EDIT9 TABLE [8053-9315] -->
</div>
<!-- EDIT8 SECTION "How do I Populate the Scenegraph?" [8005-9315] -->
<!-- EDIT8 SECTION "How do I Populate the Scenegraph?" [8006-9316] -->
<h2><a>How do I Transform Spatials?</a></h2>
<div>
@ -319,7 +320,7 @@ To move a Spatial <em>to</em> specific coordinates, such as (0,40.2f,-2), use: <
@ -347,9 +348,9 @@ To roll an object 180° around the z axis: <pre>thing.rotate( 0f , 0f , 180*
</td><td>pitch = nodding your head</td><td>yaw = shaking your head</td><td>roll = cocking your head</td>
</tr>
</table></div>
<!-- EDIT13 TABLE [10448-11229] -->
<!-- EDIT13 TABLE [10449-11230] -->
</div>
<!-- EDIT10 SECTION "How do I Transform Spatials?" [9316-11230] -->
<!-- EDIT10 SECTION "How do I Transform Spatials?" [9317-11231] -->
<h2><a>How do I Troubleshoot Spatials?</a></h2>
<div>
@ -378,9 +379,9 @@ Did you rotate around the right axis? </td>
<td> A Geometry has an unexpected Color or Material. </td><td> Did you reuse a Material from another Geometry and have inadvertently changed its properties? (If so, consider cloning it: mat2 = mat.clone(); ) </td>
</tr>
</table></div>
<!-- EDIT15 TABLE [11362-12335] -->
<!-- EDIT15 TABLE [11363-12336] -->
</div>
<!-- EDIT14 SECTION "How do I Troubleshoot Spatials?" [11231-12336] -->
<!-- EDIT14 SECTION "How do I Troubleshoot Spatials?" [11232-12337] -->
<h2><a>How do I Add Custom Data to Spatials?</a></h2>
<div>
@ -413,7 +414,7 @@ By using different Strings keys (here the key is <code>pivot id</code>), you can
</p>
</div>
<!-- EDIT16 SECTION "How do I Add Custom Data to Spatials?" [12337-13702] -->
<!-- EDIT16 SECTION "How do I Add Custom Data to Spatials?" [12338-13703] -->
<h2><a>Conclusion</a></h2>
<div>
@ -435,5 +436,5 @@ Since standard shapes like spheres and boxes get old fast, continue with the nex
@ -25,9 +25,9 @@ To export an animated model in Blender make sure the following conditions are me
</p>
<ol>
<li><div> Apply Location, Rotation and Scate to the mesh on Blender: On 3D View editor on Blender, select the mesh in Object Mode and go to the 3D View Editor’s header → Object Menu → Apply → Location / Rotation / Location.</div>
<li><div> Apply Location, Rotation and Scate to the mesh on Blender: On 3D View editor on Blender, select the mesh in Object Mode and go to the 3D View Editor’s header → Object Menu → Apply → Location / Rotation / Scale.</div>
</li>
<li><div> Apply Location, Rotation and Scate to the armature on Blender: On 3D View editor on Blender, select the armature in Object Mode and go to the 3D View Editor’s header → Object Menu → Apply → Location / Rotation / Location.</div>
<li><div> Apply Location, Rotation and Scate to the armature on Blender: On 3D View editor on Blender, select the armature in Object Mode and go to the 3D View Editor’s header → Object Menu → Apply → Location / Rotation / Scale.</div>
</li>
<li><div> Set the mesh’s origin point in the bottom of the mesh (see the images bellow).</div>
</li>
@ -74,6 +74,13 @@ To export an animated model in Blender make sure the following conditions are me
AppSettings settings = new AppSettings(true);
settings.setResolution(640,480);
... // other properties see below
MyGame app = new MyGame(); // or Main or whatever you called your SimpleApplication
// ... other properties, see below
MyGame app = new MyGame();
app.setSettings(settings);
app.start();
}</pre>
<p>
Set the boolean in the AppSettings contructor to true if you want to keep the default settings for everything that you do not specify. Set this parameter to false if you want to change some of the settings, but otherwise want the application to load user settings from previous launches.
Set the boolean in the AppSettings contructor to true if you want to keep the default settings for values that you do not specify. Set this parameter to false if you want the application to load user settings from previous launches. In either case you can still customize individual settings.
</p>
<p>
<p><div>Use <code>app.setShowSettings(true);</code> to present the user with a splashscreen and display settings dialog when starting the game, or <code>app.setShowSettings(false);</code> to hide the custom splashscreen. Set this boolean before calling <code>app.start()</code> on the SimpleApplication.
</div></p>
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.
<td>setEmulateMouse(true)</td><td>Enable or disable mouse emulation for touchscreen-based devices. Setting this to true converts taps on the touchscreen to clicks, and finger swiping gestures over the touchscreen into mouse axis events.</td><td>false</td>
</tr>
<tr>
<td>setEmulateMouseFlipAxis(true,true)</td><td>Flips the X or Y (or both) axes for the emulated mouse. Set the first parameter to true to flip the x axis, and the second to flip the y axis.</td><td>false,false</td>
@ -97,7 +117,7 @@ Set VSync to false to deactivate vertical syncing (faster, but possible page tea
<td>setStereo3D(true)</td><td>Enable 3D stereo. This feature requires hardware support from the GPU driver. See <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://en.wikipedia.org/wiki/Quad_buffering"><paramname="text"value="<html><u>Quad Buffering</u></html>"><paramname="textColor"value="blue"></object>. Currently, your everday user's hardware does not support this, so you can ignore it for now.</td><td>false</td>
@ -106,26 +126,54 @@ Set VSync to false to deactivate vertical syncing (faster, but possible page tea
</tr>
<tr>
<td>setIcons(new BufferedImage[]{ <br/>
ImageIO.read(new File("")), …});</td><td>This specifies the little application icon in the titlebar of the application. You should specify the icon in various sizes (256,128,32,16) to look good on each <acronymtitle="Operating System">OS</acronym>. Note: This is not the application icon on the desktop.</td><td>null</td>
ImageIO.read(new File("")), …});</td><td>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.</td><td>null</td>
</tr>
<tr>
<td>setSettingsDialogImage("Interface/mysplashscreen.png")</td><td>A custom splashscreen image in the <code>assets/Interface</code> directory which is displayed when the settings dialog is shown.</td><td>"/com/jme3/app/Monkey.png"</td>
</tr>
</table></div>
<!-- EDIT7 TABLE [5331-6038] -->
<p>
<p><div>You can use <code>app.setShowSettings(true);</code> and <code>setSettingsDialogImage("Interface/mysplashscreen.png")</code> to present the user with jme3's default display settings dialog when starting the game. Use <code>app.setShowSettings(false);</code> to hide the default settings screen. Set this boolean before calling <code>app.start()</code> on the SimpleApplication.
<td>app.setShowSettings(boolean)</td><td>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.</td>
</tr>
<tr>
<td>app.setSettings(settings)</td><td>After you have modified the properties on the settings object, you apply it to your application. Note that the settings are not automatically reloaded while the game is running.</td>
</tr>
<tr>
<td>app.start()</td><td>Every game calls start() in the beginning to initialize the game and apply the settings. Modify and set your settings before calling start().</td>
</tr>
<tr>
<td>setSettingsDialogImage("/path/to/splash.png")</td><td>A custom splashscreen image in the assets directory which is displayed when the settings dialog is shown.</td><td>"/com/jme3/app/Monkey.png"</td>
<td>app.restart()</td><td>Restart()ing a running game restarts the game context and applies the updated settings object. (This does not restart or reinitialize the whole game.)</td>
</tr>
</table></div>
<!-- EDIT7 TABLE [4346-4993] -->
<!-- EDIT9 TABLE [6445-7326] -->
</div>
<!-- EDIT3 SECTION "Properties" [1382-4994] -->
<!-- EDIT8 SECTION "Toggling and Activating Settings" [6399-7327] -->
<h2><a>Saving and Loading Settings</a></h2>
<div>
<p>
An AppSettings object also supports the following methods:
An AppSettings object also supports the following methods to save your settings under a unique key (in this example "com.foo.MyCoolGame3"):
</p>
<ul>
<li><div> Use <code>settings.save("unique_key")</code> to save your settings via standard java.io serialization.</div>
<li><div> Use <code>settings.save("com.foo.MyCoolGame3")</code> to save your settings via standard java.io serialization.</div>
</li>
<li><div> Use <code>settings.load("unique_key")</code> to load your settings.</div>
<li><div> Use <code>settings.load("com.foo.MyCoolGame3")</code> to load your settings.</div>
</li>
<li><div> Use <code>settings2.copyFrom(settings)</code> to copy a settings object.</div>
</li>
@ -154,5 +202,5 @@ Provide the unique name of your jME3 application as the String argument. For exa
</ul>
</div>
<!-- EDIT8 SECTION "Saving and Loading Settings" [4995-] -->
<!-- EDIT10 SECTION "Saving and Loading Settings" [7328-] -->
@ -307,9 +307,9 @@ As your SimpleApplication-based game grows more advanced, you find yourself putt
<ul>
<li><div> Each AppState calls its own <code>initialize()</code> and <code>cleanup()</code> methods when it is attached to or detached from the game. </div>
</li>
<li><div> Each AppState runs its own <code>update()</code> loop that hooks into the main simpleUpdate() loop. </div>
<li><div> Each AppState runs its own <em>thread-safe</em><code>update()</code> loop that hooks into the main <code>simpleUpdate()</code> loop. </div>
</li>
<li><div> You can specify what happens if an AppState is paused/unpaused.</div>
<li><div> You specify what happens if an AppState is paused/unpaused.</div>
</li>
<li><div> You can use an AppState to switch between sets of AppStates.</div>
</li>
@ -323,7 +323,7 @@ As your SimpleApplication-based game grows more advanced, you find yourself putt
<ul>
<li><div> Controls add a type of behaviour (methods and fields) to an individual Spatial (a player, an NPC). </div>
</li>
<li><div> Each Control runs its own <code>controlUpdate()</code> loop that hooks into the main <code>simpleUpdate()</code> loop. </div>
<li><div> Each Control runs its own <em>thread-safe</em><code>controlUpdate()</code> loop that hooks into the main <code>simpleUpdate()</code> loop. </div>
</li>
<li><div> One Spatial can be influenced by several Controls. (!)</div>
</li>
@ -337,6 +337,11 @@ As your SimpleApplication-based game grows more advanced, you find yourself putt
<p>
<p><div>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.
</div></p>
</p>
<p>
Controls and AppStates often work together: An AppState can reach up to the application and <code>get</code> all Spatials from the rootNode that carry a specific Control, and perform a global action on them. Example: In BulletPhysics, all physical Spatials that carry RigidBodyControls are steered by the overall BulletAppState.
</p>
@ -350,7 +355,7 @@ Read all about <a href="/com/jme3/gde/core/docs/jme3/advanced/custom_controls.ht
</p>
</div>
<!-- EDIT13 SECTION "The Smart Way to Implement Game Logic" [10494-12862] -->
<!-- EDIT13 SECTION "The Smart Way to Implement Game Logic" [10494-13296] -->
<h3><a>Optimize Application Performance</a></h3>
<div>
<ul>
@ -363,7 +368,7 @@ Read all about <a href="/com/jme3/gde/core/docs/jme3/advanced/custom_controls.ht
@ -498,7 +503,7 @@ Decide whether you want to release your game as WebStart, Desktop JAR, or Applet
(.APK)</td><td>Game runs on Android devices.</td><td>Android devices do not support post-procesor effects.</td>
</tr>
</table></div>
<!-- EDIT21 TABLE [18475-19695] -->
<!-- EDIT21 TABLE [18909-20129] -->
<p>
Which ever method you choose, a Java-Application works on the main operating systems: Windows, Mac <acronymtitle="Operating System">OS</acronym>, Linux, Android.
@ -510,5 +515,5 @@ The distribution appears in a newly generated <code>dist</code> directory inside
</p>
</div>
<!-- EDIT20 SECTION "Distributing the Executables" [18042-] -->
<!-- EDIT20 SECTION "Distributing the Executables" [18476-] -->
@ -222,7 +222,7 @@ Use the jMonkeyEngine SceneComposer to add these properties.</div>
<p>
<p><div>Important: Unoptimized external model files (.mesh.xml, .material, .obj, .mat, etc) are not bundled when you build your application! If you try to run the JAR with code referring to non-j3o models, you get a <strong>Runtime Error</strong>because the resource is not found. The final application code should only reference .j3o files.
<p><div>Important: Unoptimized external model files (.mesh.xml, .material, .obj, .mat, .blend, etc) are not bundled by the default build script into the final executables! If you try to run executables containing code that loads non-.j3o models, you get a <strong>Runtime Error</strong>(resource not found). The final application code should only reference .j3o files. (Note that you will not get this runtime error when running development builds straight from the <acronymtitle="Software Development Kit">SDK</acronym>!)
@ -92,7 +92,7 @@ Genereally jME3 is well optimized and optimizes these things correctly. The norm
<ul>
<li><div> If the (S) values are significantly higher than the (F) values, that means there are a lot of extra switches happening which can cause a performance loss. Switches happen for instance if you have many transparent materials in your scene. In that case this tells you that you should use fewer transparent materials.</div>
</li>
<li><div> If the (M) values are much higher than the (F) values, that means a lot more GL objects are in memory than are actually used. This can happen in rare cases, such as extremely large scenes (> 2000 wu). In this case, you should can optimize performance by identifying spatials to cull or detach.</div>
<li><div> If the (M) values are much higher than the (F) values, that means a lot more GL objects are in memory than are actually used. This can happen in rare cases, such as extremely large scenes (> 2000 wu) with lots of spatials or lots of different materials. In this case, you should can optimize performance by identifying spatials to cull or detach.</div>
</li>
<li><div> The Object Count (Batch Count) is a very important value that indicates how many geometries were rendered in the last frame. In general, try to keep the object count around 100-200 to keep your game fast and responsive. If the count is permanently higher, hand-code rules that detach remote objects, or optimize a complex multi-material scene using: <pre>GeometryBatchFactory.optimize(complexNode, true);</pre>
<li><div> 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).</div>
</li>
<li><div> If an armature is attached to a mesh that has more than one material the vertices of the mesh might be strongly displaced. Hope to fix that soon.</div>
<h2><a>Using BlenderLoader instead of BlenderModelLoader</a></h2>
<div>
@ -241,7 +245,7 @@ You can use ModelKey as well. This will give the same result as using default Bl
</p>
</div>
<!-- EDIT7 SECTION "Using BlenderLoader instead of BlenderModelLoader" [4577-6313] -->
<!-- EDIT7 SECTION "Using BlenderLoader instead of BlenderModelLoader" [4745-6481] -->
<h2><a>How does it work?</a></h2>
<div>
@ -287,7 +291,7 @@ Here is the list of how blender features are mapped into jme.
<td>Surface </td><td>Node </td><td>The surface is transformed to the proper mesh</td>
</tr>
</table></div>
<!-- EDIT9 TABLE [6787-7138] -->
<!-- EDIT9 TABLE [6955-7306] -->
<p>
Using BlenderLoader can allow you to use blend file as your local assets repository.
@ -297,7 +301,7 @@ Probably versions before 2.49 will work pretty well too, but I never checked tha
</p>
</div>
<!-- EDIT8 SECTION "How does it work?" [6314-7473] -->
<!-- EDIT8 SECTION "How does it work?" [6482-7641] -->
<h2><a>Notes</a></h2>
<div>
@ -306,6 +310,10 @@ I know that the current version of loader is not yet fully functional, but beliv
Hope I will meet your expectations.
</p>
<p>
Be mindful of the result model vertices amount. The best results are achieved when the model is smooth and has no texture. Then the vertex amount is equal to the vertex amount in blender. If the model is not smooth or has a generated texture applied then the amount of vertices is 3 times larger than mesh's triangles amount. If a 2d texture is applied with UV mapping then the vertex count will vary depending on how much the UV map is fragmented.
@ -34,13 +34,19 @@ The jMonkeyEngine <acronym title="Software Development Kit">SDK</acronym> includ
</li>
</ol>
<p>
Also check out <ahref="/com/jme3/gde/core/docs/jme3/external/blender.html">how to create compatible models in blender</a> and <ahref="/com/jme3/gde/core/docs/jme3/intermediate/multi-media_asset_pipeline.html">how to organize your assets</a>.
</p>
</div>
<!-- EDIT2 SECTION "Installing the OgreXML Exporter in Blender" [712-1144] -->
<!-- EDIT2 SECTION "Installing the OgreXML Exporter in Blender" [712-1311] -->
<h2><a>Importing and Viewing a Model</a></h2>
<div>
</div>
<!-- EDIT3 SECTION "Importing and Viewing a Model" [1145-1186] -->
<!-- EDIT3 SECTION "Importing and Viewing a Model" [1312-1353] -->
<h3><a>Using the Model Importer Tool</a></h3>
<div>
@ -76,7 +82,7 @@ The model is converted to j3o and all necessary files are copied to the project
</p>
</div>
<!-- EDIT4 SECTION "Using the Model Importer Tool" [1187-2052] -->
<!-- EDIT4 SECTION "Using the Model Importer Tool" [1354-2219] -->
<h3><a>Using the model files directly</a></h3>
<div>
@ -113,7 +119,7 @@ Note: If the SceneViewer doesn't work refer to <a href="/com/jme3/gde/core/
</p>
</div>
<!-- EDIT5 SECTION "Using the model files directly" [2053-3270] -->
<!-- EDIT5 SECTION "Using the model files directly" [2220-3437] -->
<h2><a>Working With a Model</a></h2>
<div>
<ul>
@ -128,17 +134,17 @@ Note: If the SceneViewer doesn't work refer to <a href="/com/jme3/gde/core/
</ul>
</div>
<!-- EDIT6 SECTION "Working With a Model" [3271-3606] -->
<!-- EDIT6 SECTION "Working With a Model" [3438-3773] -->
<h2><a>Notes About Model Assets</a></h2>
<div>
<p>
The original OgreXML <code>.mesh.xml</code>, <code>.scene</code>, <code>.material</code> and<code>.skeleton.xml</code> model files <strong>will not be included</strong> in the distribution <code>assets.jar</code> file of your distributed game, they are only available in the assets folder so you are able to recreate the <code>.j3o</code> file from the original if you ever come to change it in blender and have to export it again.
The original OgreXML <code>.mesh.xml</code>, <code>.scene</code>, <code>.material</code>,<code>.skeleton.xml</code> and <code>.blend</code> model files <strong>will not be included</strong> in the distribution <code>assets.jar</code> file of your distributed game, they are only available in the assets folder so you are able to recreate the <code>.j3o</code> file from the original if you ever come to change it in blender and have to export it again.
</p>
</div>
<!-- EDIT7 SECTION "Notes About Model Assets" [3607-4011] -->
<!-- EDIT7 SECTION "Notes About Model Assets" [3774-4190] -->
<h2><a>About the SceneViewer and SceneExplorer window</a></h2>
<div>
@ -152,7 +158,7 @@ Most plugins will deliver their own UI elements to modify the scene so the Scene
</p>
</div>
<!-- EDIT8 SECTION "About the SceneViewer and SceneExplorer window" [4012-4531] -->
<!-- EDIT8 SECTION "About the SceneViewer and SceneExplorer window" [4191-4710] -->
<h3><a>About the projects AssetManager</a></h3>
<div>
@ -176,5 +182,5 @@ To have a valid jME3 object, the paths to textures and other assets belonging to
</span></div>
</div>
<!-- EDIT9 SECTION "About the projects AssetManager" [4532-] -->
<!-- EDIT9 SECTION "About the projects AssetManager" [4711-] -->
<p><div>Pressing <strong>F6 builds & runs</strong> the <em>main</em> class of the <em>main project</em>. 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. <br/>
To build and run the main() of <em>any file that is open in the editor</em>, press <strong>Shift-F6</strong> !
</div></p>
</p>
<ul>
<li><div> Select Tools→Libraries in the main menu.</div>
</li>
<li><div> Click "New Library", enter a name for the library, and press OK</div>
</li>
<li><div> In the "Classpath" tab, press "Add JAR/Folder" and select the jar file(s) needed for the library</div>
</li>
<li><div> (Optional) In the "JavaDoc" tab, press "Add ZIP/Folder" and select the javadoc for the library, as zip file or folder.</div>
<li><div> Right-Click the project and use the context-menu to clean all generated classes and JARs.</div>
</li>
<li><div>(Optional) In the "Sources" tab you can select a folder or jar file containing the source files of the library.</div>
<li><div> Right-Click individual files with a main method to build and run them. (Shift-F6)</div>
</li>
<li><div> Press OK</div>
<li><div> Press the Run button (green arrow in the toolbar) to build and run the project. (F6) </div>
</li>
</ul>
<p>
Add the library to a project:
<strong>More than one project open?</strong> 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.
</p>
<ul>
<li><div> Right-Click your project and select "Properties"</div>
</li>
<li><div> Select "Libaries" on the left and then press "Add Library"</div>
</li>
<li><div> Select the library from the list and press OK</div>
</li>
</ul>
<p>
That's it, your project can now use the external library. If you also linked the javadoc and sources, the <acronymtitle="Software Development Kit">SDK</acronym> will assist you with javadoc popups, code completion (ctrl-space) and source navigation (ctrl-click).
<strong>Worried About Proprietary Lock-in?</strong> You are never locked into the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>: 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:
</p>
<pre>ant clean; ant jar; ant run;</pre>
</div>
<!-- EDIT5 SECTION "Adding external jar libraries" [3467-4570] -->
<!-- EDIT5 SECTION "Clean, Build and Run Cycle" [3503-4839] -->
<h3><a>Development Process</a></h3>
<div>
<ul>
@ -191,36 +180,53 @@ That's it, your project can now use the external library. If you also linke
You may want to use external Java libraries in your jME project, for example content generators or artificial intelligence implementations.
</p>
<p>
Add the library to the global library list:
</p>
<ul>
<li><div>Right-Click the project and use the context-menu to clean all generated classes and JARs.</div>
<li><div>Select Tools→Libraries in the main menu.</div>
</li>
<li><div> Right-Click individual files with a main method to build and run them. (Shift-F6)</div>
<li><div> Click "New Library", enter a name for the library, and press OK</div>
</li>
<li><div> In the "Classpath" tab, press "Add JAR/Folder" and select the jar file(s) needed for the library</div>
</li>
<li><div> Press the Run button (green arrow in the toolbar) to build and run the project. (F6)</div>
<li><div> (Optional) In the "JavaDoc" tab, press "Add ZIP/Folder" and select the javadoc for the library, as zip file or folder.</div>
</li>
<li><div> (Optional) In the "Sources" tab you can select a folder or jar file containing the source files of the library.</div>
</li>
<li><div> Press OK</div>
</li>
</ul>
<p>
<strong>More than one project open?</strong> 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.
Add the library to a project:
</p>
<ul>
<li><div> Right-Click your project and select "Properties"</div>
</li>
<li><div> Select "Libaries" on the left and then press "Add Library"</div>
</li>
<li><div> Select the library from the list and press OK</div>
</li>
</ul>
<p>
<strong>Worried About Proprietary Lock-in?</strong> You are never locked into the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>: 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:
That's it, your project can now use the external library. If you also linked the javadoc and sources, the <acronymtitle="Software Development Kit">SDK</acronym> will assist you with javadoc popups, code completion (ctrl-space) and source navigation (ctrl-click).
</p>
<pre>ant clean; ant jar; ant run;</pre>
</div>
<!-- EDIT7 SECTION "Clean, Build and Run Cycle" [5757-6655] -->
<!-- EDIT7 SECTION "Adding external jar libraries" [6026-7129] -->
<h3><a>Application Deployment</a></h3>
<div>
<ul>
@ -229,7 +235,7 @@ That's it, your project can now use the external library. If you also linke
If you have problems updating the <acronymtitle="Software Development Kit">SDK</acronym>, try deleting all files from jmonkeyplatform/update/downloador [settings folder]/update/download depending on your system (look above for the settings folder location).
If you have problems updating the <acronymtitle="Software Development Kit">SDK</acronym>, try deleting all files from <code>jmonkeyplatform/update/download</code> and/or <code>[settings folder]/update/download</code> depending on your system (look above for the settings folder location).