Skip to content

Commit f477110

Browse files
committed
Remove camera type from model
Notably, this limits the type of pygfx-specific interaction available. But we need a scenex version of this anyways - planning to implement the beginnings of this with events
1 parent 2ca7ca6 commit f477110

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/scenex/adaptors/_pygfx/_camera.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,11 @@ class Camera(Node, CameraAdaptor):
2626

2727
def __init__(self, camera: model.Camera, **backend_kwargs: Any) -> None:
2828
self._camera_model = camera
29-
if camera.type == "panzoom":
30-
self._pygfx_node = pygfx.OrthographicCamera()
31-
self.pygfx_controller = pygfx.PanZoomController(self._pygfx_node)
32-
elif camera.type == "perspective":
33-
# this type ignore is because PerspectiveCamera lacks hints
34-
self._pygfx_node = pygfx.PerspectiveCamera(70, 4 / 3) # pyright: ignore reportArgumentType]
35-
self.pygfx_controller = pygfx.OrbitController(self._pygfx_node)
29+
# FIXME: This won't always hold as the projection matrix changes.
30+
# Once we have better controllers via event filters, the pygfx_controller
31+
# field should disappear and the _pygfx_node should just be a pygfx.Camera.
32+
self._pygfx_node = pygfx.OrthographicCamera()
33+
self.pygfx_controller = pygfx.PanZoomController(self._pygfx_node)
3634

3735
self._pygfx_node.local.scale_y = -1 # don't think this is working...
3836

src/scenex/model/_nodes/camera.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ class Camera(Node):
3030

3131
node_type: Literal["camera"] = "camera"
3232

33-
type: CameraType = Field(default="panzoom", description="Camera type.")
3433
interactive: bool = Field(
3534
default=True,
3635
description="Whether the camera responds to user interaction, "

0 commit comments

Comments
 (0)