PhysicsMaterial.generated.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. [NativeWrapper]
  46. public float StaticFriction
  47. {
  48. get { return Internal_getStaticFriction(mCachedPtr); }
  49. set { Internal_setStaticFriction(mCachedPtr, value); }
  50. }
  51. /// <summary>
  52. /// Controls friction when two in-contact objects are moving lateral to each other (for example how quickly does an
  53. /// object slow down when sliding along another object).
  54. /// </summary>
  55. [ShowInInspector]
  56. [NativeWrapper]
  57. public float DynamicFriction
  58. {
  59. get { return Internal_getDynamicFriction(mCachedPtr); }
  60. set { Internal_setDynamicFriction(mCachedPtr, value); }
  61. }
  62. /// <summary>
  63. /// Controls "bounciness" of an object during a collision. Value of 1 means the collision is elastic, and value of 0
  64. /// means the value is inelastic. Must be in [0, 1] range.
  65. /// </summary>
  66. [ShowInInspector]
  67. [NativeWrapper]
  68. public float Restitution
  69. {
  70. get { return Internal_getRestitutionCoefficient(mCachedPtr); }
  71. set { Internal_setRestitutionCoefficient(mCachedPtr, value); }
  72. }
  73. /// <summary>Returns a reference wrapper for this resource.</summary>
  74. public static implicit operator RRef<PhysicsMaterial>(PhysicsMaterial x)
  75. { return Internal_GetRef(x.mCachedPtr); }
  76. [MethodImpl(MethodImplOptions.InternalCall)]
  77. private static extern RRef<PhysicsMaterial> Internal_GetRef(IntPtr thisPtr);
  78. [MethodImpl(MethodImplOptions.InternalCall)]
  79. private static extern void Internal_setStaticFriction(IntPtr thisPtr, float value);
  80. [MethodImpl(MethodImplOptions.InternalCall)]
  81. private static extern float Internal_getStaticFriction(IntPtr thisPtr);
  82. [MethodImpl(MethodImplOptions.InternalCall)]
  83. private static extern void Internal_setDynamicFriction(IntPtr thisPtr, float value);
  84. [MethodImpl(MethodImplOptions.InternalCall)]
  85. private static extern float Internal_getDynamicFriction(IntPtr thisPtr);
  86. [MethodImpl(MethodImplOptions.InternalCall)]
  87. private static extern void Internal_setRestitutionCoefficient(IntPtr thisPtr, float value);
  88. [MethodImpl(MethodImplOptions.InternalCall)]
  89. private static extern float Internal_getRestitutionCoefficient(IntPtr thisPtr);
  90. [MethodImpl(MethodImplOptions.InternalCall)]
  91. private static extern void Internal_create(PhysicsMaterial managedInstance, float staticFriction, float dynamicFriction, float restitution);
  92. }
  93. /** @} */
  94. }