You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+36-6Lines changed: 36 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ Ideal for simulations, games, and physics engines requiring reliable arithmetic
24
24
-**Bounding Shapes:** Includes `IBound` structs `BoundingBox`, `BoundingSphere`, and `BoundingArea` for lightweight spatial calculations.
25
25
-**Advanced Math Functions:** Includes trigonometry and common math utilities.
26
26
-**Framework Agnostic:** Works with **.NET, Unity, and other game engines**.
27
-
-**Full Serialization Support:**Out-of-the-box round-trip serialization via `MemoryPack` across all serializable structs, with `System.Text.Json` constructor support on .NET 8+.
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.
28
28
29
29
---
30
30
@@ -34,33 +34,63 @@ Clone the repository and add it to your project:
34
34
35
35
### Non-Unity Projects
36
36
37
-
1.**Install via NuGet**:
38
-
- Add FixedMathSharp to your project using the following command:
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:
39
43
40
44
```bash
41
45
dotnet add package FixedMathSharp
42
46
```
43
47
48
+
- No-MemoryPack package:
49
+
50
+
```bash
51
+
dotnet add package FixedMathSharp.NoMemoryPack
52
+
```
53
+
44
54
- If you're using `FluentAssertions` in your test project, the companion assertions package is available here:
- Include the FixedMathSharp project or its DLLs in your build process.
57
67
68
+
### Package Variants
69
+
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.
78
+
79
+
If you build from source, the repository also provides matching release configurations:
80
+
81
+
- `Release` builds the standard `FixedMathSharp` package and archives.
82
+
- `ReleaseNoMemoryPack` builds the `FixedMathSharp.NoMemoryPack` package and archives.
83
+
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.
85
+
58
86
### Unity Integration
59
87
60
-
FixedMathSharp is now maintained as a separate Unity package.For Unity-specific implementations, refer to:
88
+
FixedMathSharp is now maintained as a separate Unity package.For Unity-specific implementations, refer to:
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`.
0 commit comments