Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // KEY INPUT FUCN
- glm::vec3 aboveBall = glm::vec3(ballCollection.at(15).ballPos.x, ballCollection.at(15).ballPos.y + 6 , ballCollection.at(15).ballPos.z);
- glm::vec3 cameraFwd = aboveBall - cameraPos;
- if (keys[GLFW_KEY_A]) {
- angle += 50 * deltaTime;
- }
- if (keys[GLFW_KEY_D]) {
- angle -= 50 * deltaTime;
- }
- if (keys[GLFW_KEY_SPACE]) {
- power += 2.0f;
- }
- if (keys[GLFW_KEY_F]) {
- ballCollection.at(15).F = power*glm::normalize(cameraFwd);
- //power = 0.0f;
- }
- //MAIN - IN GAME LOOP
- 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)));
- view = glm::lookAt(cameraPos, ballCollection.at(15).ballPos, cameraUp);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement