Spring.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>
  10. /// Controls spring parameters for a physics joint limits. If a limit is soft (body bounces back due to restition when
  11. /// the limit is reached) the spring will pull the body back towards the limit using the specified parameters.
  12. /// </summary>
  13. [StructLayout(LayoutKind.Sequential), SerializeObject]
  14. public partial struct Spring
  15. {
  16. /// <summary>Initializes the struct with default values.</summary>
  17. public static Spring Default()
  18. {
  19. Spring value = new Spring();
  20. value.stiffness = 0f;
  21. value.damping = 0f;
  22. return value;
  23. }
  24. /// <summary>Constructs a spring.</summary>
  25. /// <param name="stiffness">Spring strength. Force proportional to the position error.</param>
  26. /// <param name="damping">Damping strength. Force propertional to the velocity error.</param>
  27. public Spring(float stiffness, float damping)
  28. {
  29. this.stiffness = stiffness;
  30. this.damping = damping;
  31. }
  32. /// <summary>Spring strength. Force proportional to the position error.</summary>
  33. public float stiffness;
  34. /// <summary>Damping strength. Force propertional to the velocity error.</summary>
  35. public float damping;
  36. }
  37. /** @} */
  38. }