| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
- //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
- #pragma once
- #include "BsCorePrerequisites.h"
- #include "BsJoint.h"
- namespace BansheeEngine
- {
- /** @addtogroup Physics
- * @{
- */
- /**
- * Joint that removes all but a single translational degree of freedom. Bodies are allowed to move along a single axis.
- */
- class BS_CORE_EXPORT SliderJoint : public Joint
- {
- public:
- /** Flag that controls slider joint's behaviour. */
- enum class Flag
- {
- Limit = 0x1,
- };
- public:
- virtual ~SliderJoint() { }
- /** Returns the current position of the slider. */
- virtual float getPosition() const = 0;
- /** Returns the current speed of the slider. */
- virtual float getSpeed() const = 0;
- /**
- * Returns a limit that constrains the movement of the joint to a specific minimum and maximum distance. You must
- * enable the limit flag on the joint in order for this to be recognized.
- *
- * @see LimitLinearRange
- */
- virtual LimitLinearRange getLimit() const = 0;
- /**
- * Sets a limit that constrains the movement of the joint to a specific minimum and maximum distance. You must
- * enable the limit flag on the joint in order for this to be recognized.
- *
- * @see LimitLinearRange
- */
- virtual void setLimit(const LimitLinearRange& limit) = 0;
- /** Enables or disables a flag that controls the joint's behaviour. */
- virtual void setFlag(Flag flag, bool enabled) = 0;
- /** Checks is the specified flag enabled. */
- virtual bool hasFlag(Flag flag) const = 0;
- /** Creates a new spherical joint. */
- static SPtr<SliderJoint> create();
- };
- /** @} */
- }
|