所以我是 JME3 的新手,我在理解 BetterCharacterControl 时遇到了一些问题。
当我尝试将 BetterCharacterControl 应用于一个盒子时,它总是从盒子的上部而不是中心“扩展”。(一张图片更好地说明了这一点:)
我找不到任何函数来更改它应用的位置,我已经尝试创建一个子类,在其中我将 RigidBody 直接更改为 BoxCollisionShape 但这似乎以某种方式搞砸了 isOnGround 方法。另外,如果我以后想使用斜坡,那么胶囊形状会很好。
Box box2 = new Box(10, 15, 10);
player = new Geometry("Player", box2);
player.setLocalTranslation(new Vector3f(0, 20, 0));
Material mat = new Material(assetManager,
"Common/MatDefs/Light/Lighting.j3md");
mat.setBoolean("UseMaterialColors", true);
mat.setColor("Ambient", ColorRGBA.Blue);
mat.setColor("Diffuse", ColorRGBA.Blue);
player.setMaterial(mat);
playerC = new BetterCharacterControl(12, 30, 0);
playerC.setJumpForce(new Vector3f(0, 700, 0));
player.addControl(playerC);
rootNode.attachChild(player);
bulletAppState.getPhysicsSpace().add(playerC);
另一方面,似乎我必须为跳跃力应用一个巨大的矢量才能做任何事情(我没有改变任何重力值)
我很高兴有任何帮助