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
impl ModelTransformBuffer
Sourcepub fn update(&self, queue: &Queue, pos: Vec3, rot: Quat, scale: Vec3)
pub fn update(&self, queue: &Queue, pos: Vec3, rot: Quat, scale: Vec3)
Update the model transformation buffer.
Sourcepub fn update_with_pod(&self, queue: &Queue, pod: &ModelTransformPod)
pub fn update_with_pod(&self, queue: &Queue, pod: &ModelTransformPod)
Update the model transformation buffer with ModelTransformPod.
Trait Implementations§
Source§impl BufferWrapper for ModelTransformBuffer
impl BufferWrapper for ModelTransformBuffer
Source§const DEFAULT_USAGES: BufferUsages = _
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
fn download<T: NoUninit + AnyBitPattern>( &self, device: &Device, queue: &Queue, ) -> impl Future<Output = Result<Vec<T>, DownloadBufferError>> + Send
Download the buffer data into a
Vec.Source§fn prepare_download(
&self,
device: &Device,
encoder: &mut CommandEncoder,
) -> Buffer
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
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
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 moreSource§impl Clone for ModelTransformBuffer
impl Clone for ModelTransformBuffer
Source§fn clone(&self) -> ModelTransformBuffer
fn clone(&self) -> ModelTransformBuffer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModelTransformBuffer
impl Debug for ModelTransformBuffer
Source§impl FixedSizeBufferWrapper for ModelTransformBuffer
impl FixedSizeBufferWrapper for ModelTransformBuffer
Source§type Pod = ModelTransformPod
type Pod = ModelTransformPod
The POD element type that defines the layout/size.
Source§fn pod_size() -> BufferAddress
fn pod_size() -> BufferAddress
Returns the size in bytes of the POD element.
Source§fn verify_buffer_size(
buffer: &Buffer,
) -> Result<(), FixedSizeBufferWrapperError>
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
fn download_single( &self, device: &Device, queue: &Queue, ) -> impl Future<Output = Result<Self::Pod, DownloadBufferError>> + Send
Download a single
FixedSizeBufferWrapper::Pod.Source§impl From<ModelTransformBuffer> for Buffer
impl From<ModelTransformBuffer> for Buffer
Source§fn from(wrapper: ModelTransformBuffer) -> Self
fn from(wrapper: ModelTransformBuffer) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ModelTransformBuffer
impl !RefUnwindSafe for ModelTransformBuffer
impl Send for ModelTransformBuffer
impl Sync for ModelTransformBuffer
impl Unpin for ModelTransformBuffer
impl !UnwindSafe for ModelTransformBuffer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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