void Camera::move(Movement direction, float speed) { glm::vec3 translation; if (direction == LEFT) { translation = -getSideVector(); } else if (direction == RIGHT) { translation = getSideVector(); } else if (direction == UP) { translation = getOrthoUpVector(); } else if (direction == DOWN) { translation = -getOrthoUpVector(); } else if (direction == BACKWARD) { translation = -getLookVector(); } else if (direction == FORWARD) { translation = getLookVector(); } translation = translation * m_Orientation * speed; m_Eye += translation; m_Center += translation; }
vec3 getSideVector() { return glm::cross(getLookVector(), vec3(0,-1,0));}