Skip to content

Commit

Permalink
Merge pull request #154 from pranavtotla/master
Browse files Browse the repository at this point in the history
Fix: lerp() for 3D points when z is 0
  • Loading branch information
Pomax committed Apr 30, 2021
2 parents cb4fe3e + 9832af0 commit 6af37cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.js
Expand Up @@ -288,7 +288,7 @@ const utils = {
x: v1.x + r * (v2.x - v1.x),
y: v1.y + r * (v2.y - v1.y),
};
if (!!v1.z && !!v2.z) {
if (v1.z !== undefined && v2.z !== undefined) {
ret.z = v1.z + r * (v2.z - v1.z);
}
return ret;
Expand Down

0 comments on commit 6af37cf

Please sign in to comment.