| 16 | |
| 17 | @dataclass(frozen=True) |
| 18 | class CameraState: |
| 19 | wxyz: np.ndarray |
| 20 | position: np.ndarray |
| 21 | look_at: np.ndarray |
| 22 | up_direction: np.ndarray |
| 23 | fov: float |
| 24 | near: float |
| 25 | far: float |
| 26 | |
| 27 | @classmethod |
| 28 | def from_camera(cls, camera: Any) -> "CameraState": |
| 29 | return cls( |
| 30 | wxyz=np.asarray(camera.wxyz, dtype=np.float64).copy(), |
| 31 | position=np.asarray(camera.position, dtype=np.float64).copy(), |
| 32 | look_at=np.asarray(camera.look_at, dtype=np.float64).copy(), |
| 33 | up_direction=np.asarray(camera.up_direction, dtype=np.float64).copy(), |
| 34 | fov=float(camera.fov), |
| 35 | near=float(camera.near), |
| 36 | far=float(camera.far), |
| 37 | ) |
| 38 | |
| 39 | |
| 40 | @dataclass(frozen=True) |
nothing calls this directly
no outgoing calls
no test coverage detected