Skip to content

Mirror of jayfella/jme-focuscamera from github

License

Notifications You must be signed in to change notification settings

jMonkeyEngine-archive/jme-focuscamera-jayfella-github

Repository files navigation

Jme-FocusCamera

A jMonkey AppState that focuses on a given spatial. You can then rotate around it and zoom. You can also optionally offset the focus point.

There are several options to choose speeds, max zoom, min zoom, invert Y, etc..

Use the Left Mouse Button to rotate. Use the mousewheel to zoom. Middle button to reset offset. Right button to move offset.

See the main class for a working example.

FocusCameraState focusCameraState = new FocusCameraState();
stateManager.attach(focusCameraState);

// set a spatial to focus on.
focusCameraState.setFocusPoint(mySpatial);

// optional settings

focusCameraState.setZoomSpeed(1); // how fast the camera will zoom when you scroll the mouse wheel in world units.
focusCameraState.setMinZoom(3); // the minimum zoom distance the camera can get to the spatial.
focusCameraState.setMaxZoom(30); // the maximum zoom distance the camera can get from the spatial.

focusCameraState.setRotationSpeed(FastMath.TWO_PI * 4); // how fast the camera will rotate.
focusCameraState.setInvertY(false); // invert the up/down movement.

About

Mirror of jayfella/jme-focuscamera from github

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages