OSDN Git Service

Added the ability to spin camera (Z-axis rotation)
authorryan <>
Sun, 23 Aug 2009 04:34:28 +0000 (04:34 +0000)
committerryan <>
Sun, 23 Aug 2009 04:34:28 +0000 (04:34 +0000)
changelog.txt
readme.txt
src/camera.cpp
src/camera.h
src/skyscraper.cpp

index 5e1677c..fbdfdaa 100644 (file)
@@ -23,6 +23,7 @@ in a shaft or an elevator
 -elevator panel buttons now support position offsets
 -fixed manual sizing parameters of the panel buttons
 -added support for mounting zipfiles into virtual directories
+-added the ability to spin the camera (Z-axis rotation)
 
 Version 1.4.1 (2.0 Alpha 4.1)
 -------------------------
index d68b52f..410b2ad 100644 (file)
@@ -139,7 +139,9 @@ F4 - Enable/disable wireframe mode
 F11 - Take screenshot
 Shift - Run (hold down with other keys)
 Control - Walk slowly (hold down with other keys)
-Alt - Strafe (hold down with other keys)
+Alt + arrow keys - Strafe
+Alt + PgUp - Spin right
+Alt + PgDown - Spin left
 
 --- Debug options ---
 Other functions are available via a Crystal Space plugin called BugPlug.
index 6e3c67a..a3c280a 100644 (file)
@@ -659,14 +659,22 @@ void Camera::Jump()
 
 void Camera::Look(float speed)
 {
+       //look up/down by rotating camera on X axis
        desired_angle_velocity.x = 150.0f * speed * cfg_rotate_maxspeed;
 }
 
 void Camera::Turn(float speed)
 {
+       //turn camera by rotating on Y axis
        desired_angle_velocity.y = 100.0f * speed * cfg_rotate_maxspeed * cfg_walk_maxspeed_multreal;
 }
 
+void Camera::Spin(float speed)
+{
+       //spin camera by rotating on Z axis
+       desired_angle_velocity.z = 150.0f * speed * cfg_rotate_maxspeed;
+}
+
 void Camera::InterpolateMovement()
 {
        //calculate acceleration
index e9faec4..741d00b 100644 (file)
@@ -93,6 +93,7 @@ public:
        void Jump();
        void Look(float speed);
        void Turn(float speed);
+       void Spin(float speed);
        void InterpolateMovement();
        void SetGravity(float gravity);
        float GetGravity();
index 09ca516..fae538a 100644 (file)
@@ -511,6 +511,10 @@ void Skyscraper::GetInput()
                        Simcore->camera->Float(1);
                if (wxGetKeyState(WXK_DOWN) || wxGetKeyState((wxKeyCode)'s'))
                        Simcore->camera->Float(-1);
+               if (wxGetKeyState(WXK_PAGEUP))
+                       Simcore->camera->Spin(1);
+               if (wxGetKeyState(WXK_PAGEDOWN))
+                       Simcore->camera->Spin(-1);
        }
        else
        {