rigComponent 0.1.1
RigKit pack API - rigComponent
Loading...
Searching...
No Matches
PrimitiveVertices3D.h File Reference

Expands the parametric 3D primitives into local-space triangle vertices. More...

#include <glm/glm.hpp>
#include <vector>
#include "CSphere.h"
Include dependency graph for PrimitiveVertices3D.h:

Functions

std::vector< glm::vec3 > rigkit::ecs::verticesOf (const CSphere &shape)
 Vertex expansion for the parametric 3D primitives.

Detailed Description

Expands the parametric 3D primitives into local-space triangle vertices.

Subdivision is clamped, since face count grows as 20 * 4^n and Raspberry Pi pays for every triangle.

Function Documentation

◆ verticesOf()

std::vector< glm::vec3 > rigkit::ecs::verticesOf ( const CSphere & shape)

Vertex expansion for the parametric 3D primitives.

Mirrors PrimitiveVertices.h (2D): present, picking, and bounds all want the same points, so deriving them once here is what keeps a sphere the same sphere everywhere.

Loose (non-indexed) triangle soup for an icosphere, local space.

subdivisions clamped to 0..4 so a stray large value cannot blow the triangle count up (20 * 4^n faces); flat per-face shading does not need shared vertices, so faces are emitted independently.