3 using System.Runtime.InteropServices;
21 double[] managedArray =
new double[3];
22 double[] quaternionArray =
new double[4];
23 Marshal.Copy(pos, managedArray, 0, 3);
24 Marshal.Copy(quat, quaternionArray, 0, 4);
26 go.transform.position =
new Vector3((
float)managedArray[0] * factor, (
float)managedArray[1] * factor, (
float)managedArray[2] * factor);
28 go.transform.rotation =
new Quaternion((
float)quaternionArray[0], (
float)quaternionArray[1], (
float)quaternionArray[2], (
float)quaternionArray[3]);
33 Debug.Log(
"Button " + button +
" in state " + state);
38 Debug.Log(
"----------");
39 Debug.Log(report.tv_sec);
40 Debug.Log(report.tv_usec);
41 Debug.Log(report.num_channel);
42 Debug.Log(
"----------Tran");
43 Debug.Log(report.channel[0]);
44 Debug.Log(report.channel[1]);
45 Debug.Log(report.channel[2]);
46 Debug.Log(
"----------Rot");
47 Debug.Log(report.channel[3]);
48 Debug.Log(report.channel[4]);
49 Debug.Log(report.channel[5]);
58 Debug.Log(
"VRPNTestScript::Start");
60 MethodInfo minfo = typeof(
VRPNTestScript).GetMethod(
"dummyLogger");
75 go = GameObject.CreatePrimitive(PrimitiveType.Capsule);
79 Debug.Log(
"Destroying VRPNTestScript");
103 Debug.Log(isForceSet);
static bool vrpn_c_button_is_connected(System.IntPtr device)
static System.IntPtr vrpn_c_open_analog(string name, AnalogCallbackDelegate analogCallbackF)
static bool vrpn_c_close_analog(System.IntPtr device)
static void dummyButtonLogger(Int32 button, Int32 state)
static bool vrpn_c_poll_analog(System.IntPtr device)
static bool vrpn_c_close_button(System.IntPtr device)
static VRPN.VRPNManager getVRPNManager()
delegate void ButtonCallbackDelegate(Int32 button, Int32 state)
static bool vrpn_c_tracker_is_connected(System.IntPtr device)
static bool vrpn_c_close_force_feedback(System.IntPtr device)
delegate void AnalogCallbackDelegate(VRPN.Wrapper.VRPNAnalogReport report)
static System.IntPtr vrpn_c_open_button(string name, ButtonCallbackDelegate buttonCallbackF)
static System.IntPtr vrpn_c_open_force_feedback(string name)
void dummyLogger(uint sensor, System.IntPtr pos, System.IntPtr quat)
delegate void TrackerCallbackDelegate(uint sensor, System.IntPtr pos, System.IntPtr quat)
VRPN.Wrapper.TrackerCallbackDelegate functionPointer
static void dummyAnalogLogger(VRPN.Wrapper.VRPNAnalogReport report)
static System.IntPtr vrpn_c_open_tracker(string name, TrackerCallbackDelegate trackerCallbackF)
static bool vrpn_c_force_feedback_set_force(System.IntPtr device, float force_x, float force_y, float force_z)
static bool vrpn_c_poll_tracker(System.IntPtr device)
static bool vrpn_c_poll_button(System.IntPtr device)
static void vrpn_c_force_feedback_stop(System.IntPtr device)
static bool vrpn_c_close_tracker(System.IntPtr device)