From 2831f4a54bf9457357269ff0089b634a5f03ab6c Mon Sep 17 00:00:00 2001 From: atlas Date: Wed, 9 Jul 2025 02:06:14 -0400 Subject: [PATCH] rename --- crates/bevy_render/src/maths.wgsl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/bevy_render/src/maths.wgsl b/crates/bevy_render/src/maths.wgsl index 01ea3a6062..0f9a11076f 100644 --- a/crates/bevy_render/src/maths.wgsl +++ b/crates/bevy_render/src/maths.wgsl @@ -68,14 +68,14 @@ fn mat4x4_to_mat3x3(m: mat4x4) -> mat3x3 { // The results are equivalent to the Gram-Schmidt process [1]. // // [1]: https://math.stackexchange.com/a/1849294 -fn orthonormalize(z_basis: vec3) -> mat3x3 { +fn orthonormalize(z_normalized: vec3) -> mat3x3 { var up = vec3(0.0, 1.0, 0.0); - if (abs(dot(up, z_basis)) > 0.99) { + if (abs(dot(up, z_normalized)) > 0.99) { up = vec3(1.0, 0.0, 0.0); // Avoid creating a degenerate basis. } - let x_basis = normalize(cross(z_basis, up)); - let y_basis = cross(z_basis, x_basis); - return mat3x3(x_basis, y_basis, z_basis); + let x_basis = normalize(cross(z_normalized, up)); + let y_basis = cross(z_normalized, x_basis); + return mat3x3(x_basis, y_basis, z_normalized); } // Returns true if any part of a sphere is on the positive side of a plane.