|
@@ -1,18 +1,14 @@
|
|
|
= terrain_collision
|
|
|
:author:
|
|
|
:revnumber:
|
|
|
-:revdate: 2016/03/17 20:48
|
|
|
+:revdate: 2020/07/15
|
|
|
:keywords: terrain, collision
|
|
|
-:relfileprefix: ../../
|
|
|
-:imagesdir: ../..
|
|
|
-:experimental:
|
|
|
-ifdef::env-github,env-browser[:outfilesuffix: .adoc]
|
|
|
|
|
|
|
|
|
|
|
|
== Terrain Collision
|
|
|
|
|
|
-This tutorial expands the HelloTerrain tutorial and makes the terrain solid. You combine what you learned in <<jme3/beginner/hello_terrain#,Hello Terrain>> and <<jme3/beginner/hello_collision#,Hello Collision>> and add a CollisionShape to the terrain. The terrain's CollisionShape lets the first-person player (who is also a CollisionShape) collide with the terrain, i.e. walk on it and stand on it.
|
|
|
+This tutorial expands the HelloTerrain tutorial and makes the terrain solid. You combine what you learned in xref:tutorials:beginner/hello_terrain.adoc[Hello Terrain] and xref:tutorials:beginner/hello_collision.adoc[Hello Collision] and add a CollisionShape to the terrain. The terrain's CollisionShape lets the first-person player (who is also a CollisionShape) collide with the terrain, i.e. walk on it and stand on it.
|
|
|
|
|
|
|
|
|
== Sample Code
|
|
@@ -227,7 +223,7 @@ Compile and run the code. You should see a terrain. You can use the WASD keys an
|
|
|
|
|
|
=== The Terrain Code
|
|
|
|
|
|
-Read <<jme3/beginner/hello_terrain#,Hello Terrain>> for details of the following parts that we reuse:
|
|
|
+Read xref:tutorials:beginner/hello_terrain.adoc[Hello Terrain] for details of the following parts that we reuse:
|
|
|
|
|
|
. The `AbstractHeightMap` is an efficient way to describe the shape of the terrain.
|
|
|
. The `Terrain.j3md`-based Material and its texture layers let you colorize rocky mountain, grassy valleys, and a paved path criss-crossing over the landscape.
|
|
@@ -236,7 +232,7 @@ Read <<jme3/beginner/hello_terrain#,Hello Terrain>> for details of the following
|
|
|
|
|
|
=== The Collision Detection Code
|
|
|
|
|
|
-Read <<jme3/beginner/hello_collision#,Hello Collision>> for details of the following parts that we reuse:
|
|
|
+Read xref:tutorials:beginner/hello_collision.adoc[Hello Collision] for details of the following parts that we reuse:
|
|
|
|
|
|
. The `BulletAppState` lines activate physics.
|
|
|
. The `ActionListener` (`onAction()`) lets you reconfigure the input handling for the first-person player, so it takes collision detection into account.
|
|
@@ -287,5 +283,5 @@ You should spawn high up in the area and fall down to the map, giving you a few
|
|
|
|
|
|
See also:
|
|
|
|
|
|
-* <<jme3/beginner/hello_terrain#,Hello Terrain>>,
|
|
|
-* <<jme3/advanced/terrain#,Terrain>>
|
|
|
+* xref:tutorials:beginner/hello_terrain.adoc[Hello Terrain],
|
|
|
+* xref:tutorials:advanced/terrain.adoc[Terrain]
|