initial setup for rendering into a viewport
This commit is contained in:
parent
3b18d1e032
commit
c793c81ee8
3 changed files with 8 additions and 5 deletions
|
@ -68,6 +68,6 @@ pub fn offaxis_camera_setup(mut commands: Commands) {
|
||||||
VisibleEntities::default(),
|
VisibleEntities::default(),
|
||||||
Camera::default(),
|
Camera::default(),
|
||||||
Camera3d::default(),
|
Camera3d::default(),
|
||||||
ScreenInfo::default()
|
ScreenInfo::new("Test")
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,9 +28,9 @@ pub struct ScreenInfo {
|
||||||
|
|
||||||
impl ScreenInfo {
|
impl ScreenInfo {
|
||||||
|
|
||||||
fn default() -> Self {
|
pub fn new(name: &str) -> Self {
|
||||||
Self {
|
Self {
|
||||||
name: String::from("main"),
|
name: name.to_string(),
|
||||||
width: 3.08,
|
width: 3.08,
|
||||||
height: 2.33,
|
height: 2.33,
|
||||||
center: Vec3 { x: 0.0, y: -1.15, z: -3.08 },
|
center: Vec3 { x: 0.0, y: -1.15, z: -3.08 },
|
||||||
|
@ -45,7 +45,7 @@ impl ScreenInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fn update(&mut self) {
|
pub fn update(&mut self) -> &mut Self {
|
||||||
|
|
||||||
// compute right as up ^ forward
|
// compute right as up ^ forward
|
||||||
self.horizontal = self.up.cross(self.normal);
|
self.horizontal = self.up.cross(self.normal);
|
||||||
|
@ -56,6 +56,8 @@ impl ScreenInfo {
|
||||||
self.left = self.center - self.horizontal * (self.height * 0.5);
|
self.left = self.center - self.horizontal * (self.height * 0.5);
|
||||||
self.right = self.center + self.horizontal * (self.height * 0.5);
|
self.right = self.center + self.horizontal * (self.height * 0.5);
|
||||||
|
|
||||||
|
self
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn intersection(
|
fn intersection(
|
||||||
|
|
|
@ -28,6 +28,7 @@ pub fn update_offaxis(mut query : Query<(
|
||||||
(*q).far *= 1.0;
|
(*q).far *= 1.0;
|
||||||
|
|
||||||
println!("Update {:?}",q);
|
println!("Update {:?}",q);
|
||||||
println!("Screeninfo {0}",si.name.len());
|
|
||||||
|
println!("Screeninfo {}",si.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue