Skip to content

Commit 4bceb92

Browse files
committed
Merge branch 'develop' of https://github.com/mrdav30/FixedMathSharp into develop
2 parents 329a113 + 600e379 commit 4bceb92

7 files changed

Lines changed: 11 additions & 22 deletions

File tree

AGENTS.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@
88

99
## Build and test workflows
1010
- Solution: `FixedMathSharp.sln` with library project and test project.
11-
- Target frameworks are multi-targeted in both projects: `net48;net8`.
11+
- Target frameworks are configured in the respective `.csproj` files; `net8.0` is the primary TFM.
1212
- Typical local workflow:
1313
- `dotnet restore`
1414
- `dotnet build --configuration Debug --no-restore`
1515
- `dotnet test --configuration Debug`
1616
- CI detail from `.github/workflows/dotnet.yml`:
17-
- Linux runs `net48` tests via Mono + `xunit.console.exe` and `net8` via `dotnet test -f net8`.
18-
- Windows runs `dotnet test` for both TFMs.
17+
- Linux and Windows both run `dotnet test` against the supported TFMs (with `net8.0` as the primary test target).
18+
- Refer to the workflow file for the exact matrix of OS/TFM combinations.
1919
- Packaging/versioning comes from `src/FixedMathSharp/FixedMathSharp.csproj`: GitVersion variables are consumed when present, otherwise version falls back to `0.0.0`.
2020

2121
## Code conventions specific to this repo
2222
- Prefer `Fixed64` constants (`Fixed64.Zero`, `Fixed64.One`, `FixedMath.PI`) over primitive literals in math-heavy code.
2323
- Preserve saturating/guarded semantics in operators and math helpers (for example `Fixed64` add/sub overflow behavior).
2424
- When touching bounds logic, maintain cross-type dispatch shape in `Intersects(IBound)` and shared clamping projection via `IBoundExtensions.ProjectPointWithinBounds`.
25-
- Serialization compatibility is intentional:
26-
- MessagePack attributes on serializable structs (`[MessagePackObject]`, `[Key]`) across TFMs.
27-
- Conditional serializers in tests (`BinaryFormatter` for `NET48`, `System.Text.Json` for `NET8`).
25+
- Serialization compatibility is intentional and now uses MemoryPack:
26+
- MemoryPack attributes on serializable structs (for example `[MemoryPackable]`, `[MemoryPackInclude]`) are the source of truth for serialized layouts.
27+
- Tests use MemoryPack-based roundtrips (and `System.Text.Json` where appropriate) instead of legacy `MessagePack`/`BinaryFormatter` serializers.
2828
- `ThreadLocalRandom` is marked `[Obsolete]`; new deterministic RNG work should prefer `DeterministicRandom` and `DeterministicRandom.FromWorldFeature(...)` in `src/FixedMathSharp/Utility/DeterministicRandom.cs`.
2929

3030
## Testing patterns to mirror

src/FixedMathSharp/Bounds/BoundingArea.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ public bool Intersects(IBound other)
209209

210210
default: return false; // Default case for unknown or unsupported types
211211
}
212-
;
213212
}
214213

215214
/// <summary>

src/FixedMathSharp/Bounds/BoundingBox.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public partial struct BoundingBox : IBound, IEquatable<BoundingBox>
3939
public Vector3d Max { get; private set; }
4040

4141
/// <summary>
42-
///
42+
/// Serialization/compatibility version of this <see cref="BoundingBox"/> instance.
4343
/// </summary>
4444
[MemoryPackOrder(2)]
4545
public byte Version { get; private set; }
@@ -238,7 +238,6 @@ public bool Intersects(IBound other)
238238
default:
239239
return false; // Default case for unknown or unsupported types
240240
}
241-
;
242241
}
243242

244243
/// <summary>

src/FixedMathSharp/Bounds/BoundingSphere.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ public bool Intersects(IBound other)
108108

109109
default: return false; // Default case for unknown or unsupported types
110110
}
111-
;
112111
}
113112

114113
/// <summary>

src/FixedMathSharp/FixedMathSharp.csproj

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<!-- Define the target framework and compatibility -->
55
<LangVersion>11.0</LangVersion>
6-
<TargetFrameworks>netstandard2.1;net8</TargetFrameworks>
6+
<TargetFrameworks>netstandard2.1;net8.0</TargetFrameworks>
77
<!-- Versioning and Build Configuration -->
88
<!-- Set SemVer to GitVersion_FullSemVer if available, otherwise fallback to 0.0.0 -->
99
<SemVer Condition="'$(GitVersion_FullSemVer)' != ''">$(GitVersion_FullSemVer)</SemVer>
@@ -68,10 +68,6 @@
6868
<!-- Dependencies and Package References -->
6969
<ItemGroup>
7070
<PackageReference Include="MemoryPack" Version="1.21.4" />
71-
<PackageReference Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'" Include="Microsoft.NETFramework.ReferenceAssemblies.net48" Version="1.0.3">
72-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
73-
<PrivateAssets>all</PrivateAssets>
74-
</PackageReference>
7571
</ItemGroup>
7672
<!-- Ensure LICENSE, README, & icon files are included in the NuGet package -->
7773
<ItemGroup>

src/FixedMathSharp/Numerics/FixedQuaternion.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ public static FixedQuaternion FromAxisAngle(Vector3d axis, Fixed64 angle)
372372

373373
// Check if the angle is in a valid range (-pi, pi)
374374
if (angle < -FixedMath.PI || angle > FixedMath.PI)
375-
throw new ArgumentOutOfRangeException($"Angle must be in the range ({-FixedMath.PI}, {FixedMath.PI}), but was {angle}");
375+
throw new ArgumentOutOfRangeException(nameof(angle), angle, $"Angle must be in the range ({-FixedMath.PI}, {FixedMath.PI}), but was {angle}");
376376

377377
Fixed64 halfAngle = angle / Fixed64.Two; // Half-angle formula
378378
Fixed64 sinHalfAngle = FixedMath.Sin(halfAngle);
@@ -412,7 +412,7 @@ public static FixedQuaternion FromEulerAngles(Fixed64 pitch, Fixed64 yaw, Fixed6
412412
yaw < -FixedMath.PI || yaw > FixedMath.PI ||
413413
roll < -FixedMath.PI || roll > FixedMath.PI)
414414
{
415-
throw new ArgumentOutOfRangeException($"Euler angles must be in the range ({-FixedMath.PI}, {FixedMath.PI}), but were ({pitch}, {yaw}, {roll})");
415+
throw new ArgumentOutOfRangeException(nameof(pitch), $"Euler angles must be in the range ({-FixedMath.PI}, {FixedMath.PI}), but were ({pitch}, {yaw}, {roll})");
416416
}
417417

418418
Fixed64 c1 = FixedMath.Cos(yaw / Fixed64.Two);

tests/FixedMathSharp.Tests/FixedMathSharp.Tests.csproj

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<LangVersion>11.0</LangVersion>
4-
<TargetFrameworks>net8</TargetFrameworks>
4+
<TargetFrameworks>net8.0</TargetFrameworks>
55
<ImplicitUsings>disable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<IsPackable>false</IsPackable>
@@ -16,10 +16,6 @@
1616
<PrivateAssets>all</PrivateAssets>
1717
</ProjectReference>
1818
<PackageReference Include="MemoryPack" Version="1.21.4" />
19-
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net48" Version="1.0.3">
20-
<PrivateAssets>all</PrivateAssets>
21-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
22-
</PackageReference>
2319
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
2420
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
2521
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

0 commit comments

Comments
 (0)