1//************************************ bs::framework - Copyright 2018 Marko Pintera **************************************//
2//*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********//
3#pragma once
4
5#include "BsCorePrerequisites.h"
6#include "Physics/BsCollider.h"
7#include "Math/BsVector3.h"
8#include "Math/BsQuaternion.h"
9
10namespace bs
11{
12 class PhysicsScene;
13
14 /** @addtogroup Physics
15 * @{
16 */
17
18 /** Collider with a capsule geometry. */
19 class BS_CORE_EXPORT CapsuleCollider : public Collider
20 {
21 public:
22 CapsuleCollider() = default;
23
24 /**
25 * Determines the half height of the capsule, from the origin to one of the hemispherical centers, along the normal
26 * vector.
27 */
28 virtual void setHalfHeight(float halfHeight) = 0;
29
30 /** @copydoc setHalfHeight() */
31 virtual float getHalfHeight() const = 0;
32
33 /** Determines the radius of the capsule. */
34 virtual void setRadius(float radius) = 0;
35
36 /** @copydoc setRadius() */
37 virtual float getRadius() const = 0;
38
39 /**
40 * Creates a new capsule collider.
41 *
42 * @param[in] scene Scene into which to add the collider to.
43 * @param[in] radius Radius of the capsule.
44 * @param[in] halfHeight Half height of the capsule, from the origin to one of the hemispherical centers, along
45 * the normal vector.
46 * @param[in] position Center of the box.
47 * @param[in] rotation Rotation of the box.
48 */
49 static SPtr<CapsuleCollider> create(PhysicsScene& scene, float radius = 0.0f, float halfHeight = 0.0f,
50 const Vector3& position = Vector3::ZERO, const Quaternion& rotation = Quaternion::IDENTITY);
51 };
52
53 /** @} */
54}