Пример #1
0
 public void Tessellate(WindingRule windingRule, ElementType elementType, int polySize, CombineCallback combineCallback)
 {
     _normal          = Vec3.Zero;
     _vertices        = null;
     _elements        = null;
     _windingRule     = windingRule;
     _combineCallback = combineCallback;
     if (_mesh != null)
     {
         ProjectPolygon();
         ComputeInterior();
         if (elementType == ElementType.BoundaryContours)
         {
             SetWindingNumber(1, true);
         }
         else
         {
             TessellateInterior();
         }
         if (elementType == ElementType.BoundaryContours)
         {
             OutputContours();
         }
         else
         {
             OutputPolymesh(elementType, polySize);
         }
         if (UsePooling)
         {
             _mesh.Free();
         }
         _mesh = null;
     }
 }
Пример #2
0
        public void Tessellate(WindingRule windingRule, ElementType elementType, int polySize, CombineCallback combineCallback)
        {
            _normal = Vec3.Zero;
            _vertices = null;
            _elements = null;

            _windingRule = windingRule;
            _combineCallback = combineCallback;

            if (_mesh == null)
            {
                return;
            }

            // Determine the polygon normal and project vertices onto the plane
            // of the polygon.
            ProjectPolygon();

            // ComputeInterior computes the planar arrangement specified
            // by the given contours, and further subdivides this arrangement
            // into regions.  Each region is marked "inside" if it belongs
            // to the polygon, according to the rule given by windingRule.
            // Each interior region is guaranteed be monotone.
            ComputeInterior();

            // If the user wants only the boundary contours, we throw away all edges
            // except those which separate the interior from the exterior.
            // Otherwise we tessellate all the regions marked "inside".
            if (elementType == ElementType.BoundaryContours)
            {
                SetWindingNumber(1, true);
            }
            else
            {
                TessellateInterior();
            }

            _mesh.Check();

            if (elementType == ElementType.BoundaryContours)
            {
                OutputContours();
            }
            else
            {
                OutputPolymesh(elementType, polySize);
            }

            if (UsePooling)
            {
                _mesh.Free();
            }
            _mesh = null;
        }
Пример #3
0
 public static void TessCombineCallBack(IntPtr tess, CombineCallback callback)
 {
     TessCombineCallBack(tess, CallbackName.Combine, callback);
 }
Пример #4
0
 private extern static void TessCombineCallBack(
     IntPtr tesselationObject,
     CallbackName which,
     CombineCallback callback);
Пример #5
0
		public extern static void GluTessCombineCallBack( 
			IntPtr tesselationObject, 
			GlCallbackName which, 
			CombineCallback callback);
Пример #6
0
 private static extern void TessCombineCallBack(
  IntPtr tesselationObject, 
  CallbackName which, 
  CombineCallback callback);
Пример #7
0
 public static void TessCombineCallBack(IntPtr tess, CombineCallback callback)
 {
     TessCombineCallBack(tess, CallbackName.Combine, callback);
 }
Пример #8
0
 /// <summary>
 /// Tessellates the input contours.
 /// </summary>
 /// <param name="windingRule"> Winding rule used for tessellation. See <see cref="WindingRule"/> for details. </param>
 /// <param name="elementType"> Tessellation output type. See <see cref="ElementType"/> for details. </param>
 /// <param name="polySize"> Number of vertices per polygon if output is polygons. </param>
 /// <param name="combineCallback"> Interpolator used to determine the data payload of generated vertices. </param>
 /// <param name="normal"> Normal of the input contours. If set to zero, the normal will be calculated during tessellation. </param>
 public void Tessellate(WindingRule windingRule         = WindingRule.EvenOdd, ElementType elementType = ElementType.Polygons, int polySize = 3,
                        CombineCallback combineCallback = null, Vector3 normal = new Vector3())
 {
     tess.Tessellate(windingRule, elementType, polySize, combineCallback, new Vec3(normal.x, normal.y, normal.z));
 }
Пример #9
0
        public void Tessellate(WindingRule windingRule, ElementType elementType, int polySize, CombineCallback combineCallback)
        {
            _vertices = null;
            _elements = null;

            _windingRule = windingRule;
            _combineCallback = combineCallback;

            if (_mesh == null)
            {
                return;
            }

            // Determine the polygon normal and project vertices onto the plane
            // of the polygon.
            ProjectPolygon();

            // ComputeInterior computes the planar arrangement specified
            // by the given contours, and further subdivides this arrangement
            // into regions.  Each region is marked "inside" if it belongs
            // to the polygon, according to the rule given by windingRule.
            // Each interior region is guaranteed be monotone.
            ComputeInterior();

            // If the user wants only the boundary contours, we throw away all edges
            // except those which separate the interior from the exterior.
            // Otherwise we tessellate all the regions marked "inside".
            if (elementType == ElementType.BoundaryContours)
            {
                SetWindingNumber(1, true);
            }
            else
            {
                TessellateInterior();
            }

            _mesh.Check();

            if (elementType == ElementType.BoundaryContours)
            {
                OutputContours();
            }
            else
            {
                OutputPolymesh(elementType, polySize);
            }

            _mesh = null;
        }
Пример #10
0
 public extern static void GluTessCombineCallBack(
     IntPtr tesselationObject,
     GlCallbackName which,
     CombineCallback callback);
Пример #11
0
 public void Tessellate(WindingRule windingRule, ElementType elementType, int polySize, CombineCallback combineCallback)
 {
     Tessellate(windingRule, elementType, polySize, combineCallback, Vec3.Zero);
 }