Skip to content

Releases: gdifiore/libgolf

v4.1.0

14 Apr 23:01

Choose a tag to compare

v4.1.0

GroundProvider is gone. Use TerrainInterface instead.

Breaking

  • Deleted: GroundProvider, UniformGroundProvider, TerrainProviderAdapter, docs/ground_providers.md, and the FlightSimulator(launch, atmos, GroundProvider) overload.
  • FlightSimulator now has two constructors: (launch, atmos, GroundSurface) for flat ground and (launch, atmos, TerrainInterface, model) for custom.

Porting

// Before
MyProvider p;
FlightSimulator sim(ball, atmos, p);

// After
FlightSimulator sim(ball, atmos, std::make_shared<MyTerrain>());

Mechanical translation:

  • public GroundProviderpublic TerrainInterface
  • getGroundAt(x, y)getSurfaceProperties(x, y); also implement getHeight and getNormal
  • Remove the clone() override; TerrainInterface is passed by shared_ptr

See docs/terrain.md and examples/multi_ground_simulation.cpp for a working example.

v4.0.0

13 Apr 21:11

Choose a tag to compare

libgolf 4.0.0

Installation

Download the appropriate binary for your platform below.

Building from Source

See the README for build instructions.

v3.0.1

17 Mar 18:46

Choose a tag to compare

Pre-reserve trajectory vector in runAndGetTrajectory() to avoid 4-5 reallocs on a typical shot.

Release v3.0.0

17 Mar 18:36

Choose a tag to compare

libgolf 3.0.0

Installation

Download the appropriate binary for your platform below.

Building from Source

See the README for build instructions.

v2.2.1

17 Mar 18:08

Choose a tag to compare

Bug Fixes

  • Fix wind velocity applied one step late in calculateVelocityw
  • Fix KELVIN_OFFSET: 273.16 → 273.15 (triple point vs. definition)
  • Fix Cd transition interpolation denominator to use (RE_THRESHOLD_HIGH - RE_THRESHOLD_LOW)

Code Quality

  • Use STD_BALL_RADIUS_FT in calculateTau instead of recomputing
  • Use INCHES_PER_FOOT in calculateROmega instead of magic 12.0
  • Fix SVP division to use 100.0F instead of 100.0 (avoids double promotion)
  • Construct FlatTerrain once in FlightSimulator and share across phases
  • Cache drag and lift coefficients per step instead of recomputing 3× each

v2.2.0

17 Mar 17:29

Choose a tag to compare

What's New

Penner Spin Model

  • Backspin now reduces tangent velocity on bounce using the Penner (2003) physics model
  • High-backspin shots (wedges) realistically "check" on landing
  • Added STD_BALL_RADIUS_FT constant to physics_constants.hpp
  • New tests covering spin effect on bounce velocity

Release v2.1.0

20 Dec 01:52

Choose a tag to compare

libgolf 2.1.0

v2.0.2 Release Notes

NEW: Contract-based design

  • Removed all physics parameter validation
  • Library now accepts any input values (enables experimental physics)
  • Caller responsible for validating inputs

Improvements:

  • Added typical value ranges to parameter documentation
  • Modern C++ patterns: move semantics, [[maybe_unused]]
  • TerrainProviderAdapter now uses value semantics

Removed:

  • Surface property range checks (restitution, friction, firmness, spin retention)
  • Surface normal unit length validation
  • NORMAL_VECTOR_TOLERANCE constant

Allows realistic golf simulations or experimental physics without constraints.

Installation

Download the appropriate binary for your platform below.

Building from Source

See the README for build instructions.

Release v2.0.1

18 Dec 22:16
46f6594

Choose a tag to compare

libgolf 2.0.1

Installation

Download the appropriate binary for your platform below.

Building from Source

See the README for build instructions.

Release v2.0.0

17 Dec 03:02

Choose a tag to compare

libgolf 2.0.0

Terrain System

The library now supports position-dependent terrain with sloped surfaces. You can model elevated greens, fairway transitions, rough patches, and other realistic course features.

Two new interfaces:

  • TerrainInterface - for custom terrain implementations with height queries and surface normals
  • GroundProvider - for position-dependent ground materials on flat terrain

Physics calculations now handle sloped surfaces correctly. Bounces decompose velocity along the surface normal, and rolling accounts for gravity components down the slope.

FlightSimulator has new constructors that accept terrain or ground providers. Old code still works - we didn't break the existing API.

Fixes

  • Cache comparison now uses epsilon tolerance instead of exact float equality
  • Constructor initialization order matches declaration order
  • Roll phase no longer stops the ball on slopes when it shouldn't

Code cleanup

  • Ground surface properties validated at construction
  • Thread-safety documented for terrain adapter
  • Performance optimizations with noexcept on hot paths

See docs/terrain.md and docs/ground_providers.md for examples and migration guide.

Installation

Download the appropriate binary for your platform below.

Building from Source

See the README for build instructions.

Release v1.0.0

12 Dec 19:49
53ba74f

Choose a tag to compare

libshotscope 1.0.0

Installation

Download the appropriate binary for your platform below.

Building from Source

See the README for build instructions.