Skip to content

Commit 290a484

Browse files
committed
task: bump FixedMathSharp to v6
1 parent 913062b commit 290a484

20 files changed

Lines changed: 2037 additions & 829 deletions

‎.assets/unity-package-versions.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"packageRoot": ".",
3-
"packageVersion": "5.0.5",
3+
"packageVersion": "6.0.0",
44
"dependencyVersions": {},
55
"packages": [
66
{

‎Build/Base/Runtime/Extensions/FixedBounds.Extensions.cs‎

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,48 +23,34 @@ public static class FixedBoundsUnityExtensions
2323
/// <param name="boundingBox">The BoundingBox to convert.</param>
2424
/// <returns>A Unity Bounds with equivalent minimum and maximum corners.</returns>
2525
[MethodImpl(MethodImplOptions.AggressiveInlining)]
26-
public static UnityBounds ToBounds(this FixedBoundBox boundingBox)
27-
{
28-
UnityBounds bounds = new UnityBounds();
29-
bounds.SetMinMax(boundingBox.Min.ToVector3(), boundingBox.Max.ToVector3());
30-
return bounds;
31-
}
26+
public static UnityBounds ToBounds(this FixedBoundBox boundingBox) =>
27+
new(boundingBox.Center.ToVector3(), boundingBox.Proportions.ToVector3());
3228

3329
/// <summary>
3430
/// Converts a FixedMathSharp BoundingArea into Unity Bounds.
3531
/// </summary>
3632
/// <param name="boundingArea">The BoundingArea to convert.</param>
3733
/// <returns>A Unity Bounds with equivalent minimum and maximum corners.</returns>
3834
[MethodImpl(MethodImplOptions.AggressiveInlining)]
39-
public static UnityBounds ToBounds(this FixedBoundArea boundingArea)
40-
{
41-
UnityBounds bounds = new UnityBounds();
42-
bounds.SetMinMax(boundingArea.Min.ToVector3(), boundingArea.Max.ToVector3());
43-
return bounds;
44-
}
35+
public static UnityBounds ToBounds(this FixedBoundArea boundingArea) =>
36+
new(boundingArea.Center.ToVector3(), boundingArea.Size.ToVector3());
4537

4638
/// <summary>
4739
/// Converts Unity Bounds into a FixedMathSharp BoundingBox.
4840
/// </summary>
4941
/// <param name="bounds">The Unity Bounds to convert.</param>
5042
/// <returns>A FixedBoundBox with equivalent minimum and maximum corners.</returns>
5143
[MethodImpl(MethodImplOptions.AggressiveInlining)]
52-
public static FixedBoundBox ToBoundingBox(this UnityBounds bounds)
53-
{
54-
FixedBoundBox boundingBox = default;
55-
boundingBox.SetMinMax(bounds.min.ToVector3d(), bounds.max.ToVector3d());
56-
return boundingBox;
57-
}
44+
public static FixedBoundBox ToBoundingBox(this UnityBounds bounds) =>
45+
FixedBoundBox.FromMinMax(bounds.min.ToVector3d(), bounds.max.ToVector3d());
5846

5947
/// <summary>
6048
/// Converts Unity Bounds into a FixedMathSharp BoundingArea.
6149
/// </summary>
6250
/// <param name="bounds">The Unity Bounds to convert.</param>
6351
/// <returns>A FixedBoundArea with equivalent minimum and maximum corners.</returns>
6452
[MethodImpl(MethodImplOptions.AggressiveInlining)]
65-
public static FixedBoundArea ToBoundingArea(this UnityBounds bounds)
66-
{
67-
return new FixedBoundArea(bounds.min.ToVector3d(), bounds.max.ToVector3d());
68-
}
53+
public static FixedBoundArea ToBoundingArea(this UnityBounds bounds) =>
54+
FixedBoundArea.FromMinMax(bounds.min.ToVector2d(), bounds.max.ToVector2d());
6955
}
7056
}
11.5 KB
Binary file not shown.
5.32 KB
Binary file not shown.

‎com.mrdav30.fixedmathsharp.lean/Plugins/FixedMathSharp.xml‎

Lines changed: 978 additions & 384 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.

‎com.mrdav30.fixedmathsharp.lean/Runtime/Extensions/FixedBounds.Extensions.cs‎

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,48 +23,34 @@ public static class FixedBoundsUnityExtensions
2323
/// <param name="boundingBox">The BoundingBox to convert.</param>
2424
/// <returns>A Unity Bounds with equivalent minimum and maximum corners.</returns>
2525
[MethodImpl(MethodImplOptions.AggressiveInlining)]
26-
public static UnityBounds ToBounds(this FixedBoundBox boundingBox)
27-
{
28-
UnityBounds bounds = new UnityBounds();
29-
bounds.SetMinMax(boundingBox.Min.ToVector3(), boundingBox.Max.ToVector3());
30-
return bounds;
31-
}
26+
public static UnityBounds ToBounds(this FixedBoundBox boundingBox) =>
27+
new(boundingBox.Center.ToVector3(), boundingBox.Proportions.ToVector3());
3228

3329
/// <summary>
3430
/// Converts a FixedMathSharp BoundingArea into Unity Bounds.
3531
/// </summary>
3632
/// <param name="boundingArea">The BoundingArea to convert.</param>
3733
/// <returns>A Unity Bounds with equivalent minimum and maximum corners.</returns>
3834
[MethodImpl(MethodImplOptions.AggressiveInlining)]
39-
public static UnityBounds ToBounds(this FixedBoundArea boundingArea)
40-
{
41-
UnityBounds bounds = new UnityBounds();
42-
bounds.SetMinMax(boundingArea.Min.ToVector3(), boundingArea.Max.ToVector3());
43-
return bounds;
44-
}
35+
public static UnityBounds ToBounds(this FixedBoundArea boundingArea) =>
36+
new(boundingArea.Center.ToVector3(), boundingArea.Size.ToVector3());
4537

4638
/// <summary>
4739
/// Converts Unity Bounds into a FixedMathSharp BoundingBox.
4840
/// </summary>
4941
/// <param name="bounds">The Unity Bounds to convert.</param>
5042
/// <returns>A FixedBoundBox with equivalent minimum and maximum corners.</returns>
5143
[MethodImpl(MethodImplOptions.AggressiveInlining)]
52-
public static FixedBoundBox ToBoundingBox(this UnityBounds bounds)
53-
{
54-
FixedBoundBox boundingBox = default;
55-
boundingBox.SetMinMax(bounds.min.ToVector3d(), bounds.max.ToVector3d());
56-
return boundingBox;
57-
}
44+
public static FixedBoundBox ToBoundingBox(this UnityBounds bounds) =>
45+
FixedBoundBox.FromMinMax(bounds.min.ToVector3d(), bounds.max.ToVector3d());
5846

5947
/// <summary>
6048
/// Converts Unity Bounds into a FixedMathSharp BoundingArea.
6149
/// </summary>
6250
/// <param name="bounds">The Unity Bounds to convert.</param>
6351
/// <returns>A FixedBoundArea with equivalent minimum and maximum corners.</returns>
6452
[MethodImpl(MethodImplOptions.AggressiveInlining)]
65-
public static FixedBoundArea ToBoundingArea(this UnityBounds bounds)
66-
{
67-
return new FixedBoundArea(bounds.min.ToVector3d(), bounds.max.ToVector3d());
68-
}
53+
public static FixedBoundArea ToBoundingArea(this UnityBounds bounds) =>
54+
FixedBoundArea.FromMinMax(bounds.min.ToVector2d(), bounds.max.ToVector2d());
6955
}
7056
}

0 commit comments

Comments
 (0)