From 071a635e63536e50abfad7d5aeca1208dba58025 Mon Sep 17 00:00:00 2001 From: omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Sat, 10 Aug 2024 13:25:53 +1000 Subject: impl Default for Camera --- bindgen/rust/celeritas-sys/src/lib.rs | 28 ++++++++++++++++++++++++++++ bindgen/rust/src/lib.rs | 3 ++- 2 files changed, 30 insertions(+), 1 deletion(-) (limited to 'bindgen') 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}; -- cgit v1.2.3-70-g09d2