Selaa lähdekoodia

Removed outdated comment about BetterCharacterControl.

mitm 8 vuotta sitten
vanhempi
commit
9933d17e79
1 muutettua tiedostoa jossa 20 lisäystä ja 20 poistoa
  1. 20 20
      src/docs/asciidoc/jme3/advanced/walking_character.adoc

+ 20 - 20
src/docs/asciidoc/jme3/advanced/walking_character.adoc

@@ -1,6 +1,6 @@
 = Walking Character
-:author: 
-:revnumber: 
+:author:
+:revnumber:
 :revdate: 2016/03/17 20:48
 :keywords: documentation, physics, input, animation, character, NPC, collision
 :relfileprefix: ../../
@@ -8,7 +8,7 @@
 ifdef::env-github,env-browser[:outfilesuffix: .adoc]
 
 
-In the <<jme3/beginner/hello_collision#,Hello Collision>> tutorial and the link:https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-examples/src/main/java/jme3test/bullet/TestQ3.java[TestQ3.java] code sample you have seen how to create collidable landscapes and walk around in a first-person perspective. The first-person camera is enclosed by a collision shape and is steered by the BetterCharacterControl. 
+In the <<jme3/beginner/hello_collision#,Hello Collision>> tutorial and the link:https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-examples/src/main/java/jme3test/bullet/TestQ3.java[TestQ3.java] code sample you have seen how to create collidable landscapes and walk around in a first-person perspective. The first-person camera is enclosed by a collision shape and is steered by the BetterCharacterControl.
 
 Other games however require a third-person perspective of the character: In these cases you use a CharacterControl on a Spatial. This example also shows how to set up custom navigation controls, so you can press WASD to make the third-person character walk; and how to implement dragging the mouse to rotate.
 
@@ -26,7 +26,7 @@ Several related code samples can be found here:
 
 *  link:https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-examples/src/main/java/jme3test/bullet/TestPhysicsCharacter.java[TestPhysicsCharacter.java] (third-person view)
 *  link:https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-examples/src/main/java/jme3test/bullet/TestWalkingChar.java[TestWalkingChar.java] (third-person view)
-**  Uses also link:https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-examples/src/main/java/jme3test/bullet/BombControl.java[BombControl.java] 
+**  Uses also link:https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-examples/src/main/java/jme3test/bullet/BombControl.java[BombControl.java]
 
 *  link:https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-examples/src/main/java/jme3test/bullet/TestQ3.java[TestQ3.java] (first-person view)
 *  link:https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-examples/src/main/java/jme3test/helloworld/HelloCollision.java[HelloCollision.java] (first-person view)
@@ -75,12 +75,12 @@ player.setLocalScale(0.5f); // optionally adjust scale of model
 playerControl = new BetterCharacterControl(1.5f, 6f, 1f); // construct character. (If your character bounces, try increasing height and weight.)
 playerNode.addControl(playerControl); // attach to wrapper
 // set basic physical properties:
-        playerControl.setJumpForce(new Vector3f(0,5f,0)); 
+        playerControl.setJumpForce(new Vector3f(0,5f,0));
         playerControl.setGravity(new Vector3f(0,1f,0));
 playerControl.warp(new Vector3f(0,10,10)); // warp character into landscape at particular location
 // add to physics state
-        bulletAppState.getPhysicsSpace().add(playerControl); 
-        bulletAppState.getPhysicsSpace().addAll(playerNode); 
+        bulletAppState.getPhysicsSpace().add(playerControl);
+        bulletAppState.getPhysicsSpace().addAll(playerNode);
 rootNode.attachChild(playerNode); // add wrapper to root
 
 ----
@@ -90,7 +90,7 @@ rootNode.attachChild(playerNode); // add wrapper to root
 
 [IMPORTANT]
 ====
-The BulletPhysics CharacterControl only collides with “real PhysicsControls (RigidBody). It does not detect collisions with other CharacterControls! If you need additional collision checks, add GhostControls to your characters and create a custom <<jme3/advanced/physics_listeners#,collision listener>> to respond. (The JME3 team may implement a better CharacterControl one day.)
+The BulletPhysics CharacterControl only collides with “real PhysicsControls (RigidBody). It does not detect collisions with other CharacterControls! If you need additional collision checks, add GhostControls to your characters and create a custom <<jme3/advanced/physics_listeners#,collision listener>> to respond.
 ====
 
 
@@ -98,28 +98,28 @@ A CharacterControl is a special kinematic object with restricted movement. Chara
 [cols="2", options="header"]
 |===
 
-a| CharacterControl Method 
-a| Property 
+a| CharacterControl Method
+a| Property
 
 a| setUpAxis(1)
 a| Fixed upward axis. Values: 0 = X axis , 1 = Y axis , 2 = Z axis. +
 Default: 1, because for characters and vehicles, up is typically along the Y axis.
 
-a| setJumpSpeed(10f) 
-a| Jump speed (movement along upward-axis) 
+a| setJumpSpeed(10f)
+a| Jump speed (movement along upward-axis)
 
-a| setFallSpeed(20f) 
-a| Fall speed (movement opposite to upward-axis) 
+a| setFallSpeed(20f)
+a| Fall speed (movement opposite to upward-axis)
 
-a| setMaxSlope(1.5f) 
-a| How steep the slopes and steps are that the character can climb without considering them an obstacle. Higher obstacles need to be jumped. Vertical height in world units. 
+a| setMaxSlope(1.5f)
+a| How steep the slopes and steps are that the character can climb without considering them an obstacle. Higher obstacles need to be jumped. Vertical height in world units.
 
-<a| setGravity(1f)   
+<a| setGravity(1f)
 a| The intensity of gravity for this CharacterControl'ed entity. Tip: To change the direction of gravity for a character, modify the up axis.
 
 a| setWalkDirection(new Vector3f(0f,0f,0.1f))
 a| (CharacterControl only) Make a physical character walk continuously while checking for floors and walls as solid obstacles. This should probably be called “setPositionIncrementPerSimulatorStep. This argument is neither a direction nor a velocity, but the amount to increment the position each physics tick: vector length = accuracy*speed in m/s. +
-Use `setWalkDirection(Vector3f.ZERO)` to stop a directional motion. 
+Use `setWalkDirection(Vector3f.ZERO)` to stop a directional motion.
 
 |===
 
@@ -388,7 +388,7 @@ private void attack() {
 
 ----
 
-Finally, the update loop looks at the directional variables and moves the character accordingly. Since this is a special kinematic CharacterControl, we use the `setWalkDirection()` method. 
+Finally, the update loop looks at the directional variables and moves the character accordingly. Since this is a special kinematic CharacterControl, we use the `setWalkDirection()` method.
 
 The variable `airTime` tracks how long the character is off the ground (e.g. when jumping or falling) and adjusts the walk and stand animations acccordingly.
 
@@ -433,7 +433,7 @@ public void simpleUpdate(float tpf) {
         animationChannel.setAnim("Walk", 0.7f);
       }
     }
-    
+
   walkDirection.multLocal(25f).multLocal(tpf);// The use of the first multLocal here is to control the rate of movement multiplier for character walk speed. The second one is to make sure the character walks the same speed no matter what the frame rate is.
   character.setWalkDirection(walkDirection); // THIS IS WHERE THE WALKING HAPPENS
 }