PhysicsMaterial.generated.cs 4.1 KB

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