// Use this for initialization
 void Start()
 {
     _OSCReader = new OSCReader();
     _AVG_X     = new MovingAverage(Position_Smoothing);
     _AVG_Y     = new MovingAverage(Position_Smoothing);
     _AVG_Z     = new MovingAverage(Position_Smoothing);
     _AVG_Pitch = new MovingAverage(Orientation_Smoothing);
     _AVG_Roll  = new MovingAverage(Orientation_Smoothing);
     _AVG_Yaw   = new MovingAverage(Orientation_Smoothing);
 }
    public int Orientation_Smoothing;     // Adjust as necessary (1 = No sampling, > 1 = increased smoothing)

    // Use this for initialization
    void Start()
    {
        _OSCReader = new OSCReader();
        _AVG_X     = new DataSmooth(Position_Smoothing);
        _AVG_Y     = new DataSmooth(Position_Smoothing);
        _AVG_Z     = new DataSmooth(Position_Smoothing);
        _AVG_Pitch = new DataSmooth(Orientation_Smoothing);
        _AVG_Roll  = new DataSmooth(Orientation_Smoothing);
        _AVG_Yaw   = new DataSmooth(Orientation_Smoothing);
    }
    private const int _ORIENTATION_SMOOTHING = 3;    // Adjust as necessary (1 = No sampling, > 1 = increased smoothing)

    // Use this for initialization
    void Start()
    {
        _OSCReader = new OSCReader();
        _AVG_X     = new DataSmooth(_POSITION_SMOOTHING);
        _AVG_Y     = new DataSmooth(_POSITION_SMOOTHING);
        _AVG_Z     = new DataSmooth(_POSITION_SMOOTHING);
        _AVG_QtX   = new DataSmooth(_ORIENTATION_SMOOTHING);
        _AVG_QtY   = new DataSmooth(_ORIENTATION_SMOOTHING);
        _AVG_QtZ   = new DataSmooth(_ORIENTATION_SMOOTHING);
        _AVG_QtW   = new DataSmooth(_ORIENTATION_SMOOTHING);
    }
示例#4
0
    // Use this for initialization
    void Start()
    {
        Application.targetFrameRate = 60;
        OSCtimer = 0;

        penrose = GameObject.FindObjectOfType <Penrose>();
        penrose.Init();

        myIPText.text = GetLocalIPv4();

        SetupEffects();
        SetupTransitions();
        try
        {
            setupUDP();
        }
        catch (Exception e)
        {
            Debug.Log($"Failed to setup UDP: {e.Message}");
        }

        osc = gameObject.AddComponent(typeof(OSCReader)) as OSCReader;
        osc.SetAllMessageHandler(OscHandler);
        dance = new Dance();
        dance.Init();
        drum = new drums();
        drum.Init();
        readACN = new ACNHandler();
        readACN.Init();

        cameraOverlay = new CameraReader();
        cameraOverlay.Init((int)penrose.Bounds.size.x, (int)penrose.Bounds.size.y, Penrose.Total);

        timer             = new Timer(effectTime, false);
        timer.onFinished += OnTimerFinished;

        effectText.text = effects[currentEffect].GetType().ToString();
        StartCoroutine(Fps());
    }