Struct TextureUV

Source
pub struct TextureUV<Width, Height, AtlasWidth, AtlasHeight> {
    pub begin_u: f32,
    pub begin_v: f32,
    pub end_u: f32,
    pub end_v: f32,
    /* private fields */
}
Expand description

テクスチャアトラス内での、始点と終点のUV座標を表す

Fields§

§begin_u: f32§begin_v: f32§end_u: f32§end_v: f32

Implementations§

Source§

impl<Width, Height, AtlasWidth, AtlasHeight> TextureUV<Width, Height, AtlasWidth, AtlasHeight>

Source

pub fn flipv(&self) -> Self

上下を反転させる

Source

pub fn fliph(&self) -> Self

左右を反転させる

Source§

impl<const W: u32, const H: u32, const ATLAS_W: u32, const ATLAS_H: u32> TextureUV<Const<W>, Const<H>, Const<ATLAS_W>, Const<ATLAS_H>>

Source

pub fn of_atlas(pos: &TextureAtlasPos) -> Self

ATLAS_W×ATLAS_HのテクスチャアトラスをW×Hのサイズに分割した時、pos.row行目pos.column列目のパーツの始点と終点のUV座標

Source§

impl<const ATLAS_W: u32, const ATLAS_H: u32> TextureUV<Dynamic, Dynamic, Const<ATLAS_W>, Const<ATLAS_H>>

Source

pub fn new(rect: &Rect<i32, u32>) -> Self

Source§

impl TextureUV<Dynamic, Dynamic, Dynamic, Dynamic>

Source

pub fn new( rect: &Rect<i32, u32>, texture_width: u32, texture_height: u32, ) -> Self

Trait Implementations§

Source§

impl<Width: Debug, Height: Debug, AtlasWidth: Debug, AtlasHeight: Debug> Debug for TextureUV<Width, Height, AtlasWidth, AtlasHeight>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Width, Height, AtlasWidth, AtlasHeight> VaoBuilder2DGui<TextureUV<Width, Height, AtlasWidth, AtlasHeight>> for VaoBuffer<VertexWithNormUv>

Source§

fn add_rectangle( &mut self, texture: &TextureUV<Width, Height, AtlasWidth, AtlasHeight>, dst: &Rect<i32, u32>, )

Source§

fn add_layout_rectangle( &mut self, texture: &TextureUV<Width, Height, AtlasWidth, AtlasHeight>, parent_width: u32, parent_height: u32, origin: &Origin, position_x: &Position<i32>, position_y: &Position<i32>, inner_width: u32, inner_height: u32, )

Source§

fn add_biggest_rectangle( &mut self, texture: &TextureUV<Width, Height, AtlasWidth, AtlasHeight>, parent_width: u32, parent_height: u32, inner_width: u32, inner_height: u32, )

Source§

impl<Width, Height, AtlasWidth, AtlasHeight> VaoBuilder3DGeometry<TextureUV<Width, Height, AtlasWidth, AtlasHeight>> for VaoBuffer<VertexWithNormUv>

Source§

fn add_cuboid( &mut self, begin: &Point3, end: &Point3, textures: &CuboidTextures<'_, TextureUV<Width, Height, AtlasWidth, AtlasHeight>>, )

各辺が軸に並行な直方体を追加する Read more
Source§

fn add_face( &mut self, p1: &Point3, p2: &Point3, p3: &Point3, p4: &Point3, uv: &TextureUV<Width, Height, AtlasWidth, AtlasHeight>, )

各辺が軸に並行な長方形を追加する Read more
Source§

fn add_octahedron( &mut self, center: &Point3, r: f32, uv: &TextureUV<Width, Height, AtlasWidth, AtlasHeight>, )

正八面体を追加する Read more

Auto Trait Implementations§

§

impl<Width, Height, AtlasWidth, AtlasHeight> Freeze for TextureUV<Width, Height, AtlasWidth, AtlasHeight>

§

impl<Width, Height, AtlasWidth, AtlasHeight> RefUnwindSafe for TextureUV<Width, Height, AtlasWidth, AtlasHeight>
where Width: RefUnwindSafe, Height: RefUnwindSafe, AtlasWidth: RefUnwindSafe, AtlasHeight: RefUnwindSafe,

§

impl<Width, Height, AtlasWidth, AtlasHeight> Send for TextureUV<Width, Height, AtlasWidth, AtlasHeight>
where Width: Send, Height: Send, AtlasWidth: Send, AtlasHeight: Send,

§

impl<Width, Height, AtlasWidth, AtlasHeight> Sync for TextureUV<Width, Height, AtlasWidth, AtlasHeight>
where Width: Sync, Height: Sync, AtlasWidth: Sync, AtlasHeight: Sync,

§

impl<Width, Height, AtlasWidth, AtlasHeight> Unpin for TextureUV<Width, Height, AtlasWidth, AtlasHeight>
where Width: Unpin, Height: Unpin, AtlasWidth: Unpin, AtlasHeight: Unpin,

§

impl<Width, Height, AtlasWidth, AtlasHeight> UnwindSafe for TextureUV<Width, Height, AtlasWidth, AtlasHeight>
where Width: UnwindSafe, Height: UnwindSafe, AtlasWidth: UnwindSafe, AtlasHeight: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.