Skip to content
Browse files

move camara rotation/zoom methods to new MoveableCamera class. they a…

…ren't useful on the baseclass
  • Loading branch information...
1 parent 385ccf0 commit 067dc4c0b6c3d1ec2e0ceb7deb25ac003ade7f55 @robn robn committed Oct 1, 2012
Showing with 8 additions and 8 deletions.
  1. +2 −2 src/WorldView.cpp
  2. +2 −2 src/WorldViewCamera.cpp
  3. +4 −4 src/WorldViewCamera.h
View
4 src/WorldView.cpp
@@ -806,7 +806,7 @@ void WorldView::Update()
if (KeyBindings::topCamera.IsActive() && GetCamType() != CAM_INTERNAL_TOP) SetCamType(CAM_INTERNAL_TOP);
if (KeyBindings::bottomCamera.IsActive() && GetCamType() != CAM_INTERNAL_BOTTOM) SetCamType(CAM_INTERNAL_BOTTOM);
} else {
- RotatableCamera *cam = static_cast<RotatableCamera*>(m_activeCamera);
+ MoveableCamera *cam = static_cast<MoveableCamera*>(m_activeCamera);
if (KeyBindings::cameraRotateUp.IsActive()) cam->RotateUp(frameTime);
if (KeyBindings::cameraRotateDown.IsActive()) cam->RotateDown(frameTime);
if (KeyBindings::cameraRotateLeft.IsActive()) cam->RotateLeft(frameTime);
@@ -1709,7 +1709,7 @@ void WorldView::MouseButtonDown(int button, int x, int y)
if (this == Pi::GetView())
{
if (m_activeCamera->IsExternal()) {
- RotatableCamera *cam = static_cast<RotatableCamera*>(m_activeCamera);
+ MoveableCamera *cam = static_cast<MoveableCamera*>(m_activeCamera);
if (Pi::MouseButtonState(SDL_BUTTON_WHEELDOWN)) // Zoom out
cam->ZoomEvent( ZOOM_SPEED * WHEEL_SENSITIVITY);
View
4 src/WorldViewCamera.cpp
@@ -98,7 +98,7 @@ void InternalCamera::Load(Serializer::Reader &rd)
}
ExternalCamera::ExternalCamera(const Ship *s, const vector2f &size, float fovY, float near, float far) :
- RotatableCamera(s, size, fovY, near, far),
+ MoveableCamera(s, size, fovY, near, far),
m_dist(200), m_distTo(m_dist),
m_rotX(0),
m_rotY(0),
@@ -192,7 +192,7 @@ void ExternalCamera::Load(Serializer::Reader &rd)
}
SiderealCamera::SiderealCamera(const Ship *s, const vector2f &size, float fovY, float near, float far) :
- RotatableCamera(s, size, fovY, near, far),
+ MoveableCamera(s, size, fovY, near, far),
m_dist(200), m_distTo(m_dist),
m_orient(matrix4x4d::Identity())
{
View
8 src/WorldViewCamera.h
@@ -53,9 +53,9 @@ class InternalCamera : public WorldViewCamera {
const char *m_name;
};
-class RotatableCamera : public WorldViewCamera {
+class MoveableCamera : public WorldViewCamera {
public:
- RotatableCamera(const Ship *s, const vector2f &size, float fovY, float nearClip, float farClip) :
+ MoveableCamera(const Ship *s, const vector2f &size, float fovY, float nearClip, float farClip) :
WorldViewCamera(s, size, fovY, nearClip, farClip) {}
virtual void RollLeft(float frameTime) { }
virtual void RollRight(float frameTime) { }
@@ -78,7 +78,7 @@ class RotatableCamera : public WorldViewCamera {
};
// Zoomable, rotatable orbit camera, always looks at the ship
-class ExternalCamera : public RotatableCamera {
+class ExternalCamera : public MoveableCamera {
public:
ExternalCamera(const Ship *s, const vector2f &size, float fovY, float nearClip, float farClip);
Type GetType() const { return EXTERNAL; }
@@ -109,7 +109,7 @@ class ExternalCamera : public RotatableCamera {
};
// Much like external camera, but does not turn when the ship turns
-class SiderealCamera : public RotatableCamera {
+class SiderealCamera : public MoveableCamera {
public:
SiderealCamera(const Ship *s, const vector2f &size, float fovY, float nearClip, float farClip);
Type GetType() const { return SIDEREAL; }

0 comments on commit 067dc4c

Please sign in to comment.
Something went wrong with that request. Please try again.