示例#1
0
 public ControllerInput(int handle, string name)
 {
     this.handle = handle;
     this.name   = name;
     //
     m_State     = new XDevicePlugin.ControllerState();
     m_PrevState = new XDevicePlugin.ControllerState();
 }
        public static int GetInputState(int which, ref XDevicePlugin.ControllerState state)
        {
            ExternalControllerDevice device = ExternalControllerDevice.GetInputDevice(which);

            if (device == null)
            {
                return(-1);
            }
            //
            return(device.GetInputState(ref state));
        }
        /// <summary>
        ///
        /// </summary>
        public virtual void ResetStatePose(ref XDevicePlugin.ControllerState state)
        {
            int i;

            // Motion ???
            i = 0;
            state.position[i++] = 0f;
            state.position[i++] = 0f;
            state.position[i++] = 0f;
            i = 0;
            state.rotation[i++] = 0f;
            state.rotation[i++] = 0f;
            state.rotation[i++] = 0f;
            state.rotation[i++] = 1f;
        }
 /// <summary>
 ///
 /// </summary>
 public virtual int GetInputState(ref XDevicePlugin.ControllerState state)
 {
     return(-1);
 }