BsPhysXMesh.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsPhysXPrerequisites.h"
  5. #include "BsPhysicsMesh.h"
  6. #include "PxMaterial.h"
  7. namespace BansheeEngine
  8. {
  9. class PhysXMesh : public PhysicsMesh
  10. {
  11. public:
  12. PhysXMesh(const MeshDataPtr& meshData, PhysicsMeshType type);
  13. MeshDataPtr getMeshData() const override;
  14. physx::PxTriangleMesh* _getTriangle() const { assert(mType == PhysicsMeshType::Triangle); return mTriangleMesh; }
  15. physx::PxConvexMesh* _getConvex() const { assert(mType == PhysicsMeshType::Convex); return mConvexMesh; }
  16. private:
  17. /** @copydoc PhysicsMesh::initialize() */
  18. void initialize() override;
  19. /** @copydoc PhysicsMesh::initialize() */
  20. void destroy() override;
  21. physx::PxTriangleMesh* mTriangleMesh = nullptr;
  22. physx::PxConvexMesh* mConvexMesh = nullptr;
  23. UINT8* mCookedData = nullptr;
  24. UINT32 mCookedDataSize = 0;
  25. /************************************************************************/
  26. /* SERIALIZATION */
  27. /************************************************************************/
  28. public:
  29. friend class PhysXMeshRTTI;
  30. static RTTITypeBase* getRTTIStatic();
  31. RTTITypeBase* getRTTI() const override;
  32. };
  33. }