diff --git a/CameraController.cpp b/CameraController.cpp index 14de31d..a1e791e 100644 --- a/CameraController.cpp +++ b/CameraController.cpp @@ -26,13 +26,10 @@ GCamera* CameraController::getCamera() } void CameraController::lookAt(const Vector3& position) { - //g3dCamera.lookAt(position,g3dCamera.getCoordinateFrame().upVector()); - const Vector3 look = (position - g3dCamera.getCoordinateFrame().translation); yaw = aTan2(look.x, -look.z); pitch = -aTan2(look.y, distance(look.x, look.z)); - std::cout << distance(look.x, look.z) << "pitch:" << pitch << std::endl; CoordinateFrame frame = g3dCamera.getCoordinateFrame().translation; frame.rotation = Matrix3::fromEulerAnglesZYX(0, -yaw, -pitch); g3dCamera.setCoordinateFrame(frame); @@ -69,14 +66,10 @@ bool CameraController::onMouseWheel(int x, int y, short delta) if (delta>0) { // Mouse wheel up if (zoom>CAM_ZOOM_MIN) frame = frame+frame.lookVector()*(zoom/5); - - //setFrame(frame); } else { - //zoom+=0.5; if (zoom1.4) pitch=1.4; - //if (pitch<-1.4) pitch=-1.4; - //frame.translation = Vector3(sin(-yaw)*zoom*cos(pitch),sin(pitch)*zoom,cos(-yaw)*zoom*cos(pitch))+focusPosition; - //frame.lookAt(focusPosition); - } if(GetHoldKeyState(VK_RSHIFT) || GetHoldKeyState(VK_LSHIFT)) { diff --git a/main.cpp b/main.cpp index 770deff..01f255a 100644 --- a/main.cpp +++ b/main.cpp @@ -1142,10 +1142,6 @@ void Demo::onGraphics(RenderDevice* rd) { void Demo::onKeyPressed(int key) { - if (key=='A') - { - std::cout << "A PRESS" << std::endl; - } if(key==VK_DELETE) { deleteInstance(); @@ -1153,10 +1149,7 @@ void Demo::onKeyPressed(int key) } void Demo::onKeyUp(int key) { - if (key=='A') - { - std::cout << "A UP" << std::endl; - } + } void Demo::onMouseLeftPressed(int x,int y) @@ -1207,7 +1200,7 @@ void Demo::onMouseLeftPressed(int x,int y) } void Demo::onMouseLeftUp(int x,int y) { - std::cout << "Release: " << x << "," << y << std::endl; + //std::cout << "Release: " << x << "," << y << std::endl; dragging = false; //message = "Dragging = false."; @@ -1228,16 +1221,13 @@ void Demo::onMouseLeftUp(int x,int y) } void Demo::onMouseRightPressed(int x,int y) { - std::cout << "Click: " << x << "," << y << std::endl; } void Demo::onMouseRightUp(int x,int y) { - std::cout << "Release: " << x << "," << y << std::endl; } void Demo::onMouseMoved(int x,int y) { oldMouse = dataModel->getMousePos(); - std::cout << "Moved: " << x << "," << y << std::endl; dataModel->mousex = x; dataModel->mousey = y;