3 ms·
Three.js implements their math this way. https://github.com/mrdoob/three.js/blob/master/src/math/Vector3.js https://github.com/mrdoob/three.js/blob/master/src/
by meheleventyone 7y ago
Three.js implements their math this way.
https://github.com/mrdoob/three.js/blob/master/src/math/Vector3.js https://github.com/mrdoob/three.js/blob/master/src/math/Vect...
You can see most operations act on the Vector and there are some shared temporary variables that have been preallocated. If you look through some of the other parts you can see closures used to capture pre-allocated temporaries per function as well.
- RobertKerans 7y agoAh brilliant, that's definitely useful. Thank you for the pointer