Skip to content
This repository has been archived by the owner on Oct 30, 2019. It is now read-only.

Commit

Permalink
Supplement to 3vi1 FNA fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
flibitijibibo committed Apr 6, 2014
1 parent a671673 commit 24f1eb3
Show file tree
Hide file tree
Showing 14 changed files with 187 additions and 542 deletions.
9 changes: 7 additions & 2 deletions MonoGame.Framework/BoundingFrustum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,13 @@ public void Contains(ref Vector3 point, out ContainmentType result)
{
for (int i = 0; i < PlaneCount; i += 1)
{
// TODO: we might want to inline this for performance reasons
if (PlaneHelper.ClassifyPoint(ref point, ref this.planes[i]) > 0)
float classifyPoint = (
(point.X * planes[i].Normal.X) +
(point.Y * planes[i].Normal.Y) +
(point.Z * planes[i].Normal.Z) +
planes[i].D
);
if (classifyPoint > 0)
{
result = ContainmentType.Disjoint;
return;
Expand Down
2 changes: 1 addition & 1 deletion MonoGame.Framework/Color.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1879,7 +1879,7 @@ public override string ToString()
#endregion
}

#region XNAColorConverter Class
#region Color TypeConverter

public class XNAColorConverter : TypeConverter
{
Expand Down
14 changes: 8 additions & 6 deletions MonoGame.Framework/MathHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,11 @@ float amount
double amountCubed = amountSquared * amount;
return (float) (
0.5 *
(2.0 * value2 + (value3 - value1) * amount +
(2.0 * value1 - 5.0 * value2 + 4.0 * value3 - value4) * amountSquared +
(3.0 * value2 - value1 - 3.0 * value3 + value4) * amountCubed)
(
((2.0 * value2 + (value3 - value1) * amount) +
((2.0 * value1 - 5.0 * value2 + 4.0 * value3 - value4) * amountSquared) +
(3.0 * value2 - value1 - 3.0 * value3 + value4) * amountCubed)
)
);
}

Expand Down Expand Up @@ -241,9 +243,9 @@ float amount
else
{
result = (
(2 * v1 - 2 * v2 + t2 + t1) * sCubed +
(3 * v2 - 3 * v1 - 2 * t1 - t2) * sSquared +
t1 * s +
((2 * v1 - 2 * v2 + t2 + t1) * sCubed) +
((3 * v2 - 3 * v1 - 2 * t1 - t2) * sSquared) +
(t1 * s) +
v1
);
}
Expand Down

0 comments on commit 24f1eb3

Please sign in to comment.