PR #114 2/2
This commit is contained in:
parent
9da93c46e8
commit
fcb122ddb8
|
@ -944,8 +944,6 @@ fn center_of_window(window_size: &WindowSize) -> Point2DF32 {
|
||||||
enum Camera {
|
enum Camera {
|
||||||
TwoD(Transform2DF32),
|
TwoD(Transform2DF32),
|
||||||
ThreeD {
|
ThreeD {
|
||||||
// The mode will either be 3D or VR
|
|
||||||
mode: Mode,
|
|
||||||
// For each camera, the perspective from camera coordinates to display coordinates,
|
// For each camera, the perspective from camera coordinates to display coordinates,
|
||||||
// and the view transform from world coordinates to camera coordinates.
|
// and the view transform from world coordinates to camera coordinates.
|
||||||
transforms: Vec<CameraTransform>,
|
transforms: Vec<CameraTransform>,
|
||||||
|
@ -983,7 +981,6 @@ impl Camera {
|
||||||
let transforms = iter::repeat(transform).take(viewport_count).collect();
|
let transforms = iter::repeat(transform).take(viewport_count).collect();
|
||||||
|
|
||||||
Camera::ThreeD {
|
Camera::ThreeD {
|
||||||
mode,
|
|
||||||
transforms,
|
transforms,
|
||||||
transform: CameraTransform3D::new(view_box),
|
transform: CameraTransform3D::new(view_box),
|
||||||
velocity: Point3DF32::default(),
|
velocity: Point3DF32::default(),
|
||||||
|
@ -995,7 +992,11 @@ impl Camera {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn mode(&self) -> Mode {
|
fn mode(&self) -> Mode {
|
||||||
match *self { Camera::ThreeD { mode, .. } => mode, Camera::TwoD { .. } => Mode::TwoD }
|
match *self {
|
||||||
|
Camera::ThreeD { ref transforms, .. } if 2 <= transforms.len() => Mode::VR,
|
||||||
|
Camera::ThreeD { .. } => Mode::ThreeD,
|
||||||
|
Camera::TwoD { .. } => Mode::TwoD,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue