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::*;
|
2022-12-06 21:12:15 +01:00
|
|
|
use crate::viewer::*;
|
2022-12-06 15:44:16 +01:00
|
|
|
|
2022-12-09 21:30:47 +01:00
|
|
|
|
2022-12-05 23:01:16 +01:00
|
|
|
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;
|
2022-12-05 23:01:16 +01:00
|
|
|
mod screeninfo;
|
2022-12-06 15:44:16 +01:00
|
|
|
mod utils;
|
2022-12-06 21:12:15 +01:00
|
|
|
mod viewer;
|
2022-12-09 21:30:47 +01:00
|
|
|
mod projection;
|
2022-07-16 20:46:08 +02:00
|
|
|
|
2022-07-15 22:23:24 +02:00
|
|
|
fn main() {
|
|
|
|
App::new()
|
2022-12-09 18:35:37 +01:00
|
|
|
.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,
|
|
|
|
..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-05 23:01:16 +01:00
|
|
|
|
2022-12-06 15:44:16 +01:00
|
|
|
.add_startup_system(offaxis_camera_setup)
|
2022-12-05 23:01:16 +01:00
|
|
|
.add_plugin(CameraProjectionPlugin::<OffAxisProjection>::default())
|
|
|
|
.add_system(update_offaxis)
|
2022-12-06 21:12:15 +01:00
|
|
|
.add_system(simulate_viewer)
|
2022-11-17 20:10:49 +01:00
|
|
|
.run();
|
|
|
|
}
|
2022-07-16 20:46:08 +02:00
|
|
|
|
2022-12-05 23:01:16 +01:00
|
|
|
|