update
This commit is contained in:
17
camera.h
17
camera.h
@@ -45,7 +45,7 @@ public:
|
||||
updateCameraVectors();
|
||||
}
|
||||
|
||||
void mouseCallback(float xoffset, float yoffset, GLboolean constrainPitch = true) {
|
||||
void mouseMoveCallback(float xoffset, float yoffset, GLboolean constrainPitch = true) {
|
||||
xoffset *= mouseSensitivity_;
|
||||
yoffset *= mouseSensitivity_;
|
||||
|
||||
@@ -63,10 +63,25 @@ public:
|
||||
updateCameraVectors();
|
||||
}
|
||||
|
||||
void mouseScrollCallback(float yoffset) {
|
||||
zoom_ -= yoffset;
|
||||
if (zoom_ < 1.0f) {
|
||||
zoom_ = 1.0;
|
||||
}
|
||||
if (zoom_ > 45.0f) {
|
||||
zoom_ = 45.0;
|
||||
}
|
||||
updateCameraVectors();
|
||||
}
|
||||
|
||||
glm::mat4 getViewMatrix() {
|
||||
return glm::lookAt(position_, position_ + front_, up_);
|
||||
}
|
||||
|
||||
bool firstMouse() const { return firstMouse_; }
|
||||
|
||||
void triggleFirstMouse() { firstMouse_ = !firstMouse_; }
|
||||
|
||||
private:
|
||||
void updateCameraVectors() {
|
||||
glm::vec3 front;
|
||||
|
||||
Reference in New Issue
Block a user