コード例 #1
0
        protected void RotateModel(IPlayer byPlayer, bool clockwise)
        {
            List <uint>        rotatedCuboids = new List <uint>();
            CuboidWithMaterial cwm            = tmpCuboid;

            foreach (var val in VoxelCuboids)
            {
                FromUint(val, cwm);
                Cuboidi rotated = cwm.RotatedCopy(0, clockwise ? 90 : -90, 0, new Vec3d(8, 8, 8));
                cwm.Set(rotated.X1, rotated.Y1, rotated.Z1, rotated.X2, rotated.Y2, rotated.Z2);
                rotatedCuboids.Add(ToCuboid(cwm));
            }
            VoxelCuboids = rotatedCuboids;

            rotatedCuboids = new List <uint>();
            foreach (var val in SnowCuboids)
            {
                FromUint(val, cwm);
                Cuboidi rotated = cwm.RotatedCopy(0, clockwise ? 90 : -90, 0, new Vec3d(8, 8, 8));
                cwm.Set(rotated.X1, rotated.Y1, rotated.Z1, rotated.X2, rotated.Y2, rotated.Z2);
                rotatedCuboids.Add(ToCuboid(cwm));
            }

            SnowCuboids = rotatedCuboids;
        }
コード例 #2
0
        private void RotateModel(IPlayer byPlayer, bool clockwise)
        {
            List <uint> rotatedCuboids = new List <uint>();

            foreach (var val in this.VoxelCuboids)
            {
                FromUint(val, ref tmpCuboid);
                Cuboidi rotated = tmpCuboid.RotatedCopy(0, clockwise ? 90 : -90, 0, new Vec3d(8, 8, 8));
                tmpCuboid.Set(rotated.X1, rotated.Y1, rotated.Z1, rotated.X2, rotated.Y2, rotated.Z2);
                rotatedCuboids.Add(ToCuboid(tmpCuboid));
            }

            VoxelCuboids = rotatedCuboids;
        }