make proper setup for VRPN with buttons and trackers
This commit is contained in:
parent
ea953e92a6
commit
3f823111d1
10 changed files with 115 additions and 39 deletions
18
addons/vrpn/scripts/VRPN_Button.gd
Normal file
18
addons/vrpn/scripts/VRPN_Button.gd
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue