schteppe / cannon.js

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

Cleanup and improvement for fromVectors() #491

Open infusion opened 11 months ago

infusion commented 11 months ago

Hi Stefan,

thanks for Cannon.js! As I am the author of Quaternion.js ( https://github.com/infusion/Quaternion.js ), I was interested in your implementation and figured, your fromVectors() method could be improved quite a bit. Besides this I added a note where the calculation for normalizeFast() comes from and removed the unused vectors used before for multiplication.

Hope this is helpful. Robert