discBuilder.d.ts 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 of the Disc or regular Polygon
  8. * @param options an object used to set the following optional parameters for the disc, required but can be empty
  9. * * radius the radius of the disc, optional default 0.5
  10. * * tessellation the number of polygon sides, optional, default 64
  11. * * arc a number from 0 to 1, to create an unclosed polygon based on the fraction of the circumference given by the arc value, optional, default 1
  12. * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
  13. * * 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)
  14. * * 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)
  15. * @returns the VertexData of the box
  16. */
  17. export declare function CreateDiscVertexData(options: {
  18. radius?: number;
  19. tessellation?: number;
  20. arc?: number;
  21. sideOrientation?: number;
  22. frontUVs?: Vector4;
  23. backUVs?: Vector4;
  24. }): VertexData;
  25. /**
  26. * Creates a plane polygonal mesh. By default, this is a disc
  27. * * The parameter `radius` sets the radius size (float) of the polygon (default 0.5)
  28. * * The parameter `tessellation` sets the number of polygon sides (positive integer, default 64). So a tessellation valued to 3 will build a triangle, to 4 a square, etc
  29. * * You can create an unclosed polygon with the parameter `arc` (positive float, default 1), valued between 0 and 1, what is the ratio of the circumference : 2 x PI x ratio
  30. * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
  31. * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation
  32. * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
  33. * @param name defines the name of the mesh
  34. * @param options defines the options used to create the mesh
  35. * @param scene defines the hosting scene
  36. * @returns the plane polygonal mesh
  37. * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#disc-or-regular-polygon
  38. */
  39. export declare function CreateDisc(name: string, options?: {
  40. radius?: number;
  41. tessellation?: number;
  42. arc?: number;
  43. updatable?: boolean;
  44. sideOrientation?: number;
  45. frontUVs?: Vector4;
  46. backUVs?: Vector4;
  47. }, scene?: Nullable<Scene>): Mesh;
  48. /**
  49. * Class containing static functions to help procedurally build meshes
  50. * @deprecated please use CreateDisc directly
  51. */
  52. export declare const DiscBuilder: {
  53. CreateDisc: typeof CreateDisc;
  54. };