pub struct ExtendedTriangleMesh {
pub mesh: TriangleMesh,
pub uvs: Option<Vec<UV>>,
pub tangents: Option<Vec<Tangent>>,
pub metadata: MeshMetadata,
}
Expand description
Extended mesh with full attribute support
Fields§
§mesh: TriangleMesh
Base mesh data
uvs: Option<Vec<UV>>
Texture coordinates per vertex
tangents: Option<Vec<Tangent>>
Tangent vectors per vertex
metadata: MeshMetadata
Metadata for tracking attribute completeness
Implementations§
Source§impl ExtendedTriangleMesh
impl ExtendedTriangleMesh
Sourcepub fn from_mesh(mesh: TriangleMesh) -> Self
pub fn from_mesh(mesh: TriangleMesh) -> Self
Create from a base TriangleMesh
Sourcepub fn new(
mesh: TriangleMesh,
uvs: Option<Vec<UV>>,
tangents: Option<Vec<Tangent>>,
) -> Self
pub fn new( mesh: TriangleMesh, uvs: Option<Vec<UV>>, tangents: Option<Vec<Tangent>>, ) -> Self
Create with full attributes
Sourcepub fn vertex_count(&self) -> usize
pub fn vertex_count(&self) -> usize
Get vertex count
Sourcepub fn face_count(&self) -> usize
pub fn face_count(&self) -> usize
Get face count
Sourcepub fn set_tangents(&mut self, tangents: Vec<Tangent>)
pub fn set_tangents(&mut self, tangents: Vec<Tangent>)
Set tangent vectors
Sourcepub fn process_attributes(
&mut self,
options: &MeshAttributeOptions,
) -> Result<()>
pub fn process_attributes( &mut self, options: &MeshAttributeOptions, ) -> Result<()>
Process mesh attributes with given options
Sourcepub fn validate_attributes(&mut self) -> Result<()>
pub fn validate_attributes(&mut self) -> Result<()>
Validate attribute consistency
Sourcepub fn compute_normals(&mut self, smooth: bool, normalize: bool) -> Result<()>
pub fn compute_normals(&mut self, smooth: bool, normalize: bool) -> Result<()>
Compute vertex normals
Sourcepub fn compute_tangents(&mut self, normalize: bool) -> Result<()>
pub fn compute_tangents(&mut self, normalize: bool) -> Result<()>
Compute tangent vectors using Lengyel’s method
Sourcepub fn generate_default_uvs(&mut self) -> Result<()>
pub fn generate_default_uvs(&mut self) -> Result<()>
Generate default UV coordinates (planar projection)
Sourcepub fn to_triangle_mesh(self) -> TriangleMesh
pub fn to_triangle_mesh(self) -> TriangleMesh
Convert back to base TriangleMesh (loses extended attributes)
Trait Implementations§
Source§impl Clone for ExtendedTriangleMesh
impl Clone for ExtendedTriangleMesh
Source§fn clone(&self) -> ExtendedTriangleMesh
fn clone(&self) -> ExtendedTriangleMesh
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 moreAuto Trait Implementations§
impl Freeze for ExtendedTriangleMesh
impl RefUnwindSafe for ExtendedTriangleMesh
impl Send for ExtendedTriangleMesh
impl Sync for ExtendedTriangleMesh
impl Unpin for ExtendedTriangleMesh
impl UnwindSafe for ExtendedTriangleMesh
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.