Ejemplo n.º 1
0
        public static AABB BlockAABB(BlockID block, Level lvl)
        {
            BlockDefinition def = lvl.GetBlockDef(block);

            if (def != null)
            {
                return(new AABB(def.MinX * 2, def.MinZ * 2, def.MinY * 2,
                                def.MaxX * 2, def.MaxZ * 2, def.MaxY * 2));
            }

            if (block >= Block.Extended)
            {
                return(new AABB(0, 0, 0, 32, 32, 32));
            }
            BlockID core = Convert(block);

            return(new AABB(0, 0, 0, 32, DefaultSet.Height(core) * 2, 32));
        }
Ejemplo n.º 2
0
        public static AABB BlockAABB(ExtBlock block, Level lvl)
        {
            BlockDefinition def = lvl.GetBlockDef(block);

            if (def != null)
            {
                return(new AABB(def.MinX * 2, def.MinZ * 2, def.MinY * 2,
                                def.MaxX * 2, def.MaxZ * 2, def.MaxY * 2));
            }

            if (block.BlockID == Block.custom_block)
            {
                return(new AABB(0, 0, 0, 32, 32, 32));
            }

            byte core = Block.Convert(block.BlockID);

            return(new AABB(0, 0, 0, 32, DefaultSet.Height(core) * 2, 32));
        }