Ejemplo n.º 1
0
        public virtual void GetBroadphaseAabb(out IndexedVector3 aabbMin, out IndexedVector3 aabbMax)
        {
            DbvtAabbMm bounds = new DbvtAabbMm();

            if (!m_sets[0].Empty())
            {
                if (!m_sets[1].Empty())
                {
                    DbvtAabbMm.Merge(ref m_sets[0].m_root.volume, ref m_sets[1].m_root.volume, ref bounds);
                }
                else
                {
                    bounds = m_sets[0].m_root.volume;
                }
            }
            else if (!m_sets[1].Empty())
            {
                bounds = m_sets[1].m_root.volume;
            }
            else
            {
                IndexedVector3 temp = IndexedVector3.Zero;
                bounds = DbvtAabbMm.FromCR(ref temp, 0);
            }
            aabbMin = bounds.Mins();
            aabbMax = bounds.Maxs();
        }