schteppe / cannon.js

A lightweight 3D physics engine written in JavaScript.
http://schteppe.github.com/cannon.js
MIT License
4.67k stars 709 forks source link

Reason behind "if (true)" ? #378

Open danaugrs opened 6 years ago

danaugrs commented 6 years ago

Is there any reason behind this if-else block with the hardcoded true and a non-empty else block? https://github.com/schteppe/cannon.js/blob/569730f94a1d9da47967a24fad0323ef7d5b4119/src/shapes/ConvexPolyhedron.js#L525-L537 I assume it's just left over from refactoring?

danaugrs commented 6 years ago

Also, this "double or" seems unnecessary: https://github.com/schteppe/cannon.js/blob/569730f94a1d9da47967a24fad0323ef7d5b4119/src/shapes/ConvexPolyhedron.js#L103

robrohan commented 6 years ago

@danaugrs I noticed that as well - I added this, but I am not sure it's the right fix. Unit tests still pass though :) https://github.com/TheRohans/cannon.js/commit/62a1ce47a851b7045e68f7b120b9e4ecb0d91aab

danaugrs commented 6 years ago

@robrohan I made some comments in your commit. Here's the most important one, noting what seems to be a non-critical issue with the cannon.js algorithm: https://github.com/TheRohans/cannon.js/commit/62a1ce47a851b7045e68f7b120b9e4ecb0d91aab#r29106924.