2 ms·
Similarly, PhysicsJS employs a "scratchpad" of pre-initialized vectors for fast intermediate computations. That way you aren't constructing new objects, but gra
by yesimahuman 12y ago
Similarly, PhysicsJS employs a "scratchpad" of pre-initialized vectors for fast intermediate computations. That way you aren't constructing new objects, but grabbing a free one, zeroing it, and using it as you would before. Seems quite performant.
https://github.com/wellcaffeinated/PhysicsJS/blob/master/src/util/scratchpad.js https://github.com/wellcaffeinated/PhysicsJS/blob/master/src...