Changeset 2829 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Camera.cpp
- Timestamp:
- 07/10/08 15:57:47 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Camera.cpp
r2806 r2829 182 182 const Vector3 fc = mPosition + view * z_far; 183 183 184 const Vector3 up = GetUpVector();184 const Vector3 up = -GetUpVector(); 185 185 186 186 const Vector3 right = GetRightVector(); … … 218 218 mYaw += angle; 219 219 CalculateFromPitchAndYaw(); 220 /*221 Matrix4x4 viewOrientation(mRight, mUp, mDirection);222 Matrix4x4 rot = RotationYMatrix(angle);223 224 viewOrientation = viewOrientation * rot;225 226 mDirection = Vector3(viewOrientation.x[2][0], viewOrientation.x[2][1], viewOrientation.x[2][2]);227 mRight = Vector3(viewOrientation.x[0][0], viewOrientation.x[0][1], viewOrientation.x[0][2]);228 mUp = Vector3(viewOrientation.x[1][0], viewOrientation.x[1][1], viewOrientation.x[1][2]);*/229 220 } 230 221 … … 237 228 238 229 230 void Camera::SetDirection(const Vector3 &direction) 231 { 232 Vector3 h1 = direction; h1.z = 0; h1.Normalize(); 233 Vector3 h2 = direction; h1.x = 0; h2.Normalize(); 234 235 mYaw = acos(DotProd(h1, Vector3(0, 1, 0))); 236 mPitch = acos(DotProd(h2, Vector3(0, 1, 0))); 237 238 CalculateFromPitchAndYaw(); 239 } 240 241 239 242 void Camera::CalculateFromPitchAndYaw() 240 243 {
Note: See TracChangeset
for help on using the changeset viewer.