Advertisement
RoshHoul

Untitled

Apr 7th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. // KEY INPUT FUCN
  2.  
  3. glm::vec3 aboveBall = glm::vec3(ballCollection.at(15).ballPos.x, ballCollection.at(15).ballPos.y + 6 , ballCollection.at(15).ballPos.z);
  4. glm::vec3 cameraFwd = aboveBall - cameraPos;
  5.  
  6. if (keys[GLFW_KEY_A]) {
  7. angle += 50 * deltaTime;
  8. }
  9. if (keys[GLFW_KEY_D]) {
  10. angle -= 50 * deltaTime;
  11. }
  12. if (keys[GLFW_KEY_SPACE]) {
  13. power += 2.0f;
  14. }
  15. if (keys[GLFW_KEY_F]) {
  16. ballCollection.at(15).F = power*glm::normalize(cameraFwd);
  17. //power = 0.0f;
  18. }
  19.  
  20. //MAIN - IN GAME LOOP
  21. cameraPos = glm::vec3(ballCollection.at(15).ballPos.x - 12 * sin(TO_RADS(angle)), ballCollection.at(15).ballPos.y + 6, ballCollection.at(15).ballPos.z - 12 * cos(TO_RADS(angle)));
  22.  
  23. view = glm::lookAt(cameraPos, ballCollection.at(15).ballPos, cameraUp);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement