PhysicsMesh.generated.cs 2.1 KB

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