better proxying of data into the receivers
This commit is contained in:
parent
4da8618746
commit
b54c78da19
3 changed files with 54 additions and 15 deletions
|
@ -7,12 +7,14 @@ class_name VRPN_Receiver
|
|||
@export var tracker_use_position : bool = true
|
||||
@export var tracker_use_rotation : bool = true
|
||||
|
||||
|
||||
func _on_pos_quat(tracker_data : Dictionary):
|
||||
|
||||
if tracker_data['tracker'] == tracker_name and tracker_data['sensor'] == tracker_sensor:
|
||||
if tracker_use_position:
|
||||
self.global_position = tracker_data['position']
|
||||
if tracker_use_rotation:
|
||||
var rotation := tracker_data['rotation'] as Quaternion
|
||||
self.global_basis = Basis(rotation)
|
||||
func _on_tracker(tracker_data : Dictionary):
|
||||
match tracker_data['type'] as VRPN.TrackingDataType:
|
||||
VRPN.TrackingDataType.POS_QUAT:
|
||||
if tracker_data['tracker'] == tracker_name and tracker_data['sensor'] == tracker_sensor:
|
||||
if tracker_use_position:
|
||||
self.global_position = tracker_data['position']
|
||||
if tracker_use_rotation:
|
||||
var rotation := tracker_data['rotation'] as Quaternion
|
||||
self.global_basis = Basis(rotation)
|
||||
_:
|
||||
push_warning("unknown tracker datatype")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue