J'ai un problème: soudainement flyCam et inputManager à l'intérieur de simpleInitApp() sont devenus égaux à NULL.jMonkeyEngine: flyCam et inputManager renvoient tous les deux NULL
Je ne comprends pas ce qui s'est passé! Ils sont toujours NULL!
public void simpleInitApp() {
Box b = new Box(1, 1, 1);
System.out.println("inputManager = " + inputManager + "; flyCam = " + flyCam);
Geometry geom = new Geometry("Box", b);
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.setColor("Color", ColorRGBA.Blue);
geom.setMaterial(mat);
rootNode.attachChild(geom);
}
Sortie: inputManager = null; flyCam = null
Tous mes exemples (j'ai fait beaucoup d'échantillons par jMonkey Book) lancent des exceptions NullPointer maintenant (ils ont fonctionné avant).
J'ai essayé de:
- SDK et réinstaller jMonkey registre propre de Windows
- réinstaller les pilotes vidéo
... rien ... aide
Je ne comprends pas ce que j'avais réellement fait ... Autant que je me souvienne je venais d'écrire ceci:
private final InputListener flyCamListener = new ActionListener() {
@Override
public void onAction(String name, boolean isPressed, float tpf) {
boolean enabled = app.getFlyByCamera().isEnabled();
app.getFlyByCamera().setEnabled(!enabled);
}
};
et tout écrasé.
===
jMonkey 3.0.10_x86, Java: 1.7.0_51, Windows 7 x86, OpenGL: 3.0.0, GLSL Ver: 1,30 - Intel Créer 8.15.10.2342
Si vous n'initialisez pas 'FlyCamAppState' (par exemple en n'utilisant pas le constructeur par défaut de' SimpleApplication'), 'flyCam' sera NULL. 'inputManager' sera NULL si vous définissez" UseInput "dans la configuration à false. – 1000ml