Ejemplo n.º 1
0
        public static Ray_t Init(Vector3 start, Vector3 end)
        {
            var ray = new Ray_t();

            if (end == null)
            {
                return(ray);
            }
            var m_Delta = (end - start);

            ray.m_Delta   = m_Delta.Aligned();
            ray.m_IsSwept = (m_Delta.LengthSqr() != 0);

            ray.m_Extents = Vector3.Zero.Aligned();
            ray.m_IsRay   = true;

            // Offset m_Start to be in the center of the box...
            ray.m_StartOffset = start.Aligned();
            return(ray);
        }
Ejemplo n.º 2
0
        bool m_IsSwept; // is delta != 0?

        #region Methods

        public static Ray_t Init(Vector3 start, Vector3  end)
        {
            var ray = new Ray_t();
            if (end == null)
                return ray;
            var m_Delta = (end - start);
            ray.m_Delta = m_Delta.Aligned();
            ray.m_IsSwept = (m_Delta.LengthSqr() != 0);

            ray.m_Extents = Vector3.Zero.Aligned();
            ray.m_IsRay = true;

            // Offset m_Start to be in the center of the box...
            ray.m_StartOffset = start.Aligned();
            return ray;
        }