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; } }
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; }
public static void TessCombineCallBack(IntPtr tess, CombineCallback callback) { TessCombineCallBack(tess, CallbackName.Combine, callback); }
private extern static void TessCombineCallBack( IntPtr tesselationObject, CallbackName which, CombineCallback callback);
public extern static void GluTessCombineCallBack( IntPtr tesselationObject, GlCallbackName which, CombineCallback callback);
private static extern void TessCombineCallBack( IntPtr tesselationObject, CallbackName which, CombineCallback callback);
/// <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)); }
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; }
public void Tessellate(WindingRule windingRule, ElementType elementType, int polySize, CombineCallback combineCallback) { Tessellate(windingRule, elementType, polySize, combineCallback, Vec3.Zero); }