PhysicsMaterial.generated.cs 4.0 KB

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