BsCJointRTTI.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 "BsCJoint.h"
  7. namespace BansheeEngine
  8. {
  9. /** @cond RTTI */
  10. /** @addtogroup RTTI-Impl-Core
  11. * @{
  12. */
  13. class BS_CORE_EXPORT CJointRTTI : public RTTIType<CJoint, Component, CJointRTTI>
  14. {
  15. BS_REFL_MEMBER_NAMED(mBodyA, mBodies[0]);
  16. BS_REFL_MEMBER_NAMED(mBodyB, mBodies[1]);
  17. BS_PLAIN_MEMBER_NAMED(mPositionA, mPositions[0]);
  18. BS_PLAIN_MEMBER_NAMED(mPositionB, mPositions[1]);
  19. BS_PLAIN_MEMBER_NAMED(mRotationA, mRotations[0]);
  20. BS_PLAIN_MEMBER_NAMED(mRotationB, mRotations[1]);
  21. BS_PLAIN_MEMBER(mBreakForce)
  22. BS_PLAIN_MEMBER(mBreakTorque)
  23. BS_PLAIN_MEMBER(mEnableCollision)
  24. public:
  25. CJointRTTI()
  26. {
  27. BS_ADD_REFL_FIELD(mBodyA, 0);
  28. BS_ADD_REFL_FIELD(mBodyB, 1);
  29. BS_ADD_PLAIN_FIELD(mPositionA, 2);
  30. BS_ADD_PLAIN_FIELD(mPositionB, 3);
  31. BS_ADD_PLAIN_FIELD(mRotationA, 4);
  32. BS_ADD_PLAIN_FIELD(mRotationB, 5);
  33. BS_ADD_PLAIN_FIELD(mBreakForce, 6);
  34. BS_ADD_PLAIN_FIELD(mBreakTorque, 7);
  35. BS_ADD_PLAIN_FIELD(mEnableCollision, 8);
  36. }
  37. const String& getRTTIName() override
  38. {
  39. static String name = "CJoint";
  40. return name;
  41. }
  42. UINT32 getRTTIId() override
  43. {
  44. return TID_CJoint;
  45. }
  46. std::shared_ptr<IReflectable> newRTTIObject() override
  47. {
  48. BS_EXCEPT(InternalErrorException, "Cannot instantiate an abstract class.");
  49. }
  50. };
  51. /** @} */
  52. /** @endcond */
  53. }