How to reach the test block in this Java code?
I want to test whether my character has moved and if it hasn't then I
should raise the height percentage to make it able to walk stairs and
slopes but it's not reaching the "update2" part so the test is not
working:
package adventure;
import com.jme3.math.Vector3f;
import com.jme3.bullet.control.BetterCharacterControl;
public class GameCharControl extends BetterCharacterControl {
protected final Vector3f lastlocation = new Vector3f();
public GameCharControl(float x, float y, float z) {
super(x, y, z);
}
@Override
public void update(float tpf) {
super.update(tpf);
System.out.println("update");
if (location.equals(lastlocation)) {
System.out.println("update2");
this.setHeightPercent(101);
}
rigidBody.getPhysicsLocation(location);
applyPhysicsTransform(location, rotation);
}
}
The background is that I'm trying to solve this problem by breaking in
down into parts and units:
How to walk stairs and slopes?
No comments:
Post a Comment