18 lines
563 B
GDScript
18 lines
563 B
GDScript
extends Node3D
|
|
|
|
class_name VRPN_Receiver
|
|
|
|
@export var tracker_name : String = "Tracker0"
|
|
@export var tracker_sensor : int = 0
|
|
@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)
|