pub struct TextureUvTransform3d { /* private fields */ }Expand description
Affine texture coordinates: sample_uv = source_uv * scale + offset.
Source coordinates retain their normalized 0..=1 contract. Zero scale is
allowed and selects a constant coordinate; negative scale reverses an axis.
Coefficients must be zero or normal finite values, with absolute values at
most 65536; both transformed axis endpoints must also lie in that range.
These bounds prevent unsafe shader products/sums but do not promise subtexel
precision for arbitrarily large repeat counts. Reduce offset modulo the
intended repeat period on the host when high phase precision matters.
use sim_engine::{TextureAddressMode3d, TextureUvTransform3d, Vec2};
let mapping = TextureUvTransform3d::new(
Vec2::new(-4.0, 2.0),
Vec2::new(0.25, 0.0),
)?;
assert_eq!(mapping.scale(), Vec2::new(-4.0, 2.0));
let addressing = TextureAddressMode3d::Repeat;Implementations§
Source§impl TextureUvTransform3d
impl TextureUvTransform3d
Sourcepub const MAX_MAGNITUDE: f32 = 65_536.0
pub const MAX_MAGNITUDE: f32 = 65_536.0
Largest accepted coefficient and transformed endpoint magnitude.
Trait Implementations§
Source§impl Clone for TextureUvTransform3d
impl Clone for TextureUvTransform3d
Source§fn clone(&self) -> TextureUvTransform3d
fn clone(&self) -> TextureUvTransform3d
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TextureUvTransform3d
Source§impl Debug for TextureUvTransform3d
impl Debug for TextureUvTransform3d
Source§impl Default for TextureUvTransform3d
impl Default for TextureUvTransform3d
Source§impl PartialEq for TextureUvTransform3d
impl PartialEq for TextureUvTransform3d
impl StructuralPartialEq for TextureUvTransform3d
Auto Trait Implementations§
impl Freeze for TextureUvTransform3d
impl RefUnwindSafe for TextureUvTransform3d
impl Send for TextureUvTransform3d
impl Sync for TextureUvTransform3d
impl Unpin for TextureUvTransform3d
impl UnsafeUnpin for TextureUvTransform3d
impl UnwindSafe for TextureUvTransform3d
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