(self)
| 83 | self.last_mouse = rl.GetMousePosition() |
| 84 | |
| 85 | def update(self): |
| 86 | # NOTE(pebaz): Comment out these lines to control them in a game loop |
| 87 | self.update_keyboard() |
| 88 | self.update_mouse() |
| 89 | |
| 90 | # Update all camera vectors to reflect changes |
| 91 | self.fps_facing = glm.vec3( |
| 92 | cos((self.yaw)) * cos((0)), |
| 93 | sin((0)), |
| 94 | sin((self.yaw)) * cos((0)) |
| 95 | ) |
| 96 | self.fps_facing = glm.normalize(self.fps_facing) |
| 97 | |
| 98 | front = glm.vec3( |
| 99 | cos((self.yaw)) * cos((self.pitch)), |
| 100 | sin((self.pitch)), |
| 101 | sin((self.yaw)) * cos((self.pitch)) |
| 102 | ) |
| 103 | |
| 104 | self.front = glm.normalize(front) |
| 105 | self.right = glm.normalize(glm.cross(self.front, self.world_up)) |
| 106 | self.up = glm.normalize(glm.cross(self.right, self.front)) |
| 107 | |
| 108 | |
| 109 | def camera_test(): |
no test coverage detected