diff options
author | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-08-10 13:25:53 +1000 |
---|---|---|
committer | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-08-10 13:25:53 +1000 |
commit | 071a635e63536e50abfad7d5aeca1208dba58025 (patch) | |
tree | e96c10f24f0accc4276ccf7d426a263fb8a14ffd /bindgen | |
parent | dcb9f65b25e59edb21c9c3cac7b32d70ca19eb72 (diff) |
impl Default for Camera
Diffstat (limited to 'bindgen')
-rw-r--r-- | bindgen/rust/celeritas-sys/src/lib.rs | 28 | ||||
-rw-r--r-- | bindgen/rust/src/lib.rs | 3 |
2 files changed, 30 insertions, 1 deletions
diff --git a/bindgen/rust/celeritas-sys/src/lib.rs b/bindgen/rust/celeritas-sys/src/lib.rs index e6f62ad..780ceff 100644 --- a/bindgen/rust/celeritas-sys/src/lib.rs +++ b/bindgen/rust/celeritas-sys/src/lib.rs @@ -111,3 +111,31 @@ impl Default for ShaderDataLayout { } } } + +impl Default for Camera { + fn default() -> Self { + let camera_pos = Vec3 { + x: 18.9, + y: 10.6, + z: 11.6, + }; + let camera_front = Vec3 { + x: -0.6, + y: -0.2, + z: -0.7, + }; + let camera = unsafe { + Camera_Create( + camera_pos, + camera_front, + Vec3 { + x: 0.0, + y: 1.0, + z: 0.0, + }, + 45.0, + ) + }; + camera + } +} diff --git a/bindgen/rust/src/lib.rs b/bindgen/rust/src/lib.rs index a20a9e8..f2e177f 100644 --- a/bindgen/rust/src/lib.rs +++ b/bindgen/rust/src/lib.rs @@ -20,7 +20,8 @@ use std::{ }; use celeritas_sys::{ - Core_Bringup, Core_Shutdown, DirectionalLight, PointLight, RenderEnt, Transform, Vec3, + Camera, Camera_Create, Core_Bringup, Core_Shutdown, DirectionalLight, PointLight, RenderEnt, + Transform, Vec3, }; use serde::{Deserialize, Serialize}; |