WIP
This commit is contained in:
parent
d3b5dbe322
commit
1320473e9d
2 changed files with 8 additions and 4 deletions
|
@ -1,10 +1,14 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://bj5ykdjle10tt"]
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bj5ykdjle10tt"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://vnywsf0rn1ax" path="res://SocketClient.gd" id="1_gxo8o"]
|
||||
[ext_resource type="Script" uid="uid://dmq3i7qmo1qe0" path="res://VRPN.gd" id="2_24d08"]
|
||||
|
||||
[node name="Node3D" type="Node3D"]
|
||||
script = ExtResource("1_gxo8o")
|
||||
|
||||
[node name="VRPN" type="Node3D" parent="."]
|
||||
script = ExtResource("2_24d08")
|
||||
|
||||
[connection signal="connected" from="." to="." method="_on_connected"]
|
||||
[connection signal="data" from="." to="." method="_on_data"]
|
||||
[connection signal="disconnected" from="." to="." method="_on_disconnected"]
|
||||
|
|
6
VRPN.gd
6
VRPN.gd
|
@ -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]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue