Releases: gdifiore/libgolf
v4.1.0
v4.1.0
GroundProvider is gone. Use TerrainInterface instead.
Breaking
- Deleted:
GroundProvider,UniformGroundProvider,TerrainProviderAdapter,docs/ground_providers.md, and theFlightSimulator(launch, atmos, GroundProvider)overload. FlightSimulatornow 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 GroundProvider→public TerrainInterfacegetGroundAt(x, y)→getSurfaceProperties(x, y); also implementgetHeightandgetNormal- Remove the
clone()override;TerrainInterfaceis passed byshared_ptr
See docs/terrain.md and examples/multi_ground_simulation.cpp for a working example.
v4.0.0
v3.0.1
Release v3.0.0
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
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_FTincalculateTauinstead of recomputing - Use
INCHES_PER_FOOTincalculateROmegainstead of magic12.0 - Fix SVP division to use
100.0Finstead of100.0(avoids double promotion) - Construct
FlatTerrainonce inFlightSimulatorand share across phases - Cache drag and lift coefficients per step instead of recomputing 3× each
v2.2.0
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_FTconstant tophysics_constants.hpp - New tests covering spin effect on bounce velocity
Release v2.1.0
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
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
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 normalsGroundProvider- 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
libshotscope 1.0.0
Installation
Download the appropriate binary for your platform below.
Building from Source
See the README for build instructions.