|
rigObj 0.1.1
RigKit pack API - rigObj
|
#include <string>#include "ecs/MEcs.h"#include "CDrawStyle.h"#include "CMesh.h"Functions | |
| IoResult | rig::obj::load (const std::string &path, rigkit::ecs::CMesh &outMesh) |
| Load a Wavefront OBJ into a CMesh (tinyobjloader). | |
| IoResult | rig::obj::save (const std::string &path, const rigkit::ecs::CMesh &mesh) |
| Write CMesh to a simple Wavefront OBJ. | |
| entt::entity | rig::obj::makeMeshFromFile (rigkit::MEcs &ecs, const std::string &path, const rigkit::ecs::CDrawStyle &style={}, const std::string &name={}, IoResult *outResult=nullptr) |
| Load OBJ and spawn a mesh entity (CTransform + CMesh + CDrawStyle). | |
| IoResult rig::obj::load | ( | const std::string & | path, |
| rigkit::ecs::CMesh & | outMesh ) |
Load a Wavefront OBJ into a CMesh (tinyobjloader).
Keeps the file's vertices and faces. Authored n-gons go in loops (a box stays 6 faces). Tessellates those loops to triangle indices for present. Does not weld coincident verts or merge coplanar islands. Fills texcoords when present (splits a vertex only when one OBJ vertex is used with two UVs). When materials exist, fills faceColors from diffuse. Never fills facePalette (RigKit-only; not part of Wavefront).
| path | File path (.obj). MTL is resolved relative to the OBJ. |
| entt::entity rig::obj::makeMeshFromFile | ( | rigkit::MEcs & | ecs, |
| const std::string & | path, | ||
| const rigkit::ecs::CDrawStyle & | style = {}, | ||
| const std::string & | name = {}, | ||
| IoResult * | outResult = nullptr ) |
Load OBJ and spawn a mesh entity (CTransform + CMesh + CDrawStyle).
| IoResult rig::obj::save | ( | const std::string & | path, |
| const rigkit::ecs::CMesh & | mesh ) |
Write CMesh to a simple Wavefront OBJ.
Prefers authored n-gon loops; otherwise triangle indices. Geometry (+ UVs) only - does not write materials, faceColors, or facePalette. Palette indices are RigKit-only; use .rig / document codecs to keep them.