Exemple #1
0
    public ILODNodeData CreateLODNodeData(LODOctreeNode node)
    {
        Block45LODNodeData data = new Block45LODNodeData(node);

        data.HelperProc = this;
        return(data);
    }
Exemple #2
0
 public void AttachLODNode(Block45LODNodeData nData)
 {
     _nData = nData;
     if (_nData != null)
     {
         _nData.AddOctNode(this);
     }
 }
Exemple #3
0
    public void OnDestroyNodeData(ILODNodeData ndata)
    {
        Block45LODNodeData cdata = ndata as Block45LODNodeData;
        IntVector4         cpos  = cdata.ChunkPosLod;

        if (cpos != null && cpos.w == 0)
        {
            SceneChunkDependence.Instance.ValidListRemove(cpos, EDependChunkType.ChunkBlkMask);
        }
    }
Exemple #4
0
    public void OnEndUpdateNodeData(ILODNodeData ndata)
    {
        Block45LODNodeData cdata = ndata as Block45LODNodeData;

        if (cdata.LOD == 0 && cdata.IsAllOctNodeReady())
        {
            EDependChunkType type = cdata.IsEmpty   ? EDependChunkType.ChunkBlkEmp
                                                                                                        : EDependChunkType.ChunkBlkCol;
            SceneChunkDependence.Instance.ValidListAdd(cdata.ChunkPosLod, type);
        }
    }
Exemple #5
0
 public void OnBegUpdateNodeData(ILODNodeData ndata)
 {
     if (LODOctreeMan._maxLod == 0)
     {
         Block45LODNodeData cdata = ndata as Block45LODNodeData;
         if (cdata.LOD == 0 && cdata.IsNodePosChange())
         {
             SceneChunkDependence.Instance.ValidListRemove(cdata.ChunkPosLod, EDependChunkType.ChunkBlkMask);
         }
     }
 }
Exemple #6
0
    public void ChunkProcPreLoadData(ILODNodeData nData)
    {
        if (_dataSource == null || _dataSource.RootNode == null)
        {
            return;
        }

        Block45LODNodeData b45NodeData = nData as Block45LODNodeData;
        int size = 1 << (LODOctreeMan.Lod0NodeShift + b45NodeData.ChunkPosLod.w);

        _tmpBoundPos.x = b45NodeData.ChunkPosLod.x << VoxelTerrainConstants._shift;
        _tmpBoundPos.y = b45NodeData.ChunkPosLod.y << VoxelTerrainConstants._shift;
        _tmpBoundPos.z = b45NodeData.ChunkPosLod.z << VoxelTerrainConstants._shift;
        _tmpLstBlock45Datas.Clear();
        lock (b45NodeData) {
            Block45OctNode.FindNodesCenterInside(_tmpBoundPos, size, b45NodeData.LOD, _dataSource.RootNode, ref _tmpLstBlock45Datas);
            b45NodeData.SetBlock45Datas(_tmpLstBlock45Datas);
        }
    }
Exemple #7
0
 public void DetachLODNode()
 {
     DestroyChunkGo();
     _nData = null;
 }