Is there any leaning toward standardizing the “plain” functions and whether they are InPlace or ToNew?
Or is there too much code that is dependent on the current functionality?
In another thread:
I was just reviewing the Matrix, Vector3, and Quaternion functions and also saw that insert() is an InPlace function. Is there any leaning toward standardizing the “plain” functions and whether they are InPlace or ToNew? Most Vector3 plain functions (no suffix) create a new object and there is a corresponding InPlace function. Vector3.normalize() is the one exception in that it is the only non-suffix function that is in place and it has a corresponding ToNew function instead.
Matrix.invert() is also in place as noted above (and invertToRef() doesn’t exist).
Any missing InPlace, ToNew or ToRef could be created from the others, but ToRef is most useful, by default avoiding new object creation and not modifying the source object.
- InPlace => ToRef(this)
- ToNew => ToRef(new Vector3())