BsCapsuleCollider.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsCorePrerequisites.h"
  5. #include "Physics/BsCollider.h"
  6. #include "Math/BsVector3.h"
  7. #include "Math/BsQuaternion.h"
  8. namespace bs
  9. {
  10. /** @addtogroup Physics
  11. * @{
  12. */
  13. /** Collider with a capsule geometry. */
  14. class BS_CORE_EXPORT CapsuleCollider : public Collider
  15. {
  16. public:
  17. CapsuleCollider();
  18. /**
  19. * Determines the half height of the capsule, from the origin to one of the hemispherical centers, along the normal
  20. * vector.
  21. */
  22. virtual void setHalfHeight(float halfHeight) = 0;
  23. /** @copdyoc setHalfHeight() */
  24. virtual float getHalfHeight() const = 0;
  25. /** Determines the radius of the capsule. */
  26. virtual void setRadius(float radius) = 0;
  27. /** @copydoc setRadius() .*/
  28. virtual float getRadius() const = 0;
  29. /**
  30. * Creates a new capsule collider.
  31. *
  32. * @param[in] radius Radius of the capsule.
  33. * @param[in] halfHeight Half height of the capsule, from the origin to one of the hemispherical centers, along
  34. * the normal vector.
  35. * @param[in] position Center of the box.
  36. * @param[in] rotation Rotation of the box.
  37. */
  38. static SPtr<CapsuleCollider> create(float radius = 0.0f, float halfHeight = 0.0f,
  39. const Vector3& position = Vector3::ZERO, const Quaternion& rotation = Quaternion::IDENTITY);
  40. };
  41. /** @} */
  42. }