Example #1
0
        public void sol_bill(float[] M, float t)
        {
            s_mtrl mp = s_mtrl.default_mtrl;

            int ri;

            for (ri = 0; ri < m_rc; ++ri)
            {
                s_bill rp = m_rv[ri];

                float T = rp.m_t * t;
                float S = (float)System.Math.Sin(T);

                float w  = rp.m_w[0] + rp.m_w[1] * T + rp.m_w[2] * S;
                float h  = rp.m_h[0] + rp.m_h[1] * T + rp.m_h[2] * S;
                float rx = rp.m_rx[0] + rp.m_rx[1] * T + rp.m_rx[2] * S;
                float ry = rp.m_ry[0] + rp.m_ry[1] * T + rp.m_ry[2] * S;
                float rz = rp.m_rz[0] + rp.m_rz[1] * T + rp.m_rz[2] * S;

                mp = m_mv[rp.m_mi].sol_draw_mtrl(mp);

                Video.MODELVIEW_PushMatrix();
                {
                    Video.MODELVIEW_Translate(rp.m_p[0], rp.m_p[1], rp.m_p[2]);

                    if (M != null &&
                        ((rp.m_fl & Solid.B_NOFACE) == 0))
                    {
                        Video.MODELVIEW_MultMatrix(M);
                    }

                    if (System.Math.Abs(rx) > 0.0f)
                    {
                        Video.MODELVIEW_Rotate(rx, 1.0f, 0.0f, 0.0f);
                    }
                    if (System.Math.Abs(ry) > 0.0f)
                    {
                        Video.MODELVIEW_Rotate(ry, 0.0f, 1.0f, 0.0f);
                    }
                    if (System.Math.Abs(rz) > 0.0f)
                    {
                        Video.MODELVIEW_Rotate(rz, 0.0f, 0.0f, 1.0f);
                    }

                    Video.Begin(Video.TRIANGLE_FAN);//GL_QUADS);
                    {
                        Video.TexCoord2(0.0f, 0.0f); Video.Vertex2(-w / 2, -h / 2);
                        Video.TexCoord2(1.0f, 0.0f); Video.Vertex2(+w / 2, -h / 2);
                        Video.TexCoord2(1.0f, 1.0f); Video.Vertex2(+w / 2, +h / 2);
                        Video.TexCoord2(0.0f, 1.0f); Video.Vertex2(-w / 2, +h / 2);
                    }
                    Video.End();
                }
                Video.MODELVIEW_PopMatrix();
            }

            mp = s_mtrl.default_mtrl.sol_draw_mtrl(mp);
        }
Example #2
0
 public static void sol_load_bill(IntPtr fin, s_bill rp)
 {
     Binary.get_index(fin, ref rp.m_fl);
     Binary.get_index(fin, ref rp.m_mi);
     Binary.get_float(fin, ref rp.m_t);
     Binary.get_float(fin, ref rp.m_d);
     Binary.get_array(fin, rp.m_w, 3);
     Binary.get_array(fin, rp.m_h, 3);
     Binary.get_array(fin, rp.m_rx, 3);
     Binary.get_array(fin, rp.m_ry, 3);
     Binary.get_array(fin, rp.m_rz, 3);
     Binary.get_array(fin, rp.m_p, 3);
 }