Skip to content

Commit 681f214

Browse files
committed
Assume MathF.
1 parent 7ea4b10 commit 681f214

2 files changed

Lines changed: 0 additions & 56 deletions

File tree

sources/Maths/Maths/Matrix3X2.Ops.cs

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ namespace Silk.NET.Maths
1010
/// </summary>
1111
public static partial class Matrix3X2
1212
{
13-
#if MATHF
1413
private const float RotationEpsilon = 0.001f * MathF.PI / 180f; // 0.1% of a degree
15-
#else
16-
private const float RotationEpsilon = 0.001f * ((float) Math.PI) / 180f; // 0.1% of a degree
17-
#endif
1814

1915
/// <summary>Creates a rotation matrix using the given rotation in radians.</summary>
2016
/// <param name="radians">The amount of rotation, in radians.</param>
@@ -33,53 +29,29 @@ public static Matrix3X2<T> CreateRotation<T>(T radians)
3329
s = T.Zero;
3430
}
3531
else if ((radians > T.CreateTruncating(
36-
#if MATHF
3732
MathF.PI
38-
#else
39-
((float) Math.PI)
40-
#endif
4133
/ 2 - RotationEpsilon)) && !(radians >= T.CreateTruncating(
42-
#if MATHF
4334
MathF.PI
44-
#else
45-
((float) Math.PI)
46-
#endif
4735
/ 2 + RotationEpsilon)))
4836
{
4937
// Exact case for 90 degree rotation.
5038
c = T.Zero;
5139
s = T.One;
5240
}
5341
else if (!(radians >= T.CreateTruncating(-
54-
#if MATHF
5542
MathF.PI
56-
#else
57-
((float) Math.PI)
58-
#endif
5943
+ RotationEpsilon)) || (radians > T.CreateTruncating(
60-
#if MATHF
6144
MathF.PI
62-
#else
63-
((float) Math.PI)
64-
#endif
6545
- RotationEpsilon)))
6646
{
6747
// Exact case for 180 degree rotation.
6848
c = -T.One;
6949
s = T.Zero;
7050
}
7151
else if ((radians > T.CreateTruncating(-
72-
#if MATHF
7352
MathF.PI
74-
#else
75-
((float) Math.PI)
76-
#endif
7753
/ 2 - RotationEpsilon)) && !(radians >= T.CreateTruncating(-
78-
#if MATHF
7954
MathF.PI
80-
#else
81-
((float) Math.PI)
82-
#endif
8355
/ 2 + RotationEpsilon)))
8456
{
8557
// Exact case for 270 degree rotation.
@@ -124,53 +96,29 @@ public static Matrix3X2<T> CreateRotation<T>(T radians, Vector2D<T> centerPoint)
12496
s = T.Zero;
12597
}
12698
else if ((radians > T.CreateTruncating(
127-
#if MATHF
12899
MathF.PI
129-
#else
130-
((float) Math.PI)
131-
#endif
132100
/ 2 - RotationEpsilon)) && !(radians >= T.CreateTruncating(
133-
#if MATHF
134101
MathF.PI
135-
#else
136-
((float) Math.PI)
137-
#endif
138102
/ 2 + RotationEpsilon)))
139103
{
140104
// Exact case for 90 degree rotation.
141105
c = T.Zero;
142106
s = T.One;
143107
}
144108
else if (!(radians >= T.CreateTruncating(-
145-
#if MATHF
146109
MathF.PI
147-
#else
148-
((float) Math.PI)
149-
#endif
150110
+ RotationEpsilon)) || (radians > T.CreateTruncating(
151-
#if MATHF
152111
MathF.PI
153-
#else
154-
((float) Math.PI)
155-
#endif
156112
- RotationEpsilon)))
157113
{
158114
// Exact case for 180 degree rotation.
159115
c = -T.One;
160116
s = T.Zero;
161117
}
162118
else if ((radians > T.CreateTruncating(-
163-
#if MATHF
164119
MathF.PI
165-
#else
166-
((float) Math.PI)
167-
#endif
168120
/ 2 - RotationEpsilon)) && !(radians >= T.CreateTruncating(-
169-
#if MATHF
170121
MathF.PI
171-
#else
172-
((float) Math.PI)
173-
#endif
174122
/ 2 + RotationEpsilon)))
175123
{
176124
// Exact case for 270 degree rotation.

sources/Maths/Maths/Matrix4X4.Ops.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ namespace Silk.NET.Maths
1212
public static partial class Matrix4X4
1313
{
1414
private const float BillboardEpsilon = 1e-4f;
15-
#if MATHF
1615
private const float BillboardMinAngle = 1.0f - (0.1f * (MathF.PI / 180.0f)); // 0.1 degrees
17-
#else
18-
private const float BillboardMinAngle = 1.0f - (0.1f * (((float) Math.PI) / 180.0f)); // 0.1 degrees
19-
#endif
2016
private const float DecomposeEpsilon = 0.0001f;
2117

2218
/// <summary>Creates a spherical billboard that rotates around a specified object position.</summary>

0 commit comments

Comments
 (0)