Skip to main content

CubeListBuilder

Struct CubeListBuilder 

pub struct CubeListBuilder { /* private fields */ }
Expand description

CubeListBuilder: the boxes of one part, each placed on the texture from the last tex_offs and mirrored after mirror.

Implementations§

§

impl CubeListBuilder

pub fn create() -> CubeListBuilder

An empty box builder.

pub fn tex_offs(self, u: i32, v: i32) -> CubeListBuilder

Where the next boxes’ faces start on the texture, in texels (texOffs).

pub fn mirror(self) -> CubeListBuilder

The next boxes are mirrored (mirror()).

pub fn set_mirror(self, mirror: bool) -> CubeListBuilder

Whether the next boxes are mirrored (mirror(boolean)).

pub fn add_box(self, origin: [f32; 3], size: [f32; 3]) -> CubeListBuilder

A box at origin of size texels (addBox(x, y, z, w, h, d)).

pub fn add_box_with( self, origin: [f32; 3], size: [f32; 3], grow: CubeDeformation, ) -> CubeListBuilder

A box grown by grow (addBox(x, y, z, w, h, d, deformation)).

pub fn add_box_mirrored( self, origin: [f32; 3], size: [f32; 3], mirror: bool, ) -> CubeListBuilder

A box mirrored or not by mirror, whatever mirror() said (addBox(x, y, z, w, h, d, mirror)).

pub fn add_box_faces( self, origin: [f32; 3], size: [f32; 3], faces: &[Direction], ) -> CubeListBuilder

A box with only faces (addBox(x, y, z, w, h, d, visibleFaces)).

pub fn add_box_tex_scaled( self, origin: [f32; 3], size: [f32; 3], grow: CubeDeformation, tex_scale: [f32; 2], ) -> CubeListBuilder

A box whose texels take tex_scale of the texture’s (addBox(x, y, z, w, h, d, deformation, texScaleU, texScaleV)).

pub fn add_box_at( self, origin: [f32; 3], size: [f32; 3], grow: CubeDeformation, tex: [i32; 2], ) -> CubeListBuilder

A box with its own place on the texture, leaving tex_offs as it is (addBox(comment, x, y, z, w, h, d, deformation, texU, texV)).

pub fn cubes(&self) -> &[CubeDefinition]

The boxes added so far (getCubes).

Trait Implementations§

§

impl Clone for CubeListBuilder

§

fn clone(&self) -> CubeListBuilder

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for CubeListBuilder

§

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

Formats the value using the given formatter. Read more
§

impl Default for CubeListBuilder

§

fn default() -> CubeListBuilder

Returns the “default value” for a type. Read more
§

impl<'de> Deserialize<'de> for CubeListBuilder

§

fn deserialize<__D>( __deserializer: __D, ) -> Result<CubeListBuilder, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl PartialEq for CubeListBuilder

§

fn eq(&self, other: &CubeListBuilder) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
§

impl Serialize for CubeListBuilder

§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl StructuralPartialEq for CubeListBuilder

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.