diff --git a/direct/src/directdevices/DirectDeviceManager.py b/direct/src/directdevices/DirectDeviceManager.py index 2909e25abb..634ebbb32c 100644 --- a/direct/src/directdevices/DirectDeviceManager.py +++ b/direct/src/directdevices/DirectDeviceManager.py @@ -99,7 +99,7 @@ class DirectAnalogs(AnalogNode, PandaObject): def disable(self): self.nodePath.reparentTo(base.dataUnused) - def normalize(self, val, minVal = -1, maxVal = -1): + def normalize(self, val, minVal = -1, maxVal = 1): # First record sign if val < 0: sign = -1 diff --git a/direct/src/directdevices/DirectJoybox.py b/direct/src/directdevices/DirectJoybox.py index 0fe410bee3..ace0c72ab6 100644 --- a/direct/src/directdevices/DirectJoybox.py +++ b/direct/src/directdevices/DirectJoybox.py @@ -161,8 +161,7 @@ class DirectJoybox(PandaObject): val = max(val - ANALOG_DEADBAND, 0.0) # Now clamp value between minVal and maxVal val = CLAMP(val, ANALOG_MIN, ANALOG_MAX) - self.aList[chan] = (((maxVal - minVal) * ((val - ANALOG_MIN) / ANALOG_RANGE)) - + minVal) + self.aList[chan] = (2.0 * ((val - ANALOG_MIN) / ANALOG_RANGE)) - 1 # Update buttons for i in range(len(self.buttons)): try: