Struct Model

Source
pub struct Model {
    pub vertices: Vec<Vertex>,
    pub transform: Matrix4<f32>,
    pub gpu_data: GpuData,
    pub is_dirty: bool,
}
Expand description

Data structure with vertex data and underlying GPU representation, shared among all instances.

Fields§

§vertices: Vec<Vertex>

The vertex data

§transform: Matrix4<f32>

A static per-model (not per-instance) transform

§gpu_data: GpuData

The params which are sent through the pipeline to the shader program

§is_dirty: bool

Flag to indicate the model gpu data needs to be refreshed

Implementations§

Source§

impl Model

Source

pub fn new(renderer: &mut Renderer, vertices: &[Vertex]) -> ModelHandle

Create a new instance of the model

Source

pub fn translate(&mut self, translation: Vector3<f32>)

Auto Trait Implementations§

§

impl Freeze for Model

§

impl !RefUnwindSafe for Model

§

impl Send for Model

§

impl Sync for Model

§

impl Unpin for Model

§

impl !UnwindSafe for Model

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