- ChaseCamera's attributes are now protected
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7249 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
9b5aa824fd
commit
0539f1971a
@ -55,61 +55,61 @@ import java.io.IOException;
|
|||||||
*/
|
*/
|
||||||
public class ChaseCamera implements ActionListener, AnalogListener, Control {
|
public class ChaseCamera implements ActionListener, AnalogListener, Control {
|
||||||
|
|
||||||
private Spatial target = null;
|
protected Spatial target = null;
|
||||||
private float minVerticalRotation = 0.00f;
|
protected float minVerticalRotation = 0.00f;
|
||||||
private float maxVerticalRotation = FastMath.PI / 2;
|
protected float maxVerticalRotation = FastMath.PI / 2;
|
||||||
private float minDistance = 1.0f;
|
protected float minDistance = 1.0f;
|
||||||
private float maxDistance = 40.0f;
|
protected float maxDistance = 40.0f;
|
||||||
private float distance = 20;
|
protected float distance = 20;
|
||||||
private float zoomSpeed = 2f;
|
protected float zoomSpeed = 2f;
|
||||||
private float rotationSpeed = 1.0f;
|
protected float rotationSpeed = 1.0f;
|
||||||
private float rotation = 0;
|
protected float rotation = 0;
|
||||||
private float trailingRotationInertia = 0.05f;
|
protected float trailingRotationInertia = 0.05f;
|
||||||
private float zoomSensitivity = 5f;
|
protected float zoomSensitivity = 5f;
|
||||||
private float rotationSensitivity = 5f;
|
protected float rotationSensitivity = 5f;
|
||||||
private float chasingSensitivity = 5f;
|
protected float chasingSensitivity = 5f;
|
||||||
private float trailingSensitivity = 0.5f;
|
protected float trailingSensitivity = 0.5f;
|
||||||
private float vRotation = FastMath.PI / 6;
|
protected float vRotation = FastMath.PI / 6;
|
||||||
private boolean smoothMotion = false;
|
protected boolean smoothMotion = false;
|
||||||
private boolean trailingEnabled = true;
|
protected boolean trailingEnabled = true;
|
||||||
private float rotationLerpFactor = 0;
|
protected float rotationLerpFactor = 0;
|
||||||
private float trailingLerpFactor = 0;
|
protected float trailingLerpFactor = 0;
|
||||||
private boolean rotating = false;
|
protected boolean rotating = false;
|
||||||
private boolean vRotating = false;
|
protected boolean vRotating = false;
|
||||||
private float targetRotation = rotation;
|
protected float targetRotation = rotation;
|
||||||
private InputManager inputManager;
|
protected InputManager inputManager;
|
||||||
private Vector3f initialUpVec;
|
protected Vector3f initialUpVec;
|
||||||
private float targetVRotation = vRotation;
|
protected float targetVRotation = vRotation;
|
||||||
private float vRotationLerpFactor = 0;
|
protected float vRotationLerpFactor = 0;
|
||||||
private float targetDistance = distance;
|
protected float targetDistance = distance;
|
||||||
private float distanceLerpFactor = 0;
|
protected float distanceLerpFactor = 0;
|
||||||
private boolean zooming = false;
|
protected boolean zooming = false;
|
||||||
private boolean trailing = false;
|
protected boolean trailing = false;
|
||||||
private boolean chasing = false;
|
protected boolean chasing = false;
|
||||||
private boolean canRotate;
|
protected boolean canRotate;
|
||||||
private float offsetDistance = 0.002f;
|
protected float offsetDistance = 0.002f;
|
||||||
private Vector3f prevPos;
|
protected Vector3f prevPos;
|
||||||
private boolean targetMoves = false;
|
protected boolean targetMoves = false;
|
||||||
private boolean enabled = true;
|
protected boolean enabled = true;
|
||||||
private Camera cam = null;
|
protected Camera cam = null;
|
||||||
private final Vector3f targetDir = new Vector3f();
|
protected final Vector3f targetDir = new Vector3f();
|
||||||
private float previousTargetRotation;
|
protected float previousTargetRotation;
|
||||||
private final Vector3f pos = new Vector3f();
|
protected final Vector3f pos = new Vector3f();
|
||||||
protected Vector3f targetLocation = new Vector3f(0, 0, 0);
|
protected Vector3f targetLocation = new Vector3f(0, 0, 0);
|
||||||
protected boolean dragToRotate = true;
|
protected boolean dragToRotate = true;
|
||||||
protected Vector3f lookAtOffset = new Vector3f(0, 0, 0);
|
protected Vector3f lookAtOffset = new Vector3f(0, 0, 0);
|
||||||
protected boolean leftClickRotate = true;
|
protected boolean leftClickRotate = true;
|
||||||
protected boolean rightClickRotate = true;
|
protected boolean rightClickRotate = true;
|
||||||
private Vector3f temp = new Vector3f(0, 0, 0);
|
protected Vector3f temp = new Vector3f(0, 0, 0);
|
||||||
protected boolean invertYaxis = false;
|
protected boolean invertYaxis = false;
|
||||||
protected boolean invertXaxis = false;
|
protected boolean invertXaxis = false;
|
||||||
private final static String ChaseCamDown = "ChaseCamDown";
|
protected final static String ChaseCamDown = "ChaseCamDown";
|
||||||
private final static String ChaseCamUp = "ChaseCamUp";
|
protected final static String ChaseCamUp = "ChaseCamUp";
|
||||||
private final static String ChaseCamZoomIn = "ChaseCamZoomIn";
|
protected final static String ChaseCamZoomIn = "ChaseCamZoomIn";
|
||||||
private final static String ChaseCamZoomOut = "ChaseCamZoomOut";
|
protected final static String ChaseCamZoomOut = "ChaseCamZoomOut";
|
||||||
private final static String ChaseCamMoveLeft = "ChaseCamMoveLeft";
|
protected final static String ChaseCamMoveLeft = "ChaseCamMoveLeft";
|
||||||
private final static String ChaseCamMoveRight = "ChaseCamMoveRight";
|
protected final static String ChaseCamMoveRight = "ChaseCamMoveRight";
|
||||||
private final static String ChaseCamToggleRotate = "ChaseCamToggleRotate";
|
protected final static String ChaseCamToggleRotate = "ChaseCamToggleRotate";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs the chase camera
|
* Constructs the chase camera
|
||||||
|
Loading…
x
Reference in New Issue
Block a user