Пример #1
0
        public MoveController(int _controllerNumber)
        {
            controllerNumber = _controllerNumber;
            moveColor        = new MoveColor();
            currentlyTracked = false;
            active           = false;

            // Initialise raw vectors.
            accelerometerRaw = new Vector3();
            gyroscopeRaw     = new Vector3();
            magnetometerRaw  = new Vector3();
            quaternion       = new Quaternion();
            positionRaw      = new Vector3();
            positionNorm     = new Vector2();

            // Initialise Smoothed Vectors
            // TODO: ALLOW USER TO DECIDE SMOOTHING AMOUNTS
            positionSmoothed      = new SmoothedVector3(5);
            positionNormSmooothed = new SmoothedVector3(5);
            gyroscopeSmoothed     = new SmoothedVector3(5);
            accelerometerSmoothed = new SmoothedVector3(5);
            magnetometerSmoothed  = new SmoothedVector3(5);
        }
Пример #2
0
        public MoveController(int _controllerNumber)
        {
            controllerNumber = _controllerNumber;
            moveColor = new MoveColor();
            currentlyTracked = false;
            active = false;

            // Initialise raw vectors.
            accelerometerRaw = new Vector3();
            gyroscopeRaw = new Vector3();
            magnetometerRaw = new Vector3();
            quaternion = new Quaternion();
            positionRaw = new Vector3();
            positionNorm = new Vector2();

            // Initialise Smoothed Vectors 
            // TODO: ALLOW USER TO DECIDE SMOOTHING AMOUNTS
            positionSmoothed = new SmoothedVector3(5);
            positionNormSmooothed = new SmoothedVector3(5);
            gyroscopeSmoothed = new SmoothedVector3(5); 
            accelerometerSmoothed = new SmoothedVector3(5); 
            magnetometerSmoothed = new SmoothedVector3(5); 
        }