Creates a new WebaniPolygon instance with the provided options.
The configuration options for the polygon.
The filled points defining the outer shape of the polygon.
The holes within the polygon, each hole defined by a set of points.
The class used for animating the polygon.
An array of additional world transforms that modify the object.
The material applied to this object.
OptionalparentThe parent transformable object, if any.
A flag indicating whether skinning transformations should be applied.
Flag indicating whether to apply scale compensation for the parent object.
The world transform of the object, including position, rotation, and scale.
Flag indicating whether to use the origin as the center of rotation.
Gets the global center of the object, taking into account the object's transform (position, scale, etc.).
The global center as a Vector3 object.
The complete world transforms of the object's extra transformations, including position, rotation, scale, and rotational center.
An array of CompleteWorldTransform objects for the extra transforms.
The complete world transform of the object, including position, rotation, scale, and rotational center.
The complete world transform as a CompleteWorldTransform object.
A copy of the extra transforms array.
A new array with copies of the extra transforms.
The combined matrix of all extra transforms without scale compensation.
A Matrix4 object representing the combined matrix of all extra transforms.
Returns an array of indices that represent where the holes in the polygon start in the point array.
An array of hole indices.
Gets the inverse bind matrices for skinning.
The inverse bind matrices as a Float32Array.
Gets the joint indices for skinning.
The joint indices as a Float32Array.
Gets the joint matrices for skinning.
The joint matrices as a Float32Array.
The model matrix of the object, including scale compensation if needed.
A Matrix4 object representing the model matrix with scale compensation.
The model matrix of the object without scale compensation.
A Matrix4 object representing the model matrix without scale compensation.
Gets the normal vectors for the object's surfaces.
The normal vectors as a Float32Array.
Returns the array of all points (including both the filled points and the holes).
A flat array of points.
Returns a shallow copy of the polygon object.
A new WebaniPolygon instance with the same properties.
A copy of the main transform.
A new WorldTransform object that is a copy of the main transform.
Gets the triangulation data for the object.
The triangulation data as a Float32Array.
Gets the UV coordinates for texture mapping.
The UV coordinates as a Float32Array.
Gets the number of vertices in the object.
The vertex count.
Gets the joint weights for skinning.
The joint weights as a Float32Array.
Computes the normals for the polygon. For simplicity, it assigns 1 to every third element of the normal array.
An array of normals.
Computes the triangulation for the polygon using the filled points and holes.
This method uses the triangulate utility function.
A Float32Array representing the triangulated points of the polygon.
Fills the arrays required for the object's geometry (triangulation, normals, UVs, joint weights, etc.). This method ensures that the arrays are allocated with the correct size.
The number of vertices in the object.
The number of joints for skinning.
Resolves the geometry of the polygon, including triangulation, normals, and local center.
Scales the object by a specified factor.
The scaling factor as a Vector3 object.
Sets the position of the object.
The new position as a Vector3 object.
Sets the scale of the object.
The new scale as a Vector3 object.
Translates the object by a specified offset.
The offset to translate the object by.
Represents a polygon in 3D space. This class extends
WebaniPrimitiveObjectand supports complex polygon shapes with holes, triangulation, and animation.