ProceduralMesh
SafiEngine::ProceduralMesh generates built-in 3D primitives (box, sphere, plane, cylinder, capsule) as Model objects without loading any external files.
Header: Core/include/Core/ProceduralMesh.h
PrimitiveType
Factory Methods
Create
Creates a primitive mesh of the given type using default parameters. Returns a shared_ptr<Model> ready for rendering.
CreateBox
Creates a unit cube (1×1×1) centered at the origin.
CreateSphere
Creates a UV sphere.
CreatePlane
Creates a flat quad on the XZ plane.
CreateCylinder
Creates a cylinder along the Y axis.
CreateCapsule
Creates a cylinder with hemispherical caps.
Path Utilities
Procedural primitives use a primitive:<type> path convention (e.g. "primitive:box") so they can be referenced by the asset manager and serialized in scene files.
PrimitiveTypeToPath
Converts a PrimitiveType to its path string (e.g. PrimitiveType::Box → "primitive:box").
PathToPrimitiveType
Converts a "primitive:<type>" path back to its PrimitiveType enum value.
IsPrimitivePath
Returns true if the path starts with "primitive:".
PrimitiveTypeName
Returns the human-readable name of a primitive type (e.g. "Box", "Sphere").
Usage Example
When using the asset manager's Load<Model> with a primitive:* path, the mesh is cached just like file-based models — multiple entities can share the same primitive without duplicating geometry.