Example #1
0
    public void Start()
    {
        Circles = new HapticCircle[HandPositions.Length];

        for (int i = 0; i < Circles.Length; i++)
        {
            Circles[i] = new HapticCircle()
            {
                Position = new Vector3(0, 0, 0),
                Radius   = _circleRadius,
            };
        }

        // Create a timepoint streaming emitter
        // Note that this automatically attempts to connect to the device, if present
        _emitter = new TimePointStreamingEmitter();

        // Inform the SDK how many control points you intend to use
        // This also calculates the resulting sample rate in Hz, which is returned to the user
        uint sample_rate = _emitter.setMaximumControlPointCount((uint)HandPositions.Length);

        _emitter.setExtendedOption("setFilterCutoffFrequencies", "0 0 0 0");

        // Set our callback to be called each time the device is ready for new points
        _emitter.setEmissionCallback(Callback, null);

        // Instruct the device to call our callback and begin emitting
        bool started = _emitter.start();

        if (!started)
        {
            // We couldn't use the emitter, so exit immediately
            Console.WriteLine("Could not start emitter.");
        }
    }
Example #2
0
    void OnEnable()
    {
        // Create a timepoint streaming emitter
        // Note that this automatically attempts to connect to the device, if present
        _emitter = new TimePointStreamingEmitter();



        //Remove Cap
        _emitter.setExtendedOption("solverCappingConstant", "3000");

        // Inform the SDK how many control points you intend to use
        // This also calculates the resulting sample rate in Hz, which is returned to the user
        sample_rate      = _emitter.setMaximumControlPointCount(1);
        _timepoint_count = (uint)(sample_rate / desired_frequency);

        //Initalize Positions and Intensities
        _positions   = new Ultrahaptics.Vector3[_timepoint_count];
        _intensities = new float[_timepoint_count];
    }