Allows to place buildings a bit faster and more perfectly aligned. Also
it helps to find a nearest placeable position in some cases.
Reviewed By: elexis
Comments By: Stan, wraitii
Differential Revision: https://code.wildfiregames.com/D2079
This was SVN commit r23330.
TS_ASSERT_EQUALS_APPROX must not silently pass if epsilon wasn't given.
Sort Vector2D.rotate summands by component rather than saving one
character.
This was SVN commit r21062.
For instance useful when working with location vectors on arrays, such
as terrain generation in random map scripts, refs #4845.
This was SVN commit r20723.
Improve some of the comments mentioned by fatherbushido in b3dbcc457b.
Rename avg to average and test it.
Inline constructor defaults.
Don't use array functions nor for...of loops here to maximize the
performance, refs c751500907.
This was SVN commit r20706.
Use it to illustrate the building placement preview rotation and
focusing of attacked units.
Split from D1037
Patch By: temple
This was SVN commit r20496.
Remove the rmgen rotateCoordinates helper function from 4256744e26 and
clean the implementation of that commit, refs #4845, #4804.
Deepfreeze mapCenter vector from 5256d8497e used here to prevent
accidental overwrites with the mutating Vector2D functions, refs #4854.
This was SVN commit r20468.
Refer to the normalized river vector instead of the river vector divided
by the length of the river.
Rename mag to magnitude.
This was SVN commit r20435.
Start unifying the euclidian distance functions instead of adding yet
another helper function to the random map script library after this
diff.
Differential Revision: https://code.wildfiregames.com/D969
Math.square accepted by mimo
Includes changes proposed by bb, fatherbushido
This was SVN commit r20328.
Extend the tests of rotate in 99494251a1 to reveal the bug.
Add non-static clone functions for vectors (as the static ones were
incorrectly removed in e95f4e9744).
Math.pow performance is investigated separately, refs P85.
Checks and balances by mimo, leper, FeXoR and fatherbushido
This was SVN commit r20272.
In compareLength, use Math.sign to replace a ternary + isNaN check.
In distanceToSquared, Use Math.pow(distance, 2) to avoid repetition of
the distance, inline its value to remove the then unneeded variables.
This was SVN commit r20263.
Delete clone globalscripts function introduced by 9f47ed536d.
Rename the better supported deepcopy function to clone.
Delete unused Vector2D and Vector3D clone prototype functions that can
just use clone if needed.
Differential Revision: https://code.wildfiregames.com/D870
Reviewed By: leper
This was SVN commit r20125.