-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update navigation manager * Add simple_weapons for enemy and update shooting manager to calculate damage
- Loading branch information
Showing
18 changed files
with
366 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,5 +19,6 @@ target_link_libraries( | |
weapon | ||
camera | ||
single_raycaster | ||
simple_weapon | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/ShootingManager/include/ShootingManager/shooting_helper.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* @file shooting_helper.h | ||
* @author Bilal Kahraman ([email protected]) | ||
* @brief | ||
* @version 0.1 | ||
* @date 2024-11-28 | ||
* | ||
* @copyright Copyright (c) 2024 | ||
* | ||
*/ | ||
|
||
#ifndef SHOOTING_MANAGER_INCLUDE_SHOOTING_MANAGER_SHOOTING_HELPER_H | ||
#define SHOOTING_MANAGER_INCLUDE_SHOOTING_MANAGER_SHOOTING_HELPER_H | ||
|
||
#include <cmath> | ||
|
||
namespace wolfenstein { | ||
|
||
inline double LinearSlope(const std::pair<double, double> damage_limits, | ||
const double range, const double distance) { | ||
const auto linear_slope_formula = | ||
[](const std::pair<double, double> damage_limits, const double range, | ||
const double distance) { | ||
return ((range - distance) / range) * | ||
(damage_limits.first - damage_limits.second) + | ||
damage_limits.second; | ||
}; | ||
return linear_slope_formula(damage_limits, range, distance); | ||
} | ||
|
||
inline double ExponentialSlope(const std::pair<double, double> damage_limits, | ||
const double range, const double distance) { | ||
|
||
const auto exp_slope_formula = | ||
[](const std::pair<double, double> damage_limits, const double range, | ||
const double distance) { | ||
return std::fmin(std::fmax(std::exp((range - distance) / 1.5), | ||
damage_limits.second), | ||
damage_limits.first); | ||
}; | ||
|
||
return exp_slope_formula(damage_limits, range, distance); | ||
} | ||
|
||
} // namespace wolfenstein | ||
|
||
#endif // SHOOTING_MANAGER_INCLUDE_SHOOTING_MANAGER_SHOOTING_HELPER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.