Struct re_renderer::transform::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.
This is “pan and scan”.
Transforms the range of region_of_interest
to the range of region
.
Fields§
§region_of_interest: RectF32
The region of the scene that should be visible.
region: RectF32
The full scene.
Implementations§
source§impl RectTransform
impl RectTransform
sourcepub const IDENTITY: Self = _
pub const IDENTITY: Self = _
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
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for RectTransform
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more