|
@@ -211,6 +211,19 @@ void SceneView3D::MoveCamera(float timeStep)
|
|
|
bool zooming = GetZooming();
|
|
bool zooming = GetZooming();
|
|
|
bool changingCameraSpeed = GetChangingCameraSpeed();
|
|
bool changingCameraSpeed = GetChangingCameraSpeed();
|
|
|
|
|
|
|
|
|
|
+ // Movement speed as world units per second
|
|
|
|
|
+ float MOVE_SPEED = 20.0f;
|
|
|
|
|
+ // Mouse sensitivity as degrees per pixel
|
|
|
|
|
+ const float MOUSE_SENSITIVITY = 0.2f;
|
|
|
|
|
+
|
|
|
|
|
+ // Orthographic zoom settings
|
|
|
|
|
+ float currCameraZoom = camera_->GetZoom();
|
|
|
|
|
+ const float ZOOM_INCREMENT = 0.1f;
|
|
|
|
|
+ const float DEFAULT_ZOOM = 1.0f;
|
|
|
|
|
+
|
|
|
|
|
+ if (shiftDown)
|
|
|
|
|
+ MOVE_SPEED *= 3.0f;
|
|
|
|
|
+
|
|
|
// Use this frame's mouse motion to adjust camera node yaw and pitch. Clamp the pitch between -90 and 90 degrees
|
|
// Use this frame's mouse motion to adjust camera node yaw and pitch. Clamp the pitch between -90 and 90 degrees
|
|
|
if ((mouseInView && input->GetMouseButtonDown(MOUSEB_RIGHT)) || orbitting)
|
|
if ((mouseInView && input->GetMouseButtonDown(MOUSEB_RIGHT)) || orbitting)
|
|
|
{
|
|
{
|
|
@@ -323,6 +336,16 @@ void SceneView3D::MoveCamera(float timeStep)
|
|
|
cameraNode_->SetWorldPosition(pos);
|
|
cameraNode_->SetWorldPosition(pos);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if (camera_->IsOrthographic() && mouseInView && !orbitting)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (input->GetMouseMoveWheel() > 0)
|
|
|
|
|
+ camera_->SetZoom(currCameraZoom + ZOOM_INCREMENT);
|
|
|
|
|
+ if (input->GetMouseMoveWheel() < 0)
|
|
|
|
|
+ camera_->SetZoom(currCameraZoom - ZOOM_INCREMENT);
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ camera_->SetZoom(DEFAULT_ZOOM);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void SceneView3D::SnapCameraToView(int snapView)
|
|
void SceneView3D::SnapCameraToView(int snapView)
|
|
@@ -385,35 +408,19 @@ void SceneView3D::SelectView()
|
|
|
if (MouseInView())
|
|
if (MouseInView())
|
|
|
{
|
|
{
|
|
|
if (input->GetKeyPress(KEY_1))
|
|
if (input->GetKeyPress(KEY_1))
|
|
|
- {
|
|
|
|
|
snapView = 1;
|
|
snapView = 1;
|
|
|
- SetPerspectiveCameraPosition();
|
|
|
|
|
- }
|
|
|
|
|
if (input->GetKeyPress(KEY_2))
|
|
if (input->GetKeyPress(KEY_2))
|
|
|
- {
|
|
|
|
|
snapView = 2;
|
|
snapView = 2;
|
|
|
- SetPerspectiveCameraPosition();
|
|
|
|
|
- }
|
|
|
|
|
if (input->GetKeyPress(KEY_3))
|
|
if (input->GetKeyPress(KEY_3))
|
|
|
- {
|
|
|
|
|
snapView = 3;
|
|
snapView = 3;
|
|
|
- SetPerspectiveCameraPosition();
|
|
|
|
|
- }
|
|
|
|
|
if (input->GetKeyPress(KEY_4))
|
|
if (input->GetKeyPress(KEY_4))
|
|
|
- {
|
|
|
|
|
snapView = 4;
|
|
snapView = 4;
|
|
|
- SetPerspectiveCameraPosition();
|
|
|
|
|
- }
|
|
|
|
|
if (input->GetKeyPress(KEY_5))
|
|
if (input->GetKeyPress(KEY_5))
|
|
|
- {
|
|
|
|
|
snapView = 5;
|
|
snapView = 5;
|
|
|
- SetPerspectiveCameraPosition();
|
|
|
|
|
- }
|
|
|
|
|
if (input->GetKeyPress(KEY_6))
|
|
if (input->GetKeyPress(KEY_6))
|
|
|
- {
|
|
|
|
|
snapView = 6;
|
|
snapView = 6;
|
|
|
- SetPerspectiveCameraPosition();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ SetPerspectiveCameraPosition();
|
|
|
|
|
|
|
|
if (input->GetKeyPress(KEY_P))
|
|
if (input->GetKeyPress(KEY_P))
|
|
|
{
|
|
{
|