mirror of
https://github.com/modelec/GameController.git
synced 2026-01-18 16:47:32 +01:00
commentaire
This commit is contained in:
@@ -46,12 +46,9 @@ public:
|
|||||||
|
|
||||||
Uint16 strength = 0xFFFF;
|
Uint16 strength = 0xFFFF;
|
||||||
if (distance < 200) {
|
if (distance < 200) {
|
||||||
// Ajuster la force en fonction de la distance
|
|
||||||
strength = static_cast<Uint16>((200 - distance) * 0xFFFF / 200);
|
strength = static_cast<Uint16>((200 - distance) * 0xFFFF / 200);
|
||||||
|
|
||||||
// Ajuster la force en fonction de l'angle
|
double angleFactor = std::abs(std::sin(angle));
|
||||||
// Plus l'angle s'éloigne de 0, plus la force sera forte
|
|
||||||
double angleFactor = std::abs(std::sin(angle)); // L'angle est fourni en radians
|
|
||||||
strength *= angleFactor;
|
strength *= angleFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user