Fixed collisions and added mouse locking
This commit is contained in:
parent
f1529d7e58
commit
da86c3a111
4 changed files with 282 additions and 199 deletions
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue