BsPhysXMeshCollider.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 "BsMeshCollider.h"
  6. #include "PxPhysics.h"
  7. namespace BansheeEngine
  8. {
  9. /** @addtogroup PhysX
  10. * @{
  11. */
  12. /** PhysX implementation of a MeshCollider. */
  13. class PhysXMeshCollider : public MeshCollider
  14. {
  15. public:
  16. PhysXMeshCollider(physx::PxPhysics* physx, const Vector3& position, const Quaternion& rotation);
  17. ~PhysXMeshCollider();
  18. /** @copydoc MeshCollider::setScale */
  19. void setScale(const Vector3& scale) override;
  20. private:
  21. /** Returns the PhysX collider implementation common to all colliders. */
  22. FPhysXCollider* getInternal() const;
  23. /** @copydoc MeshCollider::onMeshChanged */
  24. void onMeshChanged() override;
  25. /** Applies mesh geometry using the set mesh and scale. */
  26. void applyGeometry();
  27. /** Sets new geometry to the underlying shape. Rebuilds the shape if necessary. */
  28. void setGeometry(const physx::PxGeometry& geometry);
  29. };
  30. /** @} */
  31. }