MutableIndexedPolygon

data class MutableIndexedPolygon(val positions: MutableList<Int>, val textureCoords: MutableList<Int>, val normals: MutableList<Int>, val colors: MutableList<Int>, val tangents: MutableList<Int>, val bitangents: MutableList<Int>) : IIndexedPolygon(source)

Represents a mutable 3D indexed polygon. This class allows modifications to its indices and provides functionality to transform vertex references into a corresponding polygon representation.

The polygon is defined by indices referencing an external vertex data source, such as the position, texture coordinates, normals, colors, tangents, and bitangents of the vertices. These indices can be updated, providing flexibility for dynamic operations on the polygon.

Constructors

Link copied to clipboard
constructor(positions: MutableList<Int>, textureCoords: MutableList<Int>, normals: MutableList<Int>, colors: MutableList<Int>, tangents: MutableList<Int>, bitangents: MutableList<Int>)

Properties

Link copied to clipboard
open override val bitangents: MutableList<Int>

Mutable list of bitangent indices, optional.

Link copied to clipboard
open override val colors: MutableList<Int>

Mutable list of color indices specifying the vertex colors.

Link copied to clipboard
open override val normals: MutableList<Int>

Mutable list of normal indices, which specify the normals of the vertices.

Link copied to clipboard
open override val positions: MutableList<Int>

Mutable list of position indices defining the polygon's vertices.

Link copied to clipboard
open override val tangents: MutableList<Int>

Mutable list of tangent indices, optional.

Link copied to clipboard
open override val textureCoords: MutableList<Int>

Mutable list of texture coordinate indices defining the mapping of textures.

Functions

Link copied to clipboard
open fun base(vertexData: IVertexData): Matrix44
Link copied to clipboard
open fun isConvex(vertexData: IVertexData): Boolean

Determines if the polygon defined by the given vertex data is convex.

Link copied to clipboard
open fun isPlanar(vertexData: IVertexData, eps: Double = 0.01): Boolean

Checks if the polygon defined by the given vertex data is planar.

Link copied to clipboard
open fun normal(vertexData: IVertexData): Vector3

Computes the normal vector of the polygon based on the given vertex data.

Link copied to clipboard
fun IIndexedPolygon.point(vertexData: IVertexData, barycentric: Vector3): Point

Computes a Point by interpolating vertex attributes from a 3D polygon using barycentric coordinates.

Link copied to clipboard
fun IIndexedPolygon.position(vertexData: IVertexData, barycentric: Vector3): Vector3

Computes the 3D position of a point in a polygon using barycentric coordinates.

Link copied to clipboard
open override fun toPolygon(vertexData: IVertexData): MutablePolygon

Converts the provided vertex data into a polygon representation.