Skip to content

Releases: mrdav30/FixedMathSharp

FixedMathSharp v7.1.0

Choose a tag to compare

@mrdav30 mrdav30 released this 23 Aug 21:31

This release expands FixedMathSharp’s exact, allocation-conscious geometry toolkit with new segment and swept-volume queries.

What’s new

  • Added strict swept upright-cylinder intersection testing against rotated convex prisms, including full fixed-point-domain and boundary-only contact handling.
  • Added exact minimum-distance threshold comparisons for finite 2D segments.
  • Added conservative capsule-intersection parameter enclosures with deterministic outward rounding.
  • Added exact finite 3D segment point containment.
  • Added conservative unique-intersection parameter enclosures clamped to the complete [0, 1] segment domain.

FixedMathSharp v7.0.0 — Full-Domain Determinism

Choose a tag to compare

@mrdav30 mrdav30 released this 04 Aug 20:58

FixedMathSharp v7 is a major deterministic-contract hardening release. It makes
local and world transform intent explicit, carries exact fixed-width
intermediates through critical arithmetic and geometry decisions, and expands
the library's engine-neutral collision/query surface across the full Q32.32
domain.

Important

This release contains source-breaking and result-breaking
changes. Division, normalization, trigonometry, transforms, bounds, and
geometry queries can produce different raw values than v6. Version or
regenerate deterministic replays, hashes, and golden results after migrating.

Highlights

  • Full-domain arithmetic: division now rounds exact midpoints to even; new
    exact TryAdd/TrySubtract APIs and fused multiply-add/multiply-divide paths
    avoid premature saturation and intermediate rounding.
  • Explicit transform hierarchy: FixedTransform now owns authoritative
    local TRS state with derived world views, named reparenting semantics,
    cycle-rejecting reparenting, atomic world-space updates, strict matrix import,
    and full-domain point conversion.
  • Hardened vectors, rotations, and matrices: magnitude, normalization,
    projection, trigonometry, quaternion construction, scale extraction, and TRS
    decomposition now behave consistently at tiny, extreme, reflected, and
    near-degenerate inputs.
  • Expanded exact geometry: bounds and primitives now share
    FixedMathSharp.Geometry; v7 adds canonical FixedOrientedBox, semantic
    point anchors, exact ray/segment intervals, finite capsule/cylinder/cone
    queries, swept-sphere box and cylinder tests, and rigid triangle contacts.
  • Safer bounds: derived centers and extents retain full-domain arithmetic,
    bounding-sphere factories guarantee containment or throw, and explicitly named
    *ClippedToDomain factories cover intentional clipping.
  • Measured hot-path work: exact wide-ratio, oriented-box, triangle, and
    aligned-frame anchor paths were optimized while preserving allocation-free
    deterministic behavior.
  • Better project documentation: the API reference and coverage report are
    now published together on GitHub Pages, with deeper guides synchronized to the
    GitHub Wiki.

Breaking Changes

  • Import geometry types from FixedMathSharp.Geometry.
  • Replace ambiguous FixedTransform properties with explicit local/world
    members. Parent is read-only; use SetParentKeepingLocal or
    TrySetParentKeepingWorld. Replace arbitrary matrix construction with
    component construction or TryCreateFromLocalMatrix.
  • Matrix scale APIs were renamed or removed in favor of scale magnitudes,
    canonical lossy scale, and checked TRS decomposition.
  • FixedQuaternion.Angle now returns the full shortest physical rotation;
    remove downstream * 2 corrections.
  • Removed FixedBoundCircle.RadiusSquared, FixedBoundSphere.RadiusSquared,
    Vector3d.ClosestPointsOnTwoLines, and FixedMath.AddOverflowHelper; use the
    exact bound predicates, segment-owned closest-point APIs, and checked
    language/runtime primitives instead.
  • Some exact bounds operations now throw OverflowException rather than
    silently returning a saturated or under-containing result.
  • Chronicler transform hashes now contain authoritative local position,
    rotation, and scale only. v6 transform hashes are intentionally incompatible.

Upgrade

Read the complete
v6 → v7 migration guide
before upgrading production simulations.

Full changelog:
73cd639…5430dc9 (inclusive)

FixedMathSharp v6.0.0

Choose a tag to compare

@mrdav30 mrdav30 released this 30 Jun 20:49

FixedMathSharp v6 is a bounds and geometry hardening release focused on clearer dimensional ownership, deterministic hot-path behavior, and reusable lower-stack geometry for LSF libraries.

Highlights

  • Reworked FixedBoundArea into a true 2D Vector2d AABB.
  • Made FixedBoundBox the explicit 3D AABB type with named factories:
    • FromMinMax, FromCenterAndSize, and FromCenterAndScope.
  • Removed hidden FixedBoundBox.Vertices array storage in favor of allocation-free GetCorner and CopyCorners.
  • Added new reusable primitives:
    • FixedBoundCircle, FixedRay2d, FixedSegment2d, FixedTriangle2d, FixedSegment, and FixedTriangle.
  • Standardized bounds intersection semantics so default Intersects methods are boundary-inclusive.
  • Added IntersectsStrict where positive area/volume overlap matters.
  • Tightened radius handling for FixedBoundSphere and added explicit BoundingSphereState.
  • Added optional FixedMathSharp.Chronicler / .Lean companion packages for deterministic ChronicleHashWriter helpers.
  • Expanded bounds, geometry, serialization, and benchmark coverage.

Breaking Changes

  • 3D FixedBoundArea semantics were removed. Use FixedBoundBox for 3D bounds and FixedBoundArea for pure 2D planar bounds.
  • new FixedBoundBox(center, size) was removed; use named factories.
  • FixedBoundBox.Vertices was removed; use GetCorner or CopyCorners.
  • Boundary-touching bounds now count as intersections by default; use IntersectsStrict for positive overlap only.
  • Direct serialized/hash handling of FixedBoundArea and FixedBoundSphere should be reviewed.

See MIGRATION.md for more details.

FixedMathSharp v5.0.2

Choose a tag to compare

@mrdav30 mrdav30 released this 20 Jun 03:18

Added

  • Added FixedTransform, a mutable deterministic transform shell backed by Fixed4x4 for shared LSF host/runtime transform state.
  • Added barycentric product helpers:
    • FixedMath.SumSquaredBarycentricProducts(...)
    • FixedMath.SumBarycentricProducts(...)
    • Fixed3x3.CreateBarycentricProductSums(...)

Fixed

  • Fixed Fixed4x4.SetGlobalScale(...) so scale updates preserve translation and rotation instead of rebuilding from scale alone.

Validation

  • Added focused tests for FixedTransform, barycentric product helpers, and scale mutation preservation.

FixedMathSharp v5.0.1

Choose a tag to compare

@mrdav30 mrdav30 released this 16 Jun 02:36

Fixed64 Unity Serialization Fix

Unity does not serialize readonly fields, so Fixed64 values backed by a readonly long could be edited in the inspector but reload as zero from assets or prefabs. Fixed64 now uses a Unity-compatible raw-value field layout while remaining engine-agnostic and wrapper-free.

FixedMathSharp v5.0.0

Choose a tag to compare

@mrdav30 mrdav30 released this 09 Jun 17:14

FixedMathSharp v5.0.0

FixedMathSharp v5.0.0 is a major API hardening, determinism, and performance release. It removes legacy API shapes, makes numeric conversion boundaries explicit, standardizes 3D transform conventions, and adds a BenchmarkDotNet performance lab.

What's Changed

  • Hardened the v5 public API by removing ambiguous legacy surfaces, standardizing vector naming and mutation patterns, centralizing scalar algorithms on FixedMath, and splitting large numeric types into focused partial files.
  • Renamed bounds APIs to fixed-point naming: FixedBoundBox, FixedBoundSphere, FixedBoundArea, FixedBoundFrustum, and FixedEnclosureType.
  • Made Fixed64 conversions explicit:
    • Parse/TryParse now handle decimal value text.
    • ParseRaw/TryParseRaw handle raw Q32.32 payload text.
    • Floating-point conversions now reject non-finite or out-of-range values.
  • Standardized 3D transform semantics around +X right, +Y up, +Z forward, row-vector transforms, M41/M42/M43 translation, and left-to-right affine composition.
  • Added Axis3d and CoordinateConvention3d for adapting external coordinate systems without changing core runtime semantics.
  • Fixed correctness issues in quaternion direction handling, matrix composition, checked floating-point conversion paths, and stale build assets.
  • Added diagnostic formatting support with ToString(...), TryFormat(...), and ISpanFormattable on supported targets.
  • Added BenchmarkDotNet coverage for scalar math, trigonometry, vectors, quaternions, matrices, bounds, curves, ranges, RNG, serialization, and diagnostics formatting.
  • Improved performance across scalar/trigonometry guards, bounds construction, vector normalization, matrix transforms/inversion, quaternion paths, span-based sphere construction, and squared-distance checks.
  • Hardened local and CI workflows with isolated intermediate outputs, opt-in local coverage, and preserved Release / ReleaseLean validation paths.
  • Expanded tests around the new API, conversion policy, transform conventions, diagnostics formatting, geometry behavior, and benchmarked hot paths.

Breaking Changes

This release intentionally includes source-breaking API cleanup. See docs/MIGRATION.md before upgrading.

High-impact changes:

  • Bounds types were renamed:
    • BoundingBox -> FixedBoundBox
    • BoundingSphere -> FixedBoundSphere
    • BoundingArea -> FixedBoundArea
    • BoundingFrustum -> FixedBoundFrustum
    • ContainmentType -> FixedEnclosureType
  • Fixed64.Parse and Fixed64.TryParse now parse decimal value text. Use ParseRaw / TryParseRaw for raw Q32.32 payload text.
  • Removed or replaced ambiguous numeric APIs, including:
    • Fixed64(double)
    • Fixed64.Fraction
    • Fixed64 arithmetic operators with long
    • vector double constructors
    • FixedRange.InRange(double)
    • DeterministicRandom.NextDouble
  • Vector naming was standardized:
    • x/y/z/w -> X/Y/Z/W
    • Normal -> Normalized
    • Normalize() -> NormalizeInPlace()
    • SqrMagnitude -> MagnitudeSquared
    • SqrDistance -> DistanceSquared
  • Legacy public vector-result out Vector*d helper overloads were removed in favor of return-by-value APIs and explicit *InPlace methods.
  • Fixed4x4.Decompose now returns translation, rotation, scale.
  • Matrix code should be audited for row-vector affine semantics.

Migration

Review docs/MIGRATION.md before upgrading production code, especially if you persist raw Fixed64 text, synchronize deterministic state, copy matrices from engine APIs, or depend on v4 geometry type names.

FixedMathSharp v4.0.1

Choose a tag to compare

@mrdav30 mrdav30 released this 01 Jun 19:56

FixedMathSharp v4.0.1

This patch focuses on release reliability, test hardening, and documentation for the Q32.32 Fixed64 core.

What's Changed

  • Hardened NuGet publishing for release tags, including manual dispatch by tag, checked-out release refs, tag/version validation, and stricter package artifact validation.
  • Updated release packaging scripts to include both FixedMathSharp and FixedMathSharp.FluentAssertions outputs across Release and ReleaseLean.
  • Moved coverage publishing to the Release configuration.
  • Expanded focused test coverage to reach 100% line and branch coverage across the instrumented library.
  • Removed confirmed unreachable hot-path branches in fixed-point math, bounds/ray intersection, curve evaluation, and deterministic RNG paths.
  • Renamed the trigonometry partial file to FixedMath.Trigonometry.cs for clearer source organization.
  • Added consistent MIT license headers across source files.
  • Added Fixed64 representation documentation covering Q32.32 layout, raw values, range, precision, and scaled-integer behavior.

Notes

  • No public API changes are intended in this patch.

FixedMathSharp v4.0.0

Choose a tag to compare

@mrdav30 mrdav30 released this 18 May 17:08

FixedMathSharp 4.0.0 is a major geometry, transform, packaging, and reliability release. This version expands the deterministic fixed-point API with frustum, plane, ray, and 4D vector support while hardening several core math paths.

Breaking Changes

  • Removed the public IBound abstraction and generic Intersects(IBound) dispatch. Use the new strongly typed Contains(...) and Intersects(...) overloads on BoundingBox, BoundingArea, BoundingSphere, BoundingFrustum, FixedPlane, and FixedRay.
  • Renamed the no-MemoryPack build/package path from ReleaseNoMemoryPack / FixedMathSharp.NoMemoryPack to ReleaseLean / FixedMathSharp.Lean.

Added

  • Added BoundingFrustum with matrix/plane construction, containment checks, intersection checks, corners, planes, and clamp support.
  • Added FixedPlane, FixedPlaneIntersectionType, and ContainmentType for richer deterministic spatial queries.
  • Added FixedRay with intersections against planes, boxes, areas, spheres, and frustums.
  • Added Vector4d with arithmetic, comparisons, normalization, distance/dot helpers, matrix transforms, fuzzy equality helpers, JSON support, and MemoryPack support.
  • Added expanded Fixed4x4 transform helpers, including translation, rotation, scale, look-at, world, orthographic, perspective, inversion, point transforms, and Vector4d transforms.
  • Added Lean package output for FixedMathSharp.FluentAssertions.Lean.

Improved

  • Hardened BoundingBox, BoundingArea, BoundingSphere, and frustum behavior with typed containment/intersection APIs.
  • Hardened quaternion normalization, rotation, Euler conversion, division, interpolation, and matrix conversion behavior.
  • Improved Fixed4x4 affine handling and transform/inversion coverage.
  • Improved release automation with centralized archive output and a NuGet publishing workflow for standard and Lean packages.
  • Reorganized source files by domain while preserving the public FixedMathSharp namespace.

Fixed

  • Fixed a Fixed64 multiplication saturation edge case where overflow during rounded 128-bit shifting could wrap before saturation.
  • Fixed release-configuration test discrepancies, including Lean/MemoryPack-disabled scenarios.
  • Removed unreachable/dead bounding-sphere merge code surfaced during coverage hardening.

Quality

  • Expanded tests across geometry, bounds, matrices, quaternions, vectors, assertions, serialization-related paths, and Lean builds.
  • Added complexity exception documentation for intentionally complex performance-sensitive methods.
  • Refreshed README and contributor-facing guidance for the current API and release workflow.

Full Changelog: 1bec7da...be39470

FixedMathSharp v3.0.1

Choose a tag to compare

@mrdav30 mrdav30 released this 18 Apr 03:39

Fixed

  • Fixed a Fixed64 initialization issue that could trigger circular static-constructor errors when operators were used during type initialization.
  • Updated internal max/min fallback paths to avoid relying on static members during early initialization.

Added

  • Added a NoMemoryPack build/package variant for consumers that want to use FixedMathSharp without the MemoryPack dependency.
  • Added a compile-time shim so the library can build cleanly when MemoryPack is disabled.

Changed

  • Updated build and packaging scripts to produce both standard and NoMemoryPack release outputs.
  • Migrated the solution to .slnx and refreshed CI/workflow configuration accordingly.
  • Improved public documentation and README guidance, including package selection and Unity/Burst recommendations.

FixedMathSharp v3.0.0

Choose a tag to compare

@mrdav30 mrdav30 released this 14 Apr 16:20
  • Breaking Changes
    • Removed float-based numeric/vector overloads to enforce deterministic usage across Vector2d and Vector3d.
    • Core precision API refactor:
      • Fixed64.Precision replaced with Fixed64.MinIncrement.
      • Default epsilon/tolerance semantics were redefined (FixedMath.DEFAULT_TOLERANCE_L / Fixed64.Epsilon), which can change fuzzy-comparison behavior.
  • Added
    • FixedMath.InvertedPI constant.
    • New Vector3d.SnapSmallComponentsToZero(...) helper for zeroing tiny components under a threshold.
  • Changed
    • Degree/radian conversion paths in trigonometry moved to fixed-point math paths for deterministic consistency.
    • Vector epsilon guards improved across vector/component comparison logic.
  • Fixed
    • Hardened Fixed64 scalar multiply/divide operator behavior, including improved 128-bit intermediate rounding/saturation handling.
    • Quaternion math corrections:
      • Euler conversion alignment (YXZ order consistency).
      • Rotation extraction stabilization (including matrix-based paths).
    • Additional Fixed64 operator corrections from #48.
  • Maintenance
    • Project/test setup cleanup and release metadata housekeeping commits.
  • Migration Notes
    • Replace uses of Fixed64.Precision with Fixed64.MinIncrement.
    • Remove/update any call sites relying on removed float overloads.
    • Re-validate tolerance-sensitive tests/simulations due to epsilon behavior changes.