PhysicsMaterial.generated.cs 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. /// Material that controls how two physical objects interact with each other. Materials of both objects are used during
  11. /// their interaction and their combined values are used.
  12. /// </summary>
  13. public partial class PhysicsMaterial : Resource
  14. {
  15. private PhysicsMaterial(bool __dummy0) { }
  16. protected PhysicsMaterial() { }
  17. /// <summary>Creates a new physics material.</summary>
  18. /// <param name="staticFriction">
  19. /// Controls friction when two in-contact objects are not moving lateral to each other (for example how difficult is to
  20. /// get an object moving from a static state while it is in contact other object(s)).
  21. /// </param>
  22. /// <param name="dynamicFriction">
  23. /// Sets dynamic friction of the material. Controls friction when two in-contact objects are moving lateral to each other
  24. /// (for example how quickly does an object slow down when sliding along another object).
  25. /// </param>
  26. /// <param name="restitution">
  27. /// Controls "bounciness" of an object during a collision. Value of 1 means the collision is elastic, and value of 0
  28. /// means the value is inelastic. Must be in [0, 1] range.
  29. /// </param>
  30. public PhysicsMaterial(float staticFriction = 0f, float dynamicFriction = 0f, float restitution = 0f)
  31. {
  32. Internal_create(this, staticFriction, dynamicFriction, restitution);
  33. }
  34. /// <summary>
  35. /// Controls friction when two in-contact objects are not moving lateral to each other (for example how difficult it is
  36. /// to get an object moving from a static state while it is in contact with other object(s)).
  37. /// </summary>
  38. public float StaticFriction
  39. {
  40. get { return Internal_getStaticFriction(mCachedPtr); }
  41. set { Internal_setStaticFriction(mCachedPtr, value); }
  42. }
  43. /// <summary>
  44. /// Controls friction when two in-contact objects are moving lateral to each other (for example how quickly does an
  45. /// object slow down when sliding along another object).
  46. /// </summary>
  47. public float DynamicFriction
  48. {
  49. get { return Internal_getDynamicFriction(mCachedPtr); }
  50. set { Internal_setDynamicFriction(mCachedPtr, value); }
  51. }
  52. /// <summary>
  53. /// Controls "bounciness" of an object during a collision. Value of 1 means the collision is elastic, and value of 0
  54. /// means the value is inelastic. Must be in [0, 1] range.
  55. /// </summary>
  56. public float Restitution
  57. {
  58. get { return Internal_getRestitutionCoefficient(mCachedPtr); }
  59. set { Internal_setRestitutionCoefficient(mCachedPtr, value); }
  60. }
  61. [MethodImpl(MethodImplOptions.InternalCall)]
  62. private static extern void Internal_setStaticFriction(IntPtr thisPtr, float value);
  63. [MethodImpl(MethodImplOptions.InternalCall)]
  64. private static extern float Internal_getStaticFriction(IntPtr thisPtr);
  65. [MethodImpl(MethodImplOptions.InternalCall)]
  66. private static extern void Internal_setDynamicFriction(IntPtr thisPtr, float value);
  67. [MethodImpl(MethodImplOptions.InternalCall)]
  68. private static extern float Internal_getDynamicFriction(IntPtr thisPtr);
  69. [MethodImpl(MethodImplOptions.InternalCall)]
  70. private static extern void Internal_setRestitutionCoefficient(IntPtr thisPtr, float value);
  71. [MethodImpl(MethodImplOptions.InternalCall)]
  72. private static extern float Internal_getRestitutionCoefficient(IntPtr thisPtr);
  73. [MethodImpl(MethodImplOptions.InternalCall)]
  74. private static extern void Internal_create(PhysicsMaterial managedInstance, float staticFriction, float dynamicFriction, float restitution);
  75. }
  76. /** @} */
  77. }