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 | /** Collider with box geometry. */ |
19 | class BS_CORE_EXPORT BoxCollider : public Collider |
20 | { |
21 | public: |
22 | BoxCollider() = default; |
23 | |
24 | /** Determines the extents (half size) of the geometry of the box. */ |
25 | virtual void setExtents(const Vector3& extents) = 0; |
26 | |
27 | /** @copydoc setExtents() */ |
28 | virtual Vector3 getExtents() const = 0; |
29 | |
30 | /** |
31 | * Creates a new box collider. |
32 | * |
33 | * @param[in] scene Scene into which to add the collider to. |
34 | * @param[in] extents Extents (half size) of the box. |
35 | * @param[in] position Center of the box. |
36 | * @param[in] rotation Rotation of the box. |
37 | */ |
38 | static SPtr<BoxCollider> create(PhysicsScene& scene, const Vector3& extents = Vector3::ZERO, |
39 | const Vector3& position = Vector3::ZERO, const Quaternion& rotation = Quaternion::IDENTITY); |
40 | }; |
41 | |
42 | /** @} */ |
43 | } |