trailMesh.d.ts 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import { Mesh } from "../Meshes/mesh";
  2. import type { Scene } from "../scene";
  3. import type { TransformNode } from "../Meshes/transformNode";
  4. /**
  5. * Class used to create a trail following a mesh
  6. */
  7. export declare class TrailMesh extends Mesh {
  8. /**
  9. * The diameter of the trail, i.e. the width of the ribbon.
  10. */
  11. diameter: number;
  12. private _generator;
  13. private _autoStart;
  14. private _running;
  15. private _length;
  16. private _sectionPolygonPointsCount;
  17. private _sectionVectors;
  18. private _sectionNormalVectors;
  19. private _beforeRenderObserver;
  20. /**
  21. * Creates a new TrailMesh.
  22. * @param name The value used by scene.getMeshByName() to do a lookup.
  23. * @param generator The mesh or transform node to generate a trail.
  24. * @param scene The scene to add this mesh to.
  25. * @param diameter Diameter of trailing mesh. Default is 1.
  26. * @param length Length of trailing mesh. Default is 60.
  27. * @param autoStart Automatically start trailing mesh. Default true.
  28. */
  29. constructor(name: string, generator: TransformNode, scene?: Scene, diameter?: number, length?: number, autoStart?: boolean);
  30. /**
  31. * "TrailMesh"
  32. * @returns "TrailMesh"
  33. */
  34. getClassName(): string;
  35. private _createMesh;
  36. /**
  37. * Start trailing mesh.
  38. */
  39. start(): void;
  40. /**
  41. * Stop trailing mesh.
  42. */
  43. stop(): void;
  44. /**
  45. * Update trailing mesh geometry.
  46. */
  47. update(): void;
  48. /**
  49. * Returns a new TrailMesh object.
  50. * @param name is a string, the name given to the new mesh
  51. * @param newGenerator use new generator object for cloned trail mesh
  52. * @returns a new mesh
  53. */
  54. clone(name: string | undefined, newGenerator: TransformNode): TrailMesh;
  55. /**
  56. * Serializes this trail mesh
  57. * @param serializationObject object to write serialization to
  58. */
  59. serialize(serializationObject: any): void;
  60. /**
  61. * Parses a serialized trail mesh
  62. * @param parsedMesh the serialized mesh
  63. * @param scene the scene to create the trail mesh in
  64. * @returns the created trail mesh
  65. */
  66. static Parse(parsedMesh: any, scene: Scene): TrailMesh;
  67. }