|
|
@@ -15,7 +15,7 @@ You can read about the introduction of the library in the forum thread: link:htt
|
|
|
|
|
|
* link:https://github.com/MeFisto94/jme3-artificial-intelligence/releases[jme3 Artificial Intelligence Library] - The library and javaDocs for jme3AI. This is also where you can report problems or help in maintaining the library.
|
|
|
* link:https://github.com/stevefsp/critterai/releases[CritterAI] - Stephen Pratt's link:http://www.critterai.org/projects/nmgen_study/[NMGen Study] project files to generate the navmesh.
|
|
|
-* To get the assets (3D models) used in this example, add the xref:sdk:sample_code.adoc#jme3testdata-assets.adoc[jME3-testdata.jar] to your classpath.
|
|
|
+* To get the assets (3D models) used in this example, add the <<sdk:sample_code.adoc#jme3testdata-assets,jME3-testdata.jar>> to your classpath.
|
|
|
* Java SDK 8+.
|
|
|
|
|
|
Stephen Pratt explains in detail the configuration parameters of CritterAI/Jme3AI in a easy to follow format and is suggested reading.
|
|
|
@@ -57,7 +57,7 @@ Both methods produce exactly the same NavMesh and both will be covered in this t
|
|
|
* Open your scene in the Terrain Editor or Scene Explorer by btn:[RMB] selecting the file in your assets folder and choosing `Edit Terrain` or `Edit in SceneComposer`.
|
|
|
* Once open, btn:[RMB] select the root node in the `SceneExplorer` and then select `menu:Spatial[NavMesh]`.
|
|
|
|
|
|
-This will open the `Create NavMesh` dialog with default settings. You can read in depth about each parameter by following the `Configuration Parameters` link under xref:jme3/advanced/jme3_ai.adoc#requirements.adoc[Requirements].
|
|
|
+This will open the `Create NavMesh` dialog with default settings. You can read in depth about each parameter by following the `Configuration Parameters` link under <<requirements,Requirements>>.
|
|
|
|
|
|
.Parameter Insight
|
|
|
The jme3AI system uses CritterAI, which is based off link:https://github.com/recastnavigation/recastnavigation[Recast and Detour] navigation. The author of Recast lays out a few specific rules for NavMesh creation in this link:http://digestingduck.blogspot.dk/2009/08/recast-settings-uncovered.html[blog post], which logically apply to jme3AI. Below is a translation of this post as it pertains to jme3AI.
|
|
|
@@ -336,7 +336,7 @@ These are implementation decisions that are left up to you.
|
|
|
|
|
|
=== Loading the NavMesh
|
|
|
|
|
|
-In this tutorial example, the optimized mesh was exported as a geometry using the jMonkey binary format `.j3o`. Doing so means the loading of your `NavMeshes` is done the same way you load any model, by using the `AssetManager`. Once you load the `.j3o`, you grab its `Mesh` and create the `NavMesh` object to be passed to the link:https://github.com/jMonkeyEngine/doc-examples/blob/master/src/com/jme3/examples/jme3ai/ai/NavigationControl.java[NavigationControl] constructor. This tutorial uses a xref:core:app/state/application_states.adoc#baseappstate[BaseAppState] for model loading so access to the `Application` class is built in.
|
|
|
+In this tutorial example, the optimized mesh was exported as a geometry using the jMonkey binary format `.j3o`. Doing so means the loading of your `NavMeshes` is done the same way you load any model, by using the `AssetManager`. Once you load the `.j3o`, you grab its `Mesh` and create the `NavMesh` object to be passed to the link:https://github.com/jMonkeyEngine/doc-examples/blob/master/src/com/jme3/examples/jme3ai/ai/NavigationControl.java[NavigationControl] constructor. This tutorial uses a <<core:app/state/application_states.adoc#baseappstate,BaseAppState>> for model loading so access to the `Application` class is built in.
|
|
|
|
|
|
[source, java]
|
|
|
----
|
|
|
@@ -366,7 +366,7 @@ public NavigationControl(NavMesh navMesh) {
|
|
|
|
|
|
=== Communicating with NavigationControl
|
|
|
|
|
|
-This tutorial makes use of the xref:tutorials:beginner/hello_picking.adoc[Hello Picking] and xref:jme3/advanced/mouse_picking.adoc#pick-a-target-using-the-mouse-pointer.adoc[Mouse Picking] tutorials so you should already be familiar with this method for picking and how to add the xref:tutorials:beginner/hello_input_system.adoc[input mappings] to your game. How you implement your ActionListener is up to you.
|
|
|
+This tutorial makes use of the xref:tutorials:beginner/hello_picking.adoc[Hello Picking] and <<core:input/mouse_picking.adoc#pick-a-target-using-the-mouse-pointer,Mouse Picking>> tutorials so you should already be familiar with this method for picking and how to add the xref:tutorials:beginner/hello_input_system.adoc[input mappings] to your game. How you implement your ActionListener is up to you.
|
|
|
|
|
|
.PCState ActionListener
|
|
|
[source, java]
|
|
|
@@ -509,7 +509,7 @@ private void shutdownAndAwaitTermination(ExecutorService pool) {
|
|
|
}
|
|
|
----
|
|
|
|
|
|
-The easiest way to move a physics character is by using the xref:physics:control/walking_character.adoc#bettercharactercontrol[BetterCharacterControl] class. In this implementation, this is done in the link:https://github.com/jMonkeyEngine/doc-examples/blob/master/src/com/jme3/examples/jme3ai/controls/PCControl.java[PCControl] class by extending `BetterCharacterControl`. Since `BetterCharacterControl` is required to be present on the spatial for pathfinding, in the `setSpatial()` method, we throw an exception to let us know if it's missing.
|
|
|
+The easiest way to move a physics character is by using the <<physics:control/walking_character.adoc#bettercharactercontrol,BetterCharacterControl>> class. In this implementation, this is done in the link:https://github.com/jMonkeyEngine/doc-examples/blob/master/src/com/jme3/examples/jme3ai/controls/PCControl.java[PCControl] class by extending `BetterCharacterControl`. Since `BetterCharacterControl` is required to be present on the spatial for pathfinding, in the `setSpatial()` method, we throw an exception to let us know if it's missing.
|
|
|
|
|
|
[source, java]
|
|
|
----
|