mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-10 05:32:18 -06:00
Simplify setting of deadzone size in assets
This commit is contained in:
@@ -25,8 +25,8 @@
|
||||
-- First - Name of the joystick that should be bound
|
||||
-- Second - Which axis should be bound of this joystick
|
||||
-- Third - The property uri
|
||||
-- Fourth - (optional) The smallest value that you wnat to allow this property on the joystick
|
||||
-- Fifth - (optional) The largest value that you wnat to allow this property on the joystick
|
||||
-- Fourth - (optional) The smallest value that you want to allow this property on the joystick
|
||||
-- Fifth - (optional) The largest value that you want to allow this property on the joystick
|
||||
-- Sixth - (optional) Determines whether the axis should be inverted
|
||||
-- Seventh - (optional) Should this property change be sent to other connected remote sessions
|
||||
|
||||
|
||||
@@ -52,12 +52,14 @@ asset.onInitialize(function()
|
||||
local controller = PS4Controller;
|
||||
local name = "Wireless Controller";
|
||||
|
||||
openspace.navigation.setAxisDeadZone(name, controller.LeftThumbStick[1], 0.15)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.LeftThumbStick[2], 0.15)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.RightThumbStick[1], 0.15)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.RightThumbStick[2], 0.15)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.L2, 0.05)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.R2, 0.05)
|
||||
local deadzoneJoysticks = 0.15
|
||||
local deadzoneTriggers = 0.05
|
||||
openspace.navigation.setAxisDeadZone(name, controller.LeftThumbStick[1], deadzoneJoysticks)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.LeftThumbStick[2], deadzoneJoysticks)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.RightThumbStick[1], deadzoneJoysticks)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.RightThumbStick[2], deadzoneJoysticks)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.L2, deadzoneTriggers)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.R2, deadzoneTriggers)
|
||||
|
||||
openspace.navigation.bindJoystickAxis(name, controller.LeftThumbStick[1], "Orbit X");
|
||||
openspace.navigation.bindJoystickAxis(name, controller.LeftThumbStick[2], "Orbit Y", true);
|
||||
|
||||
@@ -37,12 +37,13 @@ asset.onInitialize(function()
|
||||
local controller = SpaceMouse;
|
||||
local name = "3Dconnexion Universal Receiver";
|
||||
|
||||
openspace.navigation.setAxisDeadZone(name, controller.Push[1], 0.1)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.Push[2], 0.1)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.Twist[1], 0.1)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.Tilt[2], 0.1)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.Push[3], 0.1)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.Tilt[1], 0.1)
|
||||
local deadzone = 0.15
|
||||
openspace.navigation.setAxisDeadZone(name, controller.Push[1], deadzone)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.Push[2], deadzone)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.Twist[1], deadzone)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.Tilt[2], deadzone)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.Push[3], deadzone)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.Tilt[1], deadzone)
|
||||
|
||||
openspace.navigation.bindJoystickAxis(name, controller.Push[1], "Orbit X");
|
||||
openspace.navigation.bindJoystickAxis(name, controller.Push[2], "Orbit Y");
|
||||
|
||||
@@ -37,12 +37,13 @@ asset.onInitialize(function()
|
||||
local controller = SpaceMouse;
|
||||
local name = "SpaceMouse Enterprise";
|
||||
|
||||
openspace.navigation.setAxisDeadZone(name, controller.Push[1], 0.1)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.Push[2], 0.1)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.Twist[1], 0.1)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.Tilt[2], 0.1)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.Push[3], 0.1)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.Tilt[1], 0.1)
|
||||
local deadzone = 0.15
|
||||
openspace.navigation.setAxisDeadZone(name, controller.Push[1], deadzone)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.Push[2], deadzone)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.Twist[1], deadzone)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.Tilt[2], deadzone)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.Push[3], deadzone)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.Tilt[1], deadzone)
|
||||
|
||||
openspace.navigation.bindJoystickAxis(name, controller.Push[1], "Orbit X");
|
||||
openspace.navigation.bindJoystickAxis(name, controller.Push[2], "Orbit Y");
|
||||
|
||||
@@ -50,12 +50,14 @@ asset.onInitialize(function()
|
||||
local controller = XBoxController;
|
||||
local name = "Wireless Xbox Controller";
|
||||
|
||||
openspace.navigation.setAxisDeadZone(name, controller.LeftThumbStick[1], 0.15)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.LeftThumbStick[2], 0.15)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.RightThumbStick[1], 0.15)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.RightThumbStick[2], 0.15)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.LeftTrigger, 0.05)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.RightTrigger, 0.05)
|
||||
local deadzoneJoysticks = 0.15
|
||||
local deadzoneTriggers = 0.05
|
||||
openspace.navigation.setAxisDeadZone(name, controller.LeftThumbStick[1], deadzoneJoysticks)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.LeftThumbStick[2], deadzoneJoysticks)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.RightThumbStick[1], deadzoneJoysticks)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.RightThumbStick[2], deadzoneJoysticks)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.LeftTrigger, deadzoneTriggers)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.RightTrigger, deadzoneTriggers)
|
||||
|
||||
openspace.navigation.bindJoystickAxis(name, controller.LeftThumbStick[1], "Orbit X");
|
||||
openspace.navigation.bindJoystickAxis(name, controller.LeftThumbStick[2], "Orbit Y", true);
|
||||
|
||||
@@ -50,12 +50,14 @@ asset.onInitialize(function()
|
||||
local controller = XBoxController;
|
||||
local name = "Xbox Controller";
|
||||
|
||||
openspace.navigation.setAxisDeadZone(name, controller.LeftThumbStick[1], 0.15)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.LeftThumbStick[2], 0.15)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.RightThumbStick[1], 0.15)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.RightThumbStick[2], 0.15)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.LeftTrigger, 0.05)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.RightTrigger, 0.05)
|
||||
local deadzoneJoysticks = 0.15
|
||||
local deadzoneTriggers = 0.05
|
||||
openspace.navigation.setAxisDeadZone(name, controller.LeftThumbStick[1], deadzoneJoysticks)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.LeftThumbStick[2], deadzoneJoysticks)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.RightThumbStick[1], deadzoneJoysticks)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.RightThumbStick[2], deadzoneJoysticks)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.LeftTrigger, deadzoneTriggers)
|
||||
openspace.navigation.setAxisDeadZone(name, controller.RightTrigger, deadzoneTriggers)
|
||||
|
||||
openspace.navigation.bindJoystickAxis(name, controller.LeftThumbStick[1], "Orbit X");
|
||||
openspace.navigation.bindJoystickAxis(name, controller.LeftThumbStick[2], "Orbit Y", true);
|
||||
|
||||
Reference in New Issue
Block a user