first step done: we have a custom and updatable matrix
This commit is contained in:
parent
8234a61364
commit
4a8c9a298a
7 changed files with 360 additions and 180 deletions
24
src/main.rs
24
src/main.rs
|
@ -1,8 +1,10 @@
|
|||
use crate::scene::*;
|
||||
use bevy::{prelude::*, window::PresentMode};
|
||||
use bevy::{prelude::*, window::PresentMode, render::camera::CameraProjectionPlugin};
|
||||
use offaxis::{offaxis_camera_setup, OffAxisProjection};
|
||||
|
||||
mod offaxis;
|
||||
mod scene;
|
||||
mod screeninfo;
|
||||
|
||||
fn main() {
|
||||
App::new()
|
||||
|
@ -35,7 +37,14 @@ fn main() {
|
|||
// )
|
||||
// .add_system(hello_world)
|
||||
.add_startup_system(build_scene)
|
||||
.add_system(print_positions)
|
||||
.add_system(modify_projection)
|
||||
.add_startup_system(offaxis_camera_setup)
|
||||
// .add_system(print_positions)
|
||||
// .add_system(modify_frustum)
|
||||
|
||||
.add_plugin(CameraProjectionPlugin::<OffAxisProjection>::default())
|
||||
|
||||
.add_system(update_offaxis)
|
||||
.run();
|
||||
}
|
||||
|
||||
|
@ -50,3 +59,14 @@ fn cycle_msaa(input: Res<Input<KeyCode>>, mut msaa: ResMut<Msaa>) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn update_offaxis(mut query : Query<&mut OffAxisProjection>)
|
||||
{
|
||||
for mut q in query.iter_mut() {
|
||||
|
||||
// we fake access to far for updating the matrix
|
||||
(*q).far *= 1.0;
|
||||
|
||||
println!("Update {:?}",q);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue