Struct re_renderer::RectTransform
source · pub struct RectTransform {
pub region_of_interest: RectF32,
pub region: RectF32,
}Expand description
Defines a transformation from a rectangular region of interest into a rectangular target region.
Transforms map the range of region_of_interest to the range of region.
Fields§
§region_of_interest: RectF32§region: RectF32Implementations§
source§impl RectTransform
impl RectTransform
sourcepub const IDENTITY: RectTransform = _
pub const IDENTITY: RectTransform = _
No-op rect transform that transforms from a unit rectangle to a unit rectangle.
sourcepub fn to_ndc_scale_and_translation(&self) -> Mat4
pub fn to_ndc_scale_and_translation(&self) -> Mat4
Computes a transformation matrix that applies the rect transform to the NDC space.
This matrix is expected to be the left most transformation in the vertex transformation chain.
It causes the area described by region_of_interest to be mapped to the area described by region.
Meaning, that region represents the full screen of the NDC space.
This means that only the relation of the rectangles in RectTransform is important.
Scaling or moving both rectangles by the same amount does not change the result.
pub fn scale(&self) -> Vec2
Trait Implementations§
source§impl Clone for RectTransform
impl Clone for RectTransform
source§fn clone(&self) -> RectTransform
fn clone(&self) -> RectTransform
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl RefUnwindSafe for RectTransform
impl Send for RectTransform
impl Sync for RectTransform
impl Unpin for RectTransform
impl UnwindSafe for RectTransform
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more