@ -83,7 +83,7 @@ To export your models as Ogre <acronym title="Extensible Markup Language">XML</a
<p>
You can now use the <ahref="/com/jme3/gde/docs/sdk.html">jMonkeyEngine SDK</a> to <ahref="/com/jme3/gde/docs/sdk/model_loader_and_viewer.html">load and view models</a>. You can <ahref="/com/jme3/gde/docs/sdk/scene_composer.html">create scenes</a> from them and write cde that loads them into your application.
You can now use the <ahref="/com/jme3/gde/docs/sdk.html">jMonkeyEngine SDK</a> to <ahref="/com/jme3/gde/docs/sdk/model_loader_and_viewer.html">load and view models</a>. You can <ahref="/com/jme3/gde/docs/sdk/scene_composer.html">create scenes</a> from them and write code that loads them into your application.
The <code>com.jme3.app.state.AppState</code> 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 <ahref="/com/jme3/gde/docs/jme3/advanced/custom_controls.html">Custom Controls</a> instead. Controls and AppStates can be used together.)
The <code>com.jme3.app.state.AppState</code> 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 <ahref="/com/jme3/gde/docs/jme3/advanced/custom_controls.html">Custom Controls</a> instead. Controls and AppStates can be used together.)
@ -127,7 +126,7 @@ setLocalTranslation(???)</td><td>Activates 3D audio: The sound appears to come f
<td>setReverbEnabled(true)</td><td>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 <code>com.jme3.audio.Environment</code> that the <code>audioRenderer</code> is in. See "Setting Audio Environment Properties" below. </td>
</tr>
</table></div>
<!-- EDIT11 TABLE [3880-4496] -->
<!-- EDIT11 TABLE [3917-4533] -->
<p>
<p><div>Positional 3D sounds require an <code>AudioListener</code> object in the scene (representing the player's ears).
@ -135,7 +134,7 @@ setLocalTranslation(???)</td><td>Activates 3D audio: The sound appears to come f
</p>
</div>
<!-- EDIT10 SECTION "Positional 3D Sounds" [3848-4625] -->
<!-- EDIT10 SECTION "Positional 3D Sounds" [3885-4662] -->
<h3><a>Directional 3D Sounds</a></h3>
<div>
<div><table>
@ -151,7 +150,7 @@ 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>
</tr>
</table></div>
<!-- EDIT13 TABLE [4659-5186] -->
<!-- EDIT13 TABLE [4696-5223] -->
<p>
<p><div>Directional 3D sounds require an AudioListener object in the scene (representing the player's ears).
@ -159,7 +158,7 @@ setOuterAngle()</td><td>Set the angle in degrees for the directional audio. The
</p>
</div>
<!-- EDIT12 SECTION "Directional 3D Sounds" [4626-5313] -->
<!-- EDIT12 SECTION "Directional 3D Sounds" [4663-5350] -->
<h2><a>Play, Pause, Stop</a></h2>
<div>
@ -181,7 +180,7 @@ You can also start playing instances of an AudioNode. Use the <code>playInstance
<li><div> Either use a default, e.g. make you scene sounds like a dungeon environment: <pre>audioRenderer.setEnvironment(new Environment(Environment.Dungeon));</pre>
@ -266,5 +265,5 @@ Advanced users find more info about OpenAL and its features here: <object classi
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 <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://en.wikipedia.org/wiki/Cutscene"><paramname="text"value="<html><u>cutscenes</u></html>"><paramname="textColor"value="blue"></object> and movies/trailers for your game. Internally, Cinematics are implemented as <ahref="/com/jme3/gde/docs/jme3/advanced/application_states.html">AppStates</a>.
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 <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://en.wikipedia.org/wiki/Cutscene"><paramname="text"value="<html><u>cutscenes</u></html>"><paramname="textColor"value="blue"></object> 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.
</p>
<p>
Internally, Cinematics are implemented as <ahref="/com/jme3/gde/docs/jme3/advanced/application_states.html">AppStates</a>.
</p>
<p>
@ -24,7 +28,7 @@ This Node can be the rootNode, or a Node that is attached to the rootNode. </div
</ol>
</div>
<!-- EDIT1 SECTION "JME3 Cinematics" [1-923] -->
<!-- EDIT1 SECTION "JME3 Cinematics" [1-1103] -->
<h2><a>Sample Code</a></h2>
<div>
<ul>
@ -33,7 +37,7 @@ This Node can be the rootNode, or a Node that is attached to the rootNode. </div
<td>cinematic.pause()</td><td>Pauses the cinematic.</td>
</tr>
</table></div>
<!-- EDIT4 TABLE [2182-2394] -->
<!-- EDIT4 TABLE [2362-2574] -->
</div>
<!-- EDIT3 SECTION "How to Use a Cinematic" [1091-2394] -->
<!-- EDIT3 SECTION "How to Use a Cinematic" [1271-2574] -->
<h2><a>Events(CinematicEvents)</a></h2>
<div>
@ -117,7 +121,7 @@ Here is the list of available CinematicEvents that you use as events. Each track
<td>AnimationEvent</td><td>Use this to start playing a model <ahref="/com/jme3/gde/docs/jme3/advanced/animation.html">animation</a> at a given time (a character walking animation for example)</td>
</tr>
</table></div>
<!-- EDIT6 TABLE [2688-3489] -->
<!-- EDIT6 TABLE [2868-3669] -->
<p>
Of course one can make is own event implementation, by extending the AbstractCinematicEvent.
@ -125,7 +129,7 @@ Of course one can make is own event implementation, by extending the AbstractCin
@ -189,14 +193,14 @@ To create a MotionEvent, do the following:
<td>event.setRotation(quaternion)</td><td>Sets the rotation. Use together with <code>MotionEvent.Direction.Rotation</code> or <code>MotionEvent.Direction.PathAndRotation</code>.</td>
</tr>
</table></div>
<!-- EDIT8 TABLE [4069-5478] -->
<!-- EDIT8 TABLE [4249-5658] -->
<p>
<strong>Tip:</strong> Most likely you remote-control more than one object in your scene. Give the events and paths useful names such as <code>dragonEvent</code>, <code>dragonPath</code>, <code>heroEvent</code>, <code>heroPath</code>, etc.
A <code>com.jme3.scene.control.Control</code> 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 customs Controls together implement the behaviours of a type of Spatial.
A <code>com.jme3.scene.control.Control</code> 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.
</p>
<p>
@ -43,7 +43,7 @@ To implement game logic for a type of spatial, you will either extend AbstractCo
</p>
</div>
<!-- EDIT1 SECTION "Custom Controls" [1-1747] -->
<!-- EDIT1 SECTION "Custom Controls" [1-1746] -->
<h2><a>Usage</a></h2>
<div>
@ -91,7 +91,7 @@ The possibilities are endless. <img src="/wiki/lib/images/smileys/icon_smile.gif
</p>
</div>
<!-- EDIT2 SECTION "Usage" [1748-3215] -->
<!-- EDIT2 SECTION "Usage" [1747-3214] -->
<h2><a>Example Code</a></h2>
<div>
@ -115,7 +115,7 @@ Existing examples in the code base include:
</ul>
</div>
<!-- EDIT3 SECTION "Example Code" [3216-4500] -->
<!-- EDIT3 SECTION "Example Code" [3215-4499] -->
<h2><a>AbstractControl Class</a></h2>
<div>
@ -155,12 +155,19 @@ Usage: Your custom subclass implements the three methods <code>controlUpdate()</
// index=i; // example
}
<span>/** This is your init method. Optionally, you can modify
* the spatial from here (transform it, initialize userdata, etc). */</span>
<span>/** This method is called when the control is added to the spatial,
* and when the control is removed from the spatial (setting a null value).
* It can be used for both initialization and cleanup. */</span>
@Override
public void setSpatial(Spatial spatial){
super.setSpatial(spatial);
// spatial.setUserData("index", i); // example
<p><div>In the less common case that you want to create a Control that also extends another class, create a custom interface that extends jME3's Control interface. Your class can become a Control by implement the Control interface, and at the same time extend another class.
<p><div>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.
</div></p>
</p>
@ -321,7 +328,7 @@ Usage example:
}</pre>
</div>
<!-- EDIT5 SECTION "The Control Interface" [7448-10699] -->
<!-- EDIT5 SECTION "The Control Interface" [7584-10841] -->
Here is an extract taken from @nehon in the forum thread (<objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://hub.jmonkeyengine.org/forum/topic/how-exactly-do-filters-work/"><paramname="text"value="<html><u>http://hub.jmonkeyengine.org/forum/topic/how-exactly-do-filters-work/</u></html>"><paramname="textColor"value="blue"></object>)
</p>
<p>
The methods are called in this order (pretty much the same flow as processors):
- initFilter() is called once when the FilterPostPorcessor is initialized or when the filter is added to the processor and this one as already been initialized.
</p>
<p>
for each frame the methods are called in that sequence :
- preFrame() occurs before anything happens
- postQueue() occcurs once the queues have been populated (there is one queue per bucket and 2 additional queues for the shadows, casters and recievers). Note that geometries in the queues are the one in the view frustum.
- postFrame occurs once the main frame has been rendered (the back buffer)
</p>
<p>
Those methods are optional in a filter, they are only there if you want to hook in the rendering process.
</p>
<p>
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.
</p>
<p>
Forced-technique can be any technique really, they are more related with the material system than to the filters but anyway. When you use a forced technique the renderer tries to select it on the material of each geometry, if the technique does not exists for the material the geometry is not rendered.
You assume well about the SSAO filer, the normal of the scene are rendered to a texture in a pre pass.
</p>
<p>
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.
@ -158,15 +158,15 @@ In your IDE, use code completion to quickly look up Trigger literals. In the jMo
<td>INPUT_MAPPING_CAMERA_POS</td><td>KEY_C</td><td>Prints debug output about the camera.</td>
</tr>
<tr>
<td>INPUT_MAPPING_MEMORY</td><td>KEY_M</td><td>Prints debug output for memtory usage.</td>
<td>INPUT_MAPPING_MEMORY</td><td>KEY_M</td><td>Prints debug output for memory usage.</td>
</tr>
<tr>
<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>
@ -75,7 +75,7 @@ You can get a list of all lights added to a Spatial by calling <code>getWorldLig
</p>
<p>
A PointLight has a location and shines from there in all directions as far as its radius reaches. The light intensity decreases with increased distance from the light source. A PointLight can at the moment not be used for casting shadows (using the PssmShadowRenderer - read more about this below).
A PointLight has a location and shines from there in all directions as far as its radius reaches. The light intensity decreases with increased distance from the light source. A PointLight can be used to cast shadows along with a PointLightShadowRenderer (see the Casting Shadows section)
For Simple Lighting we use Geometries with Materials based on Lighting.j3md (learn <ahref="/com/jme3/gde/docs/jme3/advanced/materials_overview.html">more about Materials</a> here). Lighting.j3md-based materials dynamically support Shininess, and Ambient, Diffuse, and Specular light if there is a light source present. Note that this lighting method alone does not make the Geometry cast a shadow onto other Geometries automatically (see below for how to add drop shadows etc).
The above example uses material colors and no textures. You can of course also use Lighting.j3md to create a lit Material that uses Texture Maps. The following example uses Shininess, Diffuse Map and Normal Map (a.k.a Bump Map).
These light effects update live when the object or light source moves. If you shine a colored PointLight at this object, you will see a light reflection tinged in the color of the PointLight.
Use the Shadow Renderer to make Geometries with Lighting.j3md-based Materials cast and receive basic drop shadows. This fast and simple implementation of a shadow effect is good for scenes with flat floors, but looks less realistic on uneven terrains. To use it, you add a jME SceneProcessor named com.jme3.shadow.BasicShadowRenderer to the viewPort.
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.
Shadow calculations (cast and receive) have a performance impact, so use them sparingly. With shadow renderers, you can turn off shadow casting and/or shadow receiving for individual geometries, for portions of the scene graph, or for the entire scene:
</p>
<pre>BasicShadowRenderer bsr;
...
public void simpleInitApp(){
...
bsr = new BasicShadowRenderer(assetManager, 256);
bsr.setDirection(new Vector3f(-.5f,-.5f,-.5f).normalizeLocal()); // light direction
viewPort.addProcessor(bsr);
...</pre>
<pre>spatial.setShadowMode(ShadowMode.Inherit); // This is the default setting for new spatials.
rootNode.setShadowMode(ShadowMode.Off); // Disable shadows for the whole scene, except where overridden.
wall.setShadowMode(ShadowMode.CastAndReceive); // The wall can cast shadows and also receive them.
floor.setShadowMode(ShadowMode.Receive); // Any shadows cast by the floor would be hidden by it.
airplane.setShadowMode(ShadowMode.Cast); // There's nothing above the airplane to cast shadows on it.
ghost.setShadowMode(ShadowMode.Off); // The ghost is translucent: it neither casts nor receives shadows.</pre>
<p>
Shadow calculations (cast and receive) have a performance impact, therefor we recommend to use them smartly. Switch off the default shadow mode for the whole scene graph, and then specify the shadow behaviour individually for every scene node that needs shadows: You specifiy whether it casts shadows, receives shadows, both (slower), or neither (faster).
Both shadow renderers and shadow filters use shadow modes to determine which objects can cast shadows. However, only the shadow renderers pay attention to shadow modes when determining which objects receive shadows. With a shadow filter, shadow modes have no effect on which objects receive shadows.
</p>
<pre>rootNode.setShadowMode(ShadowMode.Off); // reset all
wall.setShadowMode(ShadowMode.CastAndReceive); // normal behaviour (slow)
floor.setShadowMode(ShadowMode.Receive); // can't see shadow cast below floor anyway...
The more advanced PSSM shadow renderer can cast real-time shadows, even on curved surfaces such as terrains. It is a bit more resource hungry than the BasicShadowRenderer. To activate PSSM drop shadows, add a jME SceneProcessor named <code>com.jme3.shadow.PssmShadowRenderer</code> to the viewPort. PSSM stands for the Parallel-Split Shadow Map technique.
<li><div><objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/test/jme3test/post/TestTransparentSSAO.java"><paramname="text"value="<html><u>jme3/src/test/jme3test/post/TestTransparentSSAO.java</u></html>"><paramname="textColor"value="blue"></object> ??? Screen-Space Ambient Occlusion shadows plus transparancy</div>
</li>
<li><div><objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://jmonkeyengine.org/2010/08/16/screen-space-ambient-occlusion-for-jmonkeyengine-3-0/#more-321"><paramname="text"value="<html><u>Screen Space Ambient Occlusion for jMonkeyEngine (article)</u></html>"><paramname="textColor"value="blue"></object></div>
<li><div><objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://hub.jmonkeyengine.org/2010/08/screen-space-ambient-occlusion-for-jmonkeyengine-3-0/"><paramname="text"value="<html><u>Screen Space Ambient Occlusion for jMonkeyEngine (article)</u></html>"><paramname="textColor"value="blue"></object></div>
</li>
</ul>
<p>
Ambient Occlusion refers to the shadows that nearby objects cast on each other under an ambient lighting. It???s an approximation of how light radiates in a real life scene. To activate Ambient Occlusion shadows, add a jME SceneProcessor named <code>com.jme3.post.SSAOFilter</code> to the viewPort. SSAO stands for the Screen Space Ambient Occlusion technique.
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.
</p>
<p>
In JME3, SSAO is implemented by adding an instance of <code>com.jme3.post.SSAOFilter</code> to a viewport which already simulates shadows using another method such as DirectionalLightShadowRenderer.
</p>
<pre>FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
SSAOFilter ssaoFilter = new SSAOFilter(12.94f, 43.92f, 0.33f, 0.61f);
@ -22,7 +22,7 @@ See <a href="/com/jme3/gde/docs/jme3/advanced/input_handling.html">Input Handlin
<p>
The following <code>pick target</code> 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 use this method together with a first-person flyCam.
The following <code>pick target</code> 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.
</p>
<ol>
@ -72,7 +72,7 @@ The following example rotates Spatials named "Red Box" or "Blue B
};</pre>
</div>
<!-- EDIT2 SECTION "Pick a Target Using Fixed Crosshairs" [534-3109] -->
<!-- EDIT2 SECTION "Pick a Target Using Fixed Crosshairs" [534-3105] -->
<h2><a>Pick a Target Using the Mouse Pointer</a></h2>
<div>
@ -146,5 +146,5 @@ The following example rotates Spatials named "Red Box" or "Blue B
</span></div>
</div>
<!-- EDIT3 SECTION "Pick a Target Using the Mouse Pointer" [3110-] -->
<!-- EDIT3 SECTION "Pick a Target Using the Mouse Pointer" [3106-] -->
jME3 is similar to Swing in that for speed and efficiency all changes to the world must be made in a single update thread. This is happening automatically if using Controls and AppSates update metod or simpleUpdate however whenever you pass work to another thread you need to hand the results back to the main jME3 thread before making any changes to the scene graph.
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.
</p>
<pre>public void rotateGeometry(final Geometry geo, final Quaternion rot){
@ -230,7 +230,17 @@ private Callable<MyWayList> findWay = new Callable<MyWayList>(&#
};</pre>
</div>
<!-- EDIT8 SECTION "The Callable" [7508-9874] -->
<!-- EDIT8 SECTION "The Callable" [7560-9926] -->
<h2><a>Useful Links</a></h2>
<div>
<p>
High level description which describes how to manage the game state and the rendering in different threads - <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://www.altdevblogaday.com/2011/07/03/threading-and-your-game-loop/"><paramname="text"value="<html><u>link</u></html>"><paramname="textColor"value="blue"></object>
@ -53,15 +53,17 @@ You can register several types of listeners to be notified of changes.
</li>
<li><div> ConnectionListeners inform the Server about HostedConnection arrivals and removals, e.g. if a client joins or quits.</div>
</li>
<li><div> ErrorListeners inform the Client about network exceptions that have happened, e.g. if the server crashes, the client throws a ConnectorException, this can be picked up so that the application can do something about it.</div>
</li>
</ul>
</div>
<!-- EDIT2 SECTION "SpiderMonkey API Overview" [842-2386] -->
<!-- EDIT2 SECTION "SpiderMonkey API Overview" [842-2609] -->
<h2><a>Client and Server</a></h2>
<div>
</div>
<!-- EDIT4 SECTION "Client and Server" [2387-2417] -->
<!-- EDIT4 SECTION "Client and Server" [2610-2640] -->
<h3><a>Creating a Server</a></h3>
<div>
@ -96,7 +98,7 @@ When you run this app on a host, the server is ready to accept clients. Let'
</p>
</div>
<!-- EDIT5 SECTION "Creating a Server" [2418-3368] -->
<!-- EDIT5 SECTION "Creating a Server" [2641-3591] -->
<h3><a>Creating a Client</a></h3>
<div>
@ -135,7 +137,7 @@ When you run this client, it connects to the server.
</p>
</div>
<!-- EDIT6 SECTION "Creating a Client" [3369-4534] -->
<!-- EDIT6 SECTION "Creating a Client" [3592-4757] -->
<h3><a>Getting Info About a Client</a></h3>
<div>
@ -158,7 +160,7 @@ The server refers to a connected client as com.jme3.network.HostedConnection obj
<td>myServer.getConnection(0)</td><td>Server gets the first (0), second (1), etc, connected HostedConnection object (one client).</td>
</tr>
</table></div>
<!-- EDIT8 TABLE [4711-5090] -->
<!-- EDIT8 TABLE [4934-5313] -->
<p>
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 <code>MyState</code> in the HostedConnection object <code>conn</code>:
@ -175,14 +177,14 @@ Your game can define its own game data based on whatever criteria you want, typi
<td> MyState state = conn.getAttribute("MyState")</td><td> Server can read an attribute of the HostedConnection. </td>
</tr>
</table></div>
<!-- EDIT9 TABLE [5465-5694] -->
<!-- EDIT9 TABLE [5688-5917] -->
</div>
<!-- EDIT7 SECTION "Getting Info About a Client" [4535-5695] -->
<!-- EDIT7 SECTION "Getting Info About a Client" [4758-5918] -->
<h2><a>Messaging</a></h2>
<div>
</div>
<!-- EDIT10 SECTION "Messaging" [5696-5718] -->
<!-- EDIT10 SECTION "Messaging" [5919-5941] -->
<h3><a>Creating Message Types</a></h3>
<div>
@ -203,7 +205,7 @@ You must register each message type to the com.jme3.network.serializing.Serializ
<!-- EDIT12 SECTION "Responding to Messages" [6672-8416] -->
<!-- EDIT12 SECTION "Responding to Messages" [6895-8639] -->
<h3><a>Creating and Sending Messages</a></h3>
<div>
@ -297,7 +299,7 @@ The last two broadcasting methods use com.jme3.network.Filters to select a subse
</p>
</div>
<!-- EDIT13 SECTION "Creating and Sending Messages" [8417-9506] -->
<!-- EDIT13 SECTION "Creating and Sending Messages" [8640-9729] -->
<h2><a>Identification and Rejection</a></h2>
<div>
@ -308,21 +310,22 @@ The ID of the Client and HostedConnection are the same at both ends of a connect
<pre>... myClient.getId() ...</pre>
<p>
A server has a game version and game name property. Each client expects to communicate with a server with a certain game name and version. Test first whether the game name matches, and then whether game version matches, before sending any messages! If they do not match, you should refuse to connect, because unmatched clients and servers will likely miscommunicate.
A server has a game version and game name property. Each client expects to communicate with a server with a certain game name and version. Test first whether the game name matches, and then whether game version matches, before sending any messages! If they do not match, SpiderMoney will reject it for you, you have no choice in the mater. This is so the client and server can avoid miscommunication.
</p>
<p>
<p><div>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).
</div></p>
</p>
</div>
<!-- EDIT14 SECTION "Identification and Rejection" [9507-10424] -->
<!-- EDIT14 SECTION "Identification and Rejection" [9730-10680] -->
<h2><a>Closing Clients and Server Cleanly</a></h2>
<div>
</div>
<!-- EDIT15 SECTION "Closing Clients and Server Cleanly" [10425-10471] -->
<!-- EDIT15 SECTION "Closing Clients and Server Cleanly" [10681-10727] -->
<h3><a>Closing a Client</a></h3>
<div>
@ -338,7 +341,7 @@ You must override the client's destroy() method to close the connection cle
}</pre>
</div>
<!-- EDIT16 SECTION "Closing a Client" [10472-10747] -->
<!-- EDIT16 SECTION "Closing a Client" [10728-11003] -->
<h3><a>Closing a Server</a></h3>
<div>
@ -354,7 +357,7 @@ You must override the server's destroy() method to close the connection whe
}</pre>
</div>
<!-- EDIT17 SECTION "Closing a Server" [10748-11004] -->
<!-- EDIT17 SECTION "Closing a Server" [11004-11260] -->
<h3><a>Kicking a Client</a></h3>
<div>
@ -365,7 +368,7 @@ The server can kick a HostedConnection to make it disconnect. You should provide
<!-- EDIT18 SECTION "Kicking a Client" [11005-11395] -->
<!-- EDIT18 SECTION "Kicking a Client" [11261-11651] -->
<h2><a>Listening to Connection Notification</a></h2>
<div>
@ -375,13 +378,18 @@ The server and clients are notified about connection changes.
</p>
</div>
<!-- EDIT19 SECTION "Listening to Connection Notification" [11396-11507] -->
<!-- EDIT19 SECTION "Listening to Connection Notification" [11652-11763] -->
<h3><a>ClientStateListener</a></h3>
<div>
<p>
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.
</p>
<p>
<p><div>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.
</div></p>
</p>
<div><table>
@ -395,7 +403,7 @@ The com.jme3.network.ClientStateListener notifies the Client when the Client has
<td> public void clientDisconnected(Client c, DisconnectInfo info){} </td><td> Implement here what happens after the server kicks this client. For example, display the DisconnectInfo to the user. </td>
</tr>
</table></div>
<!-- EDIT21 TABLE [11750-12119] -->
<!-- EDIT21 TABLE [12348-12717] -->
<p>
First implement the ClientStateListener interface in the Client class. Then register it to myClient in MyGameClient's simpleInitApp() method:
@ -403,7 +411,7 @@ First implement the ClientStateListener interface in the Client class. Then regi
@ -423,7 +431,7 @@ The com.jme3.network.ConnectionListener notifies the Server whenever new HostedC
<td> public void connectionRemoved(Server s, HostedConnection c){} </td><td> Implement here what happens after a HostedConnection has left. E.g. a player has quit the game and the server removes his character. </td>
</tr>
</table></div>
<!-- EDIT23 TABLE [12587-12985] -->
<!-- EDIT23 TABLE [13184-13582] -->
<p>
First implement the ConnectionListener interface in the Server class. Then register it to myServer in MyGameServer's simpleInitApp() method.
@ -432,7 +440,55 @@ First implement the ConnectionListener interface in the Server class. Then regis
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.
</p>
<p>
<p><div>If you intend on using the default network mechanics, <strong>don't</strong> 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.
<td> public void handleError(Client c, Throwable t){} </td><td> Implemenent here what happens after a exception affects the network . </td>
</tr>
</table></div>
<!-- EDIT25 TABLE [14233-14402] -->
<p>
<p><div>This interface was built for the client and server, but the code has never been put on the server to handle this listener.
</div></p>
</p>
<p>
First implement the ErrorListener interface in the client class. Then you need to register it to myClient in MyGameClients's simpleInitApp() method.
In the class that implements the ErrorListener, a method would of been added call handleError(Client s, Throwable t). Inside this method to get you started, you going to want to listen for an error. To do this you're going to want a bit of code like this.
</p>
<pre>if(t instanceof exception){
//Add your own code here
}</pre>
<p>
Replace <strong>exception</strong> part in the <strong>if</strong> statement for the type of exception that you would like it to handle.
@ -154,10 +154,16 @@ Learn more from the NiftyGUI page:
</li>
<li><div><objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://jmonkeyengine.org/groups/gui/forum/topic/anyone-succeeded-in-changing-text-in-nifty-programatically/#post-109510"><paramname="text"value="<html><u>Forum post: Changing Text in Nifty GUIs programmatically</u></html>"><paramname="textColor"value="blue"></object></div>
<li><div><objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:nifty_gui:groovy"><paramname="text"value="<html><u>Nifty GUI with Groovy</u></html>"><paramname="textColor"value="blue"></object></div>
@ -26,7 +26,7 @@ In the previous parts of the tutorial, you created a two-screen user interface.
<p>
To let a Nifty screen communicate with the Java application, you register a <code>ScreenController</code> to every NiftyGUI screen. You create a ScreenController by creating a Java class that implements the <code>de.lessvoid.nifty.screen.ScreenController</code> interface and its abtract methods.
To let a Nifty screen communicate with the Java application, you register a <code>ScreenController</code> to every NiftyGUI screen. You create a ScreenController by creating a Java class that implements the <code>de.lessvoid.nifty.screen.ScreenController</code> interface and its abstract methods.
</p>
<p>
@ -100,7 +100,7 @@ Now the Java class <code>MyStartScreen</code> and this <acronym title="Graphical
</p>
</div>
<!-- EDIT2 SECTION "Connect GUI to Java Controller" [792-3174] -->
<!-- EDIT2 SECTION "Connect GUI to Java Controller" [792-3175] -->
<h2><a>Make GUI and Java Interact</a></h2>
<div>
@ -114,7 +114,7 @@ Use any combination of the three following approaches to make Java classes inter
</p>
</div>
<!-- EDIT3 SECTION "Make GUI and Java Interact" [3175-3547] -->
<!-- EDIT3 SECTION "Make GUI and Java Interact" [3176-3548] -->
<h3><a>GUI Calls a Void Java Method</a></h3>
<div>
@ -214,7 +214,7 @@ The quitGame() example shows that you have access to the application <code>app</
@ -104,8 +104,22 @@ public StartScreenState(SimpleApplication app){
}</pre>
<p>
<p><div>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.
</div></p>
</p>
<pre>public class TestNiftyGui extends SimpleApplication {
public void simpleInitApp(){
StartScreenState startScreenState = new StartScreenState(this);
stateManager.attach(startScreenState);
// [...] boilerplate init nifty omitted
nifty.fromXml("Interface/myGui.xml", "start", startScreenState); //one of the XML screen elements needs to reference StartScreenState controller class
}
}</pre>
</div>
<!-- EDIT3 SECTION "Get Access to Application and Update Loop" [2044-3599] -->
<!-- EDIT3 SECTION "Get Access to Application and Update Loop" [2044-4243] -->
<h2><a>Know Your Variables</a></h2>
<div>
<div><table>
@ -125,14 +139,14 @@ public StartScreenState(SimpleApplication app){
<td>${PROP.key}</td><td> looks up <code>key</code> in the Nifty properties. Use Nifty.setGlobalproperties(properties) and Nifty.getGlobalproperties("key"). Or SystemGetProperties(key);</td>
</tr>
</table></div>
<!-- EDIT5 TABLE [3632-4163] -->
<!-- EDIT5 TABLE [4276-4807] -->
<p>
See also: <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=MarkUp"><paramname="text"value="<html><u>http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=MarkUp</u></html>"><paramname="textColor"value="blue"></object>
</p>
</div>
<!-- EDIT4 SECTION "Know Your Variables" [3600-4246] -->
<!-- EDIT4 SECTION "Know Your Variables" [4244-4890] -->
<h2><a>Use ScreenControllers for Mutally Exclusive Functionality</a></h2>
<div>
@ -152,7 +166,7 @@ For example, create a <code>MyHudScreen.java</code> for the <code>hud</code> scr
The PhysicsControl constructors expect a Collision Shape and a mass (a float in kilogram). The most commonly used PhysicsControl is the RigidBodyControl:
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.
</p>
<pre>RigidBodyControl myThing_phys =
new RigidBodyControl( myThing_shape , 123.0f ); // dynamic</pre>
@ -373,7 +373,7 @@ The PhysicsControl constructors expect a Collision Shape and a mass (a float in
new RigidBodyControl( myDungeon_shape , 0.0f ); // static </pre>
<p>
<p><div>When you create the PhysicsControl, the mass value makes an important distinction: Set the mass to a non-zero value to create a dynamic object that can fall or roll, etc. Set the mass value to zero to create a static object, such as floor, wall, etc. If you give your floor a mass, it will fall out of the scene!
<p><div>If you give your floor a non-zero mass, it will fall out of the scene!
</div></p>
</p>
@ -395,10 +395,11 @@ gameLevel.addControl(new RigidBodyControl(0.0f)); // explicit ze
<p>
<p><div>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
<!-- EDIT15 SECTION "Add PhysicsControl to PhysicsSpace" [17440-18255] -->
<!-- EDIT15 SECTION "Add PhysicsControl to PhysicsSpace" [17378-18193] -->
<h2><a>Changing the Scale of a PhysicsControl</a></h2>
<div>
@ -481,7 +482,7 @@ With the corresponding output below:
</p>
</div>
<!-- EDIT16 SECTION "Changing the Scale of a PhysicsControl" [18256-20006] -->
<!-- EDIT16 SECTION "Changing the Scale of a PhysicsControl" [18194-19944] -->
<h3><a>PhysicsSpace Code Samples</a></h3>
<div>
@ -511,9 +512,9 @@ setWorldMin(new Vector3f(-10000f, -10000f, -10000f));</td><td>Specifies the size
<td>setCcdMotionThreshold()</td><td>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.</td>
<!-- EDIT22 SECTION "Kinematic vs Dynamic vs Static" [23858-26259] -->
<!-- EDIT22 SECTION "Kinematic vs Dynamic vs Static" [23796-26197] -->
<h2><a>Forces: Moving Dynamic Objects</a></h2>
<div>
@ -687,7 +688,7 @@ Use the following methods to move dynamic physical objects.
<td> clearForces()</td><td>Cancels out all forces (force, torque) etc and stops the motion.</td>
</tr>
</table></div>
<!-- EDIT25 TABLE [26365-27354] -->
<!-- EDIT25 TABLE [26303-27292] -->
<p>
<p><div>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.
@ -727,7 +728,7 @@ removeCollideWithGroup(COLLISION_GROUP_01)</td><td>Collision Groups are integer
<td> setCcdSweptSphereRadius(.5f)</td><td>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. </td>
</tr>
</table></div>
<!-- EDIT26 TABLE [27772-29727] -->
<!-- EDIT26 TABLE [27710-29665] -->
<p>
<p><div> You can <code>setApplyPhysicsLocal(true)</code> 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.
@ -735,7 +736,7 @@ removeCollideWithGroup(COLLISION_GROUP_01)</td><td>Collision Groups are integer
@ -188,11 +188,11 @@ manager.loadTexture("Textures/wavenormals.png") )</td><td>This normal
</tr>
<tr>
<td>water.setWaterColor(ColorRGBA.Brown.mult(2.0f));</td><td>Sets the main water color.</td><td>greenish blue <br/>
Vector3f(0.0f,0.5f,0.5f,1.0f)</td>
ColorRGBA(0.0f,0.5f,0.5f,1.0f)</td>
</tr>
<tr>
<td>water.setDeepWaterColor(ColorRGBA.Brown);</td><td>Sets the deep water color.</td><td>dark blue <br/>
Vector3f(0.0f, 0.0f,0.2f,1.0f)</td>
ColorRGBA(0.0f, 0.0f,0.2f,1.0f)</td>
</tr>
<tr>
<td>water.setWaterTransparency(0.2f);</td><td>Sets how fast colors fade out. use this to control how clear (e.g. 0.05f) or muddy (0.2f) water is.</td><td> 0.1f </td>
<td>water.setColorExtinction(new Vector3f(10f,20f,30f));</td><td>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.</td><td>Vector3f(5f,20f,30f)</td>
</tr>
</table></div>
<!-- EDIT9 TABLE [6562-7566] --><div><table>
<!-- EDIT9 TABLE [6562-7568] --><div><table>
<tr>
<th> Water method example</th><th> Effects: Shore</th><th>Default</th>
</tr>
@ -216,7 +216,7 @@ water.setRadius(260);</td><td>Limit the water filter to a semisphere with the gi
<td>water.setUseHQShoreline(false);</td><td>Renders shoreline with better quality ?</td><td>true</td>
</tr>
</table></div>
<!-- EDIT10 TABLE [7568-8066] --><div><table>
<!-- EDIT10 TABLE [7570-8068] --><div><table>
<tr>
<th> Water method example</th><th> Effects: Foam</th><th>Default</th>
</tr>
@ -234,7 +234,7 @@ water.setRadius(260);</td><td>Limit the water filter to a semisphere with the gi
manager.loadTexture("Textures/foam.png") )</td><td>This foam texture will be used with WrapMode.Repeat</td><td>"Common/MatDefs/Water/Textures/foam.jpg"</td>
</tr>
</table></div>
<!-- EDIT11 TABLE [8068-8713] --><div><table>
<!-- EDIT11 TABLE [8070-8715] --><div><table>
<tr>
<th> Water method example</th><th> Effects: Light</th><th>Default</th>
</tr>
@ -260,9 +260,9 @@ manager.loadTexture("Textures/foam.png") )</td><td>This foam texture w
<td>water.setReflectionMapSize(256)</td><td>Sets the size of the reflection map. The higher, the better the quality, but the slower the effect.</td><td>512</td>
</tr>
</table></div>
<!-- EDIT12 TABLE [8715-9630] -->
<!-- EDIT12 TABLE [8717-9632] -->
</div>
<!-- EDIT7 SECTION "Optional: Water Wave and Color Effects" [5230-9632] -->
<!-- EDIT7 SECTION "Optional: Water Wave and Color Effects" [5230-9634] -->
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:
<li><div><objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://jmonkeyengine.org/2011/07/03/terramonkey-more-textures-tools-and-undo/"><paramname="text"value="<html><u>More textures and Tools</u></html>"><paramname="textColor"value="blue"></object></div>
<li><div><objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://hub.jmonkeyengine.org/2011/07/03/terramonkey-more-textures-tools-and-undo/"><paramname="text"value="<html><u>More textures and Tools</u></html>"><paramname="textColor"value="blue"></object></div>
@ -185,7 +185,7 @@ Here are the names of TerrainLighting.j3md's material properties:
</p>
<p>
Video cards support a maximum of 16 Splat textures total. This means you can only use a subset of material properties at the same time!
OpenGL supports a maximum of 16 <em>samplers</em> in any given shader. This means you can only use a subset of material properties at the same time if you use the terrain's default lighting shader (TerrainLighting.j3md)!
</p>
<p>
@ -237,7 +237,7 @@ You can hand-paint Alpha, Diffuse, Glow, and Specular maps in a drawing program,
@ -93,7 +93,7 @@ Build and run the code sample. You should see a green Ninja with a colorful teap
</p>
</div>
<!-- EDIT2 SECTION "Code Sample" [839-3449] -->
<!-- EDIT2 SECTION "Code Sample" [839-3434] -->
<h2><a>The Asset Manager</a></h2>
<div>
@ -115,16 +115,17 @@ The AssetManager can load files from:
The following is the recommended directory structure for storing assets in your project directoy:
</p>
<pre>MyGame/assets/Interface/
<pre>MyGame/assets/
MyGame/assets/Interface/
MyGame/assets/MatDefs/
MyGame/assets/Materials/
MyGame/assets/Models/
MyGame/assets/Models/<-- your .j3o models go here
MyGame/assets/Scenes/
MyGame/assets/Shaders/
MyGame/assets/Sounds/
MyGame/assets/Textures/
MyGame/build.xml <-- Ant build script
MyGame/src/... <-- Java sources go here
MyGame/assets/Sounds/<-- your audio files go here
MyGame/assets/Textures/<-- your textures go here
MyGame/build.xml <-- Default Ant build script
MyGame/src/... <-- your Java sources go here
MyGame/...</pre>
<p>
@ -132,7 +133,7 @@ This is just a suggested best practice, and it's what you get by default wh
</p>
</div>
<!-- EDIT3 SECTION "The Asset Manager" [3450-4573] -->
<!-- EDIT3 SECTION "The Asset Manager" [3435-4701] -->
<h3><a>Loading Textures</a></h3>
<div>
@ -141,7 +142,7 @@ This is just a suggested best practice, and it's what you get by default wh
Place your textures in a subdirectory of <code>assets/Textures/</code>. Load the texture into the material before you set the Material. The following code sample is from the <code>simpleInitApp()</code> method and loads a simple wall model:
</p>
<pre>// Create a wall with a simple texture from test_data
Box box = new Box(Vector3f.ZERO, 2.5f,2.5f,1.0f);
Box box = new Box(2.5f,2.5f,1.0f);
Spatial wall = new Geometry("Box", box );
<!-- EDIT7 SECTION "Loading Assets From Custom Paths" [7267-8284] -->
<!-- EDIT7 SECTION "Loading Assets From Custom Paths" [7380-8397] -->
<h2><a>Creating Models and Scenes</a></h2>
<div>
<p>
To create 3D models and scenes, you need a 3D Mesh Editor with an OgreXML Exporter plugin. For example, you can <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/UV_Map_Basics"><paramname="text"value="<html><u>create fully textured models with Blender</u></html>"><paramname="textColor"value="blue"></object>.
You use the <ahref="/com/jme3/gde/docs/sdk.html">SDK</a> to <ahref="/com/jme3/gde/docs/sdk/model_loader_and_viewer.html">load models</a>, <ahref="/com/jme3/gde/docs/sdk/blender.html">convert models</a> and <ahref="/com/jme3/gde/docs/sdk/scene_composer.html">create scenes</a> from them.
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 <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/UV_Map_Basics"><paramname="text"value="<html><u>create fully textured models (e.g. with Blender)</u></html>"><paramname="textColor"value="blue"></object> and export them to your project.
Then you use the <ahref="/com/jme3/gde/docs/sdk.html">SDK</a> to <ahref="/com/jme3/gde/docs/sdk/model_loader_and_viewer.html">load models</a>, <ahref="/com/jme3/gde/docs/sdk/blender.html">convert models</a>, and <ahref="/com/jme3/gde/docs/sdk/scene_composer.html">create 3D scenes</a> from them.
</p>
<p>
If you use Blender, export your models as Ogre <acronymtitle="Extensible Markup Language">XML</acronym> meshes with materials as follows:
<strong>Example:</strong> From Blender, you export your models as Ogre <acronymtitle="Extensible Markup Language">XML</acronym> meshes with materials as follows:
</p>
<ol>
<li><div> Open the menu File > Export > OgreXML Exporter to open the exporter dialog.</div>
@ -272,17 +274,28 @@ If you use Blender, export your models as Ogre <acronym title="Extensible Markup
</ol>
</div>
<!-- EDIT8 SECTION "Creating Models and Scenes" [8285-9444] -->
<!-- EDIT8 SECTION "Creating Models and Scenes" [8398-9651] -->
<h3><a>Model File Formats</a></h3>
<div>
<p>
JME3 can load Ogre <acronymtitle="Extensible Markup Language">XML</acronym> models + materials, Ogre DotScenes, as well as Wavefront OBJ+MTL models. The loadModel() code works with these files when you run the code directly from the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>.
If you build the executables using the default build script, then <strong>the original model files (<acronymtitle="Extensible Markup Language">XML</acronym>, OBJ, etc) are not included.</strong> When you run the executable, you get an error message if you try to load any models directly:
The <code>loadModel()</code> method loads these original file formats when you run your code directly from the <acronymtitle="Software Development Kit">SDK</acronym>. If you however build the executables using the default build script, then the original model files (<acronymtitle="Extensible Markup Language">XML</acronym>, OBJ, etc) <em>are not included</em>. This means, when you run the executable outside the <acronymtitle="Software Development Kit">SDK</acronym>, and load any original models directly, you get the following error message:
Loading the <acronymtitle="Extensible Markup Language">XML</acronym>/OBJ files directly is only acceptable during the development phase. If 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 <strong><acronymtitle="Extensible Markup Language">XML</acronym>/OBJ/Blend files</strong> directly is only acceptable during the development phase in the <acronymtitle="Software Development Kit">SDK</acronym>. 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.
</p>
<p>
For testing and for the final release build, you use .j3o files exclusively. J3o is an optimized binary format for jME3 applications, and .j3o files are automatically included in the distributable JAR file by the build script. When you do QA test builds or are ready to release, use the <ahref="/com/jme3/gde/docs/sdk.html">SDK</a> to <ahref="/com/jme3/gde/docs/sdk/model_loader_and_viewer.html">convert</a> all .obj/.scene/.xml/.blend files to .j3o files, and only load the .j3o versions.
But for QA test builds and for the final release build, you use <strong>.j3o files</strong> exclusively. J3o is an optimized binary format for jME3 applications. When you do QA test builds, or are ready to release, use the <ahref="/com/jme3/gde/docs/sdk.html">SDK</a> to <ahref="/com/jme3/gde/docs/sdk/model_loader_and_viewer.html">convert</a> all .obj/.scene/.xml/.blend files to .j3o files, and update all code to load the .j3o files. The default build script automatically packages .j3o files in the executables.
</p>
<p>
@ -306,18 +319,20 @@ Open your JME3 Project in the jMonkeyEngine <acronym title="Software Development
</li>
<li><div> The .j3o file appears next to the .mesh.xml file and has the same name. </div>
</li>
<li><div>Change all your loadModel() lines accordingly. For example: <pre>Spatial ninja = assetManager.loadModel("Models/Ninja/Ninja.j3o");</pre>
<li><div>Update all your <code>loadModel()</code> lines accordingly. For example: <pre>Spatial ninja = assetManager.loadModel("Models/Ninja/Ninja.j3o");</pre>
</div>
</li>
</ol>
<p>
If your executable gets a runtime exception, make sure you have converted all models to .j3o!
<p><div>If your executable throws a "Cannot locate resource" runtime exception, check all load paths and make sure you have converted all models to .j3o files!
<!-- EDIT10 SECTION "Loading Models and Scenes" [11298-12390] -->
<!-- EDIT10 SECTION "Loading Models and Scenes" [11737-12829] -->
<h2><a>Excercise - How to Load Assets</a></h2>
<div>
@ -435,7 +450,7 @@ Here is a third method you must know, loading a scene/model from a .j3o file:
</li>
<li><div> In the projects window, browse to the <code>assets/Scenes/town</code> directory. </div>
</li>
<li><div> Right-click the <code>main.scene</code> and convert the scene to binary: The jMoneyPlatform generates a main.j3o file.</div>
<li><div> Right-click the <code>main.scene</code> and convert the scene to binary: The jMonkeyPlatform generates a main.j3o file.</div>
</li>
<li><div> Add the following code under <code>simpleInitApp() {</code><pre> Spatial gameLevel = assetManager.loadModel("Scenes/town/main.j3o");
@ -110,7 +109,7 @@ When you run the sample, you should see a blue cube. You should hear a nature-li
</p>
</div>
<!-- EDIT2 SECTION "Sample Code" [684-3519] -->
<!-- EDIT2 SECTION "Sample Code" [684-3501] -->
<h2><a>Understanding the Code Sample</a></h2>
<div>
@ -124,7 +123,7 @@ Let's have a closer look at <code>initAudio()</code> to learn how to use <c
</p>
</div>
<!-- EDIT3 SECTION "Understanding the Code Sample" [3520-3857] -->
<!-- EDIT3 SECTION "Understanding the Code Sample" [3502-3839] -->
<h2><a>AudioNodes</a></h2>
<div>
@ -153,10 +152,17 @@ These two lines create new sound nodes from the given audio files in the AssetMa
<p>
You want the gunshot sound to play <em>once</em> (you don't want it to loop). You also specify its volume as gain factor (at 0, sound is muted, at 2, it is twice as loud, etc.).
</p>
<pre> audio_gun.setLooping(false);
<pre> audio_gun.setPositional(false);
audio_gun.setLooping(false);
audio_gun.setVolume(2);
rootNode.attachChild(audio_gun);</pre>
<p>
<p><div>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.
</div></p>
</p>
<p>
The nature sound is different: You want it to loop <em>continuously</em> as background sound. This is why you set looping to true, and immediately call the play() method on the node. You also choose to set its volume to 3.
</p>
@ -184,7 +190,7 @@ Here you make audio_nature a positional sound that comes from a certain place. F
</p>
</div>
<!-- EDIT4 SECTION "AudioNodes" [3858-6947] -->
<!-- EDIT4 SECTION "AudioNodes" [3840-7174] -->
<h2><a>Triggering Sound</a></h2>
<div>
@ -192,9 +198,9 @@ Here you make audio_nature a positional sound that comes from a certain place. F
Let's have a closer look at <code>initKeys()</code>: As you learned in previous tutorials, you use the <code>inputManager</code> to respond to user input. Here you add a mapping for a left mouse button click, and name this new action <code>Shoot</code>.
</p>
<pre> /** Declaring "Shoot" action, mapping it to a trigger (mouse click). */
<pre> /** Declaring "Shoot" action, mapping it to a trigger (mouse left click). */
private void initKeys(){
inputManager.addMapping("Shoot", new MouseButtonTrigger(0));
inputManager.addMapping("Shoot", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
@ -213,10 +219,11 @@ Setting up the ActionListener should also be familiar from previous tutorials. Y
<p>
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 <code>playInstance()</code> 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.
@ -184,10 +197,11 @@ public class HelloCollision extends SimpleApplication
<p>
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! <imgsrc="/wiki/lib/images/smileys/icon_smile.gif"class="middle"alt=":-)"/>
</p>
</div>
<!-- EDIT2 SECTION "Sample Code" [596-7019] -->
<!-- EDIT2 SECTION "Sample Code" [596-7341] -->
<h2><a>Understanding the Code</a></h2>
<div>
@ -206,7 +220,12 @@ You already know that SimpleApplication is the base class for all jME3 games. Yo
private RigidBodyControl landscape;
private CharacterControl player;
private Vector3f walkDirection = new Vector3f();
private boolean left = false, right = false, up = false, down = false;</pre>
private boolean left = false, right = false, up = false, down = false;
//Temporary vectors used on each frame.
//They here to avoid instanciating new vectors on each frame
private Vector3f camDir = new Vector3f();
private Vector3f camLeft = new Vector3f();</pre>
<p>
You initialize a few private fields:
@ -222,15 +241,18 @@ You initialize a few private fields:
</li>
<li><div> The fields <code>walkDirection</code> and the four Booleans are used for physics-controlled navigation.</div>
</li>
<li><div> camDir and camLeft are temporary vectors used later when computing the walkingDirection from the cam position and rotation</div>
</li>
</ul>
<p>
Let's have a look at all the details:
</p>
</div>
<!-- EDIT3 SECTION "Understanding the Code" [7020-8244] -->
<!-- EDIT3 SECTION "Understanding the Code" [7342-8887] -->
<h2><a>Initializing the Game</a></h2>
<div>
@ -254,7 +276,7 @@ As usual, you initialize the game in the <code>simpleInitApp()</code> method.
</ol>
</div>
<!-- EDIT4 SECTION "Initializing the Game" [8245-8841] -->
<!-- EDIT4 SECTION "Initializing the Game" [8888-9484] -->
<h3><a>The Physics-Controlled Scene</a></h3>
<div>
@ -301,7 +323,7 @@ To use collision detection, you add a RigidBodyControl to the <code>sceneModel</
</p>
</div>
<!-- EDIT5 SECTION "The Physics-Controlled Scene" [8842-10815] -->
<!-- EDIT5 SECTION "The Physics-Controlled Scene" [9485-11458] -->
<h3><a>The Physics-Controlled Player</a></h3>
<div>
@ -353,7 +375,7 @@ Finally we put the player in its starting position and update its state ??? reme
</p>
</div>
<!-- EDIT6 SECTION "The Physics-Controlled Player" [10816-13580] -->
<!-- EDIT6 SECTION "The Physics-Controlled Player" [11459-14223] -->
<h3><a>PhysicsSpace</a></h3>
<div>
@ -369,7 +391,7 @@ The invisible body of the character just sits there on the physical floor. It ca
@ -491,10 +521,11 @@ This is how the walking is triggered:
<p>
<strong>Important:</strong> Again, do not use <code>setLocalTranslation()</code> 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 <code>setPhysicalLocation()</code> if you make sure to place it a bit above the floor and away from obstacles.
This code goes into the <code>simpleInitApp()</code> method. But since we will likely add many keybindings, we extract these lines and wrap them in an auxiliary method, <code>initKeys()</code>. The <code>initKeys()</code> 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 <code>initSimpleApp()</code> method.
</p>
</div>
<!-- EDIT3 SECTION "Defining Mappings and Triggers" [3679-5893] -->
<!-- EDIT3 SECTION "Defining Mappings and Triggers" [3652-5835] -->
<h2><a>Implementing the Actions</a></h2>
<div>
@ -268,7 +269,7 @@ It's okay to use only one of the two Listeners, and not implement the other
</p>
</div>
<!-- EDIT4 SECTION "Implementing the Actions" [5894-9012] -->
<!-- EDIT4 SECTION "Implementing the Actions" [5836-8954] -->
<h2><a>Analog, Pressed, or Released?</a></h2>
<div>
@ -325,7 +326,7 @@ Mappings registered to the <strong>ActionListener</strong> are digital either-or
}</pre>
</div>
<!-- EDIT5 SECTION "Analog, Pressed, or Released?" [9013-11037] -->
<!-- EDIT5 SECTION "Analog, Pressed, or Released?" [8955-10979] -->
<h2><a>Table of Triggers</a></h2>
<div>
@ -361,14 +362,14 @@ You can find the list of input constants in the files <code>src/core/com/jme3/in
<strong>Tip:</strong> 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. <code>KeyInput.|</code> and trigger code completion to select possible input identifiers.
</p>
</div>
<!-- EDIT6 SECTION "Table of Triggers" [11038-12100] -->
<!-- EDIT6 SECTION "Table of Triggers" [10980-12042] -->
<h2><a>Exercises</a></h2>
<div>
<ol>
@ -396,7 +397,7 @@ inputManager.addMapping("Pause", new KeyTrigger(usersPauseKey
</p>
</div>
<!-- EDIT8 SECTION "Exercises" [12101-12785] -->
<!-- EDIT8 SECTION "Exercises" [12043-12727] -->
<h2><a>Conclusion</a></h2>
<div>
@ -418,5 +419,5 @@ Now you can already write a little interactive game! But wouldn't it be coo
@ -48,20 +48,21 @@ public class HelloLoop extends SimpleApplication {
rootNode.attachChild(player);
}
/* This is the update loop */
/* Use the main event loop to trigger repeating actions. */
@Override
public void simpleUpdate(float tpf){
// make the player rotate
// make the player rotate:
player.rotate(0, 2*tpf, 0);
}
}</pre>
<p>
Build and run the file: You see a constantly rotating cube.
</p>
</div>
<!-- EDIT2 SECTION "Code Sample" [405-1613] -->
<!-- EDIT2 SECTION "Code Sample" [405-1682] -->
<h2><a>Understanding the Code</a></h2>
<div>
@ -83,7 +84,7 @@ Now have a closer look at the <code>simpleUpdate()</code> method ??? this is the
</ul>
</div>
<!-- EDIT3 SECTION "Understanding the Code" [1614-2397] -->
<!-- EDIT3 SECTION "Understanding the Code" [1683-2466] -->
<h2><a>Using the Update Loop</a></h2>
<div>
@ -108,38 +109,39 @@ A rotating object is just a simple example. In the update loop, you typically ha
</ul>
</div>
<!-- EDIT4 SECTION "Using the Update Loop" [2398-3232] -->
<!-- EDIT4 SECTION "Using the Update Loop" [2467-3301] -->
<h2><a>Init - Update - Render</a></h2>
<div>
<p>
Note the contrast:
Note the the three phases of every game:
</p>
<ul>
<li><div> The <code>simpleInitApp()</code> method is executed only once, right at the beginning; </div>
<li><div><strong>Init:</strong>The <code>simpleInitApp()</code> method is executed only <em>once</em>, right at the beginning; </div>
</li>
<li><div> The <code>simpleUpdate()</code> method runs repeatedly, during the game. </div>
<li><div><strong>Update:</strong>The <code>simpleUpdate()</code> method runs <em>repeatedly</em>, during the game. </div>
</li>
<li><div> After every update, the jMonkeyEngine automatically redraws (<code>renders</code>) the screen for you!</div>
<li><div><strong>Render:</strong>After every update, the jMonkeyEngine <em>automatically</em> redraws (<code>renders</code>) the screen for you.</div>
</li>
</ul>
<p>
Since rendering is automatic, initialization and updating are the two most important concepts in a SimpleApplication for you right now. These methods are where you load and create game data (once), and (repeatedly) change their properties to update the game state:
Since rendering is automatic, initialization and updating are the two most important concepts in a SimpleApplication-based game for you:
</p>
<ul>
<li><div><code>simpleInitApp()</code> is the application's "first breath".</div>
<li><div> The <code>simpleInitApp()</code> method is the application's "first breath". <br/>
Here you load and create game data (once).</div>
</li>
<li><div><code>simpleUpdate()</code> is the application's heartbeat. <br/>
The update time unit is called <code>ticks</code>.</div>
<li><div>The <code>simpleUpdate()</code>method is the application's "heartbeat" (the time unit is called <code>ticks</code>). <br/>
Here you change their properties to update the game state (repeatedly).</div>
</li>
</ul>
<p>
<p><div>Everything in a game happens either during initialization or during the update loop. This means that these two methods grow very long over time. There are two strategies how experienced developers spread out their init and update code over several Java classes:
<p><div>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:
</p>
<ul>
<li><div> Move code blocks from the simpleInitApp() method to <ahref="/com/jme3/gde/docs/jme3/advanced/application_states.html">AppStates</a>.</div>
@ -155,7 +157,7 @@ Keep this in mind for later when your application grows.
@ -14,13 +14,13 @@ The term Material includes everything that influences what the surface of a 3D m
</p>
<p>
<p><div>To use the example assets in a new jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> project, right-click your project, select "Properties", go to "Libraries", press "Add Library" and add the "jme3-test-data" library.
<li><div> Left ??? A cube with a brown monkey texture.</div>
</li>
<li><div> Middle ??? A translucent monkey picture in front of a shiny rock.</div>
</li>
<li><div> Right ??? A cube with a purple monkey texture.</div>
<li><div> Right ??? A translucent monkey picture in front of a shiny bumpy rock.</div>
</li>
</ul>
@ -122,7 +118,7 @@ Move around with the WASD keys to have a closer look at the translucency, and th
</p>
</div>
<!-- EDIT2 SECTION "Sample Code" [714-4923] -->
<!-- EDIT2 SECTION "Sample Code" [716-4277] -->
<h2><a>Simple Unshaded Texture</a></h2>
<div>
@ -130,80 +126,89 @@ Move around with the WASD keys to have a closer look at the translucency, and th
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 <acronymtitle="Joint Photographics Experts Group">JPG</acronym> or <acronymtitle="Portable Network Graphics">PNG</acronym> format. In this example, you create a box with a simple unshaded Monkey texture as material.
</p>
<pre> /** A simple textured cube. */
Box boxshape1 = new Box(new Vector3f(-3f,1.1f,0f), 1f,1f,1f);
Geometry cube = new Geometry("My Textured Box", boxshape1);
Material mat_stl = new Material(assetManager,
<pre> /** A simple textured cube -- in good MIP map quality. */
Box cube1Mesh = new Box( 1f,1f,1f);
Geometry cube1Geo = new Geometry("My Textured Box", cube1Mesh);
<li><div> Create a Geometry from a Box mesh. Let's call it <code>cube</code>.</div>
<li><div> Create a Geometry <code>cube1Geo</code> from a Box mesh <code>cube1Mesh</code>. </div>
</li>
<li><div> Create a Material <code>cube1Mat</code> based on jME3's default <code>Unshaded.j3md</code> material definition.</div>
</li>
<li><div> Create a Material based on jME3's default <code>Unshaded.j3md</code> material definition.</div>
<li><div> Create a texture <code>cube1Tex</code> from the<code>Monkey.jpg</code>file in the <code>assets/Interface/Logo/</code> directory of the project. </div>
</li>
<li><div> Create a texture from the <code>Monkey.jpg</code> file and load it into the material. <br/>
The ColorMap is the typical material layer where textures go.</div>
<li><div> Load the texture <code>cube1Tex</code> into the <code>ColorMap</code> layer of the material <code>cube1Mat</code>. </div>
</li>
<li><div> Apply the material to the cube, and attach the cube to the rootnode.</div>
<code>Monkey.png</code> is the same texture as <code>Monkey.jpg</code>, 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 remain opaque, gray areas become translucent, and white areas become transparent.
<code>Monkey.png</code> is the same texture as <code>Monkey.jpg</code>, 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.
</p>
<p>
For a partially translucent/transparent texture, you need:
</p>
<ul>
<li><div> A texture with alpha channel</div>
<li><div> A Texture with alpha channel</div>
</li>
<li><div> A Texture blend mode of <code>BlendMode.Alpha</code></div>
<li><div> A Texture with blend mode of <code>BlendMode.Alpha</code></div>
</li>
<li><div> A geometry in the <code>Bucket.Transparent</code> render bucket. This bucket ensures that the translucent object is drawn on top of objects behind it, and they show up correctly under the translucent parts. (For non-translucent objects the drawing order is not so important, because the z-buffer keeps track of whether a pixel is behind something else or not, and the color of a pixel doesn't depend on the pixels under it, this is why opaque Geometries can be drawn in any order.)</div>
<li><div> A Geometry in the <code>Bucket.Transparent</code> render bucket. <br/>
This bucket ensures that the transparent object is drawn on top of objects behind it, and they show up correctly under the transparent parts. </div>
</li>
</ul>
<pre> /** A translucent/transparent texture. */
Box boxshape3 = new Box(new Vector3f(0f,0f,0f), 1f,1f,0.01f);
Geometry seethrough = new Geometry("see-through box", boxshape3);
Material mat_tt = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
For non-transparent objects, the drawing order is not so important, because the z-buffer already keeps track of whether a pixel is behind something else or not, and the color of an opaque pixel doesn't depend on the pixels under it, this is why opaque Geometries can be drawn in any order.
</p>
<p>
What you did is the same as before, with only one added step for the transparency.
What you did for the transparent texture is the same as before, with only one added step for the transparency.
</p>
<ol>
<li><div> Create a Geometry from a mesh. This Geometry is flat upright box.</div>
<li><div> Create a Geometry <code>cube2Geo</code>from a Box mesh<code>cube2Mesh</code>. This Box Geometry is flat upright box (because z=0.01f).</div>
</li>
<li><div> Create a Material based on jME3's default <code>Unshaded.j3md</code> material definition.</div>
<li><div> Create a Material <code>cube2Mat</code>based on jME3's default <code>Unshaded.j3md</code> material definition.</div>
</li>
<li><div> Create a texture from the <code>Monkey.png</code> file and load it into the material. <br/>
The ColorMap is the material layer where textures go. This <acronymtitle="Portable Network Graphics">PNG</acronym> file must have an alpha layer.</div>
<li><div> Create a texture <code>cube2Tex</code> from the <code>Monkey.png</code> file in the <code>assets/Textures/ColoredTex/</code> directory of the project. This <acronymtitle="Portable Network Graphics">PNG</acronym> file must have an alpha layer.</div>
</li>
<li><div> Activate transparency in the material by setting the blend mode to Alpha!</div>
<li><div><strong>Activate transparency in the material by setting the blend mode to Alpha.</strong></div>
</li>
<li><div>Apply the material to the Geometry.</div>
<li><div><strong>Set the QueueBucket of the Geometry to <code>Bucket.Transparent</code>.</strong></div>
</li>
<li><div>Set the QueueBucket of the Geometry to<code>Bucket.Transparent</code>.</div>
<li><div>Load the texture <code>cube2Tex</code> into the<code>ColorMap</code> layer of the material <code>cube2Mat</code>.</div>
</li>
<li><div> Attach the cube to the rootnode.</div>
<li><div> Apply the material to the cube, and attach the cube to the rootnode.</div>
</li>
</ol>
@ -213,59 +218,62 @@ The ColorMap is the material layer where textures go. This <acronym title="Porta
But textures are not all. Have a close look at the shiny sphere ??? you cannot get such a nice bumpy material with just a texture. 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:
</p>
<p>
In a lit material, the standard texture layer is refered to as <em>DiffuseMap</em>, any material can use this layer. A lit material can additionally have lighting effects such as <em>Shininess</em> used together with the <em>SpecularMap</em> layer, and even a realistically bumpy or cracked surface with help of the <em>NormalMap</em> layer.
In a lit material, the standard texture layer is refered to as <em>DiffuseMap</em>, any material can use this layer. A lit material can additionally have lighting effects such as <em>Shininess</em> used together with the <em>SpecularMap</em> layer and <em>Specular</em> color. And you can even get a realistically bumpy or cracked surface with help of the <em>NormalMap</em> layer.
</p>
<p>
Let's have a look at the part of the code example where you create the shiny bumpy rock.
</p>
<ol>
<li><div> Create a Geometry from a Sphere shape. Note that this shape is a normal smooth sphere mesh. <pre> Sphere rock = new Sphere(32,32, 2f);
Geometry shiny_rock = new Geometry("Shiny rock", rock);</pre>
<li><div> Create a Geometry from a Sphere shape. Note that this shape is a normal smooth sphere mesh. <pre> Sphere sphereMesh = new Sphere(32,32, 2f);
Geometry sphereGeo = new Geometry("Shiny rock", sphereMesh);</pre>
</div>
<ol>
<li><div> (Only for Spheres) Change the sphere's TextureMode to make the square texture project better onto the sphere.<pre>rock.setTextureMode(Sphere.TextureMode.Projected);</pre>
<li><div> (Only for Spheres) Change the sphere's TextureMode to make the square texture project better onto the sphere.<pre>sphereMesh.setTextureMode(Sphere.TextureMode.Projected);</pre>
</div>
</li>
<li><div> You generate TangentBinormals for the sphere mesh so you can use the NormalMap layer of the texture.<pre> TangentBinormalGenerator.generate(rock);</pre>
<li><div> You must generate TangentBinormals for the mesh so you can use the NormalMap layer of the texture.<pre> TangentBinormalGenerator.generate(sphereMesh);</pre>
</div>
</li>
</ol>
</li>
<li><div> Create a material based on the <code>Lighting.j3md</code> default material.<pre> Material mat_lit = new Material(assetManager,
<li><div> Create a material based on the <code>Lighting.j3md</code> default material.<pre> Material sphereMat = new Material(assetManager,
<li><div> Set the <code>NormalMap</code> layer that contains the bumpiness. The NormalMap was generated for this particular DiffuseMap with a special tool (e.g. Blender). <imgsrc="/wiki/lib/exe/fetch.php"><pre>mat_lit.setTexture("NormalMap", assetManager.loadTexture(
<li><div> Set the <code>NormalMap</code> layer that contains the bumpiness. The NormalMap was generated for this particular DiffuseMap with a special tool (e.g. Blender). <imgsrc="/wiki/lib/exe/fetch.php"><pre>sphereMat.setTexture("NormalMap",
<li><div> Set the Material's Shininess to a value between 1 and 128. For a rock, a low fuzzy shininess is appropriate. <pre> mat_lit.setFloat("Shininess", 5f); // [1,128]</pre>
<li><div> Set the Material's Shininess to a value between 1 and 128. For a rock, a low fuzzy shininess is appropriate. Use material colors to define the shiny Specular color. <pre> sphereMat.setBoolean("UseMaterialColors",true);
sphereMat.setColor("Diffuse",ColorRGBA.White); // minimum material color
sphereMat.setColor("Specular",ColorRGBA.White); // for shininess
sphereMat.setFloat("Shininess", 64f); // [1,128] for shininess</pre>
</div>
</li>
</ol>
</li>
<li><div> Assign your newly created material to the Geometry.<pre> shiny_rock.setMaterial(mat_lit);</pre>
<li><div> Assign your newly created material to the Geometry.<pre> sphereGeo.setMaterial(sphereMat);</pre>
</div>
</li>
<li><div> Let's move and rotate the geometry a bit to position it better. <pre> shiny_rock.setLocalTranslation(0,2,-2); // Move it a bit
shiny_rock.rotate(1.6f, 0, 0); // Rotate it a bit
rootNode.attachChild(shiny_rock);</pre>
<li><div> Let's move and rotate the geometry a bit to position it better. <pre> sphereGeo.setLocalTranslation(0,2,-2); // Move it a bit
sphereGeo.rotate(1.6f, 0, 0); // Rotate it a bit
rootNode.attachChild(sphereGeo);</pre>
</div>
</li>
</ol>
@ -280,7 +288,7 @@ Remember that any Lighting.j3md-based material requires a light source, as shown
</p>
</div>
<!-- EDIT5 SECTION "Shininess and Bumpiness" [8377-11260] -->
<!-- EDIT5 SECTION "Shininess and Bumpiness" [8185-11426] -->
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.
</p>
</div>
<!-- EDIT6 SECTION "Default Material Definitions" [11261-12027] -->
<!-- EDIT6 SECTION "Default Material Definitions" [11427-12193] -->
<h2><a>Exercises</a></h2>
<div>
</div>
<!-- EDIT8 SECTION "Exercises" [12028-12050] -->
<!-- EDIT8 SECTION "Exercises" [12194-12216] -->
<h3><a>Exercise 1: Custom .j3m Material</a></h3>
<div>
<p>
Look at the purple leak-through sample above again. It takes four lines to create and set the Material.
Look at the shiny rocky sphere above again. It takes several lines to create and set the Material.
</p>
<ul>
<li><div> Note how it loads the <code>Unshaded.j3md</code> Material definition.</div>
<li><div> Note how it loads the <code>Lighting.j3md</code> Material definition.</div>
</li>
<li><div> Note how it sets the <code>DiffuseMap</code> and <code>NormalMap</code> to a texture path.</div>
</li>
<li><div> Note how it sets the <code>Color</code> parameter to purple (<code>new ColorRGBA(1f,0f,1f,1f)</code>).</div>
<li><div> Note how it activates<code>UseMaterialColors</code>and sets <code>Specular</code> and <code>Diffuse</code> to 4 float values (RGBA color).</div>
</li>
<li><div> Note how it sets the <code>ColorMap</code> to a texture path.</div>
<li><div> Note how it sets <code>Shininess</code> to 64.</div>
</li>
</ul>
<p>
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.
</p>
<p>
You create a j3m file as follows:
</p>
<ol>
<li><div> Create a file <code>assets/Materials/LeakThrough.j3m</code> in your project directory, with the following content:<pre>Material Leak Through : Common/MatDefs/Misc/Unshaded.j3md {
<li><div> Create a plain text file <code>assets/Materials/MyCustomMaterial.j3m</code> in your project directory, with the following content:<pre>Material My shiny custom material : Common/MatDefs/Light/Lighting.j3md {
MaterialParameters {
Color : 1 0 1 1
ColorMap : Flip Textures/ColoredTex/Monkey.png
DiffuseMap : Textures/Terrain/Pond/Pond.jpg
NormalMap : Textures/Terrain/Pond/Pond_normal.png
UseMaterialColors : true
Specular : 1.0 1.0 1.0 1.0
Diffuse : 1.0 1.0 1.0 1.0
Shininess : 64.0
}
}</pre>
</div>
<ul>
<li><div> Note that <code>Material</code> is a fixed keyword.</div>
</li>
<li><div> Note that <code>Leak Through</code> is a String that you can choose to name the material.</div>
<li><div> Note that <code>My shiny custom material</code> is a String that you can choose to describe the material.</div>
</li>
<li><div> Note how the code sets the same three properties, Color, ColorMap, and Unshaded.j3md.</div>
<li><div> Note how the code sets all the same properties as before! </div>
</li>
</ul>
</li>
<li><div> In the code sample, comment out the three lines with<code>mat_tl</code> in them.</div>
<li><div> In the code sample, comment out the eight lines that have<code>sphereMat</code> in them.</div>
</li>
<li><div> Below them, add the following line: <pre>cube_leak.setMaterial((Material) assetManager.loadMaterial("Materials/LeakThrough.j3m"));</pre>
<li><div> Below this line, add the following line: <pre>sphereGeo.setMaterial((Material) assetManager.loadMaterial(
<li><div> Run the app. The result is the same.</div>
@ -366,11 +385,11 @@ You create a j3m file as follows:
<p>
Using this new custom material <code>LeakThrough.j3m</code> only takes one line. You have replaced the three lines of an on-the-fly material definition with one line that loads a custom material from a file. This method is very handy if you use the same material often.
Using this new custom material <code>MyCustomMaterial.j3m</code> 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.
/** Create a pivot node at (0,0,0) and attach it to the root node */
Node pivot = new Node("pivot");
rootNode.attachChild(pivot); // put this node in the scene
/** Attach the two boxes to the *pivot* node. */
/** Attach the two boxes to the *pivot* node. (And transitively to the root node.) */
pivot.attachChild(blue);
pivot.attachChild(red);
/** Rotate the pivot node: Note that both boxes have rotated! */
@ -99,7 +98,7 @@ Build and run the code sample. You should see two colored boxes tilted at the sa
</p>
</div>
<!-- EDIT2 SECTION "Code Sample" [997-3048] -->
<!-- EDIT2 SECTION "Code Sample" [997-3108] -->
<h2><a>Understanding the Terminology</a></h2>
<div>
@ -128,7 +127,7 @@ In this tutorial, you learn some new terms:
<td>Position/move, turn, or resize an object</td><td>Translate, or rotate, or scale an object = transform an object.</td>
</tr>
</table></div>
<!-- EDIT4 TABLE [3137-3561] -->
<!-- EDIT4 TABLE [3197-3621] -->
<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.
@ -155,9 +154,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 [3977-4470] -->
<!-- EDIT5 TABLE [4037-4530] -->
</div>
<!-- EDIT3 SECTION "Understanding the Terminology" [3049-4471] -->
<!-- EDIT3 SECTION "Understanding the Terminology" [3109-4531] -->
<h2><a>Understanding the Code</a></h2>
<div>
@ -171,19 +170,18 @@ What happens in the code snippet? You use the <code>simpleInitApp()</code> metho
<ul>
<li><div> Create a Box shape with extents of (1,1,1), that makes the box 2x2x2 world units big.</div>
</li>
<li><div> Position the box at (1,-1,1) using the move() method. (Don't change the Vector3f.ZERO unless you want to change the center of rotation)</div>
<li><div> Position the box at (1,-1,1) using the setLocalTranslation() method.</div>
</li>
<li><div> Wrap the Box shape into a Geometry.</div>
</li>
<li><div> Create a blue material. </div>
</li>
<li><div> Apply the blue material to the Box Geometry. <pre> Box box1 = new Box( Vector3f.ZERO, 1,1,1);
<li><div> Apply the blue material to the Box Geometry. <pre> Box box1 = new Box(1,1,1);
Geometry blue = new Geometry("Box", box1);
<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 [8245-9538] -->
<!-- EDIT9 TABLE [8256-9549] -->
</div>
<!-- EDIT8 SECTION "How do I Populate the Scenegraph?" [8198-9539] -->
<!-- EDIT8 SECTION "How do I Populate the Scenegraph?" [8209-9550] -->
<h2><a>How do I Transform Spatials?</a></h2>
<div>
@ -324,7 +322,7 @@ To move a Spatial <em>to</em> specific coordinates, such as (0,40.2f,-2), use: <
@ -352,9 +350,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 [10672-11453] -->
<!-- EDIT13 TABLE [10683-11464] -->
</div>
<!-- EDIT10 SECTION "How do I Transform Spatials?" [9540-11454] -->
<!-- EDIT10 SECTION "How do I Transform Spatials?" [9551-11465] -->
<h2><a>How do I Troubleshoot Spatials?</a></h2>
<div>
@ -371,7 +369,7 @@ If you get unexpected results, check whether you made the following common mista
<td> A created Geometry does not appear in the scene. </td><td> Have you attached it to (a node that is attached to) the rootNode? <br/>
Does it have a Material? <br/>
What is its translation (position)? Is it behind the camera or covered up by another Geometry? <br/>
Is it to tiny or too gigantic to see? <br/>
Is it too tiny or too gigantic to see? <br/>
Is it too far from the camera? (Try <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://jmonkeyengine.org/javadoc/com/jme3/renderer/Camera.html#setFrustumFar%28float%29"><paramname="text"value="<html><u>cam.setFrustumFar</u></html>"><paramname="textColor"value="blue"></object>(111111f); to see further) </td>
</tr>
<tr>
@ -384,9 +382,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 [11586-12644] -->
<!-- EDIT15 TABLE [11597-12656] -->
</div>
<!-- EDIT14 SECTION "How do I Troubleshoot Spatials?" [11455-12645] -->
<!-- EDIT14 SECTION "How do I Troubleshoot Spatials?" [11466-12657] -->
<h2><a>How do I Add Custom Data to Spatials?</a></h2>
<div>
@ -419,7 +417,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?" [12646-14099] -->
<!-- EDIT16 SECTION "How do I Add Custom Data to Spatials?" [12658-14111] -->
<h2><a>Conclusion</a></h2>
<div>
@ -445,5 +443,5 @@ Since standard shapes like spheres and boxes get old fast, continue with the nex
@ -167,10 +184,11 @@ You should see four colored cubes floating over a gray floor, and cross-hairs. A
<p>
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.
</p>
</div>
<!-- EDIT2 SECTION "Sample Code" [992-6844] -->
<!-- EDIT2 SECTION "Sample Code" [992-7402] -->
<h2><a>Understanding the Helper Methods</a></h2>
<div>
@ -204,7 +222,7 @@ In this example, we attached all "shootable" objects to one custom nod
</p>
</div>
<!-- EDIT3 SECTION "Understanding the Helper Methods" [6845-7885] -->
<!-- EDIT3 SECTION "Understanding the Helper Methods" [7403-8443] -->
<h2><a>Understanding Ray Casting for Hit Testing</a></h2>
<div>
@ -236,12 +254,12 @@ Here is our simple ray casting algorithm for picking objects:
</ol>
</div>
<!-- EDIT4 SECTION "Understanding Ray Casting for Hit Testing" [7886-8728] -->
<!-- EDIT4 SECTION "Understanding Ray Casting for Hit Testing" [8444-9286] -->
<h2><a>Implementing Hit Testing</a></h2>
<div>
</div>
<!-- EDIT5 SECTION "Implementing Hit Testing" [8729-8766] -->
<!-- EDIT5 SECTION "Implementing Hit Testing" [9287-9324] -->
<h3><a>Loading the scene</a></h3>
<div>
@ -269,7 +287,7 @@ First initialize some shootable nodes and attach them to the scene. You will use
}</pre>
</div>
<!-- EDIT6 SECTION "Loading the scene" [8767-9453] -->
<!-- EDIT6 SECTION "Loading the scene" [9325-10011] -->
<h3><a>Setting Up the Input Listener</a></h3>
<div>
@ -282,12 +300,12 @@ Next you declare the shooting action. It can be triggered either by clicking, or
@ -114,7 +114,7 @@ public class HelloJME3 extends SimpleApplication {
@Override
public void simpleInitApp(){
Box b = new Box(Vector3f.ZERO, 1, 1, 1); // create cube shape at the origin
Box b = new 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
@ -143,7 +143,7 @@ Congratulations! Now let's find out how it works!
</p>
</div>
<!-- EDIT4 SECTION "Sample Code" [2062-3976] -->
<!-- EDIT4 SECTION "Sample Code" [2061-3946] -->
<h2><a>Understanding the Code</a></h2>
<div>
@ -153,20 +153,20 @@ The code above has initialized the scene, and started the application.
</p>
</div>
<!-- EDIT5 SECTION "Understanding the Code" [3977-4084] -->
<!-- EDIT5 SECTION "Understanding the Code" [3947-4054] -->
<h3><a>Start the SimpleApplication</a></h3>
<div>
<p>
Look at the first line. The HelloJME3.java class extends <code>com.jme3.app.SimpleApplication</code>.
Look at the first line. Your HelloJME3.java class extends <code>com.jme3.app.SimpleApplication</code>.
</p>
<pre>public class HelloJME3 extends SimpleApplication {
// your code...
}</pre>
<p>
Every JME3 game is an instance of <code>com.jme3.app.SimpleApplication</code>. The SimpleApplication class manages your 3D scene graph and automatically draws it to the screen ??? that is, in short, what a game engine does for you!
Every JME3 game is an instance of the <code>com.jme3.app.SimpleApplication</code> class. The SimpleApplication class is the simplest example of an application: It manages a 3D scene graph, checks for user input, updates the game state, and automatically draws the scene to the screen. These are the core features of a game engine. You extend this simple application and customize it to create your game.
</p>
<p>
@ -184,11 +184,11 @@ You start every JME3 game from the main() method, as every standard Java applica
}</pre>
<p>
This code opens your application window. Let's learn how you put something into the window next.
The <code>app.start();</code> line opens the application window. Let's learn how you put something into this window (the scene) next.
</p>
</div>
<!-- EDIT6 SECTION "Start the SimpleApplication" [4085-5044] -->
<!-- EDIT6 SECTION "Start the SimpleApplication" [4055-5215] -->
<h3><a>Understanding the Terminology</a></h3>
<div>
<div><table>
@ -211,14 +211,14 @@ This code opens your application window. Let's learn how you put something
<td>You want the cube to appear in the center.</td><td>I create the Box at the origin = at <code>Vector3f.ZERO</code>.</td>
</tr>
</table></div>
<!-- EDIT8 TABLE [5086-5559] -->
<!-- EDIT8 TABLE [5257-5730] -->
<p>
If you are unfamiliar with the vocabulary, read more about <ahref="/com/jme3/gde/docs/jme3/the_scene_graph.html">the Scene Graph</a> here.
</p>
</div>
<!-- EDIT7 SECTION "Understanding the Terminology" [5045-5652] -->
<!-- EDIT7 SECTION "Understanding the Terminology" [5216-5823] -->
<h3><a>Initialize the Scene</a></h3>
<div>
@ -234,7 +234,7 @@ Look at rest of the code sample. The <code>simpleInitApp()</code> method is auto
The initialization code of a blue cube looks as follows:
</p>
<pre> public void simpleInitApp(){
Box b = new Box(Vector3f.ZERO, 1, 1, 1); // create a 1x1x1 box shape at the origin
Box b = new 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
@ -288,7 +288,7 @@ A typical JME3 game has the following initialization process:
</ol>
</div>
<!-- EDIT9 SECTION "Initialize the Scene" [5653-7652] -->
<!-- EDIT9 SECTION "Initialize the Scene" [5824-7794] -->
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. (As of Spring 2010, we are in alpha.) These instructions work in NetBeans IDE 6 or better.
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.
</p>
<p>
@ -12,7 +12,7 @@ Note: In the following, always replace "~" with the path to your home
</p>
</div>
<!-- EDIT1 SECTION "Setting up JME3 in Netbeans 6+" [1-407] -->
<!-- EDIT1 SECTION "Setting up JME3 in Netbeans 6+" [1-369] -->
<h2><a>Downloading the Sources</a></h2>
<div>
@ -51,59 +51,85 @@ The jme3 project opens in the Project window. It already includes a working ANT
<p>
Look into the Libraries node and confirm that the project depends on the following libraries in the classpath:
For a detailed description of the separate jar files see <ahref="/com/jme3/gde/docs/jme3/jme3_source_structure#structure_of_jmonkeyengine3_jars.html">this list</a>.
</p>
</div>
<!-- EDIT2 SECTION "Downloading the Sources" [408-1785] -->
<h2><a>Build and Run</a></h2>
<!-- EDIT2 SECTION "Downloading the Sources" [370-2005] -->
<h2><a>Build the Project and Run a Sample App</a></h2>
<div>
<p>
That's it!
</p>
<ol>
<li><div> Right-click the jme3 project node and "Clean and Build" the project.</div>
</li>
<li><div> In the Projects window, browse to the <code>src/test/jme3test</code> folder. </div>
<li><div> In the Projects window, open the <code>Test</code> folder which contains the sample apps.</div>
</li>
<li><div> Every file with a Main class (for example <code>jme3test.model/TestHoverTank.java</code> or <code>jme3test.game/CubeField.java</code>) is an app.</div>
</li>
<li><div> Right-click e.g. the file <code>src/test/jme3test/model/TestHoverTank.java</code> and choose "Run" to run a sample. </div>
<li><div> Right-click a sample app and choose "Run File" (Shift-F6).</div>
</li>
<li><div> Generally in sample apps:</div>
<ol>
<li><div> In the sample application, use the mouse and the AWSD keys to move around the test object.</div>
<li><div>the mouse and the WASD keys control movement</div>
</li>
<li><div> Press escape to quit the sample application.</div>
<li><div>the Esc key exits the application</div>
</li>
</ol>
</li>
</ol>
<p>
Sample code for cool features is in the <code>src/test/jme3test</code> folder. A sample game can be found in <code>src/games/jme3game/cubefield/CubeField.java</code>.
</p>
<p>
Tips:
</p>
<ul>
<li><div> To run runnable classes from the Projects window, right-click and choose Run.</div>
</li>
<li><div> To run any runnable class that is open in the editor, press shift-F6.</div>
</li>
</ul>
</div>
<!-- EDIT3 SECTION "Build and Run" [1786-2545] -->
<!-- EDIT3 SECTION "Build the Project and Run a Sample App" [2006-2531] -->
<h2><a>Optional: Javadoc Popups and Source Navigation in NetBeans</a></h2>
<h3><a>Importing the model in the SDK and creating the appropriate material</a></h3>
<div>
@ -424,7 +470,27 @@ The blend file, the ogre xml files and the textures can be found in the download
</p>
</div>
<!-- EDIT12 SECTION "Importing the model in the SDK and creating the appropriate material" [10910-11654] -->
<!-- EDIT12 SECTION "Importing the model in the SDK and creating the appropriate material" [11842-12586] -->
<h2><a>Modelling racing tracks and cars</a></h2>
<div>
<p>
Follow the link below to a pdf tutorial by rhymez where I guide you to modelling a car and importing it to the jMonkeyengine correctly and edit it in the vehicle editor.Plus how to model a simple racing track.
@ -43,14 +43,14 @@ Yes! Actually, you MUST customize it! For your own games, you always create a cu
<div>
<p>
You should break app 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, <acronymtitle="Graphical User Interface">GUI</acronym> 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, <acronymtitle="Graphical User Interface">GUI</acronym> nodes, spatial nodes, and even its own subset of game mechanics in the update() loop.
<!-- EDIT6 SECTION "How can I switch between screens or states?" [1260-1804] -->
<!-- EDIT6 SECTION "How can I switch between screens or states?" [1260-1805] -->
<h3><a>How do I pause/unpause a game?</a></h3>
<div>
@ -62,7 +62,7 @@ You split up your application into several AppStates and implement the setEnable
</p>
</div>
<!-- EDIT7 SECTION "How do I pause/unpause a game?" [1805-2410] -->
<!-- EDIT7 SECTION "How do I pause/unpause a game?" [1806-2411] -->
<h3><a>How do I disable logger output to the console?</a></h3>
<div>
@ -86,19 +86,19 @@ For the release, switch the severity level of the default logger to print only S
</p>
</div>
<!-- EDIT8 SECTION "How do I disable logger output to the console?" [2411-2897] -->
<!-- EDIT8 SECTION "How do I disable logger output to the console?" [2412-2898] -->
<h3><a>Why does the executable crash with "Cannot locate resource"?</a></h3>
<div>
<p>
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 ito the build.
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.
<!-- EDIT42 SECTION "How do I debug weird Physics behaviour?" [20161-20474] -->
<!-- EDIT42 SECTION "How do I debug weird Physics behaviour?" [20171-20484] -->
<h3><a>How do I make a walking character?</a></h3>
<div>
<p>
You can use jBullet's CharacterControl that locks a physical object upright, so it does not tip over when moving/walking (as tall physical objects are wont to do).
You can use jBullet's CharacterControl that locks a physical object upright, so it does not tip over when moving/walking (as tall physical objects are typically wanted to).
@ -8,7 +8,7 @@ Every class that extends jme3.app.SimpleApplication has properties that can be c
</p>
<p>
<p><div>Configure application settings in <code>main()</code>, before you call <code>app.start()</code> on the application object. If you change display settings during runtime, for eyample in <code>simpleInitApp()</code>, you must call <code>app.restart()</code> to make them take effect.
<p><div>Configure application settings in <code>main()</code>, before you call <code>app.start()</code> on the application object. If you change display settings during runtime, for example in <code>simpleInitApp()</code>, you must call <code>app.restart()</code> to make them take effect.
</div></p>
</p>
@ -47,14 +47,14 @@ This example toggles the settings to fullscreen while the game is already runnin
int i=0; // note: there are usually several, let's pick the first
@ -111,7 +111,7 @@ Set VSync to false to deactivate vertical syncing (faster, but possible page tea
<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>
@ -122,7 +122,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>
@ -137,7 +137,7 @@ ImageIO.read(new File("")), ???});</td><td>This specifies the little a
<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 [5449-6156] -->
<!-- EDIT7 TABLE [5452-6159] -->
<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.
@ -145,7 +145,7 @@ ImageIO.read(new File("")), ???});</td><td>This specifies the little a
</p>
</div>
<!-- EDIT3 SECTION "Properties" [2060-6516] -->
<!-- EDIT3 SECTION "Properties" [2063-6519] -->
<h2><a>Toggling and Activating Settings</a></h2>
<div>
<div><table>
@ -165,9 +165,9 @@ ImageIO.read(new File("")), ???});</td><td>This specifies the little a
<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>
<!-- EDIT9 TABLE [6563-7444] -->
<!-- EDIT9 TABLE [6566-7447] -->
</div>
<!-- EDIT8 SECTION "Toggling and Activating Settings" [6517-7445] -->
<!-- EDIT8 SECTION "Toggling and Activating Settings" [6520-7448] -->
<h2><a>Saving and Loading Settings</a></h2>
<div>
@ -207,5 +207,5 @@ Provide the unique name of your jME3 application as the String argument. For exa
</ul>
</div>
<!-- EDIT10 SECTION "Saving and Loading Settings" [7446-] -->
<!-- EDIT10 SECTION "Saving and Loading Settings" [7449-] -->
@ -158,7 +158,7 @@ Whether you work in a team or alone, keeping a version controlled repository of
<ul>
<li><div> Treat commit messages as messages to your future self. "Made some changes" is <em>not</em> a commit message.</div>
</li>
<li><div> The jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> supports Subversion, Mercurial, and <acronymtitle="Concurrent Versions System">CVS</acronym>. <br/>
<li><div> The jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> supports Subversion, Mercurial, and Git. <br/>
If you don't know which to choose, Subversion is a good choice for starters.</div>
</li>
<li><div> Set up your own local server, or get free remote hosting space from various open-source dev portals like <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://sourceforge.net/"><paramname="text"value="<html><u>Sourceforge</u></html>"><paramname="textColor"value="blue"></object>, <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="https://github.com/"><paramname="text"value="<html><u>Github</u></html>"><paramname="textColor"value="blue"></object>, <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="https://bitbucket.org/"><paramname="text"value="<html><u>bitbucket</u></html>"><paramname="textColor"value="blue"></object> (supports private projects), <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="http://home.java.net/create-project"><paramname="text"value="<html><u>Java.net</u></html>"><paramname="textColor"value="blue"></object>, <objectclassid="java:org.netbeans.modules.javahelp.BrowserDisplayer"><paramname="content"value="https://code.google.com"><paramname="text"value="<html><u>Google Code</u></html>"><paramname="textColor"value="blue"></object>???</div>
@ -294,7 +294,7 @@ To make a Geometry transparent or translucent:
</div>
</li>
<li><div> Put the Geometry (not the Material!) in the appropriate render queue bucket. <br/>
Objects in the translucent bucket (e.g. particles) are not affected by SceneProcessors (e.g. shadows). Obejcts in the transparent bucket (e.g. foliage) are affected by SceneProcessors (e.g. shadows).</div>
Objects in the translucent bucket (e.g. particles) are not affected by SceneProcessors (e.g. shadows). Objects in the transparent bucket (e.g. foliage) are affected by SceneProcessors (e.g. shadows).</div>
@ -20,7 +20,7 @@ Assets are files that are not code. Your multi-media assets includes, for exampl
<th>DO</th><th>DON'T</th>
</tr>
<tr>
<td>Save original models plus textures into <code>assets/Textures</code>. </td><td> Don't leave textures or models in a folder outside your JME project: The game cannot load or reference them from there. </td>
<td>Import original models plus textures into <code>assets/Textures</code>. </td><td> Don't leave textures or models in a folder outside your JME project: The game cannot load or reference them from there. </td>
</tr>
<tr>
<td> Save sounds into <code>assets/Sounds</code>. </td><td> Don't leave audio files in a folder outside your JME project: The game cannot load or reference them from there. </td>
@ -41,14 +41,14 @@ Assets are files that are not code. Your multi-media assets includes, for exampl
<td>Agree on naming schemes and folder schemes with your artists early on to avoid confusion. E.g. keep naming schemes for bones and certain model parts. Try to keep your assets folder clean, its like your codes class structure.</td><td>Don't mindlessly import downloaded models and other assets into your project without keeping a structure and knowing the files work. You can reimport, delete junk.</td>
@ -45,15 +45,41 @@ You can optimize nodes using the SceneComposer in the <acronym title="Software D
<p>
When you use math operations like <code>vectorA.mult(vectorB);</code>, they create new objects for the result. These objects have to be garbage collected when you don't use them anymore.
Different Java implementations use different garbage collection algorithms, so depending on the platforms you target, different advice applies.
</p>
<p>
Check your math operations for opportunities to use the <em>local</em> version of the math operations, e.g. <code>vectorA.multLocal(vectorB)</code>. Local methods store the result in vectorA and do not create a new object. Use local methods if you do not need to keep the previous vectorA.
The major variants are Oracle's JRE, old (pre-Gingerbread) Androids, and newer (Gingerbread or later) Androids.
</p>
<p>
Oracle's JRE is a copying collector. This means that it does not need to do any work for objects that have become unreachable, it just keeps copying live objects to new memory areas and recycles the now-unused area as a whole.
Older objects are copied less often, so the garbage collection overhead is roughly proportional to the rate at which your code creates new objects that survive for, say, more than a minute.
</p>
<p>
Gingerbread and newer Androids use a garbage collector that does some optimization tricks with local variables, but you should avoid creating and forgetting lots of objects in the scene graph.
</p>
<p>
Older Androids use a very naive garbage collector that needs to do real work for every object, both during creation and during collection. Creating local variables can build up a heap of work, particularly if the function is called often.
</p>
<p>
To avoid creating a temporary object, use <em>local methods</em> to overwrite the contents of an existing object instead of creating a new temporary object for the result.
</p>
<p>
E.g. when you use math operations like <code>vectorA.mult(vectorB);</code>, they create new objects for the result.
</p>
<p>
Check your math operations for opportunities to use the <em>local</em> version of the math operations, e.g. <code>vectorA.multLocal(vectorB)</code>. Local methods store the result in vectorA and do not create a new object.
</p>
</div>
<!-- EDIT3 SECTION "Avoid creating new objects" [1394-1890] -->
<!-- EDIT3 SECTION "Avoid creating new objects" [1394-3028] -->
<h2><a>Avoid large objects in physics</a></h2>
<div>
@ -63,7 +89,7 @@ To offload much computation to the less CPU intense physics broadphase collision
</p>
</div>
<!-- EDIT4 SECTION "Avoid large objects in physics" [1891-2295] -->
<!-- EDIT4 SECTION "Avoid large objects in physics" [3029-3433] -->
<h2><a>Check the Statistics</a></h2>
<div>
@ -94,5 +120,5 @@ Generally jME3 is well optimized and optimizes these things correctly. Read <a h
</span></div>
</div>
<!-- EDIT5 SECTION "Check the Statistics" [2296-] -->
<!-- EDIT5 SECTION "Check the Statistics" [3434-] -->
To use iOS deployment you need a computer running MacOSX and a version of Xcode 4.0+ installed. To deploy to a device or the Apple App Store, you need an Apple developer account.
</p>
<p>
<p><div>Note that at the moment iOS deployment is in alpha state.
</div></p>
</p>
<p>
iOS deployment works via cross-compilation to native iOS ARM code, there is no virtual machine running on the device. The Avian JVM supports this feature while maintaining general compatibility to OpenJDK and JNI for native access. The minimum compatible iOS deployment target is 4.3.
</p>
<p>
<p><div>Note that at the moment this option is in pre-alpha state and the system runs on a null renderer. This means there is no visual or audio output. You can however use the current system to explore the options and test cross-compiling your applications.
<p><div>To install the iOS deployment plugin, go to Tools???Plugins and under "Available plugins" select the "iOS Support" plugin.
</div></p>
</p>
</div>
<!-- EDIT1 SECTION "iOS Deployment" [1-764] -->
<!-- EDIT1 SECTION "iOS Deployment" [1-710] -->
<h3><a>Enabling iOS deployment</a></h3>
<div>
@ -39,7 +45,7 @@ After enabling deployment, a new <code>ios</code> directory is created in the pr
@ -44,6 +44,30 @@ The definition of a coordinate system is defined in jME by the properties sent t
</div>
<!-- EDIT3 SECTION "Definition" [993-1806] -->
<h3><a>Homogenous coordinates</a></h3>
<div>
<p>
Homogenous coordinates have an additional <em>W</em> value tacked on to the end. The XYZ values are to be divided by W to give the true coordinates.
</p>
<p>
This has several advantages, one technical, some relevant to application programmers:
</p>
<p>
Technically, it simplifies some formulae used inside the vector math. For example, some operations need to apply the same factor to the XYZ coordinates. Chain multiple operations of that kind (and vector math tends to do that), and you can save a lot of multiplications by simply keeping the scaling factor around and doing the multiplication to XYZ at the end of the pipeline, in the 3D card (which does accept homogenous coordinates).
It also simplifies some formulae, in particular anything that is related to rotations.
</p>
<p>
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.
@ -270,14 +294,14 @@ Translation requires a 4x4 matrix, where the vector (x,y,z) is mapped to (x,y,z,
<td>S<sup>T</sup></td><td>1</td>
</tr>
</table></div>
<!-- EDIT18 TABLE [6292-6315] -->
<!-- EDIT19 TABLE [7253-7276] -->
<p>
where M is the 3x3 matrix (containing any rotation/scale information), T is the translation vector and S<sup>T</sup> is the transpose Vector of T. 1 is just a constant.
@ -352,11 +352,11 @@ See also: <a href="/com/jme3/gde/docs/jme3/advanced/water.html">Water</a>.
<p>
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 smooth from close up, but don't waste resources with unspottable details when 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.
@ -260,13 +262,13 @@ Learn more about <a href="/com/jme3/gde/docs/jme3/android.html">Android Support<
</p>
</div>
<!-- EDIT9 SECTION "Android Mobile Device" [7169-7347] -->
<!-- EDIT9 SECTION "Android Mobile Device" [7207-7385] -->
<h3><a>iOS Device</a></h3>
<div>
<p>
You can set the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> to build an executable for iOS platforms. Mac support is work in progress.
You can set the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> to build an executable for iOS platforms. A Mac with XCode installed is needed.
</p>
<p>
@ -274,7 +276,7 @@ Learn more about <a href="/com/jme3/gde/docs/jme3/ios.html">iOS Support</a> here
<h2><a>Using BlenderLoader instead of BlenderModelLoader</a></h2>
<div>
@ -252,7 +260,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" [5068-6804] -->
<!-- EDIT7 SECTION "Using BlenderLoader instead of BlenderModelLoader" [5262-6998] -->
<h2><a>How does it work?</a></h2>
<div>
@ -298,7 +306,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 [7278-7629] -->
<!-- EDIT9 TABLE [7472-7823] -->
<p>
Using BlenderLoader can allow you to use blend file as your local assets repository.
@ -308,7 +316,7 @@ Probably versions before 2.49 will work pretty well too, but I never checked tha
</p>
</div>
<!-- EDIT8 SECTION "How does it work?" [6805-7964] -->
<!-- EDIT8 SECTION "How does it work?" [6999-8158] -->
<h2><a>Notes</a></h2>
<div>
@ -321,6 +329,15 @@ Hope I will meet your expectations.
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.
</p>
<p>
When using polygon meshes in blender 2.5 and newer, better add and apply the triangulation modifier (if available in your version) or save the file with convertion from polygons to triangles.
Even though the importer supports loading of polygons as the mesh faces, if your face isn't convex, the results might contain errors.
</p>
<p>
Not all modifiers are supported. If your model has modifiers and looks not the way you want in the jme scene - try to apply them and load again.
@ -78,6 +78,26 @@ If you feel like you want to make an addition to jMonkeyEngine <acronym title="S
</div>
<h4><a>Teminology used here</a></h4>
<div>
<ul>
<li><div> A ???plugin??? is anything you can tick in the plugin manager of the <acronymtitle="Software Development Kit">SDK</acronym>. 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.</div>
</li>
<li><div> 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.</div>
</li>
<li><div> A ???library??? is an entry for a jar file (and optionally sources and javadocs) which can be added to a <acronymtitle="Software Development Kit">SDK</acronym> project to be used and distributed with it</div>
</li>
<li><div> 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..</div>
</li>
</ul>
<p>
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 :)
</p>
</div>
<h4><a>Handy things in jMonkeyEngine SDK Core</a></h4>
@ -30,11 +30,11 @@ The SceneExplorer displays Nodes in a tree that represents the tree of Spatials
</p>
<p>
You open the SceneExplorer by viewing a model (j3o file or other) in the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>.
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.
</p>
</div>
<!-- EDIT3 SECTION "Using the SceneExplorer" [478-780] -->
<!-- EDIT3 SECTION "Using the SceneExplorer" [478-947] -->
<h3><a>Editing Objects in the scene</a></h3>
<div>
<ol>
@ -47,7 +47,7 @@ You open the SceneExplorer by viewing a model (j3o file or other) in the jMonkey
</ol>
</div>
<!-- EDIT4 SECTION "Editing Objects in the scene" [781-1085] -->
<!-- EDIT4 SECTION "Editing Objects in the scene" [948-1252] -->
<h3><a>Reorganizing Objects in the scene</a></h3>
<div>
<ol>
@ -58,7 +58,7 @@ You open the SceneExplorer by viewing a model (j3o file or other) in the jMonkey
</ol>
</div>
<!-- EDIT5 SECTION "Reorganizing Objects in the scene" [1086-1348] -->
<!-- EDIT5 SECTION "Reorganizing Objects in the scene" [1253-1515] -->
<h3><a>Adding Objects to the scene</a></h3>
<div>
@ -75,5 +75,5 @@ Right-click a Spatial or Node in the SceneExplorer to add other Spatials like Pa
</span></div>
</div>
<!-- EDIT6 SECTION "Adding Objects to the scene" [1349-] -->
<!-- EDIT6 SECTION "Adding Objects to the scene" [1516-] -->
You should install the <acronymtitle="Java Development Kit">JDK</acronym> (the one from Oracle, not OpenJDK) first, and then the jMonkey <acronymtitle="Software Development Kit">SDK</acronym>. If jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> cannot find a valid <acronymtitle="Java Development Kit">JDK</acronym> although you have it installed, then you have to specify the location manually.
</p>
<ol>
<li><div> Go to your jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> installation directory. <br/>
Mac users right-click jMonkeyApplication.app (which actually is a directory) in the Finder and select "Show package contents". </div>
</li>
<li><div> Navigate to the <code>etc</code> directory. <br/>
Mac users navigate to <code>Contents/Resources/jmonkeyplatform/etc/</code>.</div>
</li>
<li><div> Open the file <code>jmonkeyplatform.conf</code> in a text editor.</div>
</li>
<li><div> Uncomment the following line and enter the path to the <acronymtitle="Java Development Kit">JDK</acronym>: <pre>jdkhome="/path/to/jdk"</pre>
</div>
</li>
</ol>
</div>
<!-- EDIT2 SECTION "Specifying the JDK location" [48-766] -->
<h3><a>Graphics Card Driver</a></h3>
<div>
@ -37,7 +13,7 @@ Mac users navigate to <code>Contents/Resources/jmonkeyplatform/etc/</code>.</div
You can install another <acronymtitle="Java Development Kit">JDK</acronym> for use with the jMonkey <acronymtitle="Software Development Kit">SDK</acronym>. You then have to specify the location manually.
</p>
<ol>
<li><div> Go to your jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> installation directory. <br/>
Mac users right-click jMonkeyApplication.app (which actually is a directory) in the Finder and select "Show package contents". </div>
</li>
<li><div> Navigate to the <code>etc</code> directory. <br/>
Mac users navigate to <code>Contents/Resources/jmonkeyplatform/etc/</code>.</div>
</li>
<li><div> Open the file <code>jmonkeyplatform.conf</code> in a text editor.</div>
</li>
<li><div> Uncomment the following line and enter the path to the <acronymtitle="Java Development Kit">JDK</acronym>: <pre>jdkhome="/path/to/jdk"</pre>
</div>
</li>
</ol>
</div>
<!-- EDIT8 SECTION "Specifying the JDK location" [2952-3556] -->
<h3><a>Known Issues</a></h3>
<div>
@ -142,5 +142,5 @@ For a list of known issues and possible workarounds see the following link:
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 <acronymtitle="Software Development Kit">SDK</acronym>'s integrated version control features for Subversion, Mercurial, and <acronymtitle="Concurrent Versions System">CVS</acronym>.
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 <acronymtitle="Software Development Kit">SDK</acronym>'s integrated version control features for Subversion, Mercurial, and Git.
</p>
<p>
@ -31,7 +31,7 @@ Note: Since the jMonkeyEngine <acronym title="Software Development Kit">SDK</acr
<p>
The jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> supports various Version Control Systems such as Subversion, Mercurial, and <acronymtitle="Concurrent Versions System">CVS</acronym>. No matter which of them you use, they all share a common user interface.
The jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym> 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.
</p>
<p>
@ -50,7 +50,7 @@ Requirements:
<ul>
<li><div> You must have a project that you want to version. </div>
</li>
<li><div> You must have version control software installed (Subversion, Mercurial, or <acronymtitle="Concurrent Versions System">CVS</acronym>) and have initialized a repository.</div>
<li><div> You must have version control software installed (Subversion, Mercurial, or Git) and have initialized a repository.</div>
<ul>
<li><div> Tip: For Subversion, for example, the init command looks like this example: <code>svnadmin create /home/joe/jMonkeyProjects/MyGame</code></div>
</li>
@ -70,7 +70,7 @@ Now you create a repository to store your project's files.
</p>
<ol>
<li><div> In the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>, right-click the project in the Projects window and choose Versioning > Import Into <acronymtitle="Concurrent Versions System">CVS</acronym>/Subversion Repository (or initialize Mercurial Project, respectively). </div>
<li><div> In the jMonkeyEngine <acronymtitle="Software Development Kit">SDK</acronym>, right-click the project in the Projects window and choose Versioning > Import Into Subversion Repository (or initialize Mercurial Project, etc, respectively). </div>
<ul>
<li><div> Tip: If you haven't evaluated yet which system to choose, start with Subversion for now.</div>
</li>
@ -81,7 +81,7 @@ Now you create a repository to store your project's files.
</ol>
</div>
<!-- EDIT3 SECTION "Creating a Repository (Upload)" [1376-2438] -->
<!-- EDIT3 SECTION "Creating a Repository (Upload)" [1376-2439] -->
<h2><a>Checking Out a Repository (Download)</a></h2>
<div>
@ -91,7 +91,7 @@ You and your team mates check out (download) the repository to their individual
</p>
<ol>
<li><div> Go to the Team menu and choose Subversion > Checkout (or <acronymtitle="Concurrent Versions System">CVS</acronym>/Mercurial>Checkout respectively)</div>
<li><div> Go to the Team menu and choose Subversion > Checkout (or Git or Mercurial respectively)</div>
</li>
<li><div> Fill in your repo data into the wizard and click Finish.</div>
<ul>
@ -117,7 +117,7 @@ Of course you can also check out existing repositories and access code from othe
</p>
</div>
<!-- EDIT4 SECTION "Checking Out a Repository (Download)" [2439-3412] -->
<!-- EDIT4 SECTION "Checking Out a Repository (Download)" [2440-3407] -->
<h2><a>Updating and Committing Changes (Send and Receive)</a></h2>
<div>
@ -156,7 +156,7 @@ Receiving the latest changes from the team's repository is referred to as <
</ol>
</div>
<!-- EDIT5 SECTION "Updating and Committing Changes (Send and Receive)" [3413-4661] -->
<!-- EDIT5 SECTION "Updating and Committing Changes (Send and Receive)" [3408-4656] -->
<h2><a>Comparing and Reverting Changes</a></h2>
<div>
<ul>
@ -187,7 +187,7 @@ Receiving the latest changes from the team's repository is referred to as <
</ul>
</div>
<!-- EDIT6 SECTION "Comparing and Reverting Changes" [4662-5453] -->
<!-- EDIT6 SECTION "Comparing and Reverting Changes" [4657-5448] -->
<h2><a>No Version Control? Local History!</a></h2>
<div>
@ -221,5 +221,5 @@ See also:
</span></div>
</div>
<!-- EDIT7 SECTION "No Version Control? Local History!" [5454-] -->
<!-- EDIT7 SECTION "No Version Control? Local History!" [5449-] -->