BsCD6Joint.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsCorePrerequisites.h"
  5. #include "BsD6Joint.h"
  6. #include "BsCJoint.h"
  7. namespace BansheeEngine
  8. {
  9. /** @addtogroup Components-Core
  10. * @{
  11. */
  12. /**
  13. * @copydoc D6Joint
  14. *
  15. * Wraps D6Joint as a Component.
  16. */
  17. class BS_CORE_EXPORT CD6Joint : public CJoint
  18. {
  19. public:
  20. CD6Joint(const HSceneObject& parent);
  21. /** @copydoc D6Joint::getMotion */
  22. inline D6Joint::Motion getMotion(D6Joint::Axis axis) const;
  23. /** @copydoc D6Joint::setMotion */
  24. inline void setMotion(D6Joint::Axis axis, D6Joint::Motion motion);
  25. /** @copydoc D6Joint::getTwist */
  26. inline Radian getTwist() const;
  27. /** @copydoc D6Joint::getSwingY */
  28. inline Radian getSwingY() const;
  29. /** @copydoc D6Joint::getSwingZ */
  30. inline Radian getSwingZ() const;
  31. /** @copydoc D6Joint::getLimitLinear */
  32. inline LimitLinear getLimitLinear() const;
  33. /** @copydoc D6Joint::setLimitLinear */
  34. inline void setLimitLinear(const LimitLinear& limit);
  35. /** @copydoc D6Joint::getLimitTwist */
  36. inline LimitAngularRange getLimitTwist() const;
  37. /** @copydoc D6Joint::setLimitTwist */
  38. inline void setLimitTwist(const LimitAngularRange& limit);
  39. /** @copydoc D6Joint::getLimitSwing */
  40. inline LimitConeRange getLimitSwing() const;
  41. /** @copydoc D6Joint::setLimitSwing */
  42. inline void setLimitSwing(const LimitConeRange& limit);
  43. /** @copydoc D6Joint::getDrive */
  44. inline D6Joint::Drive getDrive(D6Joint::DriveType type) const;
  45. /** @copydoc D6Joint::setDrive */
  46. inline void setDrive(D6Joint::DriveType type, const D6Joint::Drive& drive);
  47. /** @copydoc D6Joint::getDrivePosition */
  48. inline Vector3 getDrivePosition() const;
  49. /** @copydoc D6Joint::getDriveRotation */
  50. inline Quaternion getDriveRotation() const;
  51. /** @copydoc D6Joint::setDriveTransform */
  52. inline void setDriveTransform(const Vector3& position, const Quaternion& rotation);
  53. /** @copydoc D6Joint::getDriveLinearVelocity */
  54. inline Vector3 getDriveLinearVelocity() const;
  55. /** @copydoc D6Joint::getDriveAngularVelocity */
  56. inline Vector3 getDriveAngularVelocity() const;
  57. /** @copydoc D6Joint::setDriveVelocity */
  58. inline void setDriveVelocity(const Vector3& linear, const Vector3& angular);
  59. /** @name Internal
  60. * @{
  61. */
  62. /** Returns the D6 joint that this component wraps. */
  63. D6Joint* _getInternal() const { return static_cast<D6Joint*>(mInternal.get()); }
  64. /** @} */
  65. /************************************************************************/
  66. /* COMPONENT OVERRIDES */
  67. /************************************************************************/
  68. protected:
  69. friend class SceneObject;
  70. /** @copydoc CJoint::createInternal */
  71. SPtr<Joint> createInternal() override;
  72. D6_JOINT_DESC mDesc;
  73. /************************************************************************/
  74. /* RTTI */
  75. /************************************************************************/
  76. public:
  77. friend class CD6JointRTTI;
  78. static RTTITypeBase* getRTTIStatic();
  79. RTTITypeBase* getRTTI() const override;
  80. protected:
  81. CD6Joint(); // Serialization only
  82. };
  83. /** @} */
  84. }