![]() |
VR-Forces Developer's Guide
|
Solves inverse ballistic problems: computes firing solutions to reach or intercept targets.
All methods are stateless; no internal state is modified between calls.
Public Member Functions | |
| DtBallisticSolver () | |
| virtual | ~DtBallisticSolver () |
| virtual DtBallisticSolveError | solveFiringAngle (const dvec3 &firingPosition, const dvec3 &targetPosition, const DtBulletDefinition &bullet, const DtBallisticEnvironment &env, std::vector< DtFiringSolution > &solutions, const float64 minElevationAngle=-DtMath::PI/2.0, const float64 maxElevationAngle=DtMath::PI/2.0, const DtCoordinateFrame *weaponFrame=nullptr) |
| virtual DtBallisticSolveError | solveInterceptTrajectory (const dvec3 &firingPosition, const dvec3 &targetPosition, const dvec3 &targetVelocity, const DtBulletDefinition &bullet, const DtBallisticEnvironment &env, DtFiringSolution &solution, const float64 minElevationAngle=-DtMath::PI/2.0, const float64 maxElevationAngle=DtMath::PI/2.0, const DtCoordinateFrame *weaponFrame=nullptr) |
| virtual DtBallisticSolveError | optimalSolution (const dvec3 &firingPosition, const dvec3 &targetPosition, const DtBulletDefinition &bullet, const DtBallisticEnvironment &env, DtFiringSolution &solution, const float64 minElevationAngle=-DtMath::PI/2.0, const float64 maxElevationAngle=DtMath::PI/2.0, const DtCoordinateFrame *weaponFrame=nullptr) |
| virtual bool | isTargetReachable (const dvec3 &firingPosition, const dvec3 &targetPosition, double muzzleVelocity, const DtBallisticEnvironment &env, const DtCoordinateFrame *weaponFrame=nullptr) |
| makVrv::DtBallisticSolver::DtBallisticSolver | ( | ) |
Default constructor.
|
virtual |
Virtual destructor.
|
virtual |
Computes all valid firing solutions to hit a stationary target.
May produce zero solutions if the target is out of range, or up to two solutions corresponding to low-arc and high-arc trajectories.
| firingPosition | World-space position of the weapon. |
| targetPosition | World-space position of the target. |
| bullet | Projectile characteristics. |
| env | Environmental conditions (gravity and wind). |
| solutions | Output vector populated with valid firing solutions (0-2 elements). |
| minElevationAngle | Minimum allowed elevation angle for the weapon. |
| maxElevationAngle | Maximum allowed elevation angle for the weapon. |
| weaponFrame | Optional coordinate frame for the weapon; nullptr uses the environment frame. |
|
virtual |
Computes a firing solution to intercept a moving target.
Accounts for target velocity to compute a lead angle.
| firingPosition | World-space position of the weapon. |
| targetPosition | Current world-space position of the target. |
| targetVelocity | Velocity vector of the moving target. |
| bullet | Projectile characteristics. |
| env | Environmental conditions. |
| solution | Output firing solution for intercepting the target. |
| minElevationAngle | Minimum allowed elevation angle for the weapon. |
| maxElevationAngle | Maximum allowed elevation angle for the weapon. |
| weaponFrame | Optional coordinate frame for the weapon; nullptr uses the environment frame. |
|
virtual |
Returns the preferred firing solution for hitting a stationary target.
Selects from the available solutions returned by solveFiringAngle().
| firingPosition | World-space position of the weapon. |
| targetPosition | World-space position of the target. |
| bullet | Projectile characteristics. |
| env | Environmental conditions. |
| solution | Output preferred firing solution. |
| minElevationAngle | Minimum allowed elevation angle for the weapon. |
| maxElevationAngle | Maximum allowed elevation angle for the weapon. |
| weaponFrame | Optional coordinate frame for the weapon; nullptr uses the environment frame. |
|
virtual |
Returns true if any valid firing solution exists to reach the target.
| firingPosition | World-space position of the weapon. |
| targetPosition | World-space position of the target. |
| muzzleVelocity | Initial projectile speed. |
| env | Environmental conditions. |
| weaponFrame | Optional coordinate frame for the weapon; nullptr uses the environment frame. |