MCPcopy Create free account
hub / github.com/electronstudio/raylib-python-cffi / update

Method update

examples/extra/extra_camera.py:85–106  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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
109def camera_test():

Callers 1

camera_testFunction · 0.95

Calls 3

update_keyboardMethod · 0.95
update_mouseMethod · 0.95
normalizeMethod · 0.80

Tested by

no test coverage detected