make proper setup for VRPN with buttons and trackers

This commit is contained in:
Hartmut Seichter 2025-07-07 22:43:04 +02:00
parent ea953e92a6
commit 3f823111d1
10 changed files with 115 additions and 39 deletions

View file

@ -0,0 +1,18 @@
class_name VRPN_Button
extends Node
@export var vrpn : VRPN = null
@export var button_sensor : String = "Button0"
@export var register_on_start : bool = true
var state : int = 0
func _ready():
if not vrpn:
push_warning("No VRPN client for button on '%s' given." % [self.name])
elif register_on_start:
vrpn.buttons.append(self)
func _on_vrpn(vrpn_data : Dictionary) -> void:
if vrpn_data['sensor'] == button_sensor:
pass