Skip to content

Commit 637c401

Browse files
authored
Bug fix in camera/data_type.py (#2047)
* Bug fix in camera/data_type.py * Give WindowProxy a current_camera property
1 parent f757ad9 commit 637c401

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

arcade/camera/data_types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ def constrain_camera_data(data: CameraData, forward_priority: bool = False):
7373
up_vec = Vec3(*data.up).normalize()
7474
right_vec = forward_vec.cross(up_vec).normalize()
7575
if forward_priority:
76-
up_vec = forward_vec.cross(right_vec)
76+
up_vec = right_vec.cross(forward_vec)
7777
else:
78-
forward_vec = up_vec.cross(right_vec)
78+
forward_vec = right_vec.cross(up_vec)
7979

8080
data.forward = (forward_vec.x, forward_vec.y, forward_vec.z)
8181
data.up = (up_vec.x, up_vec.y, up_vec.z)

tests/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,14 @@ def background_color(self):
160160
def background_color(self, color):
161161
self.window.background_color = color
162162

163+
@property
164+
def current_camera(self):
165+
return self.window.current_camera
166+
167+
@current_camera.setter
168+
def current_camera(self, new_camera):
169+
self.window.current_camera = new_camera
170+
163171
def clear(self, *args, **kwargs):
164172
return self.window.clear(*args, **kwargs)
165173

0 commit comments

Comments
 (0)