math_module

 Loading...
Author  Commit  Message  Date  Builds  

250+ commits behind default.  
merged changes from trunk



some last minute changes before I merge to trunk.
The biggest chunk is that I unified most math functions into a
gerneric one as suggested by René Dudfield.



added "lerp()" to Vector2 and Vector3 to provide a linear interpolation.
fixed bug in "Vector2.slerp()".
some cosmetic cleanups.



implemented new methods in the math module.
* added "vec1.slerp(vec2, steps)" to Vector2 and Vector3.
This method returns an iterator. This can also scale in radial direction.
* added "as_polar()" and "from_polar((r, phi))" to Vector2.
This converts to and from polarcoordiantes where r is the radial distance and
phi the angle to the positive xaxis.
* added "as_spherical()" and "from_spherical((r, theta, phi))" to Vector3.
T…



rearanged math module. added forward declarations at the beginning.
enable/disable_swizzling are now module methods
added tests for Vector3 not yet complete (but almost)



* implemented Vector3.
there are no tests yet, so there are bound to be bugs



refactored some of the vector tests.
added more test for Vector2().elementwise()



refactored the vector_elementwiseproxy functions and fixed some bugs along the way



* added the vetor_elementwiseproxy which lets you apply calculations on
each element. This also supports __pow__, __abs__ and __mod__
* added tests for the above



added support for swizzling.
added methods "enable_swizzle()" and "disable_swizzle()"; default: disabled
added test for swizzling



merged changes from trunk to math_module branch



added methods distance_to and distance_squared_to to the vector class
the vector class now supports the iter protocol
added tests for the above



added the following methods to Vector2
* length
* length_squared
* reflect
* refelct_ip
also included unit tests for the above



updates to the pygame.math module
* fixed vector_GetItem
* implemented Get/SetSlice
* fixed str/repr
* updated the constructor so that "Vector2(Vector2().__repr__())" should work
* implemented new methods:
 rotate, rotate_ip
 normalize, normalize_ip, is_normalized
 cross
 dot
 angle_to
 scale_to_length
also added unit tests for all the above



fix a reference counting bug in initmath which led to a crash
fixed some unit tests for the math module
fixed a CAPI bug for the display module



added an incomplete Vector2 to the math module.
currently this revision does not work on my system.



started writing tests for a yet to implement vector type



* create math_module branch for development of vectors etc

