Skip to content

Commit 1bec7da

Browse files
committed
chore: repo maintenace
- updated README - cleaned up build script - bumped workflow actions
1 parent 5bdb309 commit 1bec7da

4 files changed

Lines changed: 70 additions & 89 deletions

File tree

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
param (
2-
[string]$BuildType = "Release"
3-
)
4-
51
# Import shared functions
62
Set-Location (Split-Path $MyInvocation.MyCommand.Path)
73
. .\utilities.ps1
@@ -28,30 +24,31 @@ foreach ($config in $configurations) {
2824
# Determine archive label suffix (lowercase, hyphen-separated)
2925
$configLabel = $config.ToLower() -replace "release", "release" # keeps "release" / "releasenomemorypack"
3026

31-
if (Test-Path $releaseDir) {
32-
Get-ChildItem -Path $releaseDir -Directory | ForEach-Object {
33-
$targetDir = $_.FullName
34-
$frameworkName = $_.Name
27+
if (-not (Test-Path $releaseDir)) {
28+
Write-Warning "Release directory not found for configuration '$config': $releaseDir"
29+
continue
30+
}
31+
32+
Get-ChildItem -Path $releaseDir -Directory | ForEach-Object {
33+
$targetDir = $_.FullName
34+
$frameworkName = $_.Name
3535

36-
# Construct final archive name
37-
$zipFileName = "${solutionName}-v$($Env:GitVersion_FullSemVer)-${frameworkName}-${configLabel}.zip"
38-
$zipPath = Join-Path $releaseDir $zipFileName
36+
# Construct final archive name
37+
$zipFileName = "${solutionName}-v$($Env:GitVersion_FullSemVer)-${frameworkName}-${configLabel}.zip"
38+
$zipPath = Join-Path $releaseDir $zipFileName
3939

40-
Write-Host "Creating archive: $zipPath"
40+
Write-Host "Creating archive: $zipPath"
4141

42-
if (Test-Path $zipPath) {
43-
Remove-Item $zipPath -Force
44-
}
42+
if (Test-Path $zipPath) {
43+
Remove-Item $zipPath -Force
44+
}
4545

46-
Compress-Archive -Path "$targetDir\*" -DestinationPath $zipPath -Force
46+
Compress-Archive -Path "$targetDir\*" -DestinationPath $zipPath -Force
4747

48-
if (Test-Path $zipPath) {
49-
Write-Host "Archive created for $frameworkName ($config)"
50-
} else {
51-
Write-Warning "Failed to create archive for $frameworkName ($config)"
52-
}
53-
}
54-
} else {
55-
Write-Warning "Release directory not found for configuration '$config': $releaseDir"
56-
}
48+
if (Test-Path $zipPath) {
49+
Write-Host "Archive created for $frameworkName ($config)"
50+
} else {
51+
Write-Warning "Failed to create archive for $frameworkName ($config)"
52+
}
53+
}
5754
}

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
run: cat artifacts/coverage-report/SummaryGithub.md >> "$GITHUB_STEP_SUMMARY"
6666

6767
- name: Upload coverage artifact
68-
uses: actions/upload-artifact@v4
68+
uses: actions/upload-artifact@v7
6969
with:
7070
name: coverage-report
7171
path: artifacts/coverage-report

.github/workflows/github-release-to-discord.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- name: Checkout
10-
uses: actions/checkout@v3
10+
uses: actions/checkout@v6
1111
- name: GitHub Releases to Discord
1212
uses: SethCohen/github-releases-to-discord@v1
1313
with:

README.md

Lines changed: 46 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -9,87 +9,73 @@
99
[![License](https://img.shields.io/github/license/mrdav30/FixedMathSharp.svg)](https://github.com/mrdav30/FixedMathSharp/blob/main/LICENSE)
1010
[![Frameworks](https://img.shields.io/badge/frameworks-netstandard2.1%20%7C%20net8.0-512BD4.svg)](https://github.com/mrdav30/FixedMathSharp)
1111

12-
**A high-precision, deterministic fixed-point math library for .NET.**
13-
Ideal for simulations, games, and physics engines requiring reliable arithmetic without floating-point inaccuracies.
12+
**A deterministic fixed-point math library for .NET.**
13+
Built for simulations, games, and physics-heavy code that needs reliable results without floating-point drift.
1414

1515
---
1616

1717
## 🛠️ Key Features
1818

19-
- **Deterministic Calculations:** Ensures consistent results across different platforms.
20-
- **High Precision Arithmetic:** Uses fixed-point math to eliminate floating-point inaccuracies.
21-
- **Comprehensive Vector Support:** Includes 2D and 3D vector operations (`Vector2d`, `Vector3d`).
22-
- **Quaternion Rotations:** Leverage `FixedQuaternion` for smooth rotations without gimbal lock.
23-
- **Matrix Operations:** Supports transformations with `Fixed4x4` and `Fixed3x3` matrices.
24-
- **Bounding Shapes:** Includes `IBound` structs `BoundingBox`, `BoundingSphere`, and `BoundingArea` for lightweight spatial calculations.
25-
- **Advanced Math Functions:** Includes trigonometry and common math utilities.
26-
- **Framework Agnostic:** Works with **.NET, Unity, and other game engines**.
27-
- **Flexible Serialization Options:** The default build includes out-of-the-box `MemoryPack` support across serializable structs, and a `NoMemoryPack` variant is available for projects that need to avoid the MemoryPack dependency.
19+
- **Deterministic fixed-point arithmetic:** Consistent results across platforms with `Fixed64`.
20+
- **Core math types included:** `Vector2d`, `Vector3d`, `FixedQuaternion`, `Fixed3x3`, and `Fixed4x4`.
21+
- **Spatial helpers:** `BoundingBox`, `BoundingSphere`, and `BoundingArea` for lightweight bounds checks.
22+
- **Shared math utilities:** Common math and trigonometry helpers via `FixedMath` and `FixedTrigonometry`.
23+
- **Deterministic RNG:** `DeterministicRandom` for repeatable procedural generation and simulations.
24+
- **Flexible packaging:** Use the default package with `MemoryPack`, or the `NoMemoryPack` package when you want the same API without that dependency.
25+
- **Broad .NET compatibility:** Targets modern .NET while remaining friendly to engine and tooling workflows.
2826

2927
---
3028

3129
## 🚀 Installation
3230

33-
Clone the repository and add it to your project:
31+
For most .NET projects, start with the standard package:
3432

35-
### Non-Unity Projects
36-
37-
1. **Choose the package that fits your runtime**:
38-
- Use `FixedMathSharp` if you want the standard package with built-in `MemoryPack` support.
39-
- Use `FixedMathSharp.NoMemoryPack` if you want the same math library without the `MemoryPack` dependency, such as when integrating with toolchains that do better without MemoryPack-generated code.
40-
41-
2. **Install via NuGet**:
42-
- Standard package:
33+
```bash
34+
dotnet add package FixedMathSharp
35+
```
4336

44-
```bash
45-
dotnet add package FixedMathSharp
46-
```
37+
### Non-Unity Projects
4738

48-
- No-MemoryPack package:
39+
Choose the package that fits your runtime:
4940

50-
```bash
51-
dotnet add package FixedMathSharp.NoMemoryPack
52-
```
41+
| Package | Best for | Install |
42+
| --- | --- | --- |
43+
| `FixedMathSharp` | Most .NET applications. Includes built-in `MemoryPack` support. | `dotnet add package FixedMathSharp` |
44+
| `FixedMathSharp.NoMemoryPack` | Projects that want the same math API without a `MemoryPack` dependency, including custom serializer setups and Burst AOT-sensitive workflows. | `dotnet add package FixedMathSharp.NoMemoryPack` |
5345

54-
- If you're using `FluentAssertions` in your test project, the companion assertions package is available here:
55-
[FixedMathSharp.FluentAssertions](https://www.nuget.org/packages/FixedMathSharp.FluentAssertions)
46+
If you're using `FluentAssertions` in your test project, the companion assertions package is available here:
47+
[FixedMathSharp.FluentAssertions](https://www.nuget.org/packages/FixedMathSharp.FluentAssertions)
5648

57-
3. **Or Download/Clone**:
58-
- Clone the repository or download the source code.
49+
### Build From Source
5950

60-
```bash
61-
git clone https://github.com/mrdav30/FixedMathSharp.git
62-
```
51+
Clone the repository and build locally:
6352

64-
4. **Add to Project**:
53+
```bash
54+
git clone https://github.com/mrdav30/FixedMathSharp.git
55+
dotnet restore
56+
dotnet build --configuration Debug --no-restore
57+
```
6558

66-
- Include the FixedMathSharp project or its DLLs in your build process.
59+
You can also reference the project directly or consume the generated package artifacts in your own build process.
6760

6861
### Package Variants
6962

70-
FixedMathSharp is published in two build variants so you can choose between convenience and maximum compatibility:
71-
72-
- `FixedMathSharp`
73-
Includes `MemoryPack` and its generated serialization support. This is the best default choice for most .NET applications.
74-
- `FixedMathSharp.NoMemoryPack`
75-
Excludes the `MemoryPack` package and uses internal shim attributes so the same source can compile without the dependency. Choose this when you do not need built-in MemoryPack serialization, when you prefer to use a different serializer, or when your target environment is sensitive to MemoryPack-generated code paths.
76-
77-
Both variants expose the same core fixed-point math API. The main difference is whether `MemoryPack` is part of the package and serialization surface.
63+
The published NuGet packages map directly to the source-build configurations below.
7864

7965
If you build from source, the repository also provides matching release configurations:
8066

8167
- `Release` builds the standard `FixedMathSharp` package and archives.
8268
- `ReleaseNoMemoryPack` builds the `FixedMathSharp.NoMemoryPack` package and archives.
8369

84-
If you use Unity Burst AOT, prefer the `NoMemoryPack` build. `MemoryPack`'s Unity support is centered on IL2CPP via its .NET Source Generator path, so the no-MemoryPack variant is the safer choice for Burst AOT scenarios.
70+
If you use Unity Burst AOT, prefer the `NoMemoryPack` variant.
8571

8672
### Unity Integration
8773

88-
FixedMathSharp is now maintained as a separate Unity package. For Unity-specific implementations, refer to:
74+
FixedMathSharp is maintained as a separate Unity package. For Unity-specific implementations, refer to:
8975

9076
🔗 [FixedMathSharp-Unity Repository](https://github.com/mrdav30/FixedMathSharp-Unity).
9177

92-
If you are evaluating the .NET package directly for Unity-adjacent tooling, the `NoMemoryPack` variant is the safer starting point when you want to avoid the MemoryPack dependency entirely. In particular, if you use Burst AOT, prefer `FixedMathSharp.NoMemoryPack`.
78+
If you are evaluating this .NET package for Unity-adjacent tooling using Burst AOT, prefer `FixedMathSharp.NoMemoryPack`.
9379

9480
---
9581

@@ -180,40 +166,38 @@ int loot = rngOre.Next(1, 5); // [1,5)
180166

181167
## 📦 Library Structure
182168

183-
- **`Fixed64` Struct:** Represents fixed-point numbers for precise arithmetic.
184-
- **`Vector2d` and `Vector3d` Structs:** Handle 2D and 3D vector operations.
185-
- **`FixedQuaternion` Struct:** Provides rotation handling without gimbal lock, enabling smooth rotations and quaternion-based transformations.
186-
- **`IBound` Interface:** Standard interface for bounding shapes `BoundingBox`, `BoundingArea`, and `BoundingSphere`, each offering intersection, containment, and projection logic.
187-
- **`FixedMath` Static Class:** Provides common math and trigonometric functions using fixed-point math.
188-
- **`Fixed4x4` and `Fixed3x3`:** Support matrix operations for transformations.
189-
- **`DeterministicRandom` Struct:** Seedable, allocation-free RNG for repeatable procedural generation.
169+
- **`Fixed64` Struct:** Core Q32.32 fixed-point scalar type.
170+
- **`Vector2d` and `Vector3d` Structs:** 2D and 3D vector math.
171+
- **`FixedQuaternion` Struct:** Deterministic quaternion rotations.
172+
- **`Fixed4x4` and `Fixed3x3`:** Matrix math for transforms and orientation.
173+
- **`IBound` Interface and bounds types:** `BoundingBox`, `BoundingArea`, and `BoundingSphere` for intersection, containment, and projection queries.
174+
- **`FixedMath` and `FixedTrigonometry`:** Shared numeric and trigonometric helpers.
175+
- **`DeterministicRandom` Struct:** Seedable, allocation-free RNG for repeatable procedural generation.
190176

191177
### Fixed64 Struct
192178

193-
**Fixed64** is the core data type representing fixed-point numbers. It provides various mathematical operations, including addition, subtraction, multiplication, division, and more.
194-
The struct guarantees deterministic behavior by using integer-based arithmetic with a configurable `SHIFT_AMOUNT`.
179+
`Fixed64` is the center of the library: a deterministic fixed-point number type backed by integer arithmetic. It is the type used throughout the vector, matrix, quaternion, bounds, and helper APIs.
195180

196181
---
197182

198183
## ⚡ Performance Considerations
199184

200185
FixedMathSharp is optimized for high-performance deterministic calculations:
201186

202-
- **Inline methods and bit-shifting optimizations** ensure minimal overhead.
203-
- **Eliminates floating-point drift**, making it ideal for lockstep simulations.
204-
- **Supports fuzzy equality comparisons** for handling minor precision deviations.
187+
- **Inline methods and bit-shifting optimizations** keep hot paths lightweight.
188+
- **Deterministic arithmetic** avoids floating-point drift in lockstep or replay-driven systems.
189+
- **Fuzzy equality helpers** are available where precision tolerances are useful.
205190

206191
---
207192

208193
## 🧪 Testing and Validation
209194

210-
Unit tests are used extensively to validate the correctness of mathematical operations.
211-
Special **fuzzy comparisons** are employed where small precision discrepancies might occur, mimicking floating-point behavior.
195+
The library is covered by xUnit tests for core arithmetic, vectors, bounds, serialization, and deterministic random behavior. Fuzzy comparisons are used where a tolerance-based check is more appropriate than exact equality.
212196

213197
To run the tests:
214198

215199
```bash
216-
dotnet test --configuration debug
200+
dotnet test --configuration Debug
217201
```
218202

219203
---

0 commit comments

Comments
 (0)