mirror of
https://github.com/modelec/GameController.git
synced 2026-01-18 16:47:32 +01:00
distance
This commit is contained in:
@@ -47,7 +47,7 @@ void GameControllerHandler::handleMessage(const std::string &message) {
|
||||
|
||||
if (distance <= 100) {
|
||||
strength = 0xFFFF;
|
||||
} else if (distance <= 300) {
|
||||
} else if (distance <= 500) {
|
||||
double factor = 1 - Modelec::mapValue(distance, 100.0, this->lidarDectectionDistance, 0.0, 1.0);
|
||||
strength = static_cast<Uint16>(factor * 0xFFFF);
|
||||
} else {
|
||||
|
||||
@@ -27,7 +27,7 @@ public:
|
||||
private:
|
||||
SDL_GameController* controller;
|
||||
|
||||
double lidarDectectionDistance = 300;
|
||||
double lidarDectectionDistance = 500;
|
||||
|
||||
bool rumble = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user