Book Image

JMonkeyEngine 3.0 Cookbook

By : Rickard Eden
Book Image

JMonkeyEngine 3.0 Cookbook

By: Rickard Eden

Overview of this book

Table of Contents (17 chapters)
jMonkeyEngine 3.0 Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Generating NavMesh in SDK


Automatic NavMesh generation is a feature of the SDK available in the SceneExplorer. The NavMesh, as its name implies, is a mesh in which pathfinding can be applied to have AIs navigate through the game world. The generator takes a set of input values and, based on these, will create a mesh that stretches around obstacles. It can be seen as painted lines that the AI can use to know where it's safe to walk.

NavMesh on top of the terrain

Getting ready

The feature is available through a plugin, which we have to download first. Refer to the Downloading the plugins section in Appendix, Information Fragments.

How to do it...

  1. Once the plugin has been downloaded, we can open any scene in the SceneComposer window, as shown in the following screenshot:

  2. In the SceneExplorer window, right-click on the top node, and navigate to Add Spatial.. | NavMesh.. to bring up the options window.

  3. The simplest procedure from here is to click on Finish and see what happens.

  4. A geometry called NavMesh...