diff --git a/README.md b/README.md index b5ddebe..125e8e3 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,13 @@ A native GDScript implementation of the [VRPN](https://vrpn.github.io/) client protocol. -# TOC - # Background -Various VR tools even today in use are providing an interface for tracking data by implementing a VPRN server. Binding a the actual VRPN library into an extension is proven and working but is quite a burden if the main aim of usage is receiving tracking data. Hence, this project was born to allow for easy integration of VRPN tracking in Godot. +VR hardware and software provide commonly an interface for tracking data by implementing a VPRN server. Binding the actual VRPN client library into an extension is proven and working poses a burden for maintenance and deployability. To solve this gdvrpn allows for a native integration of VRPN tracking in Godot. -This project does not implement any server components and is only tested with a limited number of devices in our lab. +This project does not implement any server components or forwarding and is only tested with a limited number of devices in our lab. Currently, UDP mode is under development. + +![Tracking with an OptiTrack System](addons/docs/img/gdvrpn.jpg) # Install @@ -16,7 +16,21 @@ Install the project from the AssetLib in Godot or directly from the repository. # Usage -TBW +There are two components, a `VRPN_Client` and needed for using this addon: + +`VPRPN_Client` is mandatory and implements the network component of this addon that parses the data received and broadcasts them to the respective receivers within the scene tree. + +`VRPN_Tracker` is a receiver taking pose information (i.e. position and orientation) of a rigid body and applies it to the nodes global transform. + +`VRPN_Button` is a receiver of button events. + +## Example + +For some inspiration try the example `spin_tracker.tscn`. To create a test input use the shipped VRPN config file `test/vrpn.test.cfg` as follows (from the root of this repository) + +```bash +$> vrpn_server -f addons/vrpn/tests/vrpn.test.cfg +``` # License diff --git a/addons/vrpn/docs/img/gdvrpn-optitrack.jpg b/addons/vrpn/docs/img/gdvrpn-optitrack.jpg new file mode 100644 index 0000000..4609741 Binary files /dev/null and b/addons/vrpn/docs/img/gdvrpn-optitrack.jpg differ diff --git a/addons/vrpn/scripts/VRPN_Button.gd b/addons/vrpn/scripts/VRPN_Button.gd index 41fd2e2..5508374 100644 --- a/addons/vrpn/scripts/VRPN_Button.gd +++ b/addons/vrpn/scripts/VRPN_Button.gd @@ -3,14 +3,14 @@ extends Node @export var vrpn_client : VRPN_Client = null @export var button_sensor : String = "Button0" -@export var register_on_start : bool = true +@export var register_on_ready : bool = true var state : int = 0 func _ready(): if not vrpn_client: push_warning("No VRPN client for button on '%s' given." % [self.name]) - elif register_on_start: + elif register_on_ready: vrpn_client.buttons.append(self) func _on_vrpn(vrpn_data : Dictionary) -> void: diff --git a/addons/vrpn/scripts/VRPN_Tracker.gd b/addons/vrpn/scripts/VRPN_Tracker.gd index 2a1186b..f9788c4 100644 --- a/addons/vrpn/scripts/VRPN_Tracker.gd +++ b/addons/vrpn/scripts/VRPN_Tracker.gd @@ -6,10 +6,10 @@ extends Node3D @export var tracker_sensor : int = 0 @export var tracker_use_position : bool = true @export var tracker_use_rotation : bool = true -@export var register_on_start : bool = true +@export var register_on_ready : bool = true func _ready() -> void: - if vrpn_client and register_on_start: + if vrpn_client and register_on_ready: vrpn_client.tracker.append(self) func _on_vrpn(vrpn_data : Dictionary):