decalBuilder.d.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import { Vector3 } from "../../Maths/math.vector";
  2. import { Mesh } from "../mesh";
  3. import type { AbstractMesh } from "../abstractMesh";
  4. /**
  5. * Creates a decal mesh.
  6. * A decal is a mesh usually applied as a model onto the surface of another mesh. So don't forget the parameter `sourceMesh` depicting the decal
  7. * * The parameter `position` (Vector3, default `(0, 0, 0)`) sets the position of the decal in World coordinates
  8. * * The parameter `normal` (Vector3, default `Vector3.Up`) sets the normal of the mesh where the decal is applied onto in World coordinates
  9. * * The parameter `size` (Vector3, default `(1, 1, 1)`) sets the decal scaling
  10. * * The parameter `angle` (float in radian, default 0) sets the angle to rotate the decal
  11. * * The parameter `captureUVS` defines if we need to capture the uvs or compute them
  12. * * The parameter `cullBackFaces` defines if the back faces should be removed from the decal mesh
  13. * * The parameter `localMode` defines that the computations should be done with the local mesh coordinates instead of the world space coordinates.
  14. * * Use this mode if you want the decal to be parented to the sourceMesh and move/rotate with it.
  15. * Note: Meshes with morph targets are not supported!
  16. * @param name defines the name of the mesh
  17. * @param sourceMesh defines the mesh where the decal must be applied
  18. * @param options defines the options used to create the mesh
  19. * @returns the decal mesh
  20. * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/decals
  21. */
  22. export declare function CreateDecal(name: string, sourceMesh: AbstractMesh, options: {
  23. position?: Vector3;
  24. normal?: Vector3;
  25. size?: Vector3;
  26. angle?: number;
  27. captureUVS?: boolean;
  28. cullBackFaces?: boolean;
  29. localMode?: boolean;
  30. }): Mesh;
  31. /**
  32. * Class containing static functions to help procedurally build meshes
  33. * @deprecated use the function directly from the module
  34. */
  35. export declare const DecalBuilder: {
  36. CreateDecal: typeof CreateDecal;
  37. };