/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
release-22.11
Code/EnginePlugins/PhysXCooking/PhysXCooking.h
53 строки
2 KB
Jan Krassnigg
Updated V-HACD to latest (#651)
15 авг 2022, 13:21
Не верифицирован
15 авг 2022, 13:21
85a820b
Код
Авторство
О чём код?
#pragma once #include <Foundation/Types/Status.h> #include <PhysXCooking/PhysXCookingDLL.h> #include <PhysXPlugin/PhysXInterface.h> using namespace physx; namespace physx { class PxSimpleTriangleMesh; } class ezStreamWriter; class ezChunkStreamWriter; struct EZ_PHYSXCOOKING_DLL ezPhysXCookingMesh { bool m_bFlipNormals = false; ezDynamicArray<ezVec3> m_Vertices; ezDynamicArray<ezUInt8> m_VerticesInPolygon; ezDynamicArray<ezUInt32> m_PolygonIndices; ezDynamicArray<ezUInt16> m_PolygonSurfaceID; }; class EZ_PHYSXCOOKING_DLL ezPhysXCooking { public: static void Startup(); static void Shutdown(); enum class MeshType { Triangle, ConvexHull, ConvexDecomposition }; static ezResult CookTriangleMesh(const ezPhysXCookingMesh& mesh, ezStreamWriter& OutputStream); static ezResult CookConvexMesh(const ezPhysXCookingMesh& mesh, ezStreamWriter& OutputStream); static ezResult ComputeConvexHull(const ezPhysXCookingMesh& mesh, ezPhysXCookingMesh& outMesh); static ezStatus WriteResourceToStream(ezChunkStreamWriter& stream, const ezPhysXCookingMesh& mesh, const ezArrayPtr<ezString>& surfaces, MeshType meshType, ezUInt32 uiMaxConvexPieces = 1); static ezResult CookDecomposedConvexMesh(const ezPhysXCookingMesh& mesh, ezStreamWriter& OutputStream, ezUInt32 uiMaxConvexPieces); private: EZ_MAKE_SUBSYSTEM_STARTUP_FRIEND(PhysX, PhysXCooking); static void CreateMeshDesc(const ezPhysXCookingMesh& mesh, physx::PxSimpleTriangleMesh& desc, ezDynamicArray<ezUInt32>& TriangleIndices); static ezResult CookSingleConvexPxMesh(const ezPhysXCookingMesh& mesh, ezStreamWriter& OutputStream); static PxCooking* s_pCooking; static ezPhysXInterface* s_pPhysX; };