Skip to content

Bug fix in camera/data_type.py #2047

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions arcade/camera/data_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ def constrain_camera_data(data: CameraData, forward_priority: bool = False):
up_vec = Vec3(*data.up).normalize()
right_vec = forward_vec.cross(up_vec).normalize()
if forward_priority:
up_vec = forward_vec.cross(right_vec)
up_vec = right_vec.cross(forward_vec)
else:
forward_vec = up_vec.cross(right_vec)
forward_vec = right_vec.cross(up_vec)

data.forward = (forward_vec.x, forward_vec.y, forward_vec.z)
data.up = (up_vec.x, up_vec.y, up_vec.z)
Expand Down
8 changes: 8 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,14 @@ def background_color(self):
def background_color(self, color):
self.window.background_color = color

@property
def current_camera(self):
return self.window.current_camera

@current_camera.setter
def current_camera(self, new_camera):
self.window.current_camera = new_camera

def clear(self, *args, **kwargs):
return self.window.clear(*args, **kwargs)

Expand Down
Loading