google-code-export / monoxna

Automatically exported from code.google.com/p/monoxna
Other
1 stars 1 forks source link

#1 Neozack - Vector2, Vector3, Vector4 .Hermite #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
IN THIS PATCH
Refinement of MathHelper.Hermite method
Implementation of Hermite method on Vector2, Vector3 and Vector4 classes
Tests for all

REVISION USED:
SVN Revision:80

FILES TOUCHED:
src/Microsoft.Xna.Framework/MathHelper.cs
  Added two preconditions that avoid going through the heavy code and 
prevent from crash in situations like inicialization of floats casting 
from doubles.
src/Microsoft.Xna.Framework/Vector2.cs
src/Microsoft.Xna.Framework/Vector3.cs
src/Microsoft.Xna.Framework/Vector4.cs
  Added implementation of Hermite methods
tests/Microsoft.Xna.Framework/MathHelperTests.cs
  Added, one more test than in the other issue I sent this morning on 
Hermite method.
tests/Microsoft.Xna.Framework/Vector2Tests.cs
tests/Microsoft.Xna.Framework/Vector3Tests.cs
tests/Microsoft.Xna.Framework/Vector4Tests.cs
  Added tests for Hermite methods.

NOTES:
Both this patch and the one submitted this morning go over revision:80. I 
tried to keep them separate and they are, except for the MathHelper class. 
If any is to be chosen, choose this later version I send now.

Original issue reported on code.google.com by neoz...@gmail.com on 19 Jun 2007 at 2:04

Attachments:

GoogleCodeExporter commented 9 years ago

            // Test 3
            // Tests against the MS implementation the open implementation
            // Useful to find out whether our implementation does the same than MS's
            Vector4 test3 = Vector4.Hermite(v1, v2, v3, v4, -3.6f);
            Vector4 test3_1 = new Vector4();
            test3_1.X = MathHelper.Hermite(v1.X, v2.X, v3.X, v4.X, -3.6f);
            test3_1.Y = MathHelper.Hermite(v1.Y, v2.Y, v3.Y, v4.Y, -3.6f);
            test3_1.Z = MathHelper.Hermite(v1.Z, v2.Z, v3.Z, v4.Z, -3.6f);
            test3_1.W = MathHelper.Hermite(v1.W, v2.W, v3.W, v4.W, -3.6f);
            Assert.IsTrue(test3 == test3_1, "Vector4.Hermite#3");

This test is actually pretty useless ;) What you should be comparing is the 
results
of our Hermite method with the expected value from MS.NET. What you're 
comparing here
is the result of our hermite method with our hermite method ;)

You should run the calculation in MS.NET, then check that the resultant vector 
from
our calculation is approximately equal to theirs. I've commited what you have 
there
though, as most of it is good stuff.

Original comment by alan.mcg...@gmail.com on 22 Jun 2007 at 4:39

GoogleCodeExporter commented 9 years ago

Original comment by alan.mcg...@gmail.com on 22 Jun 2007 at 4:40

GoogleCodeExporter commented 9 years ago

Original comment by alan.mcg...@gmail.com on 22 Jun 2007 at 4:40

GoogleCodeExporter commented 9 years ago

Original comment by alan.mcg...@gmail.com on 22 Jun 2007 at 4:45

GoogleCodeExporter commented 9 years ago
That test, like some others, checks that the inner implementation of MS XNA 
uses 
internally MathHelper, and not other way of doing the Hermite method. Knowing 
it 
allows me not to write the Hermite method again, but to call MathHelper.Hermite.

Original comment by neoz...@gmail.com on 25 Jun 2007 at 3:07

GoogleCodeExporter commented 9 years ago
Issue CANCELLED
---------------
This issue is cancelled. The pbms with this patch are solved on #3 Neozack's 
patch.
I'm posting this new patch now.

Original comment by neoz...@gmail.com on 25 Jun 2007 at 5:11

GoogleCodeExporter commented 9 years ago
This patch exists in #3.

Original comment by robloach on 27 Jun 2007 at 8:57