MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / meshVertexNormal

Function meshVertexNormal

src/rendering/raster_rendering_engine.cpp:1013–1024  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1011 }
1012
1013 [[nodiscard]] glm::vec3 meshVertexNormal(const MeshCpuView& mesh,
1014 const int index,
1015 const glm::vec3& fallback) {
1016 if (!mesh.has_normals) {
1017 return fallback;
1018 }
1019 const size_t base = static_cast<size_t>(index) * 3u;
1020 return safeNormalize({mesh.normal_data[base + 0],
1021 mesh.normal_data[base + 1],
1022 mesh.normal_data[base + 2]},
1023 fallback);
1024 }
1025
1026 [[nodiscard]] glm::vec4 meshVertexTangent(const MeshCpuView& mesh,
1027 const int index) {

Callers 1

Calls 1

safeNormalizeFunction · 0.70

Tested by

no test coverage detected