ModelTransformBuffer

Struct ModelTransformBuffer 

Source
pub struct ModelTransformBuffer(/* private fields */);
Expand description

The model transformation buffer.

This buffer holds the model transformation data, including position, rotation, and scale. It is used to transform the model from model space to world space.

Implementations§

Source§

impl ModelTransformBuffer

Source

pub fn new(device: &Device) -> Self

Create a new model transformation buffer.

Source

pub fn update(&self, queue: &Queue, pos: Vec3, rot: Quat, scale: Vec3)

Update the model transformation buffer.

Source

pub fn update_with_pod(&self, queue: &Queue, pod: &ModelTransformPod)

Update the model transformation buffer with ModelTransformPod.

Trait Implementations§

Source§

impl BufferWrapper for ModelTransformBuffer

Source§

fn buffer(&self) -> &Buffer

Returns a reference to the buffer data.
Source§

const DEFAULT_USAGES: BufferUsages = _

The default usages.
Source§

fn download<T: NoUninit + AnyBitPattern>( &self, device: &Device, queue: &Queue, ) -> impl Future<Output = Result<Vec<T>, DownloadBufferError>> + Send
where Self: Send + Sync,

Download the buffer data into a Vec.
Source§

fn prepare_download( &self, device: &Device, encoder: &mut CommandEncoder, ) -> Buffer

Prepare for downloading the buffer data. Read more
Source§

fn map_download<T: NoUninit + AnyBitPattern>( download: &Buffer, device: &Device, ) -> impl Future<Output = Result<Vec<T>, DownloadBufferError>> + Send

Map the download buffer to read the buffer data. Read more
Source§

fn map_download_with_poll_type<T: NoUninit + AnyBitPattern>( download: &Buffer, device: &Device, poll_type: PollType, ) -> impl Future<Output = Result<Vec<T>, DownloadBufferError>> + Send

Map the download buffer to read the buffer data with custom wgpu::PollType. Read more
Source§

impl Clone for ModelTransformBuffer

Source§

fn clone(&self) -> ModelTransformBuffer

Returns a duplicate 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 ModelTransformBuffer

Source§

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

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

impl FixedSizeBufferWrapper for ModelTransformBuffer

Source§

type Pod = ModelTransformPod

The POD element type that defines the layout/size.
Source§

fn pod_size() -> BufferAddress

Returns the size in bytes of the POD element.
Source§

fn verify_buffer_size( buffer: &Buffer, ) -> Result<(), FixedSizeBufferWrapperError>

Check if the given buffer matches the expected size. Read more
Source§

fn download_single( &self, device: &Device, queue: &Queue, ) -> impl Future<Output = Result<Self::Pod, DownloadBufferError>> + Send
where Self: Send + Sync, Self::Pod: NoUninit + AnyBitPattern,

Download a single FixedSizeBufferWrapper::Pod.
Source§

impl From<ModelTransformBuffer> for Buffer

Source§

fn from(wrapper: ModelTransformBuffer) -> Self

Converts to this type from the input type.
Source§

impl TryFrom<Buffer> for ModelTransformBuffer

Source§

type Error = FixedSizeBufferWrapperError

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

fn try_from(buffer: Buffer) -> Result<Self, Self::Error>

Performs the conversion.

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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.
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> WasmNotSendSync for T

Source§

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