[−][src]Struct blender_mesh::SingleIndexedVertexAttributes
Most 3D model file formats export vertex data with multiple indices.
There might be indices for the positions, normals and uvs.
The SingleIndexVertexData
is vertex data that only has one index.
When we've run BlenderMesh.combine_vertex_indices
we'll end up generating
SingleIndexVertexData
Implementations
impl SingleIndexedVertexAttributes
[src]
pub fn face_weight_normals(&mut self) -> Result<(), WeightedNormalsError>
[src]
Alter normals to be both surface weighted (connected triangle size) and angle weighted (angle of connected triangle corner)
@see http://www.bytehazard.com/articles/vertnorm.html
TODO: We could also implement this for multi-indexed - but we should wait until we refactor / replace the combine_indices function because, for example, if we weight normals before we calculate face tangents our face tangents will be incorrect. In general this entire crate needs to be heavily TDD"d and refactored into something clean..
TODO: When we combine normals we'll end up with a lot of vertices that have the same data so we should dedupe the vertices / indices
impl SingleIndexedVertexAttributes
[src]
pub fn interleave<T: Copy>(
attribs: &[&VertexAttribute<T>]
) -> Result<Vec<T>, InterleaveError>
[src]
attribs: &[&VertexAttribute<T>]
) -> Result<Vec<T>, InterleaveError>
Combine anu number of vertex attributes into a single buffer of vertex data.
Say you have positions: [0., 1., 2., 10., 11., 12.] with attribute size 3 uvs : [0., 1., 1., 1.]
This would get stitched together as [0., 1., 2., 0., 1., 10., 11., 12., 1., 1.]
More generally, say you have attributes P with size 3, U with size 2, N with size 3.
They'll get interleaved as [ P0, P0, P0, U0, U0, N0, N0, P1, P1, P1, U1, U1, N1, N1, ... ],
impl SingleIndexedVertexAttributes
[src]
pub fn indices(&self) -> &Vec<u16>
[src]
For SingleIndexVertexData
every 3 indices corresponds to one triangle.
There can not be any other faces (quads, ngons) - only triangles.
pub fn vertices(&self) -> &Vec<Vertex>
[src]
All of the vertex data for the mesh.
You can index into this data using SingleIndexedVertexAttributes
Trait Implementations
impl Debug for SingleIndexedVertexAttributes
[src]
impl Default for SingleIndexedVertexAttributes
[src]
impl<'de> Deserialize<'de> for SingleIndexedVertexAttributes
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl PartialEq<SingleIndexedVertexAttributes> for SingleIndexedVertexAttributes
[src]
fn eq(&self, other: &SingleIndexedVertexAttributes) -> bool
[src]
fn ne(&self, other: &SingleIndexedVertexAttributes) -> bool
[src]
impl Serialize for SingleIndexedVertexAttributes
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for SingleIndexedVertexAttributes
[src]
Auto Trait Implementations
impl RefUnwindSafe for SingleIndexedVertexAttributes
impl Send for SingleIndexedVertexAttributes
impl Sync for SingleIndexedVertexAttributes
impl Unpin for SingleIndexedVertexAttributes
impl UnwindSafe for SingleIndexedVertexAttributes
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>,