示例#1
0
        public override void Commit()
        {
            if (chunk.Blocks.NonEmptyBlocks <= 0)
            {
                return;
            }

            // Prepare a bounding box for our geometry
            int    minX   = chunk.MinBounds & 0xFF;
            int    minY   = (chunk.MinBounds >> 8) & 0xFF;
            int    minZ   = (chunk.MinBounds >> 16) & 0xFF;
            int    maxX   = chunk.MaxBounds & 0xFF;
            int    maxY   = (chunk.MaxBounds >> 8) & 0xFF;
            int    maxZ   = (chunk.MaxBounds >> 16) & 0xFF;
            Bounds bounds = new Bounds(
                new Vector3((minX + maxX) >> 1, (minY + maxY) >> 1, (minZ + maxZ) >> 1),
                new Vector3(maxX - minX, maxY - minY, maxZ - minZ)
                );

            // Generate a mesh
            Batcher.Commit(
                chunk.world.transform.rotation * chunk.Pos + chunk.world.transform.position,
                chunk.world.transform.rotation,
                ref bounds
#if DEBUG
                , chunk.Pos.ToString()
#endif
                );
        }
        public override void Commit()
        {
            Batcher.Commit(
                chunk.world.transform.rotation * chunk.pos + chunk.world.transform.position,
                chunk.world.transform.rotation, chunk.world.renderMaterial
#if DEBUG
                , chunk.pos.ToString()
#endif
                );
        }
示例#3
0
        public override void Commit()
        {
            Batcher.Commit(
                chunk.world.transform.rotation * chunk.pos + chunk.world.transform.position,
                chunk.world.transform.rotation, chunk.world.physicsMaterial
#if DEBUG
                , chunk.pos + "C"
#endif
                );
        }