Question about packages

Hello all. I’m working on a robot simulator and I’m having some trouble overriding the default camera behavior. I inherited a class from FlyByCamera and added the code I needed, but the call to stateManager.getState(FlyCamAppState.class).setCamera(new MyCam(cam)); fails on account of the fact that my code is outside the com.jme3.input package. Creating my own version of the jME namespace seems like a bad solution, so I was hoping that I’m missing something, and that someone here could set me strait. Is there a way to override behaviors in a camera from outside of com.jme3?

Derp, I mean my code is outside the com.jme3.app package.



Also, what happened to the ability to edit my posts?

@matthew-dunlap said:
Derp, I mean my code is outside the com.jme3.app package.

Also, what happened to the ability to edit my posts?

1) No, just make your own
2) Join the group with the button above
1 Like

Ok, fair enough, thanks for the help.

Yeah, FlyCamAppState is a pretty simple class that’s sole job is giving SimpleApplication a FlyByCamera. If you want a different camera then don’t include FlyCamAppState and just write your own app state (if you even decide you want one). No reason to subclass it.

1 Like

Ah, good call. It seems that even if it had compiled it wouldn’t have worked, I’m not using a SimpleApplication and I also wasn’t adding an AppState for the camera. I’m new to the API :wink: .



Thanks for the advice, I’m definitely going to build an AppState!

You should definitely use SimpleApplication for any kind of game. Its not what the name implies.

I’m not building a game. The trick is I need to be able to separate running the physics from running the graphics. Much of the time I won’t be running graphics at all, and if at all possible I’d like to be able to do so on machines that don’t have OpenGL installed… although I’ll be the first to admit I don’t have a clear picture on that part of the project yet.

What I said is still valid, all the AppState logic etc. is in SimpleApplication.

perhaps try running the SimpleAplication in headless mode, its meant for servers but might be applicable to you (although i’ve not used it yet, but its might be a possible option)