greasedLineRibbonMesh.d.ts 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. import type { Scene } from "../../scene";
  2. import { Vector3 } from "../../Maths/math.vector";
  3. import { Mesh } from "../mesh";
  4. import type { Nullable } from "../../types";
  5. import type { Node } from "../../node";
  6. import type { GreasedLineMeshOptions } from "./greasedLineBaseMesh";
  7. import { GreasedLineBaseMesh } from "./greasedLineBaseMesh";
  8. import type { VertexData } from "../mesh.vertexData";
  9. /**
  10. * GreasedLineRibbonMesh
  11. * Use the GreasedLineBuilder.CreateGreasedLine function to create an instance of this class.
  12. */
  13. export declare class GreasedLineRibbonMesh extends GreasedLineBaseMesh {
  14. readonly name: string;
  15. /**
  16. * Default line width
  17. */
  18. static DEFAULT_WIDTH: number;
  19. private static _RightHandedForwardReadOnlyQuaternion;
  20. private static _LeftHandedForwardReadOnlyQuaternion;
  21. private static _LeftReadOnlyQuaternion;
  22. /**
  23. * Direction which the line segment will be thickened if drawn on the XY plane
  24. */
  25. static DIRECTION_XY: import("../../types").DeepImmutableObject<Vector3>;
  26. /**
  27. * Direction which the line segment will be thickened if drawn on the XZ plane
  28. */
  29. static DIRECTION_XZ: import("../../types").DeepImmutableObject<Vector3>;
  30. /**
  31. * Direction which the line segment will be thickened if drawn on the YZ plane
  32. */
  33. static DIRECTION_YZ: import("../../types").DeepImmutableObject<Vector3>;
  34. private _paths;
  35. private _pathsOptions;
  36. private _vSegmentLengths;
  37. private _uSegmentLengths;
  38. private _vTotalLengths;
  39. private _uTotalLengths;
  40. private _counters;
  41. private _slopes;
  42. private _ribbonWidths;
  43. /**
  44. * GreasedLineRibbonMesh
  45. * @param name name of the mesh
  46. * @param scene the scene
  47. * @param _options mesh options
  48. * @param _pathOptions used internaly when parsing a serialized GreasedLineRibbonMesh
  49. */
  50. constructor(name: string, scene: Scene, _options: GreasedLineMeshOptions, _pathOptions?: {
  51. options: GreasedLineMeshOptions;
  52. pathCount: number;
  53. }[]);
  54. /**
  55. * Adds new points to the line. It doesn't rerenders the line if in lazy mode.
  56. * @param points points table
  57. * @param options mesh options
  58. * @param hasPathOptions defaults to false
  59. */
  60. addPoints(points: number[][], options: GreasedLineMeshOptions, hasPathOptions?: boolean): void;
  61. /**
  62. * "GreasedLineRibbonMesh"
  63. * @returns "GreasedLineRibbonMesh"
  64. */
  65. getClassName(): string;
  66. /**
  67. * Return true if the line was created from two edge paths or one points path.
  68. * In this case the line is always flat.
  69. */
  70. get isFlatLine(): boolean;
  71. /**
  72. * Returns the slopes of the line at each point relative to the center of the line
  73. */
  74. get slopes(): number[];
  75. /**
  76. * Set the slopes of the line at each point relative to the center of the line
  77. */
  78. set slopes(slopes: number[]);
  79. protected _updateColorPointers(): void;
  80. protected _updateWidths(): void;
  81. protected _setPoints(points: number[][], _options: GreasedLineMeshOptions): void;
  82. private static _GetDirectionPlanesFromDirectionsOption;
  83. private static _CreateRibbonVertexData;
  84. private _preprocess;
  85. private static _ConvertToRibbonPath;
  86. private static _GetDirectionFromPoints;
  87. /**
  88. * Clones the GreasedLineRibbonMesh.
  89. * @param name new line name
  90. * @param newParent new parent node
  91. * @returns cloned line
  92. */
  93. clone(name?: string, newParent?: Nullable<Node>): GreasedLineRibbonMesh;
  94. /**
  95. * Serializes this GreasedLineRibbonMesh
  96. * @param serializationObject object to write serialization to
  97. */
  98. serialize(serializationObject: any): void;
  99. /**
  100. * Parses a serialized GreasedLineRibbonMesh
  101. * @param parsedMesh the serialized GreasedLineRibbonMesh
  102. * @param scene the scene to create the GreasedLineRibbonMesh in
  103. * @returns the created GreasedLineRibbonMesh
  104. */
  105. static Parse(parsedMesh: any, scene: Scene): Mesh;
  106. protected _initGreasedLine(): void;
  107. private _calculateSegmentLengths;
  108. private static _CalculateSlopes;
  109. protected _createVertexBuffers(): VertexData;
  110. }