11#include <unordered_map>
28 void addVertex(
float px,
float py,
float pz,
float nx,
float ny,
float nz,
float u,
float v);
30 void addTriangle(uint32_t
i0, uint32_t
i1, uint32_t
i2);
49 bool appendTransformed(
const MeshBuild *other,
float tx,
float ty,
float tz,
50 float yawDegrees,
float sx,
float sy,
float sz);
53 int setActiveGroup(
const std::string &
name);
55 int getGroupCount()
const;
57 std::string getGroupName(
int groupIndex)
const;
59 int getTriangleGroup(
int triangleIndex)
const;
63 const std::vector<std::string> &
groupNames()
const {
return groupNames_; }
75 [[nodiscard]]
eve::Result<void> restoreGroupData(std::vector<std::string> names, std::vector<int> assignments,
83 [[nodiscard]] std::unique_ptr<MeshBuild> copyGroup(
int groupIndex)
const;
85 int getVertexCount()
const;
87 int getIndexCount()
const;
92 float getPositionX(
int i)
const;
94 float getPositionY(
int i)
const;
96 float getPositionZ(
int i)
const;
98 float getNormalX(
int i)
const;
100 float getNormalY(
int i)
const;
102 float getNormalZ(
int i)
const;
104 float getUvU(
int i)
const;
106 float getUvV(
int i)
const;
108 [[nodiscard]]
bool hasVertexColors() const noexcept;
110 [[nodiscard]]
float getColor(
int vertexIndex,
int component) const noexcept;
117 [[nodiscard]]
eve::
Result<
void> setColor(
int vertexIndex,
float r,
float g,
float b,
float a);
118 int getIndex(
int i) const;
128 const std::vector<float> &
normals()
const {
return normals_; }
130 const std::vector<float> &
uvs()
const {
return uvs_; }
132 const std::vector<float> &
colors()
const {
return colors_; }
134 const std::vector<uint32_t> &
indices()
const {
return indices_; }
136 const std::unordered_map<std::string, std::string> &
metadata()
const {
return meta_; }
141 std::vector<float> &
normals() {
return normals_; }
143 std::vector<float> &
uvs() {
return uvs_; }
145 std::vector<uint32_t> &
indices() {
return indices_; }
148 std::vector<float> positions_;
149 std::vector<float> normals_;
150 std::vector<float> uvs_;
151 std::vector<float> colors_;
152 std::vector<uint32_t> indices_;
153 std::vector<int> triangleGroups_;
154 std::vector<std::string> groupNames_;
155 int activeGroup_ = -1;
156 std::unordered_map<std::string, std::string> meta_;
#define EVENGINE_API_DOMAINS
std::uint32_t vertexCount
std::vector< float > positions
ScriptMotionSinkStore< ScriptMotionSink< MotionColorTraits > > colors
Move-only, checked operation results for the common layer.
Share string attribute map operations through the Windows Foundation DLL.
Move-only operation result carrying either a value or Status.
CPU triangle mesh from procedural mesh recipes (e.g. marching cubes). Positions/normals are xyz-packe...
const std::vector< int > & triangleGroups() const
Return the dense triangle-to-group assignments.
const std::vector< float > & normals() const
Normals.
std::vector< uint32_t > & indices()
Indices.
const std::vector< float > & colors() const
Colors.
std::vector< float > & uvs()
Uvs.
const std::unordered_map< std::string, std::string > & metadata() const
Return all metadata key/value pairs in deterministic map order.
const std::vector< std::string > & groupNames() const
Return the stable ordered group names.
int activeGroup() const
Return the currently selected group, or -1 when none is active.
std::vector< float > & normals()
Normals.
std::vector< float > & positions()
Positions.
const std::vector< float > & uvs() const
Uvs.
const std::vector< uint32_t > & indices() const
Indices.
Build metadata (engine git commit, build time, third-party version).