linesMesh.d.ts 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. import type { Nullable } from "../types";
  2. import type { Scene } from "../scene";
  3. import { Color3 } from "../Maths/math.color";
  4. import type { Node } from "../node";
  5. import type { SubMesh } from "../Meshes/subMesh";
  6. import { Mesh } from "../Meshes/mesh";
  7. import { InstancedMesh } from "../Meshes/instancedMesh";
  8. import { Material } from "../Materials/material";
  9. import type { Effect } from "../Materials/effect";
  10. import "../Shaders/color.fragment";
  11. import "../Shaders/color.vertex";
  12. /**
  13. * Line mesh
  14. * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param
  15. */
  16. export declare class LinesMesh extends Mesh {
  17. /**
  18. * If vertex color should be applied to the mesh
  19. */
  20. readonly useVertexColor?: boolean | undefined;
  21. /**
  22. * If vertex alpha should be applied to the mesh
  23. */
  24. readonly useVertexAlpha?: boolean | undefined;
  25. /**
  26. * Color of the line (Default: White)
  27. */
  28. color: Color3;
  29. /**
  30. * Alpha of the line (Default: 1)
  31. */
  32. alpha: number;
  33. /**
  34. * The intersection Threshold is the margin applied when intersection a segment of the LinesMesh with a Ray.
  35. * This margin is expressed in world space coordinates, so its value may vary.
  36. * Default value is 0.1
  37. */
  38. intersectionThreshold: number;
  39. private _lineMaterial;
  40. private _isShaderMaterial;
  41. private _color4;
  42. /**
  43. * Creates a new LinesMesh
  44. * @param name defines the name
  45. * @param scene defines the hosting scene
  46. * @param parent defines the parent mesh if any
  47. * @param source defines the optional source LinesMesh used to clone data from
  48. * @param doNotCloneChildren When cloning, skip cloning child meshes of source, default False.
  49. * When false, achieved by calling a clone(), also passing False.
  50. * This will make creation of children, recursive.
  51. * @param useVertexColor defines if this LinesMesh supports vertex color
  52. * @param useVertexAlpha defines if this LinesMesh supports vertex alpha
  53. * @param material material to use to draw the line. If not provided, will create a new one
  54. */
  55. constructor(name: string, scene?: Nullable<Scene>, parent?: Nullable<Node>, source?: Nullable<LinesMesh>, doNotCloneChildren?: boolean,
  56. /**
  57. * If vertex color should be applied to the mesh
  58. */
  59. useVertexColor?: boolean | undefined,
  60. /**
  61. * If vertex alpha should be applied to the mesh
  62. */
  63. useVertexAlpha?: boolean | undefined, material?: Material);
  64. isReady(): boolean;
  65. /**
  66. * @returns the string "LineMesh"
  67. */
  68. getClassName(): string;
  69. /**
  70. * @internal
  71. */
  72. get material(): Material;
  73. /**
  74. * @internal
  75. */
  76. set material(value: Material);
  77. /**
  78. * @internal
  79. */
  80. get checkCollisions(): boolean;
  81. set checkCollisions(value: boolean);
  82. /**
  83. * @internal
  84. */
  85. _bind(_subMesh: SubMesh, colorEffect: Effect): Mesh;
  86. /**
  87. * @internal
  88. */
  89. _draw(subMesh: SubMesh, fillMode: number, instancesCount?: number): Mesh;
  90. /**
  91. * Disposes of the line mesh
  92. * @param doNotRecurse If children should be disposed
  93. * @param disposeMaterialAndTextures This parameter is not used by the LineMesh class
  94. * @param doNotDisposeMaterial If the material should not be disposed (default: false, meaning the material is disposed)
  95. */
  96. dispose(doNotRecurse?: boolean, disposeMaterialAndTextures?: boolean, doNotDisposeMaterial?: boolean): void;
  97. /**
  98. * Returns a new LineMesh object cloned from the current one.
  99. * @param name defines the cloned mesh name
  100. * @param newParent defines the new mesh parent
  101. * @param doNotCloneChildren if set to true, none of the mesh children are cloned (false by default)
  102. * @returns the new mesh
  103. */
  104. clone(name: string, newParent?: Nullable<Node>, doNotCloneChildren?: boolean): LinesMesh;
  105. /**
  106. * Creates a new InstancedLinesMesh object from the mesh model.
  107. * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/copies/instances
  108. * @param name defines the name of the new instance
  109. * @returns a new InstancedLinesMesh
  110. */
  111. createInstance(name: string): InstancedLinesMesh;
  112. /**
  113. * Serializes this ground mesh
  114. * @param serializationObject object to write serialization to
  115. */
  116. serialize(serializationObject: any): void;
  117. /**
  118. * Parses a serialized ground mesh
  119. * @param parsedMesh the serialized mesh
  120. * @param scene the scene to create the ground mesh in
  121. * @returns the created ground mesh
  122. */
  123. static Parse(parsedMesh: any, scene: Scene): LinesMesh;
  124. }
  125. /**
  126. * Creates an instance based on a source LinesMesh
  127. */
  128. export declare class InstancedLinesMesh extends InstancedMesh {
  129. /**
  130. * The intersection Threshold is the margin applied when intersection a segment of the LinesMesh with a Ray.
  131. * This margin is expressed in world space coordinates, so its value may vary.
  132. * Initialized with the intersectionThreshold value of the source LinesMesh
  133. */
  134. intersectionThreshold: number;
  135. constructor(name: string, source: LinesMesh);
  136. /**
  137. * @returns the string "InstancedLinesMesh".
  138. */
  139. getClassName(): string;
  140. }