Class Quick3DGeometryUtils
ClassList > Quick3DGeometryUtils
#include <quick3dgeometryutils.h>
Public Static Attributes
| Type | Name |
|---|---|
| constexpr int | VERTEX_STRIDE = 10 \* sizeof( float )Byte stride of a single vertex: position(3) + normal(3) + rgba(4) = 10 floats. |
Public Static Functions
| Type | Name |
|---|---|
| void | generatePolygonFill (const QVector< QVector3D > & vertices, float r, float g, float b, float a, float *& vptr, quint32 *& iptr, quint32 & vertexOffset, QVector3D & minBound, QVector3D & maxBound) |
| void | generateSphere (const QVector3D & center, float radius, int stacks, int slices, float r, float g, float b, float a, float *& vptr, quint32 *& iptr, quint32 & vertexOffset, QVector3D & minBound, QVector3D & maxBound) Generates a UV sphere centered at center . |
| void | generateTube (const QVector< QVector3D > & path, int segments, float radius, float r, float g, float b, float a, float *& vptr, quint32 *& iptr, quint32 & vertexOffset, QVector3D & minBound, QVector3D & maxBound) Extrudes a circular tube of segments sides and given__radius along__path . |
| int | sphereIndexCount (int stacks, int slices) Returns the number of indices produced by generateSphere() for the given subdivisions. |
| int | sphereVertexCount (int stacks, int slices) Returns the number of vertices produced by generateSphere() for the given subdivisions. |
| void | updateBounds (QVector3D & minBound, QVector3D & maxBound, const QVector3D & pos) Expands minBound /__maxBound to include__pos . |
| void | writeVertex (float *& vptr, const QVector3D & pos, const QVector3D & normal, float r, float g, float b, float a) Writes a single vertex (position + normal + rgba) to vptr and advances the pointer. |
Detailed Description
Mesh-building helpers shared between the rubberband and feature highlight geometries. Each helper appends to a raw vertex/index buffer using a fixed 10-float vertex layout: position(3) + normal(3) + rgba(4).
Public Static Attributes Documentation
variable VERTEX_STRIDE
Byte stride of a single vertex: position(3) + normal(3) + rgba(4) = 10 floats.
constexpr int Quick3DGeometryUtils::VERTEX_STRIDE;
Public Static Functions Documentation
function generatePolygonFill
static void Quick3DGeometryUtils::generatePolygonFill (
const QVector< QVector3D > & vertices,
float r,
float g,
float b,
float a,
float *& vptr,
quint32 *& iptr,
quint32 & vertexOffset,
QVector3D & minBound,
QVector3D & maxBound
)
Triangulates a closed polygon ring on the XZ plane with ear clipping and appends the resulting triangle fan to the buffer. Falls back to a simple fan from vertex 0 when ear clipping cannot make further progress (which keeps degenerate or self-touching rings from leaving uninitialised indices in the buffer).
function generateSphere
Generates a UV sphere centered at center .
static void Quick3DGeometryUtils::generateSphere (
const QVector3D & center,
float radius,
int stacks,
int slices,
float r,
float g,
float b,
float a,
float *& vptr,
quint32 *& iptr,
quint32 & vertexOffset,
QVector3D & minBound,
QVector3D & maxBound
)
function generateTube
Extrudes a circular tube of segments sides and given__radius along__path .
static void Quick3DGeometryUtils::generateTube (
const QVector< QVector3D > & path,
int segments,
float radius,
float r,
float g,
float b,
float a,
float *& vptr,
quint32 *& iptr,
quint32 & vertexOffset,
QVector3D & minBound,
QVector3D & maxBound
)
function sphereIndexCount
Returns the number of indices produced by generateSphere() for the given subdivisions.
static int Quick3DGeometryUtils::sphereIndexCount (
int stacks,
int slices
)
function sphereVertexCount
Returns the number of vertices produced by generateSphere() for the given subdivisions.
static int Quick3DGeometryUtils::sphereVertexCount (
int stacks,
int slices
)
function updateBounds
Expands minBound /__maxBound to include__pos .
static void Quick3DGeometryUtils::updateBounds (
QVector3D & minBound,
QVector3D & maxBound,
const QVector3D & pos
)
function writeVertex
Writes a single vertex (position + normal + rgba) to vptr and advances the pointer.
static void Quick3DGeometryUtils::writeVertex (
float *& vptr,
const QVector3D & pos,
const QVector3D & normal,
float r,
float g,
float b,
float a
)
The documentation for this class was generated from the following file src/core/3d/quick3dgeometryutils.h