MVP using pos/quat
This commit is contained in:
parent
2a701c0ac7
commit
63230b7754
3 changed files with 16 additions and 18 deletions
|
@ -4,14 +4,14 @@ 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:
|
||||
#self.global_position = tracker_data['position']
|
||||
var rotation := tracker_data['rotation'] as Quaternion
|
||||
|
||||
var rot_basis = Basis(rotation)
|
||||
|
||||
self.global_basis = rot_basis
|
||||
#self.global_basis = Basis(rot_basis.z,-rot_basis.y,rot_basis.x)
|
||||
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue