Stop dividing by zero
This commit is contained in:
parent
9a06d92ed7
commit
bd2307f782
5 changed files with 20 additions and 10 deletions
|
|
@ -63,7 +63,7 @@ export const InvertedTunnelFactory = (
|
|||
vec2 targetFromDelta = target - froms[i];
|
||||
|
||||
float h = dot(targetFromDelta, toFromDeltas[i])
|
||||
/ dot(toFromDeltas[i], toFromDeltas[i]);
|
||||
/ max(dot(toFromDeltas[i], toFromDeltas[i]), 0.00000001);
|
||||
|
||||
float clampedH = clamp(h, 0.0, 1.0);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue