From c73ba3b94362e7c5676f926a5f708b7bcd821f4a Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Fri, 15 Nov 2024 23:07:48 -0500 Subject: [PATCH] rename FreeFlyCamera to FreeFly3dCamera --- crates/lyra-game/src/scene/free_fly_camera.rs | 10 +++++----- crates/lyra-game/src/scene/mod.rs | 4 ++-- .../lyra-scripting/src/lua/wrappers/free_fly_camera.rs | 4 ++-- examples/2d/src/main.rs | 4 ++-- examples/fixed-timestep-rotating-model/src/main.rs | 4 ++-- examples/lua-scripting/src/main.rs | 4 ++-- examples/many-lights/src/main.rs | 4 ++-- examples/shadows/src/main.rs | 4 ++-- examples/simple_scene/src/main.rs | 4 ++-- examples/testbed/src/main.rs | 4 ++-- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/crates/lyra-game/src/scene/free_fly_camera.rs b/crates/lyra-game/src/scene/free_fly_camera.rs index 794a8a0..0ea842b 100644 --- a/crates/lyra-game/src/scene/free_fly_camera.rs +++ b/crates/lyra-game/src/scene/free_fly_camera.rs @@ -13,13 +13,13 @@ pub const ACTLBL_LOOK_UP_DOWN: &str = "LookUpDown"; pub const ACTLBL_LOOK_ROLL: &str = "LookRoll"; #[derive(Clone, Component, Reflect)] -pub struct FreeFlyCamera { +pub struct FreeFly3dCamera { pub speed: f32, pub look_speed: f32, pub mouse_sensitivity: f32, } -impl Default for FreeFlyCamera { +impl Default for FreeFly3dCamera { fn default() -> Self { Self { speed: 4.0, @@ -29,7 +29,7 @@ impl Default for FreeFlyCamera { } } -impl FreeFlyCamera { +impl FreeFly3dCamera { pub fn new(speed: f32, look_speed: f32, mouse_sensitivity: f32) -> Self { Self { speed, @@ -39,7 +39,7 @@ impl FreeFlyCamera { } } -pub fn free_fly_camera_controller(delta_time: Res, handler: Res, view: View<(&mut Transform, &FreeFlyCamera)>) -> anyhow::Result<()> { +pub fn free_fly_3d_camera_controller(delta_time: Res, handler: Res, view: View<(&mut Transform, &FreeFly3dCamera)>) -> anyhow::Result<()> { let delta_time = **delta_time; for (mut transform, fly) in view.into_iter() { let forward = transform.forward(); @@ -91,6 +91,6 @@ pub struct FreeFlyCameraPlugin; impl Plugin for FreeFlyCameraPlugin { fn setup(&mut self, app: &mut App) { - app.with_system("free_fly_camera_system", free_fly_camera_controller, &[]); + app.with_system("free_fly_camera_system", free_fly_3d_camera_controller, &[]); } } diff --git a/crates/lyra-game/src/scene/mod.rs b/crates/lyra-game/src/scene/mod.rs index 9677295..c348d71 100644 --- a/crates/lyra-game/src/scene/mod.rs +++ b/crates/lyra-game/src/scene/mod.rs @@ -1,7 +1,7 @@ -pub mod camera; +mod camera; pub use camera::*; -pub mod free_fly_camera; +mod free_fly_camera; pub use free_fly_camera::*; pub use lyra_scene::*; \ No newline at end of file diff --git a/crates/lyra-scripting/src/lua/wrappers/free_fly_camera.rs b/crates/lyra-scripting/src/lua/wrappers/free_fly_camera.rs index 75052ec..2072f57 100644 --- a/crates/lyra-scripting/src/lua/wrappers/free_fly_camera.rs +++ b/crates/lyra-scripting/src/lua/wrappers/free_fly_camera.rs @@ -1,10 +1,10 @@ use crate::{lua::LuaWrapper, ScriptBorrow}; -use lyra_game::scene::FreeFlyCamera; +use lyra_game::scene::FreeFly3dCamera; use lyra_scripting_derive::to_lua_convert; to_lua_convert!( // Struct that is being wrapped - FreeFlyCamera, + FreeFly3dCamera, // Reflection type, can be 'component' or 'resource' reflect=component, fields={ diff --git a/examples/2d/src/main.rs b/examples/2d/src/main.rs index 4896047..f10a04d 100644 --- a/examples/2d/src/main.rs +++ b/examples/2d/src/main.rs @@ -9,7 +9,7 @@ use lyra_engine::{ math::{self, Transform, Vec3}, render::light::directional::DirectionalLight, scene::{ - system_update_world_transforms, Camera2dBundle, CameraProjection, FreeFlyCamera, FreeFlyCameraPlugin, OrthographicProjection, ScaleMode, WorldTransform, ACTLBL_LOOK_LEFT_RIGHT, ACTLBL_LOOK_ROLL, ACTLBL_LOOK_UP_DOWN, ACTLBL_MOVE_FORWARD_BACKWARD, ACTLBL_MOVE_LEFT_RIGHT, ACTLBL_MOVE_UP_DOWN + system_update_world_transforms, Camera2dBundle, CameraProjection, FreeFly3dCamera, FreeFlyCameraPlugin, OrthographicProjection, ScaleMode, WorldTransform, ACTLBL_LOOK_LEFT_RIGHT, ACTLBL_LOOK_ROLL, ACTLBL_LOOK_UP_DOWN, ACTLBL_MOVE_FORWARD_BACKWARD, ACTLBL_MOVE_LEFT_RIGHT, ACTLBL_MOVE_UP_DOWN }, sprite::{self, Sprite}, }; @@ -172,6 +172,6 @@ fn setup_scene_plugin(app: &mut App) { }, //Transform::from_xyz(200.0, 120.0, 0.0), Transform::from_xyz(0.0, 0.0, 0.0), - FreeFlyCamera::default(), + FreeFly3dCamera::default(), )); } diff --git a/examples/fixed-timestep-rotating-model/src/main.rs b/examples/fixed-timestep-rotating-model/src/main.rs index 979b3b4..c108af6 100644 --- a/examples/fixed-timestep-rotating-model/src/main.rs +++ b/examples/fixed-timestep-rotating-model/src/main.rs @@ -9,7 +9,7 @@ use lyra_engine::{ Action, ActionHandler, ActionKind, ActionMapping, ActionMappingId, ActionSource, InputActionPlugin, KeyCode, LayoutId, MouseAxis, MouseInput, }, math::{self, Transform, Vec3}, render::light::directional::DirectionalLight, scene::{ - CameraBundle, FreeFlyCamera, FreeFlyCameraPlugin, WorldTransform, ACTLBL_LOOK_LEFT_RIGHT, ACTLBL_LOOK_ROLL, ACTLBL_LOOK_UP_DOWN, ACTLBL_MOVE_FORWARD_BACKWARD, ACTLBL_MOVE_LEFT_RIGHT, ACTLBL_MOVE_UP_DOWN + CameraBundle, FreeFly3dCamera, FreeFlyCameraPlugin, WorldTransform, ACTLBL_LOOK_LEFT_RIGHT, ACTLBL_LOOK_ROLL, ACTLBL_LOOK_UP_DOWN, ACTLBL_MOVE_FORWARD_BACKWARD, ACTLBL_MOVE_LEFT_RIGHT, ACTLBL_MOVE_UP_DOWN }, DeltaTime }; use tracing::info; @@ -129,7 +129,7 @@ fn setup_scene_plugin(app: &mut App) { world.spawn(( CameraBundle::default(), Transform::from_xyz(0.0, 0.0, 1.5), - FreeFlyCamera::default(), + FreeFly3dCamera::default(), )); let fps_counter = |counter: Res, diff --git a/examples/lua-scripting/src/main.rs b/examples/lua-scripting/src/main.rs index 3b80cc1..ef35431 100644 --- a/examples/lua-scripting/src/main.rs +++ b/examples/lua-scripting/src/main.rs @@ -3,7 +3,7 @@ use lyra_engine::{ Action, ActionHandler, ActionKind, ActionMapping, ActionMappingId, ActionSource, InputActionPlugin, KeyCode, LayoutId, MouseAxis, MouseInput, }, math::{self, Transform, Vec3}, render::light::directional::DirectionalLight, scene::{ - self, CameraBundle, FreeFlyCamera, FreeFlyCameraPlugin, WorldTransform, ACTLBL_LOOK_LEFT_RIGHT, ACTLBL_LOOK_ROLL, ACTLBL_LOOK_UP_DOWN, ACTLBL_MOVE_FORWARD_BACKWARD, ACTLBL_MOVE_LEFT_RIGHT, ACTLBL_MOVE_UP_DOWN + self, CameraBundle, FreeFly3dCamera, FreeFlyCameraPlugin, WorldTransform, ACTLBL_LOOK_LEFT_RIGHT, ACTLBL_LOOK_ROLL, ACTLBL_LOOK_UP_DOWN, ACTLBL_MOVE_FORWARD_BACKWARD, ACTLBL_MOVE_LEFT_RIGHT, ACTLBL_MOVE_UP_DOWN }, script::{lua::{LuaScript, LuaScriptingPlugin}, Script, ScriptList} }; @@ -128,7 +128,7 @@ fn setup_scene_plugin(app: &mut App) { world.spawn(( CameraBundle::default(), Transform::from_xyz(0.0, 0.0, 5.5), - FreeFlyCamera::default(), + FreeFly3dCamera::default(), )); } diff --git a/examples/many-lights/src/main.rs b/examples/many-lights/src/main.rs index 641c3db..58ea24d 100644 --- a/examples/many-lights/src/main.rs +++ b/examples/many-lights/src/main.rs @@ -1,4 +1,4 @@ -use lyra_engine::{assets::ResourceManager, ecs::query::Res, game::App, gltf::Gltf, input::{Action, ActionHandler, ActionKind, ActionMapping, ActionMappingId, ActionSource, InputActionPlugin, KeyCode, LayoutId, MouseAxis, MouseInput}, math::{self, Quat, Transform, Vec3}, render::light::{directional::DirectionalLight, PointLight}, scene::{CameraBundle, FreeFlyCamera, FreeFlyCameraPlugin, ACTLBL_LOOK_LEFT_RIGHT, ACTLBL_LOOK_ROLL, ACTLBL_LOOK_UP_DOWN, ACTLBL_MOVE_FORWARD_BACKWARD, ACTLBL_MOVE_LEFT_RIGHT, ACTLBL_MOVE_UP_DOWN}, DeltaTime}; +use lyra_engine::{assets::ResourceManager, ecs::query::Res, game::App, gltf::Gltf, input::{Action, ActionHandler, ActionKind, ActionMapping, ActionMappingId, ActionSource, InputActionPlugin, KeyCode, LayoutId, MouseAxis, MouseInput}, math::{self, Quat, Transform, Vec3}, render::light::{directional::DirectionalLight, PointLight}, scene::{CameraBundle, FreeFly3dCamera, FreeFlyCameraPlugin, ACTLBL_LOOK_LEFT_RIGHT, ACTLBL_LOOK_ROLL, ACTLBL_LOOK_UP_DOWN, ACTLBL_MOVE_FORWARD_BACKWARD, ACTLBL_MOVE_LEFT_RIGHT, ACTLBL_MOVE_UP_DOWN}, DeltaTime}; use rand::Rng; use tracing::info; @@ -192,6 +192,6 @@ fn setup_scene_plugin(app: &mut App) { Quat::from_xyzw(0.03375484, -0.7116095, 0.0342693, 0.70092666), Vec3::ONE, ), - FreeFlyCamera::default(), + FreeFly3dCamera::default(), )); } diff --git a/examples/shadows/src/main.rs b/examples/shadows/src/main.rs index 34a896b..ef71fc3 100644 --- a/examples/shadows/src/main.rs +++ b/examples/shadows/src/main.rs @@ -12,7 +12,7 @@ use lyra_engine::{ light::{directional::DirectionalLight, SpotLight}, }, scene::{ - CameraBundle, FreeFlyCamera, FreeFlyCameraPlugin, WorldTransform, ACTLBL_LOOK_LEFT_RIGHT, + CameraBundle, FreeFly3dCamera, FreeFlyCameraPlugin, WorldTransform, ACTLBL_LOOK_LEFT_RIGHT, ACTLBL_LOOK_ROLL, ACTLBL_LOOK_UP_DOWN, ACTLBL_MOVE_FORWARD_BACKWARD, ACTLBL_MOVE_LEFT_RIGHT, ACTLBL_MOVE_UP_DOWN, }, @@ -239,5 +239,5 @@ fn setup_scene_plugin(app: &mut App) { let mut pos = Transform::from_xyz(-1.0, -10.0, -1.5); pos.rotate_x(math::Angle::Degrees(-27.0)); pos.rotate_y(math::Angle::Degrees(-90.0)); - world.spawn((CameraBundle::default(), pos, FreeFlyCamera::default())); + world.spawn((CameraBundle::default(), pos, FreeFly3dCamera::default())); } diff --git a/examples/simple_scene/src/main.rs b/examples/simple_scene/src/main.rs index 20a03cb..8220b9e 100644 --- a/examples/simple_scene/src/main.rs +++ b/examples/simple_scene/src/main.rs @@ -9,7 +9,7 @@ use lyra_engine::{ math::{self, Transform, Vec3}, render::light::directional::DirectionalLight, scene::{ - system_update_world_transforms, CameraBundle, FreeFlyCamera, FreeFlyCameraPlugin, + system_update_world_transforms, CameraBundle, FreeFly3dCamera, FreeFlyCameraPlugin, WorldTransform, ACTLBL_LOOK_LEFT_RIGHT, ACTLBL_LOOK_ROLL, ACTLBL_LOOK_UP_DOWN, ACTLBL_MOVE_FORWARD_BACKWARD, ACTLBL_MOVE_LEFT_RIGHT, ACTLBL_MOVE_UP_DOWN, }, @@ -150,6 +150,6 @@ fn setup_scene_plugin(app: &mut App) { world.spawn(( CameraBundle::default(), Transform::from_xyz(0.0, 0.0, 5.5), - FreeFlyCamera::default(), + FreeFly3dCamera::default(), )); } diff --git a/examples/testbed/src/main.rs b/examples/testbed/src/main.rs index 6635ec0..a1075f5 100644 --- a/examples/testbed/src/main.rs +++ b/examples/testbed/src/main.rs @@ -16,7 +16,7 @@ use lyra_engine::{ math::{self, Quat, Transform, Vec3}, render::light::{directional::DirectionalLight, PointLight, SpotLight}, scene::{ - self, FreeFlyCamera, FreeFlyCameraPlugin, WorldTransform, ACTLBL_LOOK_LEFT_RIGHT, + self, FreeFly3dCamera, FreeFlyCameraPlugin, WorldTransform, ACTLBL_LOOK_LEFT_RIGHT, ACTLBL_LOOK_ROLL, ACTLBL_LOOK_UP_DOWN, ACTLBL_MOVE_FORWARD_BACKWARD, ACTLBL_MOVE_LEFT_RIGHT, ACTLBL_MOVE_UP_DOWN, }, @@ -378,7 +378,7 @@ fn setup_scene_plugin(app: &mut App) { Quat::from_xyzw(0.03375484, -0.7116095, 0.0342693, 0.70092666), Vec3::ONE, ), - FreeFlyCamera::default(), + FreeFly3dCamera::default(), )); //Ok(())