VRPN in Unity
Hi there! Here is the case:
I'm trying to conect VRPN with Unity using this plugin or this one too, with no results.
Anyone can guide me a little bit?
Thank's a lot :)
Answer by mikewarren · Mar 12, 2018 at 05:59 PM
I know it's an old thread but FWIW, Unity supports VRPN natively through the Cluster Input Manager. You used to be able to access the manager programatically to add VRPN support through code, but at some point it stopped working unless you were running in cluster mode.
I'm not sure how VRPN would fit in with the new input system, or when we'll see the new input system integrated, but I'd sure like to have a VRPN option as well.
Looks like there's an open feature request here to vote on it. https://feedback.unity3d.com/suggestions/add-vrpn-support
Hey @mikewarren, to follow up on you, i know its an old thread :)
I am currently looking into connecting Unity and VRED via VRPN to link some components.
Do you have any recommendation for a good tutorial or example to use the ClusterInput class?
$$anonymous$$H
I stopped supporting VRPN when it stopped working in non-cluster mode. I've no idea what the current state of the module is.
The way it used to work...
Cluster Input devices are VRPN devices.
If you had a license that supported cluster mode, you could add cluster input devices through the editor, much the same way you'd enter regular Input devices in the Input $$anonymous$$anager. There was just a separate Cluster Input manager for Cluster Input devices.
There is Cluster Input class that allows you to create input devices programmatically. At one time you could create and configure CI devices at run time to get VRPN data. Later, you could still create the devices, but you wouldn't get data unless you were running in Cluster mode. In a later release, Unity may have removed or restricted access to the ClusterInput class. I do not know what the current state is.
A little background. VRPN device data is served over a network from VRPN servers running locally or on remote machines. The device has a name as configured in the VRPN config file. The data served is dependent on the device, but generally its button data (boolean), axis data (float) and tracker data (position [Vector3], rotation [Vector3]). Some devices will provide more than one type of data.
Unity configured the cluster input manager much like the regular input manager, so inputs are registered with a name of single input. Generally you'd want that name to reflect the function (Eg. "jump", "fire", etc.)
So, for instance, if you had a VRPN server running locally serving a controller (named "controller") and the third button was the "fire" button, you'd register your input as
 ClusterInput.AddInput( "fire", "controller", "localhost", 2, ClusterInputType.Button );
 bool fire = ClusterInput.GetButton("fire")
 
                   If you had an ART tracker configured in the VRPN server as "ART Tracker" running on a remote machine named "TrackingPC" that tracked two objects (say a left controller, right controller).
You might configure the right controller as...
 ClusterInput.AddInput( "right controller tracker", "ART Tracker", "TrackingPC", 1, ClusterInputType.Tracker );
 Vector3 rightPos = ClusterInput.GetTrackerPosition("right controller tracker");
 Quaternion rightRot = ClusterInput.GetTrackerRotation("right controller tracker");
 
                  Your answer
 
             Follow this Question
Related Questions
error CS0117: `System.Console' does not contain a definition for `ReadKey' 0 Answers
GameObject fields evaluate to null, but they are actually assigned and working 1 Answer
Movement Unit (RTS) 0 Answers
Car from Unity's standard assets giving me of null reference errors 0 Answers
Player Movement - Not moving at all 3 Answers