News for hackers. Stuff that matters.
Re:Why I Write Games in C (yes, C) by meheleventyone on Sunday September 22, 2019 @09:09AM (#21041184)
Three.js implements their math this way.

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.

Re:Why I Write Games in C (yes, C) by RobertKerans on Sunday September 22, 2019 @06:50PM (#21044492)
Ah brilliant, that's definitely useful. Thank you for the pointer