feat(fields): implement debug gizmos for fields, controlled over dbus
Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
@@ -107,7 +107,10 @@ fn build_line_mesh(
|
||||
)
|
||||
});
|
||||
let quat = match (last_quat, next_quat) {
|
||||
(None, None) => unreachable!(),
|
||||
(None, None) => {
|
||||
error!("no previous or next point in line");
|
||||
break;
|
||||
}
|
||||
(None, Some(next)) => next,
|
||||
(Some(last), None) => last,
|
||||
(Some(last), Some(next)) => last.lerp(next, 0.5),
|
||||
@@ -148,11 +151,36 @@ fn build_line_mesh(
|
||||
PrimitiveTopology::TriangleList,
|
||||
RenderAssetUsages::RENDER_WORLD,
|
||||
);
|
||||
if vertex_colors.iter().flatten().any(|v| !v.is_finite()) {
|
||||
panic!(
|
||||
"vertex colors contains non finite float: {:#?}",
|
||||
vertex_colors
|
||||
);
|
||||
}
|
||||
if vertex_normals.iter().any(|v| !v.is_finite()) {
|
||||
panic!(
|
||||
"normals contains non finite dir: {:#?}",
|
||||
vertex_normals
|
||||
);
|
||||
}
|
||||
if vertex_normals.iter().any(|v| !v.is_normalized()) {
|
||||
panic!(
|
||||
"normals contains non normalized dir: {:#?}",
|
||||
vertex_normals
|
||||
);
|
||||
}
|
||||
if vertex_positions.iter().any(|v| !v.is_finite()) {
|
||||
panic!(
|
||||
"vertex positions contains non finite pos: {:#?}",
|
||||
vertex_positions
|
||||
);
|
||||
}
|
||||
mesh.insert_indices(Indices::U32(vertex_indices));
|
||||
mesh.insert_attribute(Mesh::ATTRIBUTE_COLOR, vertex_colors);
|
||||
mesh.insert_attribute(Mesh::ATTRIBUTE_NORMAL, vertex_normals);
|
||||
mesh.insert_attribute(Mesh::ATTRIBUTE_POSITION, vertex_positions.clone());
|
||||
if let Some(aabb) = mesh.compute_aabb() {
|
||||
info!(?aabb);
|
||||
*lines.bounds.lock() = aabb;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user