Weiter gearbeitet
This commit is contained in:
@@ -17,9 +17,10 @@ import com.jme3.scene.Spatial;
|
||||
public class ThirdPersonCamera {
|
||||
|
||||
private static final float MOUSE_SENSITIVITY = 1.8f;
|
||||
private static final float MIN_DISTANCE = 3f;
|
||||
private static final float MAX_DISTANCE = 20f;
|
||||
private static final float MIN_VERTICAL_ANGLE = -0.3f;
|
||||
private static final float BASE_DISTANCE = 5f;
|
||||
private static final float MIN_DISTANCE = BASE_DISTANCE - 3f;
|
||||
private static final float MAX_DISTANCE = BASE_DISTANCE + 3f;
|
||||
private static final float MIN_VERTICAL_ANGLE = 0.08f; // Kamera immer leicht über Schulter
|
||||
private static final float MAX_VERTICAL_ANGLE = FastMath.HALF_PI - 0.1f;
|
||||
private static final float TARGET_HEIGHT = 1.6f;
|
||||
|
||||
@@ -30,7 +31,7 @@ public class ThirdPersonCamera {
|
||||
|
||||
private float yaw = 0f;
|
||||
private float pitch = 0.4f;
|
||||
private float distance = 10f;
|
||||
private float distance = BASE_DISTANCE;
|
||||
private boolean paused = false;
|
||||
|
||||
public ThirdPersonCamera(Camera cam, InputManager inputManager) {
|
||||
@@ -65,8 +66,8 @@ public class ThirdPersonCamera {
|
||||
case "MouseY" -> pitch = FastMath.clamp(pitch - value * MOUSE_SENSITIVITY, MIN_VERTICAL_ANGLE, MAX_VERTICAL_ANGLE);
|
||||
case "MouseYNeg" -> pitch = FastMath.clamp(pitch + value * MOUSE_SENSITIVITY, MIN_VERTICAL_ANGLE, MAX_VERTICAL_ANGLE);
|
||||
// Zoom
|
||||
case "ZoomIn" -> distance = FastMath.clamp(distance - value * 20f, MIN_DISTANCE, MAX_DISTANCE);
|
||||
case "ZoomOut" -> distance = FastMath.clamp(distance + value * 20f, MIN_DISTANCE, MAX_DISTANCE);
|
||||
case "ZoomIn" -> distance = FastMath.clamp(distance - value * 0.5f, MIN_DISTANCE, MAX_DISTANCE);
|
||||
case "ZoomOut" -> distance = FastMath.clamp(distance + value * 0.5f, MIN_DISTANCE, MAX_DISTANCE);
|
||||
}
|
||||
};
|
||||
inputManager.addListener(analogListener,
|
||||
|
||||
Reference in New Issue
Block a user