Struct CubeModel

Source
pub struct CubeModel {
    pub transform: Transform,
    pub texture: Handle<Texture>,
    pub bone: CubeModelBone,
    /* private fields */
}

Fields§

§transform: Transform§texture: Handle<Texture>§bone: CubeModelBone

Implementations§

Source§

impl CubeModel

Source

pub fn new( engine: &RenderEngine, transform: Transform, texture: Handle<Texture>, bone: CubeModelBone, possible_size: usize, ) -> Self

Creates a new cube model

§Arguments
  • engine - A instance of the render engine so that buffers can be created
  • transform - The transform of this object (position, rotation, scale)
  • texture - The texture to be used for this object
  • bone - The root bone of the model
  • possible_size - The possible count of all parts and its children. This can be left as 0 or be inaccurate, as the actual size is taken when the model is autmatically, this value only serves to make the creation for effecient if it is accurate.
Source

pub fn update(&mut self, engine: &RenderEngine)

Updates this cube model so that any changes to this models transform or any of its parts transforms is reflected by the model.

§Arguments
  • engine - A instance of the render engine as this is required to update the internal buffer
Source

pub fn clone(&self, engine: &RenderEngine) -> Self

Clones this model

§Arguments
  • engine - A render engine instance to clone the model data
§Returns

A clone of this model.

Trait Implementations§

Source§

impl Debug for CubeModel

Source§

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

Formats the value using the given formatter. Read more

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> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSync for T
where T: Sync,