PixSpace/src/main.rs

66 lines
1.8 KiB
Rust
Raw Normal View History

2022-12-06 15:44:16 +01:00
/**
* PixSpace is a Virtual Reality Toolkit to run projective VR setups
*
* © Copyright 2022 Hartmut Seichter
*
*/
2022-11-17 20:10:49 +01:00
use crate::scene::*;
2022-12-06 15:44:16 +01:00
use crate::utils::*;
use crate::viewer::*;
2022-12-11 23:41:22 +01:00
use crate::tracker::*;
use crate::console::*;
use bevy::{prelude::*, window::PresentMode, render::camera::CameraProjectionPlugin};
use offaxis::{offaxis_camera_setup, OffAxisProjection};
2022-07-15 22:23:24 +02:00
2022-07-17 23:18:17 +02:00
mod offaxis;
2022-11-17 20:10:49 +01:00
mod scene;
mod screeninfo;
2022-12-06 15:44:16 +01:00
mod utils;
mod viewer;
mod projection;
2022-12-11 23:41:22 +01:00
mod tracker;
mod console;
2022-07-16 20:46:08 +02:00
2022-07-15 22:23:24 +02:00
fn main() {
App::new()
.insert_resource(ClearColor(Color::rgb(0.5, 0.5, 0.5)))
2022-11-17 20:10:49 +01:00
.add_plugins(DefaultPlugins.set(WindowPlugin {
window: WindowDescriptor {
title: "PixSpace".to_string(),
width: 1280.0,
height: 720.0,
present_mode: PresentMode::AutoVsync,
// mode: WindowMode::BorderlessFullscreen,
2022-11-17 20:10:49 +01:00
..default()
},
..default()
}))
2022-12-11 23:41:22 +01:00
// use hot reloading
// .add_plugins(DefaultPlugins.set(AssetPlugin {
// watch_for_changes: true,
// ..Default::default()
// }))
2022-12-06 15:44:16 +01:00
// .add_plugin(scene::BuildScenePlugin)
2022-11-17 20:10:49 +01:00
.add_system(bevy::window::close_on_esc)
.add_system(cycle_msaa)
.add_startup_system(build_scene)
2022-12-06 15:44:16 +01:00
// .add_system(modify_projection)
2022-12-06 15:44:16 +01:00
.add_startup_system(offaxis_camera_setup)
2022-12-13 23:18:18 +01:00
// .add_startup_system(setup_tracker)
// .add_system(update_tracker)
.add_startup_system(setup_threaded_tracker)
2022-12-11 23:41:22 +01:00
.add_plugin(CameraProjectionPlugin::<OffAxisProjection>::default())
2022-12-14 22:55:26 +01:00
// .add_system(simulate_viewer)
.add_system(simulate_viewer_with_keyboard)
.add_system(apply_viewer_to_projections)
.add_system(toggle_fullscreeen)
2022-11-17 20:10:49 +01:00
.run();
}
2022-07-16 20:46:08 +02:00