BsPhysXSphereCollider.h 1.2 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 "BsSphereCollider.h"
  6. #include "PxPhysics.h"
  7. namespace BansheeEngine
  8. {
  9. /** @addtogroup PhysX
  10. * @{
  11. */
  12. /** PhysX implementation of a SphereCollider. */
  13. class PhysXSphereCollider : public SphereCollider
  14. {
  15. public:
  16. PhysXSphereCollider(physx::PxPhysics* physx, const Vector3& position, const Quaternion& rotation, float radius);
  17. ~PhysXSphereCollider();
  18. /** @copydoc SphereCollider::setScale */
  19. void setScale(const Vector3& scale) override;
  20. /** @copydoc SphereCollider::setRadius */
  21. void setRadius(float radius) override;
  22. /** @copydoc SphereCollider::getRadius */
  23. float getRadius() const override;
  24. private:
  25. /** Returns the PhysX collider implementation common to all colliders. */
  26. FPhysXCollider* getInternal() const;
  27. /** Applies the sphere geometry to the internal object based on set radius and scale. */
  28. void applyGeometry();
  29. float mRadius;
  30. };
  31. /** @} */
  32. }