minor update
This commit is contained in:
parent
4a8c9a298a
commit
3b18d1e032
7 changed files with 154 additions and 133 deletions
src
79
src/scene.rs
79
src/scene.rs
|
@ -3,23 +3,14 @@ use rand::prelude::*;
|
|||
use bevy::render::primitives::Plane;
|
||||
|
||||
|
||||
pub struct BuildScenePlugin;
|
||||
// pub struct BuildScenePlugin;
|
||||
|
||||
impl Plugin for BuildScenePlugin {
|
||||
fn build(&self, app: &mut App) {
|
||||
app.add_startup_system(build_scene) // actual scene
|
||||
.add_system(print_positions); // debugging
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Component)]
|
||||
struct Person;
|
||||
|
||||
#[derive(Component)]
|
||||
pub struct Position {
|
||||
x: f32,
|
||||
y: f32,
|
||||
}
|
||||
// impl Plugin for BuildScenePlugin {
|
||||
// fn build(&self, app: &mut App) {
|
||||
// app.add_startup_system(build_scene) // actual scene
|
||||
// .add_system(print_positions); // debugging
|
||||
// }
|
||||
// }
|
||||
|
||||
#[derive(Component)]
|
||||
pub struct ProjectionScreen {
|
||||
|
@ -136,50 +127,50 @@ pub fn build_scene(
|
|||
|
||||
|
||||
|
||||
pub fn modify_frustum(mut query: Query<&Frustum>)
|
||||
{
|
||||
let mut rng = rand::thread_rng();
|
||||
// pub fn modify_frustum(mut query: Query<&Frustum>)
|
||||
// {
|
||||
// let mut rng = rand::thread_rng();
|
||||
|
||||
for mut q in query.iter() {
|
||||
// for mut q in query.iter() {
|
||||
|
||||
for mut p in q.planes {
|
||||
// for mut p in q.planes {
|
||||
|
||||
println!("{:?}",p);
|
||||
// println!("{:?}",p);
|
||||
|
||||
let mut n = p.normal_d();
|
||||
// let mut n = p.normal_d();
|
||||
|
||||
n.w += rng.gen::<f32>();
|
||||
// n.w += rng.gen::<f32>();
|
||||
|
||||
p = Plane::new(n);
|
||||
// p = Plane::new(n);
|
||||
|
||||
println!("{:?}",p);
|
||||
// println!("{:?}",p);
|
||||
|
||||
|
||||
|
||||
// p.normal_d() += rng.gen();
|
||||
}
|
||||
// // p.normal_d() += rng.gen();
|
||||
// }
|
||||
|
||||
// println!("{:?}",q.frustum.planes.len());
|
||||
}
|
||||
}
|
||||
// // println!("{:?}",q.frustum.planes.len());
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
pub fn modify_projection(mut query: Query<&Projection>)
|
||||
{
|
||||
let mut rng = rand::thread_rng();
|
||||
// pub fn modify_projection(mut query: Query<&Projection>)
|
||||
// {
|
||||
// let mut rng = rand::thread_rng();
|
||||
|
||||
for mut q in query.iter() {
|
||||
// for mut q in query.iter() {
|
||||
|
||||
print!("{:?}",q);
|
||||
}
|
||||
}
|
||||
// print!("{:?}",q);
|
||||
// }
|
||||
// }
|
||||
|
||||
pub fn print_positions(query: Query<&Position>) {
|
||||
for _position in query.iter() {
|
||||
_ = 33;
|
||||
// println!("position {:?} {:?}", position.x, position.y)
|
||||
}
|
||||
}
|
||||
// pub fn print_positions(query: Query<&Position>) {
|
||||
// for _position in query.iter() {
|
||||
// _ = 33;
|
||||
// // println!("position {:?} {:?}", position.x, position.y)
|
||||
// }
|
||||
// }
|
||||
|
||||
// Problem with off-axis
|
||||
// projection 2401, 240
|
Loading…
Add table
Add a link
Reference in a new issue