Merge pull request #2010 from Domanffe/perf/skip-lookup-once
🤖 Agent: contrib-gate-17 verified this head (26.3 sources, integration tree build, clippy, tests, parity; details in the PR comment). Thanks @Domanffe!
This commit is contained in:
@@ -951,7 +951,10 @@ fn draw_normals(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let normals = normals.part(p);
|
let normals = normals.part(p);
|
||||||
for poly in part.polygons.iter().filter(|_| !poses.skips(part)) {
|
// `skips` is a name lookup: ask once per part, not once per polygon. A part
|
||||||
|
// hidden this way still draws its children, so only the polygons are gated.
|
||||||
|
if !poses.skips(part) {
|
||||||
|
for poly in &part.polygons {
|
||||||
let normal = poly.vertex_normal(normals);
|
let normal = poly.vertex_normal(normals);
|
||||||
for v in poly.vertices {
|
for v in poly.vertices {
|
||||||
let pos = m.transform_point3(glam::Vec3::new(v[0], v[1], v[2]) / 16.0);
|
let pos = m.transform_point3(glam::Vec3::new(v[0], v[1], v[2]) / 16.0);
|
||||||
@@ -968,6 +971,7 @@ fn draw_normals(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for c in &part.children {
|
for c in &part.children {
|
||||||
draw_normals(c, m, normals, poses, uv, color, light, overlay, out);
|
draw_normals(c, m, normals, poses, uv, color, light, overlay, out);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user