tiledPlaneBuilder.d.ts 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. import type { Nullable } from "../../types";
  2. import type { Scene } from "../../scene";
  3. import type { Vector4 } from "../../Maths/math.vector";
  4. import { Mesh } from "../mesh";
  5. import { VertexData } from "../mesh.vertexData";
  6. /**
  7. * Creates the VertexData for a tiled plane
  8. * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/tiled_plane
  9. * @param options an object used to set the following optional parameters for the tiled plane, required but can be empty
  10. * * pattern a limited pattern arrangement depending on the number
  11. * * size of the box
  12. * * width of the box, overwrites size
  13. * * height of the box, overwrites size
  14. * * tileSize sets the width, height and depth of the tile to the value of size, optional default 1
  15. * * tileWidth sets the width (x direction) of the tile, overwrites the width set by size, optional, default size
  16. * * tileHeight sets the height (y direction) of the tile, overwrites the height set by size, optional, default size
  17. * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
  18. * * alignHorizontal places whole tiles aligned to the center, left or right of a row
  19. * * alignVertical places whole tiles aligned to the center, left or right of a column
  20. * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
  21. * @param options.pattern
  22. * @param options.tileSize
  23. * @param options.tileWidth
  24. * @param options.tileHeight
  25. * @param options.size
  26. * @param options.width
  27. * @param options.height
  28. * @param options.alignHorizontal
  29. * @param options.alignVertical
  30. * @param options.sideOrientation
  31. * @param options.frontUVs
  32. * @param options.backUVs
  33. * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
  34. * @returns the VertexData of the tiled plane
  35. */
  36. export declare function CreateTiledPlaneVertexData(options: {
  37. pattern?: number;
  38. tileSize?: number;
  39. tileWidth?: number;
  40. tileHeight?: number;
  41. size?: number;
  42. width?: number;
  43. height?: number;
  44. alignHorizontal?: number;
  45. alignVertical?: number;
  46. sideOrientation?: number;
  47. frontUVs?: Vector4;
  48. backUVs?: Vector4;
  49. }): VertexData;
  50. /**
  51. * Creates a tiled plane mesh
  52. * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/tiled_plane
  53. * @param name defines the name of the mesh
  54. * @param options an object used to set the following optional parameters for the tiled plane, required but can be empty
  55. * * pattern a limited pattern arrangement depending on the number
  56. * * size of the box
  57. * * width of the box, overwrites size
  58. * * height of the box, overwrites size
  59. * * tileSize sets the width, height and depth of the tile to the value of size, optional default 1
  60. * * tileWidth sets the width (x direction) of the tile, overwrites the width set by size, optional, default size
  61. * * tileHeight sets the height (y direction) of the tile, overwrites the height set by size, optional, default size
  62. * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
  63. * * alignHorizontal places whole tiles aligned to the center, left or right of a row
  64. * * alignVertical places whole tiles aligned to the center, left or right of a column
  65. * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
  66. * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
  67. * @param options.pattern
  68. * @param options.tileSize
  69. * @param options.tileWidth
  70. * @param options.tileHeight
  71. * @param options.size
  72. * @param options.width
  73. * @param options.height
  74. * @param options.alignHorizontal
  75. * @param options.alignVertical
  76. * @param options.sideOrientation
  77. * @param options.frontUVs
  78. * @param options.backUVs
  79. * @param options.updatable
  80. * @param scene defines the hosting scene
  81. * @returns the box mesh
  82. */
  83. export declare function CreateTiledPlane(name: string, options: {
  84. pattern?: number;
  85. tileSize?: number;
  86. tileWidth?: number;
  87. tileHeight?: number;
  88. size?: number;
  89. width?: number;
  90. height?: number;
  91. alignHorizontal?: number;
  92. alignVertical?: number;
  93. sideOrientation?: number;
  94. frontUVs?: Vector4;
  95. backUVs?: Vector4;
  96. updatable?: boolean;
  97. }, scene?: Nullable<Scene>): Mesh;
  98. /**
  99. * Class containing static functions to help procedurally build meshes
  100. * @deprecated use CreateTiledPlane instead
  101. */
  102. export declare const TiledPlaneBuilder: {
  103. CreateTiledPlane: typeof CreateTiledPlane;
  104. };