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

Holds everything about the appearance of objects like textures, vetex/index data, color and material.

Implementations§

source§

impl Appearance

source

pub fn new() -> Self

Makes a default appearance.

source

pub fn new_instanced(model: Model, material: Option<Material>) -> Self

Makes an instanced appearance allowing for better performance using the same appearance instance multiple times.

source

pub fn auto_scale(&mut self) -> Result<(), TextureError>

Scales the object appearance according to the texture applied. Works best in Expand camera mode for best quality.

source

pub fn visible(self, visible: impl Into<bool>) -> Self

Sets the visibility of this appearance and returns self.

source

pub fn set_visible(&mut self, visible: impl Into<bool>)

Sets the visibility of this appearance.

source

pub fn get_visible(&self) -> &bool

Gets the visibility of this appearance.

source

pub fn get_visible_mut(&mut self) -> &mut bool

Gets a mutable reference to the visibility of this appearance.

source

pub fn transform(self, transform: impl Into<Transform>) -> Self

Sets the transform of this appearance and returns self.

source

pub fn set_transform(&mut self, transform: impl Into<Transform>)

Sets the transform of this appearance.

source

pub fn get_transform(&self) -> &Transform

Gets the transform of this appearance.

source

pub fn get_transform_mut(&mut self) -> &mut Transform

Gets a mutable reference to the transform of this appearance.

source

pub fn color(self, color: impl Into<Color>) -> Self

Sets the color of this appearance and returns self.

source

pub fn set_color(&mut self, color: impl Into<Color>)

Sets the color of this appearance.

source

pub fn get_color(&self) -> &Color

Gets the color of this appearance.

source

pub fn get_color_mut(&mut self) -> &mut Color

Gets a mutable reference to the color of this appearance.

source

pub fn get_model(&self) -> &Model

Returns the model of the appearance.

source

pub fn get_model_mut(&mut self) -> Option<&mut Model>

Returns the mutable instance of a model in case the appearance is not instanced.

source

pub fn set_model(&mut self, model: Model)

Only sets the model if this appearance is not instanced.

source

pub fn model(self, model: Model) -> Self

Only sets the model if this appearance in not instanced.

source

pub fn get_material(&self) -> Option<&Material>

Returns the material of the appearance.

source

pub fn get_material_mut(&mut self) -> Option<Option<&mut Material>>

Returns the mutable instance of a material in case the appearance is not instanced.

source

pub fn set_material(&mut self, material: Option<Material>)

Only sets the material if this appearance is not instanced.

source

pub fn material(self, material: Option<Material>) -> Self

Only sets the material if this appearance in not instanced.

source

pub fn is_instanced(&self) -> bool

Returns true if this object is instanced.

source

pub fn set_layer(&mut self, id: u32) -> Result<(), TextureError>

Sets the layer of the texture in case it has a textured material with layers.

source

pub fn layer(&self) -> Option<u32>

Returns the layer of the texture in case there is a material.

source

pub fn next_frame(&mut self) -> Result<(), TextureError>

Goes to the next frame of the textured material.

Returns an error if it reached the limit.

source

pub fn last_frame(&mut self) -> Result<(), TextureError>

Goes back a frame of the textured material.

Returns an error if the layer is already on 0.

Trait Implementations§

source§

impl Clone for Appearance

source§

fn clone(&self) -> Appearance

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Appearance

source§

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

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

impl Default for Appearance

source§

fn default() -> Self

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

impl PartialEq for Appearance

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Appearance

source§

impl StructuralPartialEq for Appearance

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
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

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.

§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

§

fn into_sample(self) -> T

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

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

§

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

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

fn is_in_subset(&self) -> bool

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

fn to_subset_unchecked(&self) -> SS

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

fn from_subset(element: &SS) -> SP

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

impl<T> ToOwned for T
where T: Clone,

§

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
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

source§

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

§

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>,

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,