|
Physics Simulation & Visualization Tool 0.1
A C++ physics simulation engine with real-time 3D visualization
|
A linear "monitor" solver that stops simulation when a condition is met. More...
#include <InterceptSolver.h>
Public Types | |
| using | MonitorFunction = std::function< float()> |
| using | TimeoutCondition = std::function< bool()> |
Public Member Functions | |
| InterceptSolver (MonitorFunction monitorFunc, TimeoutCondition timeoutFunc=nullptr) | |
| Construct a new Intercept Solver. | |
| bool | stepFrame () override |
| Checks the current simulation state against the intercept conditions. | |
Public Member Functions inherited from ISolver | |
| virtual | ~ISolver ()=default |
| Virtual destructor for proper cleanup of derived classes. | |
A linear "monitor" solver that stops simulation when a condition is met.
This solver is used for "Forward Problems" where the initial conditions are known, and we simply need to run the simulation until a specific event occurs (e.g., reaching a peak, hitting a target, or reaching a specific time).
Unlike VectorRootSolver, this does NOT iterate or reset the simulation repeatedly. It runs a single trajectory and returns 'true' when the event is detected.
Definition at line 15 of file InterceptSolver.h.
| using InterceptSolver::MonitorFunction = std::function<float()> |
Definition at line 18 of file InterceptSolver.h.
| using InterceptSolver::TimeoutCondition = std::function<bool()> |
Definition at line 21 of file InterceptSolver.h.
|
explicit |
Construct a new Intercept Solver.
| monitorFunc | Function returning the metric to monitor. Solver stops when this drops <= 0. |
| timeoutFunc | (Optional) Safety abort check. |
Definition at line 5 of file InterceptSolver.cpp.
|
overridevirtual |
Checks the current simulation state against the intercept conditions.
Implements ISolver.
Definition at line 8 of file InterceptSolver.cpp.