planeBuilder.d.ts 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import type { Scene } from "../../scene";
  2. import type { Vector4 } from "../../Maths/math.vector";
  3. import { Mesh } from "../mesh";
  4. import { VertexData } from "../mesh.vertexData";
  5. import type { Nullable } from "../../types";
  6. import type { Plane } from "../../Maths/math.plane";
  7. /**
  8. * Creates the VertexData for a Plane
  9. * @param options an object used to set the following optional parameters for the plane, required but can be empty
  10. * * size sets the width and height of the plane to the value of size, optional default 1
  11. * * width sets the width (x direction) of the plane, overwrites the width set by size, optional, default size
  12. * * height sets the height (y direction) of the plane, overwrites the height set by size, optional, default size
  13. * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
  14. * * 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)
  15. * * 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)
  16. * @returns the VertexData of the box
  17. */
  18. export declare function CreatePlaneVertexData(options: {
  19. size?: number;
  20. width?: number;
  21. height?: number;
  22. sideOrientation?: number;
  23. frontUVs?: Vector4;
  24. backUVs?: Vector4;
  25. }): VertexData;
  26. /**
  27. * Creates a plane mesh
  28. * * The parameter `size` sets the size (float) of both sides of the plane at once (default 1)
  29. * * You can set some different plane dimensions by using the parameters `width` and `height` (both by default have the same value of `size`)
  30. * * The parameter `sourcePlane` is a Plane instance. It builds a mesh plane from a Math plane
  31. * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
  32. * * 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
  33. * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
  34. * @param name defines the name of the mesh
  35. * @param options defines the options used to create the mesh
  36. * @param scene defines the hosting scene
  37. * @returns the plane mesh
  38. * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#plane
  39. */
  40. export declare function CreatePlane(name: string, options?: {
  41. size?: number;
  42. width?: number;
  43. height?: number;
  44. sideOrientation?: number;
  45. frontUVs?: Vector4;
  46. backUVs?: Vector4;
  47. updatable?: boolean;
  48. sourcePlane?: Plane;
  49. }, scene?: Nullable<Scene>): Mesh;
  50. /**
  51. * Class containing static functions to help procedurally build meshes
  52. * @deprecated use the function directly from the module
  53. */
  54. export declare const PlaneBuilder: {
  55. CreatePlane: typeof CreatePlane;
  56. };