Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void mouse_button_callback(GLFWwindow* window, int button, int action, int mods)
- {
- if (button == GLFW_MOUSE_BUTTON_LEFT && action == GLFW_PRESS){
- double xpos, ypos;
- glfwGetCursorPos(window, &xpos, &ypos);
- mouseSpeed.p[0] = xpos;
- mouseSpeed.p[2] = ypos;
- }
- if (button == GLFW_MOUSE_BUTTON_LEFT && action == GLFW_RELEASE){
- double xpos, ypos;
- glfwGetCursorPos(window, &xpos, &ypos);
- mouseSpeed.p[0] = (xpos - mouseSpeed.p[0]) * .001;
- mouseSpeed.p[2] = (ypos -mouseSpeed.p[2]) * .001;
- SphereSpeed = mouseSpeed;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement