Tag: 控制

如何改善3D游戏的角色控制?

由于我从辅助类CharacterControl更改为新的BetterCharacterControl我注意到一些改进,例如推动其他角色正在工作,但我的主角已经开始滑过步骤而无法爬上更高的台阶。 我必须跳过上面不是正确的比赛方式,它应该只是走过去。 旧的帮助器类CharacterControl有一个默认的不滑动方式,只是走过几步,我认为可以通过改变我创建主角的代码来纠正它。 private void createNinja() { ninjaNode = (Node) assetManager .loadModel(“Models/Ninja/Ninja.mesh.xml”); ninjaNode.setShadowMode(RenderQueue.ShadowMode.CastAndReceive); ninjaNode.setLocalScale(0.06f); ninjaNode.setLocalTranslation(new Vector3f(55, 3.3f, -60)); ninjaControl = new BetterCharacterControl(2, 4, 0.5f); ninjaControl.setJumpForce(new Vector3f(6, 6, 6)); ninjaNode.addControl(ninjaControl); rootNode.attachChild(ninjaNode); bulletAppState.getPhysicsSpace().add(ninjaControl); getPhysicsSpace().add(ninjaControl); animationControl = ninjaNode.getControl(AnimControl.class); animationChannel = animationControl.createChannel(); } 完整的代码是 package adventure; import com.jme3.system.AppSettings; import java.io.File; import com.jme3.renderer.queue.RenderQueue; import com.jme3.renderer.queue.RenderQueue.ShadowMode; import com.jme3.animation.AnimChannel; import com.jme3.animation.AnimControl; import […]

获得光传感器价值

所以我正在寻找一种方法来获得按钮按下时光传感器的当前值(显然是勒克斯)。 这是我用来实现光传感器控制的代码 public class SensorActivity extends Activity implements SensorEventListener { private final SensorManager mSensorManager; private final Sensor mLight; int minLux = 0; int currentLux = 0; int maxLux; public SensorActivity() { mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE); mLight = mSensorManager.getDefaultSensor(Sensor.TYPE_LIGHT); } protected void onResume() { super.onResume(); mSensorManager.registerListener((SensorEventListener) this, mLight, SensorManager.SENSOR_DELAY_NORMAL); } protected void onPause() { super.onPause(); mSensorManager.unregisterListener((SensorListener) this); […]

用于在Java中生成控制流的工具

我需要一个工具来生成java中的控制流,但不是一个可视化绘制,我可以使用像路径条件一样的东西。 任何人 ?

JavaFX:将UI控件添加到TreeTableView

假设我在TreeTableView中有2列,现在我想在第一列中添加字符串/ Label,在另一列中添加ProgressBar。 我将如何完成这样的事情? 真的很感激任何帮助!