mirror of
https://github.com/lisk77/comet.git
synced 2025-10-23 21:38:50 +00:00
feat: added the beginnings of a ecs based camera system. render_scene_2d crashes miserably right now but theoretically everything *should* be in place for a full adoption
This commit is contained in:
parent
a9a8d076ca
commit
4ce24b58dd
5 changed files with 128 additions and 33 deletions
|
|
@ -4,7 +4,7 @@ use std::sync::atomic::AtomicBool;
|
|||
use std::thread;
|
||||
use std::time::{Duration, Instant};
|
||||
use crossbeam_channel::bounded;
|
||||
use comet_ecs::{Component, ComponentSet, Entity, Render, Transform2D, Transform3D, World};
|
||||
use comet_ecs::{Camera2D, Component, ComponentSet, Entity, Render, Render2D, Transform2D, Transform3D, World};
|
||||
use comet_resources::{ResourceManager, Vertex};
|
||||
use comet_renderer::renderer2d::Renderer2D;
|
||||
|
||||
|
|
@ -98,7 +98,9 @@ impl App {
|
|||
match preset {
|
||||
ApplicationType::App2D => {
|
||||
info!("Creating 2D app!");
|
||||
self.world.register_component::<Transform2D>()
|
||||
self.world.register_component::<Transform2D>();
|
||||
self.world.register_component::<Render2D>();
|
||||
self.world.register_component::<Camera2D>()
|
||||
},
|
||||
ApplicationType::App3D => {
|
||||
info!("Creating 3D app!");
|
||||
|
|
@ -129,8 +131,8 @@ impl App {
|
|||
self.game_state.as_mut()?.downcast_mut::<T>()
|
||||
}
|
||||
|
||||
pub fn input_manager(&self) -> &WinitInputHelper {
|
||||
&self.input_manager
|
||||
pub fn world(&self) -> &World {
|
||||
&self.world
|
||||
}
|
||||
|
||||
pub fn key_pressed(&self, key: Key) -> bool {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue