pub fn unproject_vec(&self, ndc: &na::Vector2<f32>) -> na::Vector2<f32> {
        self.projection
            .inverse()
            .transform_vector(&na::Vector3::new(ndc.x, ndc.y, 0.0))
            .xy()
    }
/// Unproject a vector from normalized device coordinates (NDC) to view
/// space.
///
/// Vectors are just a direction and a magnitude, so this transformation
/// does not apply the camera's translation in world space.
///
/// # Example
///
/// ```rust
/// # use draw2d::camera::*;
/// # use approx::assert_relative_eq;
/// # use nalgebra as na;
/// #
/// // a camera which is 3x as wide as it is tall
/// let mut ortho = OrthoCamera::with_viewport(2.0, 3.0);
///
/// // the camera's world position is ignored when unprojecting a vector
/// ortho.set_world_position(&na::Point2::new(100.0, -34523.0));
///
/// // Vulkan ndc coords have Y ranging from -1 at the top of the screen,
/// // to 1 at the bottom of the screen.
/// let top_right_ndc = na::Vector2::new(1.0, -1.0);
///
/// // The unprojected vector should point to the top right of the viewport
/// // rectangle, but is not influenced by the camera's world position.
/// let unprojected = ortho.unproject_vec(&top_right_ndc);
/// assert_relative_eq!(unprojected, na::Vector2::new(3.0, 1.0));
/// ```
Unproject a vector from normalized device coordinates (NDC) to view
space.

Vectors are just a direction and a magnitude, so this transformation
does not apply the camera's translation in world space.
Unproject a vector from normalized device coordinates ( NDC ) to view space . Vectors are just a direction and a magnitude so this transformation does not apply the camera ' s translation in world space .
pub fn unproject_vec(&self, ndc: &na::Vector2<f32>) -> na::Vector2<f32> {
        self.projection
            .inverse()
            .transform_vector(&na::Vector3::new(ndc.x, ndc.y, 0.0))
            .xy()
    }
pub fn unproject_vec ( & self , ndc : & na :: Vector2 < f32 > ) -> na :: Vector2 < f32 > { self . projection . inverse ( ) . transform_vector ( & na :: Vector3 :: new ( ndc . x , ndc . y , 0.0 ) ) . xy ( ) }
Unproject a vector from normalized device coordinates (NDC) to view
space.
Unproject a vector from normalized device coordinates ( NDC ) to view space .
&self
ndc
&na::Vector2<f32>
example
None
use draw2d::camera::*;
None
use approx::assert_relative_eq;
None
use nalgebra as na;
a camera which is 3x as wide as it is tall
let mut ortho = OrthoCamera::with_viewport(2.0, 3.0).

the camera's world position is ignored when unprojecting a vector
ortho.set_world_position(&na::Point2::new(100.0, -34523.0)).

Vulkan ndc coords have Y ranging from -1 at the top of the screen,
to 1 at the bottom of the screen.

The unprojected vector should point to the top right of the viewport
rectangle, but is not influenced by the camera's world position.
let unprojected = ortho.unproject_vec(⊤_right_ndc);
assert_relative_eq!(unprojected, na::Vector2::new(3.0, 1.0));
```
a camera which is 3x as wide as it is tall let mut ortho = OrthoCamera :: with_viewport ( 2 . 0 3 . 0 ) . the camera ' s world position is ignored when unprojecting a vector ortho . set_world_position ( &na :: Point2 :: new ( 100 . 0 - 34523 . 0 )) . Vulkan ndc coords have Y ranging from - 1 at the top of the screen to 1 at the bottom of the screen . The unprojected vector should point to the top right of the viewport rectangle but is not influenced by the camera ' s world position . let unprojected = ortho . unproject_vec ( ⊤_right_ndc ) ; assert_relative_eq! ( unprojected na :: Vector2 :: new ( 3 . 0 1 . 0 )) ; ` ` `