- Timestamp:
- 05/31/04 17:52:53 (21 years ago)
- File:
-
- 1 edited
-
ps/trunk/source/terrain/terrainMain.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ps/trunk/source/terrain/terrainMain.cpp
r310 r330 32 32 double g_LastTime; 33 33 34 static float g_CameraZoom = 10; 34 35 35 36 const int NUM_ALPHA_MAPS = 13; … … 91 92 92 93 float fov = g_Camera.GetFOV(); 94 95 #if 0 93 96 const float d_key = DEGTORAD(10.0f) * DeltaTime; 94 97 const float d_wheel = DEGTORAD( 50.0f ) * DeltaTime; … … 114 117 fov = fov_min; 115 118 } 116 117 118 119 ViewFOV = fov; 119 120 g_Camera.SetProjection(1, 1000, fov); 120 g_Camera.SetProjection(1, 5000, fov); 121 #else 122 // RC - added ScEd style zoom in and out (actually moving camera, rather than fudging fov) 123 float dir=0; 124 if (mouseButtons[SDL_BUTTON_WHEELUP]) dir=-1; 125 else if (mouseButtons[SDL_BUTTON_WHEELDOWN]) dir=1; 126 127 float factor=dir*dir; 128 if (factor) { 129 if (dir<0) factor=-factor; 130 CVector3D forward=g_Camera.m_Orientation.GetIn(); 131 132 // check we're not going to zoom into the terrain, or too far out into space 133 float h=g_Camera.m_Orientation.GetTranslation().Y+forward.Y*factor*g_CameraZoom; 134 float minh=65536*HEIGHT_SCALE*1.05f; 135 136 if (h<minh || h>1500) { 137 // yup, we will; don't move anywhere (do clamped move instead, at some point) 138 } else { 139 // do a full move 140 g_CameraZoom-=(factor)*0.1f; 141 if (g_CameraZoom<0.01f) g_CameraZoom=0.01f; 142 g_Camera.m_Orientation.Translate(forward*(factor*g_CameraZoom)); 143 } 144 } 145 #endif 146 121 147 g_Camera.UpdateFrustum (); 122 148 } … … 150 176 case 'H': 151 177 // quick hack to return camera home, for screenshots (after alt+tabbing) 152 g_Camera.SetProjection (1, 1000, DEGTORAD(20));178 g_Camera.SetProjection (1, 5000, DEGTORAD(20)); 153 179 g_Camera.m_Orientation.SetXRotation(DEGTORAD(30)); 154 180 g_Camera.m_Orientation.RotateY(DEGTORAD(-45)); … … 225 251 } 226 252 227 g_Camera.SetProjection (1, 1000, DEGTORAD(20));253 g_Camera.SetProjection (1, 5000, DEGTORAD(20)); 228 254 g_Camera.m_Orientation.SetXRotation(DEGTORAD(30)); 229 255 g_Camera.m_Orientation.RotateY(DEGTORAD(-45));
Note:
See TracChangeset
for help on using the changeset viewer.
