This commit is contained in:
numzero 2024-04-28 23:27:33 +03:00
parent 8e943df809
commit a836e7f847

View File

@ -93,7 +93,7 @@ mod riemann {
fn metric(&self, pos: Vec2) -> Mat2 {
let h = self.halfmetric(pos);
transpose(&h.ortho) * diagonal(h.diag * h.diag) * h.ortho
transpose(&h.ortho) * diagonal(pow2(h.diag)) * h.ortho
}
fn invmetric(&self, pos: Vec2) -> Mat2 {
@ -112,6 +112,7 @@ mod riemann {
fn normalize(&self, at: Vec2, v: Vec2) -> Vec2 {
v / self.length(at, v)
}
fn globalize(&self, at: Vec2, v: Vec2) -> Vec2 {
let h = self.halfmetric(at);
transpose(&h.ortho) * diagonal(Vec2::from_s(1.0) / h.diag) * h.ortho * v
@ -188,10 +189,6 @@ mod riemann {
}
}
fn sqr(x: f32) -> f32 {
return x * x;
}
fn smoothstep(x: f32) -> f32 {
return 3.0 * x * x - 2.0 * x * x * x;
}