Exemplo n.º 1
0
        /// <summary>
        /// Add a triple of envelopes to simulate the old texture velocity
        /// parameters.
        /// </summary>
        static int add_tvel(float[] pos, float[] vel, LinkedList <lwEnvelope> elist, ref int nenvs)
        {
            lwEnvelope env = null;
            lwKey      key0, key1;

            for (int i = 0; i < 3; i++)
            {
                env     = new lwEnvelope();
                env.key = new LinkedList <lwKey>();
                key0    = new lwKey();
                key1    = new lwKey();

                key0.value = pos[i];
                key0.time  = 0.0f;
                key1.value = pos[i] + vel[i] * 30.0f;
                key1.time  = 1.0f;
                key0.shape = key1.shape = LWID.ID_LINE;

                env.index = nenvs + i + 1;
                env.type  = 0x0301 + i;
                env.name  = String.Format("{0}{1}", "Position.", 'X' + i);

                env.key.AddFirst(key0);
                env.key.AddLast(key1);
                env.nkeys       = 2;
                env.behavior[0] = LWID.BEH_LINEAR;
                env.behavior[1] = LWID.BEH_LINEAR;

                elist.AddLast(env);
            }

            nenvs += 3;
            return(env.index - 2);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Add a triple of envelopes to simulate the old texture velocity
        /// parameters.
        /// </summary>
        static int add_tvel(float[] pos, float[] vel, LinkedList<lwEnvelope> elist, ref int nenvs)
        {
            lwEnvelope env = null;
            lwKey key0, key1;

            for (int i = 0; i < 3; i++)
            {
                env = new lwEnvelope();
                env.key = new LinkedList<lwKey>();
                key0 = new lwKey();
                key1 = new lwKey();

                key0.value = pos[i];
                key0.time = 0.0f;
                key1.value = pos[i] + vel[i] * 30.0f;
                key1.time = 1.0f;
                key0.shape = key1.shape = LWID.ID_LINE;

                env.index = nenvs + i + 1;
                env.type = 0x0301 + i;
                env.name = String.Format("{0}{1}", "Position.", 'X' + i);

                env.key.AddFirst(key0);
                env.key.AddLast(key1);
                env.nkeys = 2;
                env.behavior[0] = LWID.BEH_LINEAR;
                env.behavior[1] = LWID.BEH_LINEAR;

                elist.AddLast(env);
            }

            nenvs += 3;
            return env.index - 2;
        }