first idea how to deal with receivers in a flexible way
This commit is contained in:
parent
d665378c6c
commit
f648077fff
4 changed files with 26 additions and 5 deletions
13
VRPN.gd
13
VRPN.gd
|
@ -18,7 +18,7 @@ signal data(data:Array)
|
|||
signal disconnected
|
||||
signal error
|
||||
|
||||
@export var tracker_targets : Dictionary[String,Node3D] = {}
|
||||
@export var tracker_receivers : Array[VRPN_Receiver] = []
|
||||
|
||||
|
||||
# Graphics Interaction Lab OptiTrack system @212.201.64.122
|
||||
|
@ -180,9 +180,16 @@ 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("Sender:{0} Sensor:{1} Pos:{2} Quat:{3}".format([session.sensors[sender_id],sensor_id,pos,quat]))
|
||||
for r in session.tracker_receivers:
|
||||
r._on_pos_quat({
|
||||
"tracker" : session.sensors[sender_id],
|
||||
"sensor" : sensor_id,
|
||||
"position" : pos,
|
||||
"rotation" : 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]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue