THIS PATCH INCLUDES:
1. The implementation of all MathHelper mathematical methods + tests
2. The refactoring of operations of Vector classes to point to
MathHelperMethods + tests
SVN VERSION USED
I've been using the last SVN version:94.
FILES TOUCHED:
src/Microsoft.Xna.Framework/MathHelper.cs
This file is completely coded with the exception of the inherited
methods. All mathematical methods, hovever, are coded, and some are
improved after checking results against MS's XNA.
src/Microsoft.Xna.Framework/Vector2.cs
src/Microsoft.Xna.Framework/Vector3.cs
src/Microsoft.Xna.Framework/Vector4.cs
These classes now make use of MathHelper for their methods. That's been
done with two purposes in mind: 1) if specifications change or
improvements are done, we only have to change the code at one file,
instead of all; 2) we don't have code repeated once and again through
several files. Moreover, the code on the previous functions now has been
improved to work even on trying situations (infinite values, NAN and
overflow scenarios).
tests/Microsoft.Xna.Framework/MathHelperTests.cs
This file is improved in relation to SVN revision:94. It includes
extensive tests against both MS and Open XNA implementations. Some minor
tests have been flagged inside #if MSXNAONLY/#endif blocks, because they
provide different results depending on the treatment of types between
Mono/.Net. These tests, however have XPlatform versions afterwards that
are not inside the #if/#endif block, so that it still works the test on
both platforms.
tests/Microsoft.Xna.Framework/Vector2Tests.cs
tests/Microsoft.Xna.Framework/Vector3Tests.cs
tests/Microsoft.Xna.Framework/Vector4Tests.cs
These files have been improved. Some tests there did nothing or were
skipped by the Nunits. Now all tests are performed, they check important
situations and focus on testing that the code is really XPlatform. Most of
the tests added make use of MathHelper, so that it shows that behind the
scenes, these classes make use of MathHelper. Hence more effort has been
put in testing the MathHelper class than the Vector classes.
tests/TestGame.cs
The code crashed when compiling against Mono.Xna for a bad reference.
Instead of "Tests" it should put "Test." Now is ok.
NOTES
1. Apart from the tests submitted, many others have been done, and all
against both MSXNA and Mono.Xna.
2. Many of the tests performed showed that what sometimes we thought were
minor differences between platforms (Mono/.Net) are in effect differences
on implementation. Many methods, though returning single precission floats
use doubles innerly. That has been added to some of the methods we already
had and has been taken in account in the implementation of the new ones.
Just for all to know, if some checking a == b seems not to work well, try
to code the same function that returned a or b with double precission
before using ApproximatelyEquals.
3. This patch substitutes all other patches I've sent. According to your
instructions I've sent a comment on my previous patches saying that they
are cancelled.
-- Isaac L (aka Neozack)
-- neozack@gmail.com
-- 20070625
Original issue reported on code.google.com by neoz...@gmail.com on 25 Jun 2007 at 5:17
Original issue reported on code.google.com by
neoz...@gmail.com
on 25 Jun 2007 at 5:17Attachments: