Skip to content

Commit

Permalink
building visual car cockpit
Browse files Browse the repository at this point in the history
Added overlay wheel, possibility to let go of the wheel (pretty neat heuristics I mights say - you can drive one handed)
Layout editor mode - when it's enabled right trigger moves the wheel to the position of the right controller, size determined by second controller position)
Wheel has inertia and centering force when let go
Plan to add Dirt Rally telemetry for dynamic wheel recentering speed (faster you go - faster it recenters)
Right gamepad now vibrates at start a few times
  • Loading branch information
mdovgialo committed Nov 19, 2017
1 parent a7af47a commit 73f661b
Show file tree
Hide file tree
Showing 6 changed files with 425 additions and 35 deletions.
38 changes: 37 additions & 1 deletion steam_vr_wheel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

DEFAULT_CONFIG = dict(trigger_pre_press_button=True, trigger_press_button=True, multibutton_trackpad=True,
multibutton_trackpad_center_haptic=True, touchpad_always_updates=True, vertical_wheel=True,
joystick_updates_only_when_grabbed=False, joystick_grabbing_switch=False)
joystick_updates_only_when_grabbed=False, joystick_grabbing_switch=False, edit_mode=False,
wheel_center=[0, -0.4, -0.35], wheel_size=0.55)


class ConfigException(Exception):
Expand Down Expand Up @@ -165,3 +166,38 @@ def joystick_grabbing_switch(self, x: bool):
with self.data_lock:
self._data['joystick_grabbing_switch'] = x
self._write()

@property
def edit_mode(self):
with self.data_lock:
return self._data['edit_mode']

@edit_mode.setter
def edit_mode(self, x: bool):
with self.data_lock:
self._data['edit_mode'] = x
self._write()

@property
def wheel_center(self):
with self.data_lock:
return self._data['wheel_center']

@wheel_center.setter
def wheel_center(self, x: bool):
with self.data_lock:
self._data['wheel_center'] = x
self._write()

@property
def wheel_size(self):
with self.data_lock:
return self._data['wheel_size']

@wheel_size.setter
def wheel_size(self, x: bool):
with self.data_lock:
self._data['wheel_size'] = x
self._write()


5 changes: 4 additions & 1 deletion steam_vr_wheel/_virtualpad.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,7 @@ def update(self, left_ctr: Controller, right_ctr: Controller):

if (self.trackpadRtouch or self.config.touchpad_always_updates) and self.trackpad_right_enabled:
self.device.set_axis(HID_USAGE_X, int((right_ctr.trackpadX + 1) / 2 * 0x8000))
self.device.set_axis(HID_USAGE_Y, int(((-right_ctr.trackpadY + 1) / 2) * 0x8000))
self.device.set_axis(HID_USAGE_Y, int(((-right_ctr.trackpadY + 1) / 2) * 0x8000))

def edit_mode(self, left_ctr, right_ctr):
pass
Loading

0 comments on commit 73f661b

Please sign in to comment.