[−][src]Struct blender_mesh::VertexAttribute
Data for an individual vertex attribute such as positions, normals or uvs.
All of the x, y and z positions of the vertices in this mesh, indexed by position_indices
.
For example, vec![0., 10., 2., 65.2, 4., 5.] with an attribute size of three would mean that there are is data for two vertices.
Data set one being (0., 10., 2.) and (65.2, 4., 5.).
This does not, however, mean that there are two vertices in the mesh that is using these vertices.
There could be multiple vertices that happened to have the same positions.
Implementations
impl<T> VertexAttribute<T>
[src]
pub fn new(data: Vec<T>, attribute_size: u8) -> Result<VertexAttribute<T>, ()>
[src]
TODO: Introduce thiserror and add error handling to this library
pub fn as_slice(&self) -> &[T]
[src]
pub fn attribute_size(&self) -> u8
[src]
The number of values per vertex.
Typically positions and normals have a size of 3 (x, y, z)
Uvs have a size of 2 (u, v)
But other data types can vary. Bone influences / weights might have 3, 4, or some other number attribute size depending on the application's needs.
impl<T> VertexAttribute<T>
[src]
pub fn data(&self) -> &Vec<T>
[src]
Get the underlying data for this attribute. Useful for buffering vertex data onto the GPU
Trait Implementations
impl<T: Debug> Debug for VertexAttribute<T>
[src]
impl<T: Default> Default for VertexAttribute<T>
[src]
fn default() -> VertexAttribute<T>
[src]
impl<T> Deref for VertexAttribute<T>
[src]
impl<'de, T> Deserialize<'de> for VertexAttribute<T> where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<T: PartialEq> PartialEq<VertexAttribute<T>> for VertexAttribute<T>
[src]
fn eq(&self, other: &VertexAttribute<T>) -> bool
[src]
fn ne(&self, other: &VertexAttribute<T>) -> bool
[src]
impl<T> Serialize for VertexAttribute<T> where
T: Serialize,
[src]
T: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<T> StructuralPartialEq for VertexAttribute<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for VertexAttribute<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for VertexAttribute<T> where
T: Send,
T: Send,
impl<T> Sync for VertexAttribute<T> where
T: Sync,
T: Sync,
impl<T> Unpin for VertexAttribute<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for VertexAttribute<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,