[−][src]Struct amethyst_rendy::camera::Perspective
An appropriate orthographic projection for the coordinate space used by Amethyst.
Because we use vulkan coordinates internally and within the rendering engine, normal nalgebra
projection objects (Perspective3
) are incorrect for our use case.
This implementation provides an interface with feature parity to nalgebra, but retaining the vulkan coordinate space.
The projection matrix is right-handed and has a depth range of 0 to 1
Methods
impl Perspective
[src]
pub fn new(aspect: f32, fov: f32, z_near: f32, z_far: f32) -> Self
[src]
Creates a new Perspective
projection with the provided arguments.
Arguments
- aspect - Aspect Ratio represented as a
f32
ratio. - fov - Field of View represented in degrees
- z_near - Near clip plane distance
- z_far - Far clip plane distance
pub fn aspect(&self) -> f32
[src]
Returns the aspect ratio in radians
pub fn fovy(&self) -> f32
[src]
Returns the y-axis value of the FOV as a ratio.
pub fn near(&self) -> f32
[src]
Returns the near-clip value.
pub fn far(&self) -> f32
[src]
Returns the far-clip value.
pub fn set_aspect(&mut self, aspect: f32)
[src]
Sets the aspect ratio represented in radians.
NOTE
This causes changes to both the fov and aspect ratio matrix elements.
pub fn set_fov(&mut self, fov: f32)
[src]
Sets the aspect ratio represented as a f32
ratio.
NOTE
This causes changes to both the fov and aspect ratio matrix elements.
pub fn set_fov_and_aspect(&mut self, fov: f32, aspect: f32)
[src]
Sets the aspect ratio represented as a ratio as well as the FOV represented in radians.
NOTE
This causes changes to both the fov and aspect ratio matrix elements.
pub fn set_near(&mut self, near: f32)
[src]
pub fn set_far(&mut self, far: f32)
[src]
pub fn set_near_and_far(&mut self, z_near: f32, z_far: f32)
[src]
Sets the near and far clip values.
pub fn as_matrix(&self) -> &Matrix4<f32>
[src]
Returns a reference to the inner matrix representation of this projection.
pub fn as_matrix_mut(&mut self) -> &mut Matrix4<f32>
[src]
Returns a mutable reference to the inner matrix representation of this projection.
Trait Implementations
impl Copy for Perspective
[src]
impl Clone for Perspective
[src]
fn clone(&self) -> Perspective
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq<Perspective> for Perspective
[src]
fn eq(&self, other: &Perspective) -> bool
[src]
fn ne(&self, other: &Perspective) -> bool
[src]
impl From<Perspective> for Projection
[src]
fn from(proj: Perspective) -> Self
[src]
impl Debug for Perspective
[src]
impl Serialize for Perspective
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for Perspective
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Unpin for Perspective
impl Sync for Perspective
impl Send for Perspective
impl UnwindSafe for Perspective
impl RefUnwindSafe for Perspective
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
[src]
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
[src]
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into(self) -> D
[src]
Convert the source color to the destination color using the bradford method by default Read more
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> SetParameter for T
[src]
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
[src]
T: Parameter<Self>,
Sets value
as a parameter of self
.
impl<T> Supports<T> for T
[src]
impl<T> Erased for T
[src]
impl<T> Serialize for T where
T: Serialize + ?Sized,
[src]
T: Serialize + ?Sized,
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
[src]
impl<T> Scalar for T where
T: Copy + PartialEq<T> + Any + Debug,
[src]
T: Copy + PartialEq<T> + Any + Debug,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
[src]
fn is_in_subset(&self) -> bool
[src]
unsafe fn to_subset_unchecked(&self) -> SS
[src]
fn from_subset(element: &SS) -> SP
[src]
impl<T> Resource for T where
T: Any + Send + Sync,
[src]
T: Any + Send + Sync,
impl<T> Any for T where
T: Any,
[src]
T: Any,
fn get_type_id(&self) -> TypeId
[src]
impl<T> Event for T where
T: Send + Sync + 'static,
[src]
T: Send + Sync + 'static,
impl<T> Clone for T where
T: Clone,
[src]
T: Clone,