We use jme3 and a problem with the BetterCharacterControl is that setMaxSlope
is not implemented. The developer of the engine says that we can solve it ourselves using the new controller:
http://hub.jmonkeyengine.org/forum/topic/setmaxslope-for-bettercharactercontrol/
And I would really like a solution since my game needs it. I asked about it before but we didn't solve it:
How to improve character control for my 3D game?
Can you help us progress? I've recorded a video with the problem:
http://www.youtube.com/watch?v=PF_UzoOXD0E
Some documentation is here: http://hub.jmonkeyengine.org/wiki/doku.php/jme3:advanced:walking_character?s[]=bettercharactercontrol#bettercharactercontrol
My effort to add the functionality to the controller:
package adventure;
import com.jme3.math.Vector3f;
import com.jme3.bullet.control.BetterCharacterControl;
public class GameCharControl extends BetterCharacterControl {
protected 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("location " + location);
System.out.println("lastlocation " + lastlocation);
if (location.equals(lastlocation)) {
System.out.println("update2");
this.setHeightPercent(101);
}
rigidBody.getPhysicsLocation(location);
applyPhysicsTransform(location, rotation);
lastlocation = location;
}
}
But the above is not making any change or if I set height to 101 then it gets difficult to move for the game character. Can you help us see what should be done?