This commit is contained in:
ackimixs
2024-05-15 16:15:03 +02:00
parent ec3f3465a9
commit 8adf27acfb
2 changed files with 4 additions and 2 deletions

View File

@@ -42,13 +42,13 @@ public:
if (tokens[2] == "stop proximity") {
std::vector<std::string> args = Utils::split(tokens[3], ",");
int distance = stoi(args[0]);
double angle = stod(args[1]) / 100;
double angle = (stod(args[1]) / 100) + (PI / 2);
Uint16 strength = 0xFFFF;
if (distance < 200) {
strength = static_cast<Uint16>((200 - distance) * 0xFFFF / 200);
double angleFactor = std::abs(std::sin(angle));
double angleFactor = 1 - std::abs(std::sin(angle));
strength *= angleFactor;
}

View File

@@ -2,6 +2,8 @@
#include <string>
#include <vector>
#define PI 3.14159265358979323846
namespace Utils {
inline bool startWith(const std::string& str, const std::string& start)
{