载入中...
搜索中...
未找到
CanonicalMesh.h
浏览该文件的文档.
1#pragma once
2#include <cstdint>
3#include <map>
4#include <span>
5#include <string>
6#include <vector>
7#include "common/Export.h"
8#include "common/Result.h"
9namespace eve::asset {
12 std::uint32_t components = 0;
13 std::vector<float> values;
14};
19 std::vector<float> positions;
20 std::vector<float> normals;
21 std::vector<float> colors;
22 std::map<std::uint32_t, std::vector<float>> texcoords;
23 std::vector<std::uint32_t> indices;
24 std::map<std::string, CanonicalMeshAttribute> attributes;
25};
28 std::uint32_t maximumVertices = 4'000'000;
29 std::uint32_t maximumIndices = 12'000'000;
30 std::uint64_t maximumDecodedBytes = 512ull * 1024ull * 1024ull;
31};
41 std::span<const std::uint8_t> bytes, const CanonicalMeshLimits& limits = {});
49 const CanonicalMeshData& mesh, const CanonicalMeshLimits& limits = {});
50} // namespace eve::asset
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
std::uint64_t bytes
Mesh * mesh
Move-only, checked operation results for the common layer.
const AssetImportLimits & limits
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Result< CanonicalMeshData > decodeCanonicalMesh(std::span< const std::uint8_t > bytes, const CanonicalMeshLimits &limits)
Decode canonical EVMESH binary v1, v2 or v3 into independently owned arrays.
EVENGINE_API_FOUNDATION Result< std::vector< std::uint8_t > > encodeCanonicalMesh(const CanonicalMeshData &mesh, const CanonicalMeshLimits &limits={})
Encode an owning snapshot to EVMESH v3, or v2 when no named attributes exist. Borrows input synchrono...
Owning float vertex attribute; one to four components per vertex.
Owning CPU mesh snapshot; UV arrays are packed ST pairs indexed by source set number....
std::vector< float > colors
std::vector< std::uint32_t > indices
std::vector< float > normals
std::map< std::string, CanonicalMeshAttribute > attributes
std::map< std::uint32_t, std::vector< float > > texcoords
std::vector< float > positions
Allocation limits checked before decoding any vertex arrays. UV count is byte-budget bounded.