geodesicBuilder.d.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import type { Scene } from "../../scene";
  2. import type { Vector4 } from "../../Maths/math.vector";
  3. import type { Color4 } from "../../Maths/math.color";
  4. import type { Mesh } from "../../Meshes/mesh";
  5. import type { Nullable } from "../../types";
  6. /**
  7. * Creates the Mesh for a Geodesic Polyhedron
  8. * @see https://en.wikipedia.org/wiki/Geodesic_polyhedron
  9. * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/polyhedra/geodesic_poly
  10. * @param name defines the name of the mesh
  11. * @param options an object used to set the following optional parameters for the polyhedron, required but can be empty
  12. * * m number of horizontal steps along an isogrid
  13. * * n number of angled steps along an isogrid
  14. * * size the size of the Geodesic, optional default 1
  15. * * sizeX allows stretching in the x direction, optional, default size
  16. * * sizeY allows stretching in the y direction, optional, default size
  17. * * sizeZ allows stretching in the z direction, optional, default size
  18. * * faceUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively
  19. * * faceColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively
  20. * * flat when true creates a flat shaded mesh, optional, default true
  21. * * subdivisions increasing the subdivisions increases the number of faces, optional, default 4
  22. * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
  23. * * 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)
  24. * * 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)
  25. * @param scene defines the hosting scene
  26. * @returns Geodesic mesh
  27. */
  28. export declare function CreateGeodesic(name: string, options: {
  29. m?: number;
  30. n?: number;
  31. size?: number;
  32. sizeX?: number;
  33. sizeY?: number;
  34. sizeZ?: number;
  35. faceUV?: Vector4[];
  36. faceColors?: Color4[];
  37. flat?: boolean;
  38. updatable?: boolean;
  39. sideOrientation?: number;
  40. frontUVs?: Vector4;
  41. backUVs?: Vector4;
  42. }, scene?: Nullable<Scene>): Mesh;