Resize true, cursor disabled
This commit is contained in:
@@ -96,25 +96,20 @@ namespace vapp{
|
||||
xoffset *= sensitivity;
|
||||
yoffset *= sensitivity;
|
||||
|
||||
// Winkel aktualisieren
|
||||
yaw += xoffset;
|
||||
pitch += yoffset;
|
||||
|
||||
// Optional: pitch begrenzen
|
||||
if(pitch > 89.0f)
|
||||
pitch = 89.0f;
|
||||
if(pitch < -89.0f)
|
||||
pitch = -89.0f;
|
||||
|
||||
// Berechnung des neuen Richtungsvektors
|
||||
glm::vec3 direction;
|
||||
direction.x = cos(glm::radians(yaw)) * cos(glm::radians(pitch));
|
||||
direction.y = sin(glm::radians(pitch));
|
||||
direction.z = sin(glm::radians(yaw)) * cos(glm::radians(pitch));
|
||||
direction = glm::normalize(direction);
|
||||
|
||||
// Der neue "Look-at"-Punkt ergibt sich aus der Kameraposition plus diesem Richtungsvektor
|
||||
cameraFront = cameraPos + direction;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user