Excalibur
Excalibur copied to clipboard
Consistency: Adding optional destination/output arguments to all applicable Vector functions
Context
I ran into a great presentation about increasing Vector math performance that advises to add output arguments to functions to prevent the creation of unneeded objects.
Proposal
EX.Vector already has some functions (scale, add, sub, rotate and clone) that have an optional dest argument, so I'm suggesting to consistently add an optional destargument to the following functions:
minmaxnormalizecrossperpendicular
Optional
- Add an extra argument for the fallback anchor used in
rotate - Use
destinationoroutputinstead of the abbreviateddestcurrently used. - Update the documentation to inform developers of the potential performance gains from using this argument when using
Vector. (Even more optional: Add code examples to show the differences)