LimitCommon.generated.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. using System.Runtime.InteropServices;
  4. namespace BansheeEngine
  5. {
  6. /** @addtogroup Physics
  7. * @{
  8. */
  9. /// <summary>Contains common values used by all Joint limit types.</summary>
  10. [StructLayout(LayoutKind.Sequential), SerializeObject]
  11. public partial struct LimitCommon
  12. {
  13. public LimitCommon(float contactDist = -1f)
  14. {
  15. this.contactDist = contactDist;
  16. this.restitution = 0f;
  17. this.spring = new Spring();
  18. }
  19. public LimitCommon(Spring spring, float restitution = 0f)
  20. {
  21. this.contactDist = -1f;
  22. this.restitution = restitution;
  23. this.spring = spring;
  24. }
  25. /// <summary>
  26. /// Distance from the limit at which it becomes active. Allows the solver to activate earlier than the limit is reached
  27. /// to avoid breaking the limit.
  28. /// </summary>
  29. public float contactDist;
  30. /// <summary>
  31. /// Controls how do objects react when the limit is reached, values closer to zero specify non-ellastic collision, while
  32. /// those closer to one specify more ellastic (i.e bouncy) collision. Must be in [0, 1] range.
  33. /// </summary>
  34. public float restitution;
  35. /// <summary>Spring that controls how are the bodies pulled back towards the limit when they breach it.</summary>
  36. public Spring spring;
  37. }
  38. /** @} */
  39. }