BsPhysXHingeJoint.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsPhysXPrerequisites.h"
  5. #include "BsHingeJoint.h"
  6. #include "PxPhysics.h"
  7. #include "extensions\PxRevoluteJoint.h"
  8. namespace BansheeEngine
  9. {
  10. /** @addtogroup PhysX
  11. * @{
  12. */
  13. /** PhysX implementation of a HingeJoint. */
  14. class BS_PHYSX_EXPORT PhysXHingeJoint : public HingeJoint
  15. {
  16. public:
  17. PhysXHingeJoint(physx::PxPhysics* physx, const HINGE_JOINT_DESC& desc);
  18. ~PhysXHingeJoint();
  19. /** @copydoc HingeJoint::getAngle */
  20. Radian getAngle() const override;
  21. /** @copydoc HingeJoint::getSpeed */
  22. float getSpeed() const override;
  23. /** @copydoc HingeJoint::getLimit */
  24. LimitAngularRange getLimit() const override;
  25. /** @copydoc HingeJoint::setLimit */
  26. void setLimit(const LimitAngularRange& limit) override;
  27. /** @copydoc HingeJoint::getDrive */
  28. Drive getDrive() const override;
  29. /** @copydoc HingeJoint::setDrive */
  30. void setDrive(const Drive& drive) override;
  31. /** @copydoc HingeJoint::setFlag */
  32. void setFlag(Flag flag, bool enabled) override;
  33. /** @copydoc HingeJoint::hasFlag */
  34. bool hasFlag(Flag flag) const override;
  35. private:
  36. /** Returns the internal PhysX representation of the hinge (revolute) joint. */
  37. inline physx::PxRevoluteJoint* getInternal() const;
  38. };
  39. /** @} */
  40. }