MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/splashsurf / vertex_normals_inplace

Method vertex_normals_inplace

splashsurf_lib/src/mesh.rs:913–921  ·  view source on GitHub ↗

Computes the mesh's vertex normals inplace using an area weighted average of the adjacent triangle faces The method will panic if the length of the output slice is different from the number of vertices of the mesh. The method does not make any assumptions about the values in the output slice.

(&self, normals: &mut [Unit<Vector3<R>>])

Source from the content-addressed store, hash-verified

911 ///
912 /// The method does not make any assumptions about the values in the output slice.
913 pub fn vertex_normals_inplace(&self, normals: &mut [Unit<Vector3<R>>]) {
914 assert_eq!(normals.len(), self.vertices.len());
915
916 for normal in normals.iter_mut() {
917 normal.as_mut_unchecked().fill(R::zero());
918 }
919
920 self.vertex_normals_inplace_assume_zeroed(normals);
921 }
922
923 /// Computes the mesh's vertex normals using an area weighted average of the adjacent triangle faces
924 pub fn vertex_normals(&self) -> Vec<Unit<Vector3<R>>> {

Callers

nothing calls this directly

Calls 2

iter_mutMethod · 0.80

Tested by

no test coverage detected