예제 #1
0
        /// <param name="minCellLod0">Inclusive.</param>
        /// <param name="maxCellLod0">Inclusive.</param>
        public void InvalidateRange(Vector3I minCellLod0, Vector3I maxCellLod0)
        {
            //Debug.Print("InvalidateRange Clipmap: " + Id + " Min: " + minCellLod0 + " Max: " + maxCellLod0);

            if (minCellLod0 == Vector3I.Zero &&
                maxCellLod0 == m_sizeLod0 - 1)
            {
                for (int lod = 0; lod < m_lodLevels.Length; ++lod)
                {
                    m_lodLevels[lod].InvalidateAll();
                }
            }
            else
            {
                for (int lod = 0; lod < m_lodLevels.Length; ++lod)
                {
                    var shift = lod + MyVoxelCoordSystems.RenderCellSizeInLodVoxelsShiftDelta(lod);
                    m_lodLevels[lod].InvalidateRange(
                        minCellLod0 >> shift,
                        maxCellLod0 >> shift);
                }
            }

            m_invalidated = 2;

            ResetClipping();
        }
예제 #2
0
 public MyClipmap(uint id, MyClipmapScaleEnum scaleGroup, MatrixD worldMatrix, Vector3I sizeLod0, IMyClipmapCellHandler cellProvider)
 {
     m_scaleGroup  = scaleGroup;
     m_worldMatrix = worldMatrix;
     MatrixD.Invert(ref m_worldMatrix, out m_invWorldMatrix);
     m_sizeLod0  = sizeLod0;
     m_localAABB = new BoundingBoxD(Vector3D.Zero, new Vector3D(sizeLod0 * MyVoxelCoordSystems.RenderCellSizeInMeters(0)));
     for (int lod = 0; lod < m_lodLevels.Length; ++lod)
     {
         var sizeShift = lod + MyVoxelCoordSystems.RenderCellSizeInLodVoxelsShiftDelta(lod);
         m_lodLevels[lod] = new LodLevel(this, lod, ((m_sizeLod0 - 1) >> sizeShift) + 1);
     }
     m_updateQueueItem  = new UpdateQueueItem(this);
     m_requestCollector = new RequestCollector(id);
     m_cellHandler      = cellProvider;
 }
예제 #3
0
 /// <param name="minCellLod0">Inclusive.</param>
 /// <param name="maxCellLod0">Inclusive.</param>
 public void InvalidateRange(Vector3I minCellLod0, Vector3I maxCellLod0)
 {
     if (minCellLod0 == Vector3I.Zero &&
         maxCellLod0 == m_sizeLod0 - 1)
     {
         for (int lod = 0; lod < m_lodLevels.Length; ++lod)
         {
             m_lodLevels[lod].InvalidateAll();
         }
     }
     else
     {
         for (int lod = 0; lod < m_lodLevels.Length; ++lod)
         {
             var shift = lod + MyVoxelCoordSystems.RenderCellSizeInLodVoxelsShiftDelta(lod);
             m_lodLevels[lod].InvalidateRange(
                 minCellLod0 >> shift,
                 maxCellLod0 >> shift);
         }
     }
     m_updateClipping = true;
 }