PhysicsMesh.generated.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. public PhysicsMeshType Type
  36. {
  37. get { return Internal_getType(mCachedPtr); }
  38. }
  39. /// <summary>Returns the mesh's indices and vertices.</summary>
  40. [ShowInInspector]
  41. public MeshData MeshData
  42. {
  43. get { return Internal_getMeshData(mCachedPtr); }
  44. }
  45. /// <summary>Returns a reference wrapper for this resource.</summary>
  46. public static implicit operator RRef<PhysicsMesh>(PhysicsMesh x)
  47. { return Internal_GetRef(x.mCachedPtr); }
  48. [MethodImpl(MethodImplOptions.InternalCall)]
  49. private static extern RRef<PhysicsMesh> Internal_GetRef(IntPtr thisPtr);
  50. [MethodImpl(MethodImplOptions.InternalCall)]
  51. private static extern PhysicsMeshType Internal_getType(IntPtr thisPtr);
  52. [MethodImpl(MethodImplOptions.InternalCall)]
  53. private static extern void Internal_create(PhysicsMesh managedInstance, MeshData meshData, PhysicsMeshType type);
  54. [MethodImpl(MethodImplOptions.InternalCall)]
  55. private static extern MeshData Internal_getMeshData(IntPtr thisPtr);
  56. }
  57. /** @} */
  58. }