6#ifndef QSSGMESHUTILITIES_P_H
7#define QSSGMESHUTILITIES_P_H
20#include <QtQuick3DUtils/private/qtquick3dutilsglobal_p.h>
22#include <QtQuick3DUtils/private/qssgbounds3_p.h>
24#include <QtQuick3DUtils/private/qssgrenderbasetypes_p.h>
26#include <QtCore/qstring.h>
27#include <QtCore/qbytearray.h>
28#include <QtCore/qiodevice.h>
29#include <QtCore/qlist.h>
30#include <QtCore/qmap.h>
32#include <QtGui/qvectornd.h>
36struct QSSGRenderVertexBufferEntry
40 QSSGRenderComponentType m_componentType;
42 quint32 m_numComponents;
44 quint32 m_firstItemOffset;
46 QSSGRenderVertexBufferEntry(
const QByteArray &nm,
47 QSSGRenderComponentType type,
48 quint32 numComponents,
49 quint32 firstItemOffset = 0)
50 : m_name(nm), m_componentType(type), m_numComponents(numComponents), m_firstItemOffset(firstItemOffset)
54 QSSGRenderVertexBufferEntry()
55 : m_componentType(QSSGRenderComponentType::Float32), m_numComponents(0), m_firstItemOffset(0)
59 QSSGRenderVertexBufferEntry(
const QSSGRenderVertexBufferEntry &inOther)
60 : m_name(inOther.m_name)
61 , m_componentType(inOther.m_componentType)
62 , m_numComponents(inOther.m_numComponents)
63 , m_firstItemOffset(inOther.m_firstItemOffset)
67 QSSGRenderVertexBufferEntry &operator=(
const QSSGRenderVertexBufferEntry &inOther)
69 if (
this != &inOther) {
70 m_name = inOther.m_name;
71 m_componentType = inOther.m_componentType;
72 m_numComponents = inOther.m_numComponents;
73 m_firstItemOffset = inOther.m_firstItemOffset;
81struct AssetVertexEntry;
82struct AssetMeshSubset;
83struct RuntimeMeshData;
86class Q_QUICK3DUTILS_EXPORT
Mesh
465 const unsigned int *
remap);
470 const unsigned int *
remap);
float simplifyScale(const float *vertexPositions, size_t vertexCount, size_t vertexPositionsStride)
static const size_t MESH_STRUCT_SIZE
void remapVertexBuffer(void *destination, const void *vertices, size_t vertexCount, size_t vertexSize, const unsigned int *remap)
static bool isKnownComponentType(quint32 value)
static const size_t SUBSET_STRUCT_SIZE_V3_V4
static const size_t VERTEX_BUFFER_ENTRY_STRUCT_SIZE
static const size_t MULTI_ENTRY_STRUCT_SIZE
static const size_t SUBSET_STRUCT_SIZE_V6
size_t simplifyMesh(unsigned int *destination, const unsigned int *indices, size_t indexCount, const float *vertexPositions, size_t vertexCount, size_t vertexPositionsStride, size_t targetIndexCount, float targetError, unsigned int options, float *resultError)
static const size_t JOINT_STRUCT_SIZE
static const size_t MULTI_HEADER_STRUCT_SIZE
size_t generateVertexRemap(unsigned int *destination, const unsigned int *indices, size_t indexCount, size_t vertexCount, const MeshVertexStream *streams, size_t streamCount)
static const size_t LOD_STRUCT_SIZE
void optimizeVertexCache(unsigned int *destination, const unsigned int *indices, size_t indexCount, size_t vertexCount)
static const size_t MESH_HEADER_STRUCT_SIZE
static const size_t SUBSET_STRUCT_SIZE_V5
static quint32 getAlignedOffset(quint32 offset, quint32 align)
void remapIndexBuffer(unsigned int *destination, const unsigned int *indices, size_t indexCount, const unsigned int *remap)
constexpr size_t maxVertexStreams
static bool canRead(QIODevice *device, quint64 count, quint64 itemSize)
QVector< MeshLevelOfDetail > generateMeshLevelsOfDetail(const QVector< QVector3D > &positions, const QVector< QVector3D > &normals, const QVector< quint32 > &indexes, QVector< MeshVertexSplit > &splitVertices, float normalMergeAngle, float normalSplitAngle)
QVector< quint32 > indexes