Ellipse Struct
Basic Ellipse Shape (2D, in XY plane). More...
Declaration
Base struct
| struct | Shape |
|
Struct representing geometric primitives and indices for various shapes. provides immutable, shared access to vertices and indices of the represented geometric shape. More... | |
Public Constructors Index
| Ellipse () | |
|
Creates a default ellipse (radiusX = 1.0, radiusY = 0.5, 64 segments). More... | |
| Ellipse (float radiusX, float radiusY, unsigned int segments) | |
|
Creates an ellipse with specific radii and segment count. More... | |
Public Member Functions Index
| helios::rendering::mesh::PrimitiveType | primitiveType () const noexcept override |
|
Returns the primitive type used for rendering. More... | |
Private Static Functions Index
| static std::vector< Vertex > | generateVertices (float radiusX, float radiusY, unsigned int segments) |
|
Dynamically creates the vertex list for an ellipse. More... | |
| static std::vector< unsigned int > | generateIndices (unsigned int segments) |
|
Creates the index list for a Triangle Fan (for GL_TRIANGLES). More... | |
Description
Basic Ellipse Shape (2D, in XY plane).
Generates a 2D ellipse mesh, centered at the origin on the XY plane (Z=0). An ellipse is defined by two radii: one along the X-axis (semi-major or semi-minor) and one along the Y-axis. When both radii are equal, the ellipse degenerates to a circle.
The normals point in the positive Z direction. The indices are arranged as a Triangle Fan (for GL_TRIANGLES).
Definition at line 32 of file Ellipse.ixx.
Public Constructors
Ellipse()
| inline |
Ellipse()
| inline explicit |
Creates an ellipse with specific radii and segment count.
- Parameters
-
radiusX The semi-axis length along the X-axis.
radiusY The semi-axis length along the Y-axis.
segments The number of triangle segments that make up the ellipse. More segments result in a smoother curve.
Definition at line 118 of file Ellipse.ixx.
Public Member Functions
primitiveType()
| inline nodiscard noexcept virtual |
Returns the primitive type used for rendering.
- Returns
PrimitiveType::Triangles for triangle-based rendering.
Definition at line 128 of file Ellipse.ixx.
Reference helios::rendering::mesh::Triangles.
Private Static Functions
generateIndices()
| inline static |
Creates the index list for a Triangle Fan (for GL_TRIANGLES).
Each triangle consists of (center, point_i, point_i+1).
- Parameters
-
segments The number of segments used to build the ellipse.
- Returns
A vector of indices defining the triangle fan.
Definition at line 88 of file Ellipse.ixx.
generateVertices()
| inline static |
Dynamically creates the vertex list for an ellipse.
Generates one center vertex (Index 0) and 'segments' vertices on the circumference.
- Parameters
-
radiusX The semi-axis length along the X-axis.
radiusY The semi-axis length along the Y-axis.
segments The number of segments used to approximate the ellipse curve.
- Returns
A vector of vertices defining the ellipse mesh.
Definition at line 45 of file Ellipse.ixx.
The documentation for this struct was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.