ft: deserialization

This commit is contained in:
2026-04-26 23:49:03 +02:00
parent 430bdf63bc
commit 076bcc7155
5 changed files with 55 additions and 27 deletions

View File

@@ -41,11 +41,9 @@ impl Default for RawCamera {
}
}
impl TryFrom<RawCamera> for Camera {
type Error = String;
fn try_from(raw: RawCamera) -> Result<Self, Self::Error> {
let c = Camera::new_full(
impl From<RawCamera> for Camera {
fn from(raw: RawCamera) -> Self {
Camera::new_full(
raw.image_width,
raw.image_height,
raw.anti_alias_rate,
@@ -54,8 +52,6 @@ impl TryFrom<RawCamera> for Camera {
raw.look_from,
raw.look_at,
raw.vup,
);
Ok(c)
)
}
}