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/BsDistanceJoint.h"
7#include "Components/BsCJoint.h"
8
9namespace bs
10{
11 /** @addtogroup Components-Core
12 * @{
13 */
14
15 /**
16 * @copydoc DistanceJoint
17 *
18 * @note Wraps DistanceJoint as a Component.
19 */
20 class BS_CORE_EXPORT BS_SCRIPT_EXPORT(m:Physics,n:DistanceJoint) CDistanceJoint : public CJoint
21 {
22 public:
23 CDistanceJoint(const HSceneObject& parent);
24
25 /** @copydoc DistanceJoint::getDistance */
26 BS_SCRIPT_EXPORT(n:Distance,pr:getter)
27 float getDistance() const;
28
29 /** @copydoc DistanceJoint::getMinDistance */
30 BS_SCRIPT_EXPORT(n:MinDistance,pr:getter)
31 float getMinDistance() const;
32
33 /** @copydoc DistanceJoint::setMinDistance */
34 BS_SCRIPT_EXPORT(n:MinDistance,pr:setter)
35 void setMinDistance(float value);
36
37 /** @copydoc DistanceJoint::getMaxDistance */
38 BS_SCRIPT_EXPORT(n:MaxDistance,pr:getter)
39 float getMaxDistance() const;
40
41 /** @copydoc DistanceJoint::setMaxDistance */
42 BS_SCRIPT_EXPORT(n:MaxDistance,pr:setter)
43 void setMaxDistance(float value);
44
45 /** @copydoc DistanceJoint::getTolerance */
46 BS_SCRIPT_EXPORT(n:Tolerance,pr:getter)
47 float getTolerance() const;
48
49 /** @copydoc DistanceJoint::setTolerance */
50 BS_SCRIPT_EXPORT(n:Tolerance,pr:setter)
51 void setTolerance(float value);
52
53 /** @copydoc DistanceJoint::getSpring */
54 BS_SCRIPT_EXPORT(n:Spring,pr:getter)
55 Spring getSpring() const;
56
57 /** @copydoc DistanceJoint::setSpring */
58 BS_SCRIPT_EXPORT(n:Spring,pr:setter)
59 void setSpring(const Spring& value);
60
61 /** @copydoc DistanceJoint::setFlag */
62 BS_SCRIPT_EXPORT(n:SetFlag)
63 void setFlag(DistanceJointFlag flag, bool enabled);
64
65 /** @copydoc DistanceJoint::hasFlag */
66 BS_SCRIPT_EXPORT(n:HasFlag)
67 bool hasFlag(DistanceJointFlag flag) const;
68
69 /** @name Internal
70 * @{
71 */
72
73 /** Returns the distance joint that this component wraps. */
74 DistanceJoint* _getInternal() const { return static_cast<DistanceJoint*>(mInternal.get()); }
75
76 /** @} */
77
78 /************************************************************************/
79 /* COMPONENT OVERRIDES */
80 /************************************************************************/
81 protected:
82 friend class SceneObject;
83
84 /** @copydoc CJoint::createInternal */
85 SPtr<Joint> createInternal() override;
86
87 DISTANCE_JOINT_DESC mDesc;
88
89 /************************************************************************/
90 /* RTTI */
91 /************************************************************************/
92 public:
93 friend class CDistanceJointRTTI;
94 static RTTITypeBase* getRTTIStatic();
95 RTTITypeBase* getRTTI() const override;
96
97 protected:
98 CDistanceJoint(); // Serialization only
99 };
100
101 /** @} */
102}