pub struct CustomATTR {
pub data: Vec<u8>,
pub info: ATTRInfo,
}Expand description
User-defined vertex or instance attribute with arbitrary byte data.
Create via CustomATTR::empty or CustomATTR::from parameterised by a
DataType, then push elements with CustomATTR::push.
§Example
use optic_render::asset::attr::CustomATTR;
let mut attr = CustomATTR::empty::<u32>("bone_ids");
attr.push(0u32);
attr.push(1u32);Fields§
§data: Vec<u8>§info: ATTRInfoImplementations§
Source§impl CustomATTR
impl CustomATTR
Sourcepub fn empty<D: DataType>(name: &str) -> Self
pub fn empty<D: DataType>(name: &str) -> Self
Creates an empty custom attribute with the given name and data type.
Sourcepub fn from<D: DataType>(name: &str, vec: Vec<D>) -> Self
pub fn from<D: DataType>(name: &str, vec: Vec<D>) -> Self
Creates a custom attribute from a Vec of typed elements.
Sourcepub fn from_array<D: DataType + Clone>(name: &str, array: &[D]) -> Self
pub fn from_array<D: DataType + Clone>(name: &str, array: &[D]) -> Self
Creates a custom attribute from a slice of typed elements.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CustomATTR
impl RefUnwindSafe for CustomATTR
impl Send for CustomATTR
impl Sync for CustomATTR
impl Unpin for CustomATTR
impl UnsafeUnpin for CustomATTR
impl UnwindSafe for CustomATTR
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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