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 | |
10 | namespace bs |
11 | { |
12 | class PhysicsScene; |
13 | |
14 | /** @addtogroup Physics |
15 | * @{ |
16 | */ |
17 | |
18 | /** A collider with sphere geometry. */ |
19 | class BS_CORE_EXPORT SphereCollider : public Collider |
20 | { |
21 | public: |
22 | SphereCollider() = default; |
23 | |
24 | /** Determines the radius of the sphere geometry. */ |
25 | virtual void setRadius(float radius) = 0; |
26 | |
27 | /** @copydoc setRadius */ |
28 | virtual float getRadius() const = 0; |
29 | |
30 | /** |
31 | * Creates a new sphere collider. |
32 | * |
33 | * @param[in] scene Scene into which to add the collider to. |
34 | * @param[in] radius Radius of the sphere geometry. |
35 | * @param[in] position Position of the collider. |
36 | * @param[in] rotation Rotation of the collider. |
37 | */ |
38 | static SPtr<SphereCollider> create(PhysicsScene& scene, float radius = 0.0f, |
39 | const Vector3& position = Vector3::ZERO, const Quaternion& rotation = Quaternion::IDENTITY); |
40 | }; |
41 | |
42 | /** @} */ |
43 | } |