Hi,
here is a PR for Vector changes from our discussion here (and elsewhere).
https://github.com/pygame/pygame/pull/416
- Tests and fixes for keyword arguments with Vector2 Vector3
- Tests for Vector2, and Vector3 scalar constructors like GLSL. Vector3(1) -> Vector3(1, 1, 1)
- missing an element is an error now, no zero default. Vector3(1, 2), and Vector3(x=1, y=2) fails.
- Added magnitude to Vector types, which is an alias for length.
- pygame.math require import (no missing module).
- pygame.Vector2 pygame.Vector3 available.
- Not in pygame.locals for
now, to avoid possible breakage with common Vector2/Vector3 names.
The one breakage is for when people were doing:
- Vector2(1), which used to give Vector2(1, 0), and now gives Vector2(1, 1).
- Vector3(1), which used to give Vector3(1, 0, 0), or Vector3(1,2) which used to give Vector3(1,2,0).
This should be the last of the changes to the Vector stuff for now to be released in 1.9.4.
Other things can be added later without breaking backwards compatibility.
ciao,