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 "BsPhysXPrerequisites.h"
6#include "Physics/BsDistanceJoint.h"
7#include "PxPhysics.h"
8#include "extensions/PxDistanceJoint.h"
9
10namespace bs
11{
12 /** @addtogroup PhysX
13 * @{
14 */
15
16 /** PhysX implementation of a DistanceJoint */
17 class PhysXDistanceJoint : public DistanceJoint
18 {
19 public:
20 PhysXDistanceJoint(physx::PxPhysics* physx, const DISTANCE_JOINT_DESC& desc);
21 ~PhysXDistanceJoint();
22
23 /** @copydoc DistanceJoint::getDistance */
24 float getDistance() const override;
25
26 /** @copydoc DistanceJoint::getMinDistance */
27 float getMinDistance() const override;
28
29 /** @copydoc DistanceJoint::setMinDistance */
30 void setMinDistance(float value) override;
31
32 /** @copydoc DistanceJoint::getMaxDistance */
33 float getMaxDistance() const override;
34
35 /** @copydoc DistanceJoint::setMaxDistance */
36 void setMaxDistance(float value) override;
37
38 /** @copydoc DistanceJoint::getTolerance */
39 float getTolerance() const override;
40
41 /** @copydoc DistanceJoint::setTolerance */
42 void setTolerance(float value) override;
43
44 /** @copydoc DistanceJoint::getSpring */
45 Spring getSpring() const override;
46
47 /** @copydoc DistanceJoint::setSpring */
48 void setSpring(const Spring& value) override;
49
50 /** @copydoc DistanceJoint::setFlag */
51 void setFlag(DistanceJointFlag flag, bool enabled) override;
52
53 /** @copydoc DistanceJoint::hasFlag */
54 bool hasFlag(DistanceJointFlag flag) const override;
55
56 private:
57 /** Returns the internal PhysX representation of the distance joint. */
58 inline physx::PxDistanceJoint* getInternal() const;
59 };
60
61 /** @} */
62}