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/BsSphericalJoint.h" |
7 | #include "Components/BsCJoint.h" |
8 | |
9 | namespace bs |
10 | { |
11 | /** @addtogroup Components-Core |
12 | * @{ |
13 | */ |
14 | |
15 | /** |
16 | * @copydoc SphericalJoint |
17 | * |
18 | * @note Wraps SphericalJoint as a Component. |
19 | */ |
20 | class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Physics,n:SphericalJoint) CSphericalJoint : public CJoint |
21 | { |
22 | public: |
23 | CSphericalJoint(const HSceneObject& parent); |
24 | |
25 | /** @copydoc SphericalJoint::getLimit */ |
26 | BS_SCRIPT_EXPORT(n:Limit,pr:getter) |
27 | LimitConeRange getLimit() const; |
28 | |
29 | /** @copydoc SphericalJoint::setLimit */ |
30 | BS_SCRIPT_EXPORT(n:Limit,pr:setter) |
31 | void setLimit(const LimitConeRange& limit); |
32 | |
33 | /** @copydoc SphericalJoint::setFlag */ |
34 | BS_SCRIPT_EXPORT(n:SetFlag) |
35 | void setFlag(SphericalJointFlag flag, bool enabled); |
36 | |
37 | /** @copydoc SphericalJoint::hasFlag */ |
38 | BS_SCRIPT_EXPORT(n:HasFlag) |
39 | bool hasFlag(SphericalJointFlag flag) const; |
40 | |
41 | /** @name Internal |
42 | * @{ |
43 | */ |
44 | |
45 | /** Returns the spherical joint that this component wraps. */ |
46 | SphericalJoint* _getInternal() const { return static_cast<SphericalJoint*>(mInternal.get()); } |
47 | |
48 | /** @} */ |
49 | |
50 | /************************************************************************/ |
51 | /* COMPONENT OVERRIDES */ |
52 | /************************************************************************/ |
53 | protected: |
54 | friend class SceneObject; |
55 | |
56 | /** @copydoc CJoint::createInternal */ |
57 | SPtr<Joint> createInternal() override; |
58 | |
59 | SPHERICAL_JOINT_DESC mDesc; |
60 | |
61 | /************************************************************************/ |
62 | /* RTTI */ |
63 | /************************************************************************/ |
64 | public: |
65 | friend class CSphericalJointRTTI; |
66 | static RTTITypeBase* getRTTIStatic(); |
67 | RTTITypeBase* getRTTI() const override; |
68 | |
69 | protected: |
70 | CSphericalJoint(); // Serialization only |
71 | }; |
72 | |
73 | /** @} */ |
74 | } |