Пример #1
0
 public Subsection(ISharpShape Source, Vector Offset, Vector Scale)
 {
     this._Source = Source;
     this._Scale = Scale;
     this._Offset = Offset;
 }
Пример #2
0
 /// <summary>
 /// Creates an octotree representation of a shape with the specified resolution(Tree depth).
 /// </summary>
 public static OctoTree Create(ISharpShape Shape, int Resolution)
 {
     if (Resolution > 0)
     {
         OctoTree[] children = new OctoTree[8];
         for (int t = 0; t < 8; t++)
         {
             children[t] = Create(Shape.Subsect(Offset(t), new Vector(0.5, 0.5, 0.5)), Resolution - 1);
         }
         return Get(children);
     }
     else
     {
         if (Shape.Occupies(new Vector(0.0, 0.0, 0.0)))
         {
             return _Full;
         }
         else
         {
             return _Empty;
         }
     }
 }