From ecba24bd4eceb1c4fef6beb8aaff03916705a7f2 Mon Sep 17 00:00:00 2001 From: kacperks Date: Sun, 5 Mar 2023 01:30:30 +0100 Subject: [PATCH] comments removed --- src/main.cpp | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 245eff3..9057367 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -164,7 +164,6 @@ int main(int argc, char *argv[]) ///////////////////// // Camera rotation // ///////////////////// - /* // Up / Down // if(pb.er.isKeyDown(irr::KEY_UP) && pb.verticalCamRot < 100) { @@ -195,7 +194,6 @@ int main(int argc, char *argv[]) else rotVel = 0; - */ pb.device->getCursorControl()->setVisible(false); irr::core::position2d mousePos = pb.device -> getCursorControl() -> getPosition(); @@ -207,23 +205,8 @@ int main(int argc, char *argv[]) rotVel = mouseMovement.X * pb.mouseSensitivity; rotVel *= -1; - // if(pb.verticalCamRot < 100 && pb.verticalCamRot > -120) - // { - pb.verticalCamRot += mouseMovement.Y * pb.mouseSensitivity/2; - // } -/* - else if(pb.verticalCamRot >= 100) - { - pb.verticalCamRot = 100; - } - - else if(pb.verticalCamRot <= -120) - { - pb.verticalCamRot = -120; - }*/ - - // change directions of ro - + pb.verticalCamRot += mouseMovement.Y * pb.mouseSensitivity/2; + irr::core::vector3df playerRot = pb.player -> getRotation(); irr::core::vector3df playerPos = pb.player -> getPosition(); pb.camera -> setTarget(irr::core::vector3df(playerPos.X - cos(irr::core::degToRad(playerRot.Y + leftRightVel)) * angularVel, playerPos.Y + pb.verticalCamRot, playerPos.Z + sin(irr::core::degToRad(playerRot.Y + leftRightVel)) * angularVel));