示例#1
0
        public void Update(Vector3 Coord, IWorld _World)
        {
            //Get Chunk Location
            m_ChunkInWorld = new ChunkInWorld(Coord, _World);
            //Get Section Location
            m_SecInWorld = new SectionInWorld(Coord, _World);
            //Get Block Location
            m_BlkInSection = new BlockInSection(Coord, _World);
            //Get Block Location In World
            m_BlkInWorld = new BlockInWorld(m_SecInWorld, m_BlkInSection, _World);

            //Get Chunk
            m_Chunk = _World.Entity.GetChunk(m_ChunkInWorld);
            if (m_Chunk == null)
            {
                m_Section = null; m_Block = null; return;
            }

            //Get Section
            m_Section = m_Chunk.GetSection(m_SecInWorld.ToSectionInChunk());
            if (m_Section == null)
            {
                m_Block = null;; return;
            }

            //Get Block
            m_Block = m_Section.Voxel.GetBlock(m_BlkInSection);
        }
示例#2
0
        public BlockLocation(SectionInWorld SecInWorld, BlockInSection BlkInSec, IWorld _World)
        {
            //Get Section Location
            m_SecInWorld = SecInWorld;
            //Get Block Location
            m_BlkInSection = BlkInSec;
            //Get Chunk Location
            m_ChunkInWorld = m_SecInWorld.ToChunkInWorld(_World);
            //Get Block Location In World
            m_BlkInWorld = new BlockInWorld(m_SecInWorld, m_BlkInSection, _World);

            //Get Chunk
            m_Chunk = _World.Entity.GetChunk(m_ChunkInWorld);
            if (m_Chunk == null)
            {
                m_Section = null; m_Block = null; return;
            }

            //Get Section
            m_Section = m_Chunk.GetSection(m_SecInWorld.ToSectionInChunk());
            if (m_Section == null)
            {
                m_Block = null;; return;
            }

            //Get Block
            m_Block = m_Section.Voxel.GetBlock(m_BlkInSection);
        }