Polygon

class Polygon(val positions: List<Vector3> = emptyList(), val textureCoords: List<Vector2> = emptyList(), val colors: List<ColorRGBa> = emptyList(), val normals: List<Vector3> = emptyList(), val tangents: List<Vector3> = emptyList(), val bitangents: List<Vector3> = emptyList()) : IPolygon(source)

Represents a polygon in 3D space with immutable attributes such as positions, texture coordinates, colors, normals, tangents, and bitangents. Provides methods to transform the polygon and convert it to a mutable version.

Parameters

positions

The list of 3D positions of the polygon vertices.

textureCoords

The list of 2D texture coordinates for the polygon vertices.

colors

The list of color values for the polygon vertices.

normals

The list of normal vectors for the polygon vertices.

tangents

The list of tangent vectors for the polygon vertices.

bitangents

The list of bitangent vectors for the polygon vertices.

Constructors

Link copied to clipboard
constructor(positions: List<Vector3> = emptyList(), textureCoords: List<Vector2> = emptyList(), colors: List<ColorRGBa> = emptyList(), normals: List<Vector3> = emptyList(), tangents: List<Vector3> = emptyList(), bitangents: List<Vector3> = emptyList())

Creates a Polygon with specified attributes.

Properties

Link copied to clipboard
open override val bitangents: List<Vector3>
Link copied to clipboard
open override val colors: List<ColorRGBa>
Link copied to clipboard
open override val normals: List<Vector3>
Link copied to clipboard
open override val positions: List<Vector3>
Link copied to clipboard
open override val tangents: List<Vector3>
Link copied to clipboard
open override val textureCoords: List<Vector2>

Functions

Link copied to clipboard

Converts the current immutable polygon instance into a mutable polygon.

Link copied to clipboard
open override fun transform(t: Matrix44): Polygon

Transforms the polygon using a given 4x4 transformation matrix.