public static VREvent MakeEvent(string name, string type, float?analogValue = null)
        {
            VREvent e = new VREvent(name);

            e.AddData("EventType", type);

            if (analogValue.HasValue)
            {
                e.AddData("AnalogValue", analogValue.Value);
            }

            return(e);
        }
Exemple #2
0
    // Add a single new event called "ImageUpdate" that contains a buffer of floats
    // for the image data.
    public void AddEventsSinceLastFrame(ref List <VREvent> eventList)
    {
        int w = 100;
        int h = 100;

        float[] imgBuffer = new float[w * h];
        int     index     = 0;

        for (int y = 0; y < h; y++)
        {
            for (int x = 0; x < w; x++)
            {
                if (index % 2 == 0)
                {
                    imgBuffer[index] = 1.0f;
                }
                else
                {
                    imgBuffer[index] = 0.0f;
                }
                index++;
            }
        }

        VREvent e = new VREvent("ImageUpdate");

        e.AddData("Buffer", imgBuffer);
        eventList.Add(e);
    }