PhysicsMesh.generated.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. /// Represents a physics mesh that can be used with a MeshCollider. Physics mesh can be a generic triangle mesh or a
  11. /// convex mesh. Convex meshes are limited to 255 faces.
  12. /// </summary>
  13. [ShowInInspector]
  14. public partial class PhysicsMesh : Resource
  15. {
  16. private PhysicsMesh(bool __dummy0) { }
  17. protected PhysicsMesh() { }
  18. /// <summary>Creates a new physics mesh.</summary>
  19. /// <param name="meshData">Index and vertices of the mesh data.</param>
  20. /// <param name="type">
  21. /// Type of the mesh. If convex the provided mesh geometry will be converted into a convex mesh (that might not be the
  22. /// same as the provided mesh data).
  23. /// </param>
  24. public PhysicsMesh(MeshData meshData, PhysicsMeshType type = PhysicsMeshType.Convex)
  25. {
  26. Internal_create(this, meshData, type);
  27. }
  28. /// <summary>Returns a reference wrapper for this resource.</summary>
  29. public RRef<PhysicsMesh> Ref
  30. {
  31. get { return Internal_GetRef(mCachedPtr); }
  32. }
  33. /// <summary>Returns the type of the physics mesh.</summary>
  34. [ShowInInspector]
  35. [NativeWrapper]
  36. public PhysicsMeshType Type
  37. {
  38. get { return Internal_getType(mCachedPtr); }
  39. }
  40. /// <summary>Returns the mesh's indices and vertices.</summary>
  41. [ShowInInspector]
  42. [NativeWrapper]
  43. public MeshData MeshData
  44. {
  45. get { return Internal_getMeshData(mCachedPtr); }
  46. }
  47. /// <summary>Returns a reference wrapper for this resource.</summary>
  48. public static implicit operator RRef<PhysicsMesh>(PhysicsMesh x)
  49. { return Internal_GetRef(x.mCachedPtr); }
  50. [MethodImpl(MethodImplOptions.InternalCall)]
  51. private static extern RRef<PhysicsMesh> Internal_GetRef(IntPtr thisPtr);
  52. [MethodImpl(MethodImplOptions.InternalCall)]
  53. private static extern PhysicsMeshType Internal_getType(IntPtr thisPtr);
  54. [MethodImpl(MethodImplOptions.InternalCall)]
  55. private static extern void Internal_create(PhysicsMesh managedInstance, MeshData meshData, PhysicsMeshType type);
  56. [MethodImpl(MethodImplOptions.InternalCall)]
  57. private static extern MeshData Internal_getMeshData(IntPtr thisPtr);
  58. }
  59. /** @} */
  60. }