BsCapsuleCollider.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 "BsCollider.h"
  6. #include "BsVector3.h"
  7. #include "BsQuaternion.h"
  8. namespace BansheeEngine
  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. * Sets 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. /**
  24. * Gets the half height of the capsule, from the origin to one of the hemispherical centers, along the normal
  25. * vector.
  26. */
  27. virtual float getHalfHeight() const = 0;
  28. /** Sets the radius of the capsule. */
  29. virtual void setRadius(float radius) = 0;
  30. /** Gets the radius of the capsule. */
  31. virtual float getRadius() const = 0;
  32. /**
  33. * Creates a new capsule collider.
  34. *
  35. * @param[in] radius Radius of the capsule.
  36. * @param[in] halfHeight Half height of the capsule, from the origin to one of the hemispherical centers, along
  37. * the normal vector.
  38. * @param[in] position Center of the box.
  39. * @param[in] rotation Rotation of the box.
  40. */
  41. static SPtr<CapsuleCollider> create(float radius = 0.0f, float halfHeight = 0.0f,
  42. const Vector3& position = Vector3::ZERO, const Quaternion& rotation = Quaternion::IDENTITY);
  43. };
  44. /** @} */
  45. }