BsFPhysXJoint.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 "Physics/BsFJoint.h"
  6. #include "extensions/PxJoint.h"
  7. namespace bs
  8. {
  9. /** @addtogroup PhysX
  10. * @{
  11. */
  12. /** PhysX implementation of an FJoint. */
  13. class FPhysXJoint : public FJoint
  14. {
  15. public:
  16. FPhysXJoint(physx::PxJoint* joint, const JOINT_DESC& desc);
  17. ~FPhysXJoint();
  18. /** @copydoc FJoint::getBody */
  19. Rigidbody* getBody(JointBody body) const override;
  20. /** @copydoc FJoint::setBody */
  21. void setBody(JointBody body, Rigidbody* value) override;
  22. /** @copydoc FJoint::getPosition */
  23. Vector3 getPosition(JointBody body) const override;
  24. /** @copydoc FJoint::getRotation */
  25. Quaternion getRotation(JointBody body) const override;
  26. /** @copydoc FJoint::setTransform */
  27. void setTransform(JointBody body, const Vector3& position, const Quaternion& rotation) override;
  28. /** @copydoc FJoint::getBreakForce */
  29. float getBreakForce() const override;
  30. /** @copydoc FJoint::setBreakForce */
  31. void setBreakForce(float force) override;
  32. /** @copydoc FJoint::getBreakTorque */
  33. float getBreakTorque() const override;
  34. /** @copydoc FJoint::setBreakTorque */
  35. void setBreakTorque(float torque) override;
  36. /** @copydoc FJoint::getEnableCollision */
  37. bool getEnableCollision() const override;
  38. /** @copydoc FJoint::setEnableCollision */
  39. void setEnableCollision(bool value) override;
  40. /** Gets the internal PhysX joint object. */
  41. physx::PxJoint* _getInternal() const { return mJoint; }
  42. protected:
  43. physx::PxJoint* mJoint;
  44. };
  45. /** @} */
  46. }