コード例 #1
0
 private void InitializeSurfaces()
 {
     this.surfaces.Clear();
     foreach (FaceOrientation faceOrientation in Util.GetValues <FaceOrientation>())
     {
         TrixelEmplacement firstTrixel   = new TrixelEmplacement(FezMath.IsPositive(faceOrientation) ? FezMath.AsVector(faceOrientation) * (this.size * 16f - Vector3.One) : Vector3.Zero);
         TrixelSurface     trixelSurface = new TrixelSurface(faceOrientation, firstTrixel);
         Vector3           mask1         = FezMath.GetMask(FezMath.AsAxis(FezMath.GetTangent(faceOrientation)));
         int     num1  = (int)Vector3.Dot(this.size, mask1) * 16;
         Vector3 mask2 = FezMath.GetMask(FezMath.AsAxis(FezMath.GetBitangent(faceOrientation)));
         int     num2  = (int)Vector3.Dot(this.size, mask2) * 16;
         trixelSurface.RectangularParts.Add(new RectangularTrixelSurfacePart()
         {
             Orientation   = faceOrientation,
             TangentSize   = num1,
             BitangentSize = num2,
             Start         = firstTrixel
         });
         for (int index1 = 0; index1 < num1; ++index1)
         {
             for (int index2 = 0; index2 < num2; ++index2)
             {
                 trixelSurface.Trixels.Add(new TrixelEmplacement(firstTrixel + mask1 * (float)index1 + mask2 * (float)index2));
             }
         }
         this.surfaces.Add(trixelSurface);
     }
 }