Tessellator

A class responsible for handling tessellation functionality. Tessellation is the process of dividing a polygonal shape into smaller components such as triangles or other primitives for rendering purposes.

Tessellator extends GLUtessellatorImpl and provides a concrete implementation of tessellation callbacks for processing vertices, handling errors, and combining coordinates during the tessellation process.

The primary output of the tessellation process is a list of primitives that contain the tessellated shapes and their respective vertex positions.

The internal callbacks handle the following:

  • Beginning the creation of a new primitive by detecting the type of primitive to be generated.

  • Storing vertex positions associated with the current tessellation primitive.

  • Handling errors that may arise during tessellation.

  • Combining vertices when new intersection points are generated during tessellation.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
fun callCombineOrCombineData(coords: DoubleArray?, vertexData: Array<Any?>?, weights: FloatArray?, outData: Array<Any?>?)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun gluDeleteTess()

Deletes a previously created GLU tessellation object. This method should be called to free resources associated with the tessellator when it is no longer needed. After calling this, the tessellation object becomes invalid and should not be used.

Link copied to clipboard
open override fun gluEndPolygon()
Link copied to clipboard
open override fun gluGetTessProperty(which: Int, value: DoubleArray, value_offset: Int)

Retrieves the current value of a specified tessellation property. This method is used to query a property of the GLU tessellator.

Link copied to clipboard
open override fun gluNextContour(type: Int)
Link copied to clipboard
open override fun gluTessBeginContour()

Marks the beginning of a new contour within the current polygon being defined for tessellation in the GLU tessellator.

Link copied to clipboard
open override fun gluTessBeginPolygon(data: Any?)

Begins a new polygon definition for tessellation using the GLU tessellator. This method starts the specification of a polygon, which will be defined using vertices and may consist of multiple contours. The data parameter allows attaching custom application-specific data to the polygon, which can be retrieved during callback events.

Link copied to clipboard
open override fun gluTessCallback(which: Int, aCallback: GLUtessellatorCallback?)

Defines a callback function for the GLU tessellation object. The callback is associated with a specific tessellation event identified by the which parameter. This method allows users to specify behavior for various tessellation-related events such as errors, vertex processing, edge flags, and others.

Link copied to clipboard
open override fun gluTessEndContour()

Marks the end of the current contour being defined for tessellation in the GLU tessellator.

Link copied to clipboard
open override fun gluTessEndPolygon()

Completes the definition of the current polygon in the tessellation process.

Link copied to clipboard
open override fun gluTessNormal(x: Double, y: Double, z: Double)

Specifies the normal vector for the tessellation. This method is used to define a normal vector that provides a hint to the tessellator for the orientation of the following vertices. The normal vector can help determine which direction is "up" for planar tessellation.

Link copied to clipboard
open fun gluTessProperty(which: Int, value: Int)

Sets a tessellation property for the GLU tessellator using an integer value. This method internally converts the integer value to a double and delegates to the corresponding method that accepts a double value.

open override fun gluTessProperty(which: Int, value: Double)

Sets a tessellation property for the GLU tessellator. This method allows configuring various properties of the tessellator, such as winding rules, boundary-only settings, and tessellation tolerance.

Link copied to clipboard
open override fun gluTessVertex(coords: DoubleArray, coords_offset: Int, vertexData: Any?)

Defines a vertex for tessellation processing in the GLU tessellator. This method specifies a vertex using its coordinates and associates custom data with the vertex. The vertex will be processed as part of the tessellation operation.