BsPhysXCapsuleCollider.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 "Physics/BsCapsuleCollider.h"
  6. #include "PxPhysics.h"
  7. namespace bs
  8. {
  9. /** @addtogroup PhysX
  10. * @{
  11. */
  12. /** PhysX implementation of a CapsuleCollider. */
  13. class PhysXCapsuleCollider : public CapsuleCollider
  14. {
  15. public:
  16. PhysXCapsuleCollider(physx::PxPhysics* physx, const Vector3& position, const Quaternion& rotation,
  17. float radius, float halfHeight);
  18. ~PhysXCapsuleCollider();
  19. /** @copydoc CapsuleCollider::setScale() */
  20. void setScale(const Vector3& scale) override;
  21. /** @copydoc CapsuleCollider::setHalfHeight() */
  22. void setHalfHeight(float halfHeight) override;
  23. /** @copydoc CapsuleCollider::getHalfHeight() */
  24. float getHalfHeight() const override;
  25. /** @copydoc CapsuleCollider::setRadius() */
  26. void setRadius(float radius) override;
  27. /** @copydoc CapsuleCollider::getRadius() */
  28. float getRadius() const override;
  29. private:
  30. /** Returns the PhysX collider implementation common to all colliders. */
  31. FPhysXCollider* getInternal() const;
  32. /** Applies the capsule geometry to the internal object based on set radius, height and scale. */
  33. void applyGeometry();
  34. float mRadius;
  35. float mHalfHeight;
  36. };
  37. /** @} */
  38. }