pub fn bounds(&self) -> Rect<f32> {
        let viewport_top_left = na::Point2::new(
            -self.viewport_width / 2.0,
            self.viewport_height / 2.0,
        );
        let viewport_bottom_right = na::Point2::new(
            self.viewport_width / 2.0,
            -self.viewport_height / 2.0,
        );
        let inverse = self.view.inverse();
        let world_top_left = inverse.transform_point(&viewport_top_left);
        let world_bottom_right =
            inverse.transform_point(&viewport_bottom_right);
        Rect {
            left: world_top_left.x,
            right: world_bottom_right.x,
            top: world_top_left.y,
            bottom: world_bottom_right.y,
        }
    }
/// The camera's bounds in world-space.
///
/// # Example
///
/// ```rust
/// # use draw2d::camera::*;
/// # use approx::assert_relative_eq;
/// # use nalgebra as na;
/// #
/// let ortho = OrthoCamera::with_viewport(1.0, 2.0);
/// let bounds = ortho.bounds();
///
/// assert_relative_eq!(bounds.left, -1.0);
/// assert_relative_eq!(bounds.right, 1.0);
/// assert_relative_eq!(bounds.top, 0.5);
/// assert_relative_eq!(bounds.bottom, -0.5);
/// ```
The camera's bounds in world-space.
The camera ' s bounds in world - space .
pub fn bounds(&self) -> Rect<f32> {
        let viewport_top_left = na::Point2::new(
            -self.viewport_width / 2.0,
            self.viewport_height / 2.0,
        );
        let viewport_bottom_right = na::Point2::new(
            self.viewport_width / 2.0,
            -self.viewport_height / 2.0,
        );
        let inverse = self.view.inverse();
        let world_top_left = inverse.transform_point(&viewport_top_left);
        let world_bottom_right =
            inverse.transform_point(&viewport_bottom_right);
        Rect {
            left: world_top_left.x,
            right: world_bottom_right.x,
            top: world_top_left.y,
            bottom: world_bottom_right.y,
        }
    }
pub fn bounds ( & self ) -> Rect < f32 > { let viewport_top_left = na :: Point2 :: new ( - self . viewport_width / 2.0 , self . viewport_height / 2.0 , ) ; let viewport_bottom_right = na :: Point2 :: new ( self . viewport_width / 2.0 , - self . viewport_height / 2.0 , ) ; let inverse = self . view . inverse ( ) ; let world_top_left = inverse . transform_point ( & viewport_top_left ) ; let world_bottom_right = inverse . transform_point ( & viewport_bottom_right ) ; Rect { left : world_top_left . x , right : world_bottom_right . x , top : world_top_left . y , bottom : world_bottom_right . y , } }
The camera's bounds in world-space.
The camera ' s bounds in world - space .
&self
example
None
use draw2d::camera::*;
None
use approx::assert_relative_eq;
None
use nalgebra as na;
let ortho = OrthoCamera::with_viewport(1.0, 2.0);
let bounds = ortho.bounds().

assert_relative_eq!(bounds.left, -1.0);
assert_relative_eq!(bounds.right, 1.0);
assert_relative_eq!(bounds.top, 0.5);
assert_relative_eq!(bounds.bottom, -0.5);
```
let ortho = OrthoCamera :: with_viewport ( 1 . 0 2 . 0 ) ; let bounds = ortho . bounds () . assert_relative_eq! ( bounds . left - 1 . 0 ) ; assert_relative_eq! ( bounds . right 1 . 0 ) ; assert_relative_eq! ( bounds . top 0 . 5 ) ; assert_relative_eq! ( bounds . bottom - 0 . 5 ) ; ` ` `