Beispiel #1
0
 public static string ToString(TrackerInput input, int[] nodes)
 {
     System.Text.StringBuilder sb = new System.Text.StringBuilder(string.Format(
                                                                      "TrackingInput@{0} Timestamp:{1}\n", input.m_Handle, input.m_State.frameCount));
     if (XDevicePlugin.GetInt(input.m_Handle, XDevicePlugin.kField_ConnectionStateInt, 0) != (int)DeviceConnectionState.Connected)
     {
         //
         sb.Append("Connection State=\"" + ((DeviceConnectionState)XDevicePlugin.GetInt(input.m_Handle, XDevicePlugin.kField_ConnectionStateInt, 0)));
         sb.Append("\"\nError Code=\"" + XDevicePlugin.GetInt(input.m_Handle, XDevicePlugin.kField_ErrorCodeInt, 0) + "\"");
     }
     else
     {
         Vector3 pos = new Vector3();
         int     node; for (int i = 0, imax = nodes.Length; i < imax; ++i)
         {
             node = nodes[i];
             if (input.Exists(node))
             {
                 pos = input.GetLocalPosition(node);
                 sb.AppendLine(string.Format("Node@{0} is {1}",
                                             node, pos.ToString("F3")));
             }
             else
             {
                 sb.AppendLine(string.Format("Node@{0} is not existed.", node));
             }
         }
     }
     return(sb.ToString());
 }
Beispiel #2
0
        /*/ <!-- TODO : Fix Inside-out Shake.
         * [System.NonSerialized]protected bool m_FixInsideOutShake;
         * [System.NonSerialized]protected int m_FixedFrameCount;
         *
         * [System.NonSerialized]protected float m_HmdSleepVelocity=0.0010f;
         * [System.NonSerialized]protected float m_ControllerSleepVelocity=0.1f;
         * [System.NonSerialized]protected float m_LerpFactor=0.25f;
         *
         * [System.NonSerialized]protected float m_FadeMaxTime=0.125f;
         * [System.NonSerialized]protected float m_FadeTime=0.0f;
         *
         * [System.NonSerialized]protected TrackingResult m_PrevTrackingResult;
         * [System.NonSerialized]protected Vector3 m_PrevPosition;
         */// TODO : Fix Inside-out Shake. -->

        public XCobraInput(TrackerInput trackingInput, string name, int defaultNode) : base(name)
        {
            this.trackerInput = trackingInput;
            this.node         = defaultNode;
            if (this.trackerInput is XHawkInput)
            {
                xHawkInput = this.trackerInput as XHawkInput;

                /*/ <!-- TODO : Fix Inside-out Shake.
                 * m_FixInsideOutShake=(XDevicePlugin.GetInt(-1,XDevicePlugin.kField_CtxDeviceVersion,0)&0xF000)==0x3000&&
                 *      PlayerPrefsEx.GetBool("XimmerseTracker[Inside-out].fixShake",false);
                 */// TODO : Fix Inside-out Shake. -->
            }
        }
Beispiel #3
0
 public virtual TrackedControllerInput CreateControllerInput(string name, TrackerInput trackerInput, int defaultNode)
 {
     return(new TrackedControllerInput(name, trackerInput, defaultNode));
 }