cpml icon indicating copy to clipboard operation
cpml copied to clipboard

Re-introduce out-variables as optional function variants.

Open shakesoda opened this issue 8 years ago • 1 comments

Sometimes you actually do need those extra percentage points, so we should have an optional UI. We took the outvars out of 1.2.9, but they did have merit.

This could be implemented as foo_inplace which the main function variants wrap with additional checks.

shakesoda avatar Dec 16 '16 01:12 shakesoda

I think the main problem was in the original library out was the first param. Out vars should be last param and then you can just simply use: out = out or self for most situations and out = out or new() Which should allow you to use temp variables or reuse variables, example:

m:transpose() -- will alter original in place m:transpose(tmp) -- will keep original intact but return altered tmp m:translate(tmp):rotate(vec4):scale(vec3) -- will keep original intact but tmp will be translated, rotated and scaled

revolucas avatar May 15 '17 01:05 revolucas