internal void End()
        {
            if (m_list.Count > 0)
            {
                var batch = MyLinesRenderer.CreateBatch();
                for (int i = 0; i < m_list.Count; i++)
                {
                    batch.Add(m_list[i]);
                }
                batch.Commit();
            }

            if (m_onScreenList.Count > 0)
            {
                var batch = MyLinesRenderer.CreateBatch();
                for (int i = 0; i < m_onScreenList.Count; i++)
                {
                    batch.Add(m_onScreenList[i]);
                }
                batch.CustomViewProjection = Matrix.Identity;
                batch.Commit();
            }

            m_list.Clear();
            m_onScreenList.Clear();
        }
Пример #2
0
        public void DrawShadowVolumeIntoWorld()
        {
            var lineBatch = MyLinesRenderer.CreateBatch();

            MatrixD inverseViewProj = MatrixShadowToWorldAt0Space;

            Vector3D.Transform(m_boxVertices, ref inverseViewProj, m_tmpDrawShadowVolume8D);

            for (int vertexIndex = 0; vertexIndex < 8; ++vertexIndex)
            {
                m_tmpDrawShadowVolume8[vertexIndex] = m_tmpDrawShadowVolume8D[vertexIndex];
            }

            MyPrimitivesRenderer.Draw6FacedConvexZ(m_tmpDrawShadowVolume8, DebugShadowVolumeColor, 0.2f);
            lineBatch.Add6FacedConvex(m_tmpDrawShadowVolume8, Color.Pink);

            lineBatch.Commit();
        }