CRenderable.generated.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. using System.Runtime.InteropServices;
  4. namespace BansheeEngine
  5. {
  6. /** @addtogroup Rendering
  7. * @{
  8. */
  9. /// <summary>
  10. /// Renderable represents any visible object in the scene. It has a mesh, bounds and a set of materials. Renderer will
  11. /// render any Renderable objects visible by a camera.
  12. /// </summary>
  13. [ShowInInspector]
  14. public partial class Renderable : Component
  15. {
  16. private Renderable(bool __dummy0) { }
  17. protected Renderable() { }
  18. /// <summary>
  19. /// Determines the mesh to render. All sub-meshes of the mesh will be rendered, and you may set individual materials for
  20. /// each sub-mesh.
  21. /// </summary>
  22. [ShowInInspector]
  23. [NativeWrapper]
  24. public RRef<Mesh> Mesh
  25. {
  26. get { return Internal_getMesh(mCachedPtr); }
  27. set { Internal_setMesh(mCachedPtr, value); }
  28. }
  29. /// <summary>
  30. /// Determines all materials used for rendering this renderable. Each of the materials is used for rendering a single
  31. /// sub-mesh. If number of materials is larger than number of sub-meshes, they will be ignored. If lower, the remaining
  32. /// materials will be removed.
  33. /// </summary>
  34. [ShowInInspector]
  35. [NativeWrapper]
  36. public RRef<Material>[] Materials
  37. {
  38. get { return Internal_getMaterials(mCachedPtr); }
  39. set { Internal_setMaterials(mCachedPtr, value); }
  40. }
  41. /// <summary>
  42. /// Determines the layer bitfield that controls whether a renderable is considered visible in a specific camera.
  43. /// Renderable layer must match camera layer in order for the camera to render the component.
  44. /// </summary>
  45. [ShowInInspector]
  46. [NativeWrapper]
  47. public ulong Layers
  48. {
  49. get { return Internal_getLayer(mCachedPtr); }
  50. set { Internal_setLayer(mCachedPtr, value); }
  51. }
  52. /// <summary>Gets world bounds of the mesh rendered by this object.</summary>
  53. [ShowInInspector]
  54. [NativeWrapper]
  55. public Bounds Bounds
  56. {
  57. get
  58. {
  59. Bounds temp;
  60. Internal_getBounds(mCachedPtr, out temp);
  61. return temp;
  62. }
  63. }
  64. /// <summary>
  65. /// Sets a material that will be used for rendering a sub-mesh with the specified index. If a sub-mesh doesn't have a
  66. /// specific material set then the primary material will be used.
  67. /// </summary>
  68. public void SetMaterial(uint idx, RRef<Material> material)
  69. {
  70. Internal_setMaterial(mCachedPtr, idx, material);
  71. }
  72. /// <summary>
  73. /// Sets a material that will be used for rendering a sub-mesh with the specified index. If a sub-mesh doesn't have a
  74. /// specific material set then the primary material will be used.
  75. /// </summary>
  76. public void SetMaterial(RRef<Material> material)
  77. {
  78. Internal_setMaterial0(mCachedPtr, material);
  79. }
  80. /// <summary>Returns the material used for rendering a sub-mesh with the specified index.</summary>
  81. public RRef<Material> GetMaterial(uint idx)
  82. {
  83. return Internal_getMaterial(mCachedPtr, idx);
  84. }
  85. [MethodImpl(MethodImplOptions.InternalCall)]
  86. private static extern void Internal_setMesh(IntPtr thisPtr, RRef<Mesh> mesh);
  87. [MethodImpl(MethodImplOptions.InternalCall)]
  88. private static extern RRef<Mesh> Internal_getMesh(IntPtr thisPtr);
  89. [MethodImpl(MethodImplOptions.InternalCall)]
  90. private static extern void Internal_setMaterial(IntPtr thisPtr, uint idx, RRef<Material> material);
  91. [MethodImpl(MethodImplOptions.InternalCall)]
  92. private static extern void Internal_setMaterial0(IntPtr thisPtr, RRef<Material> material);
  93. [MethodImpl(MethodImplOptions.InternalCall)]
  94. private static extern RRef<Material> Internal_getMaterial(IntPtr thisPtr, uint idx);
  95. [MethodImpl(MethodImplOptions.InternalCall)]
  96. private static extern void Internal_setMaterials(IntPtr thisPtr, RRef<Material>[] materials);
  97. [MethodImpl(MethodImplOptions.InternalCall)]
  98. private static extern RRef<Material>[] Internal_getMaterials(IntPtr thisPtr);
  99. [MethodImpl(MethodImplOptions.InternalCall)]
  100. private static extern void Internal_setLayer(IntPtr thisPtr, ulong layer);
  101. [MethodImpl(MethodImplOptions.InternalCall)]
  102. private static extern ulong Internal_getLayer(IntPtr thisPtr);
  103. [MethodImpl(MethodImplOptions.InternalCall)]
  104. private static extern void Internal_getBounds(IntPtr thisPtr, out Bounds __output);
  105. }
  106. /** @} */
  107. }