wip: engine enhancements and fixes
This commit is contained in:
parent
9816f14f53
commit
cc7921a5fe
27 changed files with 347 additions and 32 deletions
|
|
@ -1,14 +1,39 @@
|
|||
use raidillon_core::{Engine, Scene};
|
||||
use raidillon_platform::Platform;
|
||||
use glam::Vec3;
|
||||
use raidillon_core::{Engine, Scene, System};
|
||||
use raidillon_core::system::SystemContext;
|
||||
use raidillon_platform::{Platform, Camera};
|
||||
|
||||
#[cfg(feature = "glium")]
|
||||
use raidillon_glium::GliumPlatform;
|
||||
|
||||
const RENDERING_TEST_SYSTEM: &str = "rendering_test_system";
|
||||
struct RenderingTestSystem;
|
||||
|
||||
impl System for RenderingTestSystem {
|
||||
fn initialize(&mut self) {}
|
||||
fn load_world(&mut self, ctx: &mut SystemContext) {
|
||||
ctx.scene.world.spawn((Camera {
|
||||
eye: Vec3::new(0.0, 0.0, 2.0),
|
||||
center: Vec3::ZERO,
|
||||
up: Vec3::Y,
|
||||
fovy: 60_f32.to_radians(),
|
||||
aspect: 1920 as f32 / 1080 as f32, // FIXME
|
||||
znear: 0.1,
|
||||
zfar: 100.0,
|
||||
},));
|
||||
|
||||
// TODO: Load a sample glTF file
|
||||
}
|
||||
|
||||
fn update(&mut self, ctx: &mut SystemContext) {}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let mut engine = Engine::new();
|
||||
// Define systems
|
||||
// engine.system_manager.add_system("spawn_chunks".to_string(), ChunkSystem);
|
||||
// engine.system_manager.add_system("movement".to_string(), MovementSystem);
|
||||
engine.system_manager.add_system(RENDERING_TEST_SYSTEM, Box::new(RenderingTestSystem));
|
||||
|
||||
// Set up the scene
|
||||
let main_scene_id = "Main".to_owned();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue