From da86c3a111485fa6499ea7d92cf7a035ad2a4321 Mon Sep 17 00:00:00 2001 From: 2ndbeam <2ndbeam@disroot.org> Date: Thu, 10 Jul 2025 12:11:00 +0300 Subject: [PATCH] Fixed collisions and added mouse locking --- data/player.rgs | Bin 10933 -> 10979 bytes data/scene.rgs | Bin 17112 -> 13175 bytes game/src/lib.rs | 11 ++ settings.ron | 470 ++++++++++++++++++++++++++++-------------------- 4 files changed, 282 insertions(+), 199 deletions(-) diff --git a/data/player.rgs b/data/player.rgs index 50d1d72dd747f4dc5e02726626ce37e97daff0e3..036019d79d73413133e77bddeae510b553e9e5bf 100644 GIT binary patch delta 310 zcmdlQ`Z#pMB6gOoJ2oGjBrdjj4|^MvZPb%$I|hb^jZR7x_I$4Dc8kJl?B|@-+`DON ziG9~3oqgdf*^LD#%?QN?%s>V! z5Id!&XXbGO8E^oSam`Bsi>0MKvj<7A0dY`bN@i&>=jJoK4_H`?jW_S#yg_Il6KlaI z0gyA(Chru@VcqZs%9$XR&3fSnm~)AB!B?oLtwc6!!fQB3d9sfw&P~v7+1zi?K_Q}O6&Vsxk+f$2EOJJVcyhUX*>tt62LAHRL#LCp7$qibj E06^|#v;Y7A delta 279 zcmaDHx;1peB6b!T#^rk^FO(G9yobGw$(DhkVLt;3Xs}1&GBnt800jc_i!)0y^YgeN zk|0G62R7GpsW9s@1BDo&*Z{-;sqsk6Npr0zNzE%M25~`Vg7IWUY4go0d`np-&r=qf z%&!oSe$vQ3_#;=K8p%0|}7dcuO7@$o_a{vq-443iZ& FOaM9#Qj`Dy diff --git a/data/scene.rgs b/data/scene.rgs index 1e715088e61dcdf1f689c390512497d4ea469d59..59b6d889d52d55847f9abd7064fe71700e368003 100644 GIT binary patch delta 705 zcmcc7%J@BP!$Nkp2Rr|mTnwGO&_Hza9`-gS+Zl)1_A>y1&5FqVzdsz>m-sZrUNEiD z?#>*i{ed1&_dWmn!HxqcACO<1S(2Hb$NlQQmSa=$I*0OaHxEp%=L%v4$#P8o%~QPD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(wHnsV^aoq>c$5rWpeOvV~`@#oq37`Wl0j8GImuy&KTV|DU)M|{Pn&tT13C` zB$_Ug=#;UYdE;Y~GC6jj&N~`qlT_*ME3hkIET diff --git a/game/src/lib.rs b/game/src/lib.rs index f17fa75..72db96f 100644 --- a/game/src/lib.rs +++ b/game/src/lib.rs @@ -8,6 +8,7 @@ use fyrox::{ gui::message::UiMessage, plugin::{Plugin, PluginContext, PluginRegistrationContext}, scene::Scene, + renderer::framework::core::log::Log, }; use std::path::Path; @@ -75,4 +76,14 @@ impl Plugin for Game { ) { self.scene = scene; } + + fn on_graphics_context_initialized( + &mut self, + #[allow(unused_variables)] context: PluginContext, + ) { + let gfxctx = context.graphics_context.as_initialized_mut(); + + gfxctx.window.set_cursor_visible(false); + Log::verify(gfxctx.window.set_cursor_grab(fyrox::window::CursorGrabMode::Confined)); + } } diff --git a/settings.ron b/settings.ron index a844585..c6b1bce 100644 --- a/settings.ron +++ b/settings.ron @@ -489,6 +489,272 @@ ), ), scene_settings: { + "data/scene.rgs": ( + camera_settings: ( + position: (-11.366306, -7.537056, 6.83859), + yaw: 11.549961, + pitch: 0.46432278, + projection: Perspective(( + fov: 1.3089969, + z_near: 0.025, + z_far: 128.0, + )), + ), + node_infos: { + ( + index: 95, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 97, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 139, + generation: 2, + ): ( + is_expanded: true, + ), + ( + index: 94, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 1, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 51, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 187, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 140, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 50, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 54, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 45, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 56, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 69, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 6, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 47, + generation: 2, + ): ( + is_expanded: true, + ), + ( + index: 2, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 4, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 181, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 138, + generation: 2, + ): ( + is_expanded: true, + ), + ( + index: 48, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 102, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 0, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 109, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 3, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 5, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 107, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 190, + generation: 2, + ): ( + is_expanded: true, + ), + ( + index: 186, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 180, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 47, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 193, + generation: 2, + ): ( + is_expanded: true, + ), + ( + index: 53, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 52, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 7, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 182, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 185, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 49, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 110, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 46, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 82, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 8, + generation: 1, + ): ( + is_expanded: true, + ), + ( + index: 57, + generation: 1, + ): ( + is_expanded: true, + ), + }, + ), "/home/secondbeam/workspace/rust/fyrox/red_dragon_pon/data/guns/placeholder.ui": ( camera_settings: ( position: (0.0, 1.0, 0.0), @@ -530,9 +796,9 @@ ), "data/player.rgs": ( camera_settings: ( - position: (0.0, 1.0, 0.0), - yaw: 0.0, - pitch: 0.0, + position: (-2.509219, 0.8766233, 0.08671797), + yaw: 1.4641014, + pitch: 0.121562436, projection: Perspective(( fov: 1.3089969, z_near: 0.025, @@ -540,158 +806,12 @@ )), ), node_infos: { - ( - index: 2, - generation: 1, - ): ( - is_expanded: true, - ), - ( - index: 1, - generation: 1, - ): ( - is_expanded: true, - ), ( index: 0, generation: 1, ): ( is_expanded: true, ), - }, - ), - "data/scene.rgs": ( - camera_settings: ( - position: (0.0, 0.0, 0.0), - yaw: 7.867303, - pitch: 0.41450697, - projection: Perspective(( - fov: 1.3089969, - z_near: 0.025, - z_far: 128.0, - )), - ), - node_infos: { - ( - index: 3, - generation: 1, - ): ( - is_expanded: false, - ), - ( - index: 140, - generation: 1, - ): ( - is_expanded: true, - ), - ( - index: 0, - generation: 1, - ): ( - is_expanded: true, - ), - ( - index: 180, - generation: 1, - ): ( - is_expanded: true, - ), - ( - index: 1, - generation: 1, - ): ( - is_expanded: true, - ), - ( - index: 49, - generation: 1, - ): ( - is_expanded: true, - ), - ( - index: 181, - generation: 1, - ): ( - is_expanded: true, - ), - ( - index: 5, - generation: 1, - ): ( - is_expanded: true, - ), - ( - index: 53, - generation: 1, - ): ( - is_expanded: true, - ), - ( - index: 51, - generation: 1, - ): ( - is_expanded: true, - ), - ( - index: 182, - generation: 1, - ): ( - is_expanded: true, - ), - ( - index: 139, - generation: 2, - ): ( - is_expanded: true, - ), - ( - index: 138, - generation: 2, - ): ( - is_expanded: true, - ), - ( - index: 69, - generation: 1, - ): ( - is_expanded: true, - ), - ( - index: 47, - generation: 1, - ): ( - is_expanded: true, - ), - ( - index: 97, - generation: 1, - ): ( - is_expanded: true, - ), - ( - index: 52, - generation: 1, - ): ( - is_expanded: true, - ), - ( - index: 46, - generation: 1, - ): ( - is_expanded: true, - ), - ( - index: 56, - generation: 1, - ): ( - is_expanded: true, - ), - ( - index: 102, - generation: 1, - ): ( - is_expanded: true, - ), ( index: 2, generation: 1, @@ -699,55 +819,7 @@ is_expanded: true, ), ( - index: 45, - generation: 1, - ): ( - is_expanded: true, - ), - ( - index: 6, - generation: 1, - ): ( - is_expanded: true, - ), - ( - index: 57, - generation: 1, - ): ( - is_expanded: true, - ), - ( - index: 110, - generation: 1, - ): ( - is_expanded: true, - ), - ( - index: 50, - generation: 1, - ): ( - is_expanded: true, - ), - ( - index: 109, - generation: 1, - ): ( - is_expanded: true, - ), - ( - index: 4, - generation: 1, - ): ( - is_expanded: true, - ), - ( - index: 48, - generation: 1, - ): ( - is_expanded: true, - ), - ( - index: 54, + index: 1, generation: 1, ): ( is_expanded: true, @@ -764,7 +836,7 @@ ), windows: ( window_position: (0.0, 0.0), - window_size: (1896.0, 1024.0), + window_size: (483.0, 1024.0), window_maximized: false, layout: None, ),