BsCD6JointRTTI.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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 "BsRTTIType.h"
  6. #include "BsCD6Joint.h"
  7. #include "BsGameObjectRTTI.h"
  8. namespace BansheeEngine
  9. {
  10. /** @cond RTTI */
  11. /** @addtogroup RTTI-Impl-Core
  12. * @{
  13. */
  14. class BS_CORE_EXPORT CD6JointRTTI : public RTTIType<CD6Joint, CJoint, CD6JointRTTI>
  15. {
  16. D6Joint::Motion& getMotion(CD6Joint* obj, UINT32 idx) { return obj->mDesc.motion[idx]; }
  17. void setMotion(CD6Joint* obj, UINT32 idx, D6Joint::Motion& value) { obj->mDesc.motion[idx] = value; }
  18. UINT32 getMotionCount(CD6Joint* obj) { return (UINT32)D6Joint::Motion::Count; }
  19. void setMotionCount(CD6Joint* obj, UINT32 size) { /* Do nothing */ }
  20. float& getDriveStiffness(CD6Joint* obj, UINT32 idx) { return obj->mDesc.drive[idx].stiffness; }
  21. void setDriveStiffness(CD6Joint* obj, UINT32 idx, float& value) { obj->mDesc.drive[idx].stiffness = value; }
  22. float& getDriveDamping(CD6Joint* obj, UINT32 idx) { return obj->mDesc.drive[idx].damping; }
  23. void setDriveDamping(CD6Joint* obj, UINT32 idx, float& value) { obj->mDesc.drive[idx].damping = value; }
  24. float& getDriveForceLimit(CD6Joint* obj, UINT32 idx) { return obj->mDesc.drive[idx].forceLimit; }
  25. void setDriveForceLimit(CD6Joint* obj, UINT32 idx, float& value) { obj->mDesc.drive[idx].forceLimit = value; }
  26. bool& getDriveAcceleration(CD6Joint* obj, UINT32 idx) { return obj->mDesc.drive[idx].acceleration; }
  27. void setDriveAcceleration(CD6Joint* obj, UINT32 idx, bool& value) { obj->mDesc.drive[idx].acceleration = value; }
  28. UINT32 getDriveCount(CD6Joint* obj) { return (UINT32)D6Joint::DriveType::Count; }
  29. void setDriveCount(CD6Joint* obj, UINT32 size) { /* Do nothing */ }
  30. BS_BEGIN_RTTI_MEMBERS
  31. BS_RTTI_MEMBER_PLAIN_NAMED(mLimitLinearExtent, mDesc.limitLinear.extent, 5)
  32. BS_RTTI_MEMBER_PLAIN_NAMED(mLimitLinearContactDist, mDesc.limitTwist.contactDist, 6)
  33. BS_RTTI_MEMBER_PLAIN_NAMED(mLimitLinearRestitution, mDesc.limitTwist.restitution, 7)
  34. BS_RTTI_MEMBER_PLAIN_NAMED(mLimitLinearSpringDamping, mDesc.limitTwist.spring.damping, 8)
  35. BS_RTTI_MEMBER_PLAIN_NAMED(mLimitLinearSpringStiffness, mDesc.limitTwist.spring.stiffness, 9)
  36. BS_RTTI_MEMBER_PLAIN_NAMED(mLimitTwistLower, mDesc.limitTwist.lower, 10)
  37. BS_RTTI_MEMBER_PLAIN_NAMED(mLimitTwistUpper, mDesc.limitTwist.upper, 11)
  38. BS_RTTI_MEMBER_PLAIN_NAMED(mLimitTwistContactDist, mDesc.limitTwist.contactDist, 12)
  39. BS_RTTI_MEMBER_PLAIN_NAMED(mLimitTwistRestitution, mDesc.limitTwist.restitution, 13)
  40. BS_RTTI_MEMBER_PLAIN_NAMED(mLimitTwistSpringDamping, mDesc.limitTwist.spring.damping, 14)
  41. BS_RTTI_MEMBER_PLAIN_NAMED(mLimitTwistSpringStiffness, mDesc.limitTwist.spring.stiffness, 15)
  42. BS_RTTI_MEMBER_PLAIN_NAMED(mLimitSwingYLimitAngle, mDesc.limitSwing.yLimitAngle, 16)
  43. BS_RTTI_MEMBER_PLAIN_NAMED(mLimitSwingZLimitAngle, mDesc.limitSwing.zLimitAngle, 17)
  44. BS_RTTI_MEMBER_PLAIN_NAMED(mLimitSwingContactDist, mDesc.limitSwing.contactDist, 18)
  45. BS_RTTI_MEMBER_PLAIN_NAMED(mLimitSwingRestitution, mDesc.limitSwing.restitution, 19)
  46. BS_RTTI_MEMBER_PLAIN_NAMED(mLimitSwingSpringDamping, mDesc.limitSwing.spring.damping, 20)
  47. BS_RTTI_MEMBER_PLAIN_NAMED(mLimitSwingSpringStiffness, mDesc.limitSwing.spring.stiffness, 21)
  48. BS_RTTI_MEMBER_PLAIN_NAMED(mDrivePosition, mDesc.drivePosition, 22)
  49. BS_RTTI_MEMBER_PLAIN_NAMED(mDriveRotation, mDesc.driveRotation, 23)
  50. BS_RTTI_MEMBER_PLAIN_NAMED(mDriveLinearVelocity, mDesc.driveLinearVelocity, 24)
  51. BS_RTTI_MEMBER_PLAIN_NAMED(mDriveAngularVelocity, mDesc.driveAngularVelocity, 25)
  52. BS_END_RTTI_MEMBERS
  53. public:
  54. CD6JointRTTI()
  55. :mInitMembers(this)
  56. {
  57. addPlainArrayField("mMotion", 0, &CD6JointRTTI::getMotion, &CD6JointRTTI::getMotionCount,
  58. &CD6JointRTTI::setMotion, &CD6JointRTTI::setMotionCount);
  59. addPlainArrayField("mDriveStiffnes", 1, &CD6JointRTTI::getDriveStiffness, &CD6JointRTTI::getDriveCount,
  60. &CD6JointRTTI::setDriveStiffness, &CD6JointRTTI::setDriveCount);
  61. addPlainArrayField("mDriveDamping", 2, &CD6JointRTTI::getDriveDamping, &CD6JointRTTI::getDriveCount,
  62. &CD6JointRTTI::setDriveDamping, &CD6JointRTTI::setDriveCount);
  63. addPlainArrayField("mDriveForceLimit", 3, &CD6JointRTTI::getDriveForceLimit, &CD6JointRTTI::getDriveCount,
  64. &CD6JointRTTI::setDriveForceLimit, &CD6JointRTTI::setDriveCount);
  65. addPlainArrayField("mDriveAcceleartion", 4, &CD6JointRTTI::getDriveAcceleration, &CD6JointRTTI::getDriveCount,
  66. &CD6JointRTTI::setDriveAcceleration, &CD6JointRTTI::setDriveCount);
  67. }
  68. const String& getRTTIName() override
  69. {
  70. static String name = "CD6Joint";
  71. return name;
  72. }
  73. UINT32 getRTTIId() override
  74. {
  75. return TID_CD6Joint;
  76. }
  77. SPtr<IReflectable> newRTTIObject() override
  78. {
  79. return GameObjectRTTI::createGameObject<CD6Joint>();
  80. }
  81. };
  82. /** @} */
  83. /** @endcond */
  84. }