Beispiel #1
0
        public static float sol_test_edge(float dt,
                                          float[] T,
                                          s_ball up,
                                          s_file fp,
                                          s_edge ep,
                                          float[] o,
                                          float[] w)
        {
            float[] q = new float[3];
            float[] u = new float[3];

            Vec3.v_cpy(q, fp.m_vv[ep.m_vi].m_p);
            Vec3.v_sub(u, fp.m_vv[ep.m_vj].m_p,
                       fp.m_vv[ep.m_vi].m_p);

            return(v_edge(T, o, q, u, w, up.m_p, up.m_v, up.m_r));
        }
Beispiel #2
0
        public static float sol_test_lump(float dt,
                                          float[] T,
                                          s_ball up,
                                          s_file fp,
                                          s_lump lp,
                                          float[] o,
                                          float[] w)
        {
            float[] U = new float[3] {
                0.0f, 0.0f, 0.0f
            };

            float u, t = dt;
            int   i;

            /* Short circuit a non-solid lump. */

            if ((lp.m_fl & Solid.L_DETAIL) != 0)
            {
                return(t);
            }

            /* Test all verts */

            if (up.m_r > 0.0f)
            {
                for (i = 0; i < lp.m_vc; i++)
                {
                    s_vert vp = fp.m_vv[fp.m_iv[lp.m_v0 + i]];

                    if ((u = sol_test_vert(t, U, up, vp, o, w)) < t)
                    {
                        Vec3.v_cpy(T, U);
                        t = u;
                    }
                }
            }

            /* Test all edges */

            if (up.m_r > 0.0f)
            {
                for (i = 0; i < lp.m_ec; i++)
                {
                    s_edge ep = fp.m_ev[fp.m_iv[lp.m_e0 + i]];

                    if ((u = sol_test_edge(t, U, up, fp, ep, o, w)) < t)
                    {
                        Vec3.v_cpy(T, U);
                        t = u;
                    }
                }
            }

            /* Test all sides */

            for (i = 0; i < lp.m_sc; i++)
            {
                s_side sp = fp.m_sv[fp.m_iv[lp.m_s0 + i]];

                if ((u = sol_test_side(t, U, up, fp, lp, sp, o, w)) < t)
                {
                    Vec3.v_cpy(T, U);
                    t = u;
                }
            }
            return(t);
        }
Beispiel #3
0
 public static void sol_load_edge(IntPtr fin, s_edge ep)
 {
     Binary.get_index(fin, ref ep.m_vi);
     Binary.get_index(fin, ref ep.m_vj);
 }