Skip to content
Snippets Groups Projects
Commit 254e35cf authored by Sebastian Gaida's avatar Sebastian Gaida
Browse files

[#35] [Fix] wasd-Movement

but broke mouseMovement xD
parent fa7a669f
No related branches found
No related tags found
1 merge request!26Resolve "Kamera - Erstellung und Handling"
Pipeline #25071 passed
...@@ -76,7 +76,7 @@ namespace vkcv { ...@@ -76,7 +76,7 @@ namespace vkcv {
} }
glm::vec3 Camera::getFront(){ glm::vec3 Camera::getFront(){
return glm::vec3( m_view[2]); return glm::vec3( m_view[2].x,m_view[2].y,-m_view[2].z);
} }
void Camera::setFront( glm::vec3 front ){ void Camera::setFront( glm::vec3 front ){
......
...@@ -14,7 +14,7 @@ namespace vkcv{ ...@@ -14,7 +14,7 @@ namespace vkcv{
m_cameraSpeed = 0.05f; m_cameraSpeed = 0.05f;
m_roll = 0.0; m_roll = 0.0;
m_pitch = 0.0; m_pitch = 0.0;
m_yaw = 0.0; m_yaw = 90.0;
m_lastX = width/2.0; m_lastX = width/2.0;
m_lastY = height/2.0; m_lastY = height/2.0;
bindCamera(); bindCamera();
...@@ -48,7 +48,7 @@ namespace vkcv{ ...@@ -48,7 +48,7 @@ namespace vkcv{
return; return;
} }
float sensitivity = 0.1f; float sensitivity = 0.05f;
xoffset *= sensitivity; xoffset *= sensitivity;
yoffset *= sensitivity; yoffset *= sensitivity;
...@@ -85,6 +85,9 @@ namespace vkcv{ ...@@ -85,6 +85,9 @@ namespace vkcv{
} }
void CameraManager::keyCallback(int key, int scancode, int action, int mods) { void CameraManager::keyCallback(int key, int scancode, int action, int mods) {
std::cout << m_camera.getFront().x << " " << m_camera.getFront().y << " " <<m_camera.getFront().z << std::endl;
switch (key) { switch (key) {
case GLFW_KEY_W: case GLFW_KEY_W:
//std::cout << "Move forward" << std::endl; //std::cout << "Move forward" << std::endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment