Exemplo n.º 1
0
 public MyClipmap(uint id, MyClipmapScaleEnum scaleGroup, MatrixD worldMatrix, Vector3I sizeLod0, IMyClipmapCellHandler cellProvider, Vector3D massiveCenter, float massiveRadius, PruningFunc prunningFunc)
 {
     m_id            = id;
     m_scaleGroup    = scaleGroup;
     m_worldMatrix   = worldMatrix;
     m_massiveCenter = massiveCenter;
     m_massiveRadius = massiveRadius;
     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;
     m_prunningFunc     = prunningFunc;
 }
Exemplo n.º 2
0
 public MyClipmap(uint id, MyClipmapScaleEnum scaleGroup, MatrixD worldMatrix, Vector3I sizeLod0, IMyClipmapCellHandler cellProvider, Vector3D massiveCenter, float massiveRadius, PruningFunc prunningFunc)
 {
     m_id = id;
     m_scaleGroup = scaleGroup;
     m_worldMatrix = worldMatrix;
     m_massiveCenter = massiveCenter;
     m_massiveRadius = massiveRadius;
     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;
     m_prunningFunc = prunningFunc;
 }