[][src]Struct blender_mesh::VertexAttribute

pub struct VertexAttribute<T> { /* fields omitted */ }

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]

impl<T> Deref for VertexAttribute<T>[src]

type Target = Vec<T>

The resulting type after dereferencing.

impl<'de, T> Deserialize<'de> for VertexAttribute<T> where
    T: Deserialize<'de>, 
[src]

impl<T: PartialEq> PartialEq<VertexAttribute<T>> for VertexAttribute<T>[src]

impl<T> Serialize for VertexAttribute<T> where
    T: Serialize
[src]

impl<T> StructuralPartialEq for VertexAttribute<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for VertexAttribute<T> where
    T: RefUnwindSafe

impl<T> Send for VertexAttribute<T> where
    T: Send

impl<T> Sync for VertexAttribute<T> where
    T: Sync

impl<T> Unpin for VertexAttribute<T> where
    T: Unpin

impl<T> UnwindSafe for VertexAttribute<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.