This commit is contained in:
Hartmut Seichter 2025-06-30 20:54:52 +02:00
parent d3b5dbe322
commit 1320473e9d
2 changed files with 8 additions and 4 deletions

View file

@ -1,8 +1,7 @@
extends Node
class_name VRPN
enum { POS_QUAT }
enum TrackingData { POS_QUAT, VELOCITY }
const magic_cookie_start : String = "vrpn: ver."
@ -12,6 +11,7 @@ class Session:
func _init():
pass
@export
static func marshall_block(data : PackedByteArray,session : Session) -> void:
@ -91,7 +91,7 @@ static func marshall_body(data : PackedByteArray,message_type : int, sender_id:
var quat_y = body.get_double()
var quat_z = body.get_double()
var quat = Quaternion(quat_x,quat_y,quat_z,quat_w)
print("Tracker:{0} Sensor:{1} Pos:{2} Quat:{3}".format([session.sensors[sender_id],sensor_id,pos,quat]))
print("Sender:{0} Sensor:{1} Pos:{2} Quat:{3}".format([session.sensors[sender_id],sensor_id,pos,quat]))
_:
pass
#print("unhandled message type {0}".format([message_type]))